1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-10-24 20:17:39 +00:00

Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into next

This commit is contained in:
Carles Fernandez
2019-09-17 17:05:15 +02:00
9 changed files with 43 additions and 16 deletions

View File

@@ -68,7 +68,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration,
pvt_output_parameters.dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); pvt_output_parameters.dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
pvt_output_parameters.dump_mat = configuration->property(role + ".dump_mat", true); pvt_output_parameters.dump_mat = configuration->property(role + ".dump_mat", true);
//OPTIONAL: specify a custom year to override the system time in order to postprocess old gnss records and avoid wrong week rollover // OPTIONAL: specify a custom year to override the system time in order to postprocess old gnss records and avoid wrong week rollover
pvt_output_parameters.custom_year = configuration->property("GNSS-SDR.custom_year", 0); pvt_output_parameters.custom_year = configuration->property("GNSS-SDR.custom_year", 0);
// output rate // output rate

View File

@@ -3040,7 +3040,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
if ((gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and if ((gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and
(gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend()))
{ {
rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, true);
} }
if (!b_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0)) if (!b_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0))
{ {
@@ -3054,7 +3054,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
(gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and (gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and
(gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend()))
{ {
rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, true);
} }
if (!b_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0) and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) if (!b_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0) and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0))
{ {

View File

@@ -53,7 +53,7 @@ Pvt_Solution::Pvt_Solution()
d_valid_observations = 0; d_valid_observations = 0;
d_rx_pos = arma::zeros(3, 1); d_rx_pos = arma::zeros(3, 1);
d_rx_dt_s = 0.0; d_rx_dt_s = 0.0;
d_custom_year = 0; //disabled by default d_custom_year = 0; // disabled by default
} }

View File

@@ -130,7 +130,7 @@ public:
int tropo(double *ddr_m, double sinel, double hsta_km, double p_mb, double t_kel, double hum, double hp_km, double htkel_km, double hhum_km); int tropo(double *ddr_m, double sinel, double hsta_km, double p_mb, double t_kel, double hum, double hp_km, double htkel_km, double hhum_km);
protected: protected:
int d_custom_year; //custom year to guess the correct week rollover in post processing mode int d_custom_year; // custom year to guess the correct week rollover in post processing mode
private: private:
double d_rx_dt_s; // RX time offset [s] double d_rx_dt_s; // RX time offset [s]

View File

@@ -10086,7 +10086,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e
} }
void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, const Gps_CNAV_Ephemeris& eph_cnav, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables) void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, const Gps_CNAV_Ephemeris& eph_cnav, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables, bool triple_band)
{ {
if (eph_cnav.d_i_0) if (eph_cnav.d_i_0)
{ {
@@ -10255,8 +10255,19 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
} }
lineObs += std::to_string(static_cast<int32_t>(*it)); lineObs += std::to_string(static_cast<int32_t>(*it));
ret = total_mmap.equal_range(*it); ret = total_mmap.equal_range(*it);
bool have_l2 = false;
for (auto iter = ret.first; iter != ret.second; ++iter) for (auto iter = ret.first; iter != ret.second; ++iter)
{ {
std::string sig_(iter->second.Signal);
if (sig_ == "2S")
{
have_l2 = true;
}
if (triple_band and sig_ == "L5" and have_l2 == false)
{
lineObs += std::string(62, ' ');
}
lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14);
// Loss of lock indicator (LLI) // Loss of lock indicator (LLI)
@@ -11123,7 +11134,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e
} }
void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables) void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables, bool triple_band)
{ {
if (galileo_eph.e_1) if (galileo_eph.e_1)
{ {
@@ -11323,8 +11334,19 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
} }
lineObs += std::to_string(static_cast<int32_t>(*it)); lineObs += std::to_string(static_cast<int32_t>(*it));
ret = total_gps_map.equal_range(*it); ret = total_gps_map.equal_range(*it);
bool have_l2 = false;
for (auto iter = ret.first; iter != ret.second; ++iter) for (auto iter = ret.first; iter != ret.second; ++iter)
{ {
std::string sig_(iter->second.Signal);
if (sig_ == "2S")
{
have_l2 = true;
}
if (triple_band and sig_ == "L5" and have_l2 == false)
{
lineObs += std::string(62, ' ');
}
lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14);
// Loss of lock indicator (LLI) // Loss of lock indicator (LLI)
@@ -11795,7 +11817,7 @@ boost::posix_time::ptime Rinex_Printer::compute_UTC_time(const Gps_Navigation_Me
} }
else else
{ {
//assume receiver operating in between 1999 to 2008 // assume receiver operating in between 1999 to 2008
boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t); boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t);
return p_time; return p_time;
} }
@@ -11842,7 +11864,7 @@ boost::posix_time::ptime Rinex_Printer::compute_GPS_time(const Gps_Ephemeris& ep
} }
else else
{ {
//assume receiver operating in between 1999 to 2008 // assume receiver operating in between 1999 to 2008
boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t); boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t);
return p_time; return p_time;
} }

View File

@@ -347,7 +347,7 @@ public:
/*! /*!
* \brief Writes dual frequency GPS L1 and L2 observables into the RINEX file * \brief Writes dual frequency GPS L1 and L2 observables into the RINEX file
*/ */
void log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, const Gps_CNAV_Ephemeris& eph_cnav, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables); void log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, const Gps_CNAV_Ephemeris& eph_cnav, double obs_time, const std::map<int32_t, Gnss_Synchro>& observables, bool triple_band = false);
/*! /*!
* \brief Writes Galileo observables into the RINEX file. Example: galileo_bands("1B"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". * \brief Writes Galileo observables into the RINEX file. Example: galileo_bands("1B"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B".
@@ -367,7 +367,7 @@ public:
/*! /*!
* \brief Writes Mixed GPS / Galileo observables into the RINEX file * \brief Writes Mixed GPS / Galileo observables into the RINEX file
*/ */
void log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables); void log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map<int32_t, Gnss_Synchro>& observables, bool triple_band = false);
/*! /*!
* \brief Writes GLONASS GNAV observables into the RINEX file. Example: glonass_bands("1C"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". * \brief Writes GLONASS GNAV observables into the RINEX file. Example: glonass_bands("1C"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B".

View File

@@ -2128,6 +2128,11 @@ int adjgpsweek(int week, int custom_year)
// w = week + 1024; //add weeks from 6-january-1980 to week rollover in 21 august 1999 // w = week + 1024; //add weeks from 6-january-1980 to week rollover in 21 august 1999
// } // }
int w; int w;
if (week > 1023)
{
return week;
}
if (custom_year == 0) if (custom_year == 0)
{ {
(void)time2gpst(utc2gpst(timeget()), &w); (void)time2gpst(utc2gpst(timeget()), &w);
@@ -2141,15 +2146,15 @@ int adjgpsweek(int week, int custom_year)
{ {
if (custom_year >= 2019) if (custom_year >= 2019)
{ {
w = week + 2048; //add weeks from 6-january-1980 to week rollover in 6 april 2019 w = week + 2048; // add weeks from 6-january-1980 to week rollover in 6 april 2019
} }
else if (custom_year < 2019 and custom_year >= 1999) else if (custom_year < 2019 and custom_year >= 1999)
{ {
w = week + 1024; //add weeks from 6-january-1980 to week rollover in 21 august 1999 w = week + 1024; // add weeks from 6-january-1980 to week rollover in 21 august 1999
} }
else else
{ {
w = week; //no rollover w = week; // no rollover
} }
return w; return w;
} }

View File

@@ -116,7 +116,7 @@ ControlThread::ControlThread(const std::shared_ptr<ConfigurationInterface> &conf
void ControlThread::init() void ControlThread::init()
{ {
//OPTIONAL: specify a custom year to override the system time in order to postprocess old gnss records and avoid wrong week rollover // OPTIONAL: specify a custom year to override the system time in order to postprocess old gnss records and avoid wrong week rollover
custom_year_ = configuration_->property("GNSS-SDR.custom_year", 0); custom_year_ = configuration_->property("GNSS-SDR.custom_year", 0);
// Instantiates a control queue, a GNSS flowgraph, and a control message factory // Instantiates a control queue, a GNSS flowgraph, and a control message factory
control_queue_ = std::make_shared<Concurrent_Queue<pmt::pmt_t>>(); control_queue_ = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();

View File

@@ -171,7 +171,7 @@ private:
std::shared_ptr<GNSSFlowgraph> flowgraph_; std::shared_ptr<GNSSFlowgraph> flowgraph_;
std::shared_ptr<ConfigurationInterface> configuration_; std::shared_ptr<ConfigurationInterface> configuration_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> control_queue_; std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> control_queue_;
int custom_year_; //to override the system time to postprocess old gnss records and avoid wrong week rollover int custom_year_; // to override the system time to postprocess old gnss records and avoid wrong week rollover
bool stop_; bool stop_;
bool restart_; bool restart_;
bool delete_configuration_; bool delete_configuration_;