diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index 6a48ae290..04eb44ae2 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -29,6 +29,7 @@ */ #include "rtklib_pvt_gs.h" +#include "MATH_CONSTANTS.h" #include "beidou_dnav_almanac.h" #include "beidou_dnav_ephemeris.h" #include "beidou_dnav_iono.h" @@ -43,6 +44,7 @@ #include "glonass_gnav_almanac.h" #include "glonass_gnav_ephemeris.h" #include "glonass_gnav_utc_model.h" +#include "gnss_frequencies.h" #include "gnss_sdr_create_directory.h" #include "gps_almanac.h" #include "gps_cnav_ephemeris.h" @@ -129,6 +131,19 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, // Send PVT status to gnss_flowgraph this->message_port_register_out(pmt::mp("status")); + + mapStringValues_["1C"] = evGPS_1C; + mapStringValues_["2S"] = evGPS_2S; + mapStringValues_["L5"] = evGPS_L5; + mapStringValues_["1B"] = evGAL_1B; + mapStringValues_["5X"] = evGAL_5X; + mapStringValues_["1G"] = evGLO_1G; + mapStringValues_["2G"] = evGLO_2G; + mapStringValues_["B1"] = evBDS_B1; + mapStringValues_["B2"] = evBDS_B2; + mapStringValues_["B3"] = evBDS_B3; + + max_obs_block_rx_clock_offset_ms = conf_.max_obs_block_rx_clock_offset_ms; d_output_rate_ms = conf_.output_rate_ms; d_display_rate_ms = conf_.display_rate_ms; d_report_rate_ms = 1000; //report every second PVT to gnss_synchro @@ -443,8 +458,18 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, d_local_time_str = std::string(" ") + time_zone_abrv + " (UTC " + utc_diff_str.substr(0, 3) + ":" + utc_diff_str.substr(3, 2) + ")"; } - d_pvt_solver = std::make_shared(static_cast(nchannels), dump_ls_pvt_filename, d_dump, d_dump_mat, rtk); - d_pvt_solver->set_averaging_depth(1); + //user PVT solver + d_user_pvt_solver = std::make_shared(static_cast(nchannels), dump_ls_pvt_filename, d_dump, d_dump_mat, rtk); + d_user_pvt_solver->set_averaging_depth(1); + + //internal PVT solver, mainly used to estimate the receiver clock + rtk_t internal_rtk = rtk; + internal_rtk.opt.mode = PMODE_SINGLE; //use single positioning mode in internal PVT solver + d_internal_pvt_solver = std::make_shared(static_cast(nchannels), dump_ls_pvt_filename, false, false, internal_rtk); + d_internal_pvt_solver->set_averaging_depth(1); + + d_waiting_obs_block_rx_clock_offset_correction_msg = false; + start = std::chrono::system_clock::now(); } @@ -458,14 +483,14 @@ rtklib_pvt_gs::~rtklib_pvt_gs() { // save GPS L2CM ephemeris to XML file std::string file_name = xml_base_path + "gps_cnav_ephemeris.xml"; - if (d_pvt_solver->gps_cnav_ephemeris_map.empty() == false) + if (d_internal_pvt_solver->gps_cnav_ephemeris_map.empty() == false) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_cnav_ephemeris_map", d_pvt_solver->gps_cnav_ephemeris_map); + xml << boost::serialization::make_nvp("GNSS-SDR_cnav_ephemeris_map", d_internal_pvt_solver->gps_cnav_ephemeris_map); LOG(INFO) << "Saved GPS L2CM or L5 Ephemeris map data"; } catch (const boost::archive::archive_exception& e) @@ -484,14 +509,14 @@ rtklib_pvt_gs::~rtklib_pvt_gs() // save GPS L1 CA ephemeris to XML file file_name = xml_base_path + "gps_ephemeris.xml"; - if (d_pvt_solver->gps_ephemeris_map.empty() == false) + if (d_internal_pvt_solver->gps_ephemeris_map.empty() == false) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", d_pvt_solver->gps_ephemeris_map); + xml << boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", d_internal_pvt_solver->gps_ephemeris_map); LOG(INFO) << "Saved GPS L1 CA Ephemeris map data"; } catch (const boost::archive::archive_exception& e) @@ -510,14 +535,14 @@ rtklib_pvt_gs::~rtklib_pvt_gs() // save Galileo E1 ephemeris to XML file file_name = xml_base_path + "gal_ephemeris.xml"; - if (d_pvt_solver->galileo_ephemeris_map.empty() == false) + if (d_internal_pvt_solver->galileo_ephemeris_map.empty() == false) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gal_ephemeris_map", d_pvt_solver->galileo_ephemeris_map); + xml << boost::serialization::make_nvp("GNSS-SDR_gal_ephemeris_map", d_internal_pvt_solver->galileo_ephemeris_map); LOG(INFO) << "Saved Galileo E1 Ephemeris map data"; } catch (const boost::archive::archive_exception& e) @@ -540,14 +565,14 @@ rtklib_pvt_gs::~rtklib_pvt_gs() // save GLONASS GNAV ephemeris to XML file file_name = xml_base_path + "eph_GLONASS_GNAV.xml"; - if (d_pvt_solver->glonass_gnav_ephemeris_map.empty() == false) + if (d_internal_pvt_solver->glonass_gnav_ephemeris_map.empty() == false) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_pvt_solver->glonass_gnav_ephemeris_map); + xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_internal_pvt_solver->glonass_gnav_ephemeris_map); LOG(INFO) << "Saved GLONASS GNAV Ephemeris map data"; } catch (const boost::archive::archive_exception& e) @@ -570,14 +595,14 @@ rtklib_pvt_gs::~rtklib_pvt_gs() // Save GPS UTC model parameters file_name = xml_base_path + "gps_utc_model.xml"; - if (d_pvt_solver->gps_utc_model.valid) + if (d_internal_pvt_solver->gps_utc_model.valid) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_utc_model", d_pvt_solver->gps_utc_model); + xml << boost::serialization::make_nvp("GNSS-SDR_utc_model", d_internal_pvt_solver->gps_utc_model); LOG(INFO) << "Saved GPS UTC model parameters"; } catch (const std::ofstream::failure& e) @@ -600,14 +625,14 @@ rtklib_pvt_gs::~rtklib_pvt_gs() // Save Galileo UTC model parameters file_name = xml_base_path + "gal_utc_model.xml"; - if (d_pvt_solver->galileo_utc_model.Delta_tLS_6 != 0.0) + if (d_internal_pvt_solver->galileo_utc_model.Delta_tLS_6 != 0.0) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gal_utc_model", d_pvt_solver->galileo_utc_model); + xml << boost::serialization::make_nvp("GNSS-SDR_gal_utc_model", d_internal_pvt_solver->galileo_utc_model); LOG(INFO) << "Saved Galileo UTC model parameters"; } catch (const boost::archive::archive_exception& e) @@ -630,14 +655,14 @@ rtklib_pvt_gs::~rtklib_pvt_gs() // Save GPS iono parameters file_name = xml_base_path + "gps_iono.xml"; - if (d_pvt_solver->gps_iono.valid == true) + if (d_internal_pvt_solver->gps_iono.valid == true) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_iono_model", d_pvt_solver->gps_iono); + xml << boost::serialization::make_nvp("GNSS-SDR_iono_model", d_internal_pvt_solver->gps_iono); LOG(INFO) << "Saved GPS ionospheric model parameters"; } catch (const boost::archive::archive_exception& e) @@ -660,14 +685,14 @@ rtklib_pvt_gs::~rtklib_pvt_gs() // Save GPS CNAV iono parameters file_name = xml_base_path + "gps_cnav_iono.xml"; - if (d_pvt_solver->gps_cnav_iono.valid == true) + if (d_internal_pvt_solver->gps_cnav_iono.valid == true) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_cnav_iono_model", d_pvt_solver->gps_cnav_iono); + xml << boost::serialization::make_nvp("GNSS-SDR_cnav_iono_model", d_internal_pvt_solver->gps_cnav_iono); LOG(INFO) << "Saved GPS CNAV ionospheric model parameters"; } catch (const boost::archive::archive_exception& e) @@ -690,14 +715,14 @@ rtklib_pvt_gs::~rtklib_pvt_gs() // Save Galileo iono parameters file_name = xml_base_path + "gal_iono.xml"; - if (d_pvt_solver->galileo_iono.ai0_5 != 0.0) + if (d_internal_pvt_solver->galileo_iono.ai0_5 != 0.0) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gal_iono_model", d_pvt_solver->galileo_iono); + xml << boost::serialization::make_nvp("GNSS-SDR_gal_iono_model", d_internal_pvt_solver->galileo_iono); LOG(INFO) << "Saved Galileo ionospheric model parameters"; } catch (const boost::archive::archive_exception& e) @@ -720,14 +745,14 @@ rtklib_pvt_gs::~rtklib_pvt_gs() // save GPS almanac to XML file file_name = xml_base_path + "gps_almanac.xml"; - if (d_pvt_solver->gps_almanac_map.empty() == false) + if (d_internal_pvt_solver->gps_almanac_map.empty() == false) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gps_almanac_map", d_pvt_solver->gps_almanac_map); + xml << boost::serialization::make_nvp("GNSS-SDR_gps_almanac_map", d_internal_pvt_solver->gps_almanac_map); LOG(INFO) << "Saved GPS almanac map data"; } catch (const boost::archive::archive_exception& e) @@ -750,14 +775,14 @@ rtklib_pvt_gs::~rtklib_pvt_gs() // Save Galileo almanac file_name = xml_base_path + "gal_almanac.xml"; - if (d_pvt_solver->galileo_almanac_map.empty() == false) + if (d_internal_pvt_solver->galileo_almanac_map.empty() == false) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gal_almanac_map", d_pvt_solver->galileo_almanac_map); + xml << boost::serialization::make_nvp("GNSS-SDR_gal_almanac_map", d_internal_pvt_solver->galileo_almanac_map); LOG(INFO) << "Saved Galileo almanac data"; } catch (const boost::archive::archive_exception& e) @@ -780,14 +805,14 @@ rtklib_pvt_gs::~rtklib_pvt_gs() // Save GPS CNAV UTC model parameters file_name = xml_base_path + "gps_cnav_utc_model.xml"; - if (d_pvt_solver->gps_cnav_utc_model.valid) + if (d_internal_pvt_solver->gps_cnav_utc_model.valid) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_cnav_utc_model", d_pvt_solver->gps_cnav_utc_model); + xml << boost::serialization::make_nvp("GNSS-SDR_cnav_utc_model", d_internal_pvt_solver->gps_cnav_utc_model); LOG(INFO) << "Saved GPS CNAV UTC model parameters"; } catch (const boost::archive::archive_exception& e) @@ -810,14 +835,14 @@ rtklib_pvt_gs::~rtklib_pvt_gs() // save GLONASS GNAV ephemeris to XML file file_name = xml_base_path + "glo_gnav_ephemeris.xml"; - if (d_pvt_solver->glonass_gnav_ephemeris_map.empty() == false) + if (d_internal_pvt_solver->glonass_gnav_ephemeris_map.empty() == false) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_pvt_solver->glonass_gnav_ephemeris_map); + xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_internal_pvt_solver->glonass_gnav_ephemeris_map); LOG(INFO) << "Saved GLONASS GNAV ephemeris map data"; } catch (const boost::archive::archive_exception& e) @@ -840,14 +865,14 @@ rtklib_pvt_gs::~rtklib_pvt_gs() // save GLONASS UTC model parameters to XML file file_name = xml_base_path + "glo_utc_model.xml"; - if (d_pvt_solver->glonass_gnav_utc_model.valid) + if (d_internal_pvt_solver->glonass_gnav_utc_model.valid) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gnav_utc_model", d_pvt_solver->glonass_gnav_utc_model); + xml << boost::serialization::make_nvp("GNSS-SDR_gnav_utc_model", d_internal_pvt_solver->glonass_gnav_utc_model); LOG(INFO) << "Saved GLONASS UTC model parameters"; } catch (const boost::archive::archive_exception& e) @@ -870,14 +895,14 @@ rtklib_pvt_gs::~rtklib_pvt_gs() // save BeiDou DNAV ephemeris to XML file file_name = xml_base_path + "bds_dnav_ephemeris.xml"; - if (d_pvt_solver->beidou_dnav_ephemeris_map.empty() == false) + if (d_internal_pvt_solver->beidou_dnav_ephemeris_map.empty() == false) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_ephemeris_map", d_pvt_solver->beidou_dnav_ephemeris_map); + xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_ephemeris_map", d_internal_pvt_solver->beidou_dnav_ephemeris_map); LOG(INFO) << "Saved BeiDou DNAV Ephemeris map data"; } catch (const boost::archive::archive_exception& e) @@ -900,14 +925,14 @@ rtklib_pvt_gs::~rtklib_pvt_gs() // Save BeiDou DNAV iono parameters file_name = xml_base_path + "bds_dnav_iono.xml"; - if (d_pvt_solver->beidou_dnav_iono.valid) + if (d_internal_pvt_solver->beidou_dnav_iono.valid) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_iono_model", d_pvt_solver->beidou_dnav_iono); + xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_iono_model", d_internal_pvt_solver->beidou_dnav_iono); LOG(INFO) << "Saved BeiDou DNAV ionospheric model parameters"; } catch (const boost::archive::archive_exception& e) @@ -930,14 +955,14 @@ rtklib_pvt_gs::~rtklib_pvt_gs() // save BeiDou DNAV almanac to XML file file_name = xml_base_path + "bds_dnav_almanac.xml"; - if (d_pvt_solver->beidou_dnav_almanac_map.empty() == false) + if (d_internal_pvt_solver->beidou_dnav_almanac_map.empty() == false) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_almanac_map", d_pvt_solver->beidou_dnav_almanac_map); + xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_almanac_map", d_internal_pvt_solver->beidou_dnav_almanac_map); LOG(INFO) << "Saved BeiDou DNAV almanac map data"; } catch (const boost::archive::archive_exception& e) @@ -960,14 +985,14 @@ rtklib_pvt_gs::~rtklib_pvt_gs() // Save BeiDou UTC model parameters file_name = xml_base_path + "bds_dnav_utc_model.xml"; - if (d_pvt_solver->beidou_dnav_utc_model.valid) + if (d_internal_pvt_solver->beidou_dnav_utc_model.valid) { std::ofstream ofs; try { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_utc_model", d_pvt_solver->beidou_dnav_utc_model); + xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_utc_model", d_internal_pvt_solver->beidou_dnav_utc_model); LOG(INFO) << "Saved BeiDou DNAV UTC model parameters"; } catch (const boost::archive::archive_exception& e) @@ -1015,13 +1040,13 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) if (b_rinex_header_written) // The header is already written, we can now log the navigation message data { bool new_annotation = false; - if (d_pvt_solver->gps_ephemeris_map.find(gps_eph->i_satellite_PRN) == d_pvt_solver->gps_ephemeris_map.cend()) + if (d_internal_pvt_solver->gps_ephemeris_map.find(gps_eph->i_satellite_PRN) == d_internal_pvt_solver->gps_ephemeris_map.cend()) { new_annotation = true; } else { - if (d_pvt_solver->gps_ephemeris_map[gps_eph->i_satellite_PRN].d_Toe != gps_eph->d_Toe) + if (d_internal_pvt_solver->gps_ephemeris_map[gps_eph->i_satellite_PRN].d_Toe != gps_eph->d_Toe) { new_annotation = true; } @@ -1075,14 +1100,16 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) } } } - d_pvt_solver->gps_ephemeris_map[gps_eph->i_satellite_PRN] = *gps_eph; + d_internal_pvt_solver->gps_ephemeris_map[gps_eph->i_satellite_PRN] = *gps_eph; + d_user_pvt_solver->gps_ephemeris_map[gps_eph->i_satellite_PRN] = *gps_eph; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { // ### GPS IONO ### std::shared_ptr gps_iono; gps_iono = boost::any_cast>(pmt::any_ref(msg)); - d_pvt_solver->gps_iono = *gps_iono; + d_internal_pvt_solver->gps_iono = *gps_iono; + d_user_pvt_solver->gps_iono = *gps_iono; DLOG(INFO) << "New IONO record has arrived "; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) @@ -1090,7 +1117,8 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) // ### GPS UTC MODEL ### std::shared_ptr gps_utc_model; gps_utc_model = boost::any_cast>(pmt::any_ref(msg)); - d_pvt_solver->gps_utc_model = *gps_utc_model; + d_internal_pvt_solver->gps_utc_model = *gps_utc_model; + d_user_pvt_solver->gps_utc_model = *gps_utc_model; DLOG(INFO) << "New UTC record has arrived "; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) @@ -1102,13 +1130,13 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) if (b_rinex_header_written) // The header is already written, we can now log the navigation message data { bool new_annotation = false; - if (d_pvt_solver->gps_cnav_ephemeris_map.find(gps_cnav_ephemeris->i_satellite_PRN) == d_pvt_solver->gps_cnav_ephemeris_map.cend()) + if (d_internal_pvt_solver->gps_cnav_ephemeris_map.find(gps_cnav_ephemeris->i_satellite_PRN) == d_internal_pvt_solver->gps_cnav_ephemeris_map.cend()) { new_annotation = true; } else { - if (d_pvt_solver->gps_cnav_ephemeris_map[gps_cnav_ephemeris->i_satellite_PRN].d_Toe1 != gps_cnav_ephemeris->d_Toe1) + if (d_internal_pvt_solver->gps_cnav_ephemeris_map[gps_cnav_ephemeris->i_satellite_PRN].d_Toe1 != gps_cnav_ephemeris->d_Toe1) { new_annotation = true; } @@ -1145,7 +1173,8 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) } } } - d_pvt_solver->gps_cnav_ephemeris_map[gps_cnav_ephemeris->i_satellite_PRN] = *gps_cnav_ephemeris; + d_internal_pvt_solver->gps_cnav_ephemeris_map[gps_cnav_ephemeris->i_satellite_PRN] = *gps_cnav_ephemeris; + d_user_pvt_solver->gps_cnav_ephemeris_map[gps_cnav_ephemeris->i_satellite_PRN] = *gps_cnav_ephemeris; DLOG(INFO) << "New GPS CNAV ephemeris record has arrived "; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) @@ -1153,7 +1182,8 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) // ### GPS CNAV IONO ### std::shared_ptr gps_cnav_iono; gps_cnav_iono = boost::any_cast>(pmt::any_ref(msg)); - d_pvt_solver->gps_cnav_iono = *gps_cnav_iono; + d_internal_pvt_solver->gps_cnav_iono = *gps_cnav_iono; + d_user_pvt_solver->gps_cnav_iono = *gps_cnav_iono; DLOG(INFO) << "New CNAV IONO record has arrived "; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) @@ -1161,7 +1191,8 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) // ### GPS CNAV UTC MODEL ### std::shared_ptr gps_cnav_utc_model; gps_cnav_utc_model = boost::any_cast>(pmt::any_ref(msg)); - d_pvt_solver->gps_cnav_utc_model = *gps_cnav_utc_model; + d_internal_pvt_solver->gps_cnav_utc_model = *gps_cnav_utc_model; + d_user_pvt_solver->gps_cnav_utc_model = *gps_cnav_utc_model; DLOG(INFO) << "New CNAV UTC record has arrived "; } @@ -1170,7 +1201,8 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) // ### GPS ALMANAC ### std::shared_ptr gps_almanac; gps_almanac = boost::any_cast>(pmt::any_ref(msg)); - d_pvt_solver->gps_almanac_map[gps_almanac->i_satellite_PRN] = *gps_almanac; + d_internal_pvt_solver->gps_almanac_map[gps_almanac->i_satellite_PRN] = *gps_almanac; + d_user_pvt_solver->gps_almanac_map[gps_almanac->i_satellite_PRN] = *gps_almanac; DLOG(INFO) << "New GPS almanac record has arrived "; } @@ -1188,13 +1220,13 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) if (b_rinex_header_written) // The header is already written, we can now log the navigation message data { bool new_annotation = false; - if (d_pvt_solver->galileo_ephemeris_map.find(galileo_eph->i_satellite_PRN) == d_pvt_solver->galileo_ephemeris_map.cend()) + if (d_internal_pvt_solver->galileo_ephemeris_map.find(galileo_eph->i_satellite_PRN) == d_internal_pvt_solver->galileo_ephemeris_map.cend()) { new_annotation = true; } else { - if (d_pvt_solver->galileo_ephemeris_map[galileo_eph->i_satellite_PRN].t0e_1 != galileo_eph->t0e_1) + if (d_internal_pvt_solver->galileo_ephemeris_map[galileo_eph->i_satellite_PRN].t0e_1 != galileo_eph->t0e_1) { new_annotation = true; } @@ -1238,14 +1270,16 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) } } } - d_pvt_solver->galileo_ephemeris_map[galileo_eph->i_satellite_PRN] = *galileo_eph; + d_internal_pvt_solver->galileo_ephemeris_map[galileo_eph->i_satellite_PRN] = *galileo_eph; + d_user_pvt_solver->galileo_ephemeris_map[galileo_eph->i_satellite_PRN] = *galileo_eph; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { // ### Galileo IONO ### std::shared_ptr galileo_iono; galileo_iono = boost::any_cast>(pmt::any_ref(msg)); - d_pvt_solver->galileo_iono = *galileo_iono; + d_internal_pvt_solver->galileo_iono = *galileo_iono; + d_user_pvt_solver->galileo_iono = *galileo_iono; DLOG(INFO) << "New IONO record has arrived "; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) @@ -1253,7 +1287,8 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) // ### Galileo UTC MODEL ### std::shared_ptr galileo_utc_model; galileo_utc_model = boost::any_cast>(pmt::any_ref(msg)); - d_pvt_solver->galileo_utc_model = *galileo_utc_model; + d_internal_pvt_solver->galileo_utc_model = *galileo_utc_model; + d_user_pvt_solver->galileo_utc_model = *galileo_utc_model; DLOG(INFO) << "New UTC record has arrived "; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) @@ -1268,15 +1303,18 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) if (sv1.i_satellite_PRN != 0) { - d_pvt_solver->galileo_almanac_map[sv1.i_satellite_PRN] = sv1; + d_internal_pvt_solver->galileo_almanac_map[sv1.i_satellite_PRN] = sv1; + d_user_pvt_solver->galileo_almanac_map[sv1.i_satellite_PRN] = sv1; } if (sv2.i_satellite_PRN != 0) { - d_pvt_solver->galileo_almanac_map[sv2.i_satellite_PRN] = sv2; + d_internal_pvt_solver->galileo_almanac_map[sv2.i_satellite_PRN] = sv2; + d_user_pvt_solver->galileo_almanac_map[sv2.i_satellite_PRN] = sv2; } if (sv3.i_satellite_PRN != 0) { - d_pvt_solver->galileo_almanac_map[sv3.i_satellite_PRN] = sv3; + d_internal_pvt_solver->galileo_almanac_map[sv3.i_satellite_PRN] = sv3; + d_user_pvt_solver->galileo_almanac_map[sv3.i_satellite_PRN] = sv3; } DLOG(INFO) << "New Galileo Almanac data have arrived "; } @@ -1286,7 +1324,8 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) std::shared_ptr galileo_alm; galileo_alm = boost::any_cast>(pmt::any_ref(msg)); // update/insert new almanac record to the global almanac map - d_pvt_solver->galileo_almanac_map[galileo_alm->i_satellite_PRN] = *galileo_alm; + d_internal_pvt_solver->galileo_almanac_map[galileo_alm->i_satellite_PRN] = *galileo_alm; + d_user_pvt_solver->galileo_almanac_map[galileo_alm->i_satellite_PRN] = *galileo_alm; } // **************** GLONASS GNAV Telemetry ************************** @@ -1305,13 +1344,13 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) if (b_rinex_header_written) // The header is already written, we can now log the navigation message data { bool new_annotation = false; - if (d_pvt_solver->glonass_gnav_ephemeris_map.find(glonass_gnav_eph->i_satellite_PRN) == d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + if (d_internal_pvt_solver->glonass_gnav_ephemeris_map.find(glonass_gnav_eph->i_satellite_PRN) == d_internal_pvt_solver->glonass_gnav_ephemeris_map.cend()) { new_annotation = true; } else { - if (d_pvt_solver->glonass_gnav_ephemeris_map[glonass_gnav_eph->i_satellite_PRN].d_t_b != glonass_gnav_eph->d_t_b) + if (d_internal_pvt_solver->glonass_gnav_ephemeris_map[glonass_gnav_eph->i_satellite_PRN].d_t_b != glonass_gnav_eph->d_t_b) { new_annotation = true; } @@ -1366,14 +1405,16 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) } } } - d_pvt_solver->glonass_gnav_ephemeris_map[glonass_gnav_eph->i_satellite_PRN] = *glonass_gnav_eph; + d_internal_pvt_solver->glonass_gnav_ephemeris_map[glonass_gnav_eph->i_satellite_PRN] = *glonass_gnav_eph; + d_user_pvt_solver->glonass_gnav_ephemeris_map[glonass_gnav_eph->i_satellite_PRN] = *glonass_gnav_eph; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { // ### GLONASS GNAV UTC MODEL ### std::shared_ptr glonass_gnav_utc_model; glonass_gnav_utc_model = boost::any_cast>(pmt::any_ref(msg)); - d_pvt_solver->glonass_gnav_utc_model = *glonass_gnav_utc_model; + d_internal_pvt_solver->glonass_gnav_utc_model = *glonass_gnav_utc_model; + d_user_pvt_solver->glonass_gnav_utc_model = *glonass_gnav_utc_model; DLOG(INFO) << "New GLONASS GNAV UTC record has arrived "; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) @@ -1381,7 +1422,8 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) // ### GLONASS GNAV Almanac ### std::shared_ptr glonass_gnav_almanac; glonass_gnav_almanac = boost::any_cast>(pmt::any_ref(msg)); - d_pvt_solver->glonass_gnav_almanac = *glonass_gnav_almanac; + d_internal_pvt_solver->glonass_gnav_almanac = *glonass_gnav_almanac; + d_user_pvt_solver->glonass_gnav_almanac = *glonass_gnav_almanac; DLOG(INFO) << "New GLONASS GNAV Almanac has arrived " << ", GLONASS GNAV Slot Number =" << glonass_gnav_almanac->d_n_A; } @@ -1401,13 +1443,13 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) if (b_rinex_header_written) // The header is already written, we can now log the navigation message data { bool new_annotation = false; - if (d_pvt_solver->beidou_dnav_ephemeris_map.find(bds_dnav_eph->i_satellite_PRN) == d_pvt_solver->beidou_dnav_ephemeris_map.cend()) + if (d_internal_pvt_solver->beidou_dnav_ephemeris_map.find(bds_dnav_eph->i_satellite_PRN) == d_internal_pvt_solver->beidou_dnav_ephemeris_map.cend()) { new_annotation = true; } else { - if (d_pvt_solver->beidou_dnav_ephemeris_map[bds_dnav_eph->i_satellite_PRN].d_Toc != bds_dnav_eph->d_Toc) + if (d_internal_pvt_solver->beidou_dnav_ephemeris_map[bds_dnav_eph->i_satellite_PRN].d_Toc != bds_dnav_eph->d_Toc) { new_annotation = true; } @@ -1427,14 +1469,16 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) } } } - d_pvt_solver->beidou_dnav_ephemeris_map[bds_dnav_eph->i_satellite_PRN] = *bds_dnav_eph; + d_internal_pvt_solver->beidou_dnav_ephemeris_map[bds_dnav_eph->i_satellite_PRN] = *bds_dnav_eph; + d_user_pvt_solver->beidou_dnav_ephemeris_map[bds_dnav_eph->i_satellite_PRN] = *bds_dnav_eph; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { // ### BeiDou IONO ### std::shared_ptr bds_dnav_iono; bds_dnav_iono = boost::any_cast>(pmt::any_ref(msg)); - d_pvt_solver->beidou_dnav_iono = *bds_dnav_iono; + d_internal_pvt_solver->beidou_dnav_iono = *bds_dnav_iono; + d_user_pvt_solver->beidou_dnav_iono = *bds_dnav_iono; DLOG(INFO) << "New BeiDou DNAV IONO record has arrived "; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) @@ -1442,7 +1486,8 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) // ### BeiDou UTC MODEL ### std::shared_ptr bds_dnav_utc_model; bds_dnav_utc_model = boost::any_cast>(pmt::any_ref(msg)); - d_pvt_solver->beidou_dnav_utc_model = *bds_dnav_utc_model; + d_internal_pvt_solver->beidou_dnav_utc_model = *bds_dnav_utc_model; + d_user_pvt_solver->beidou_dnav_utc_model = *bds_dnav_utc_model; DLOG(INFO) << "New BeiDou DNAV UTC record has arrived "; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) @@ -1450,7 +1495,8 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) // ### BeiDou ALMANAC ### std::shared_ptr bds_dnav_almanac; bds_dnav_almanac = boost::any_cast>(pmt::any_ref(msg)); - d_pvt_solver->beidou_dnav_almanac_map[bds_dnav_almanac->i_satellite_PRN] = *bds_dnav_almanac; + d_internal_pvt_solver->beidou_dnav_almanac_map[bds_dnav_almanac->i_satellite_PRN] = *bds_dnav_almanac; + d_user_pvt_solver->beidou_dnav_almanac_map[bds_dnav_almanac->i_satellite_PRN] = *bds_dnav_almanac; DLOG(INFO) << "New BeiDou DNAV almanac record has arrived "; } else @@ -1467,54 +1513,55 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) std::map rtklib_pvt_gs::get_gps_ephemeris_map() const { - return d_pvt_solver->gps_ephemeris_map; + return d_internal_pvt_solver->gps_ephemeris_map; } std::map rtklib_pvt_gs::get_gps_almanac_map() const { - return d_pvt_solver->gps_almanac_map; + return d_internal_pvt_solver->gps_almanac_map; } std::map rtklib_pvt_gs::get_galileo_ephemeris_map() const { - return d_pvt_solver->galileo_ephemeris_map; + return d_internal_pvt_solver->galileo_ephemeris_map; } std::map rtklib_pvt_gs::get_galileo_almanac_map() const { - return d_pvt_solver->galileo_almanac_map; + return d_internal_pvt_solver->galileo_almanac_map; } std::map rtklib_pvt_gs::get_beidou_dnav_ephemeris_map() const { - return d_pvt_solver->beidou_dnav_ephemeris_map; + return d_internal_pvt_solver->beidou_dnav_ephemeris_map; } std::map rtklib_pvt_gs::get_beidou_dnav_almanac_map() const { - return d_pvt_solver->beidou_dnav_almanac_map; + return d_internal_pvt_solver->beidou_dnav_almanac_map; } void rtklib_pvt_gs::clear_ephemeris() { - d_pvt_solver->gps_ephemeris_map.clear(); - d_pvt_solver->gps_almanac_map.clear(); - d_pvt_solver->galileo_ephemeris_map.clear(); - d_pvt_solver->galileo_almanac_map.clear(); - d_pvt_solver->beidou_dnav_ephemeris_map.clear(); - d_pvt_solver->beidou_dnav_almanac_map.clear(); -} + d_internal_pvt_solver->gps_ephemeris_map.clear(); + d_internal_pvt_solver->gps_almanac_map.clear(); + d_internal_pvt_solver->galileo_ephemeris_map.clear(); + d_internal_pvt_solver->galileo_almanac_map.clear(); + d_internal_pvt_solver->beidou_dnav_ephemeris_map.clear(); + d_internal_pvt_solver->beidou_dnav_almanac_map.clear(); - -bool rtklib_pvt_gs::observables_pairCompare_min(const std::pair& a, const std::pair& b) -{ - return (a.second.Pseudorange_m) < (b.second.Pseudorange_m); + d_user_pvt_solver->gps_ephemeris_map.clear(); + d_user_pvt_solver->gps_almanac_map.clear(); + d_user_pvt_solver->galileo_ephemeris_map.clear(); + d_user_pvt_solver->galileo_almanac_map.clear(); + d_user_pvt_solver->beidou_dnav_ephemeris_map.clear(); + d_user_pvt_solver->beidou_dnav_almanac_map.clear(); } @@ -1602,14 +1649,14 @@ bool rtklib_pvt_gs::get_latest_PVT(double* longitude_deg, double* course_over_ground_deg, time_t* UTC_time) const { - if (d_pvt_solver->is_valid_position()) + if (d_user_pvt_solver->is_valid_position()) { - *latitude_deg = d_pvt_solver->get_latitude(); - *longitude_deg = d_pvt_solver->get_longitude(); - *height_m = d_pvt_solver->get_height(); - *ground_speed_kmh = d_pvt_solver->get_speed_over_ground() * 3600.0 / 1000.0; - *course_over_ground_deg = d_pvt_solver->get_course_over_ground(); - *UTC_time = convert_to_time_t(d_pvt_solver->get_position_UTC_time()); + *latitude_deg = d_user_pvt_solver->get_latitude(); + *longitude_deg = d_user_pvt_solver->get_longitude(); + *height_m = d_user_pvt_solver->get_height(); + *ground_speed_kmh = d_user_pvt_solver->get_speed_over_ground() * 3600.0 / 1000.0; + *course_over_ground_deg = d_user_pvt_solver->get_course_over_ground(); + *UTC_time = convert_to_time_t(d_user_pvt_solver->get_position_UTC_time()); return true; } @@ -1618,6 +1665,108 @@ bool rtklib_pvt_gs::get_latest_PVT(double* longitude_deg, } +void rtklib_pvt_gs::apply_rx_clock_offset(std::map& observables_map, + double rx_clock_offset_s) +{ + //apply corrections according to Rinex 3.04, Table 1: Observation Corrections for Receiver Clock Offset + std::map::iterator observables_iter; + + for (observables_iter = observables_map.begin(); observables_iter != observables_map.end(); observables_iter++) + { + //all observables in the map are valid + observables_iter->second.RX_time -= rx_clock_offset_s; + observables_iter->second.Pseudorange_m -= rx_clock_offset_s * SPEED_OF_LIGHT; + + switch (mapStringValues_[observables_iter->second.Signal]) + { + case evGPS_1C: + observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ1; + break; + case evGPS_L5: + observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ5; + break; + case evSBAS_1C: + observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ1; + break; + case evGAL_1B: + observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ1; + break; + case evGAL_5X: + observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ5; + break; + case evGPS_2S: + observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ2; + break; + case evBDS_B3: + observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ3_BDS; + break; + case evGLO_1G: + observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ1_GLO; + break; + case evGLO_2G: + observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ2_GLO; + break; + case evBDS_B1: + observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ1_BDS; + break; + case evBDS_B2: + observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ2_BDS; + break; + default: + break; + } + } +} + +std::map rtklib_pvt_gs::interpolate_observables(std::map& observables_map_t0, + std::map& observables_map_t1, + double rx_time_s) +{ + std::map interp_observables_map; + //Linear interpolation: y(t) = y(t0) + (y(t1) - y(t0)) * (t - t0) / (t1 - t0) + + // check TOW rollover + double time_factor; + if ((observables_map_t1.cbegin()->second.RX_time - + observables_map_t0.cbegin()->second.RX_time) > 0) + { + time_factor = (rx_time_s - observables_map_t0.cbegin()->second.RX_time) / + (observables_map_t1.cbegin()->second.RX_time - + observables_map_t0.cbegin()->second.RX_time); + } + else + { + // TOW rollover situation + time_factor = (604800000.0 + rx_time_s - observables_map_t0.cbegin()->second.RX_time) / + (604800000.0 + observables_map_t1.cbegin()->second.RX_time - + observables_map_t0.cbegin()->second.RX_time); + } + + + std::map::const_iterator observables_iter; + for (observables_iter = observables_map_t0.cbegin(); observables_iter != observables_map_t0.cend(); observables_iter++) + { + //1. Check if the observable exist in t0 and t1 + //the map key is the channel ID (see work()) + try + { + if (observables_map_t1.at(observables_iter->first).PRN == observables_iter->second.PRN) + { + interp_observables_map.insert(std::pair(observables_iter->first, observables_iter->second)); + interp_observables_map.at(observables_iter->first).RX_time = rx_time_s; //interpolation point + interp_observables_map.at(observables_iter->first).Pseudorange_m += (observables_map_t1.at(observables_iter->first).Pseudorange_m - observables_iter->second.Pseudorange_m) * time_factor; + interp_observables_map.at(observables_iter->first).Carrier_phase_rads += (observables_map_t1.at(observables_iter->first).Carrier_phase_rads - observables_iter->second.Carrier_phase_rads) * time_factor; + interp_observables_map.at(observables_iter->first).Carrier_Doppler_hz += (observables_map_t1.at(observables_iter->first).Carrier_Doppler_hz - observables_iter->second.Carrier_Doppler_hz) * time_factor; + } + } + catch (const std::out_of_range& oor) + { + //observable does not exist in t1 + } + } + return interp_observables_map; +} + int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_items, gr_vector_void_star& output_items __attribute__((unused))) { @@ -1638,11 +1787,11 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { if (in[i][epoch].Flag_valid_pseudorange) { - std::map::const_iterator tmp_eph_iter_gps = d_pvt_solver->gps_ephemeris_map.find(in[i][epoch].PRN); - std::map::const_iterator tmp_eph_iter_gal = d_pvt_solver->galileo_ephemeris_map.find(in[i][epoch].PRN); - std::map::const_iterator tmp_eph_iter_cnav = d_pvt_solver->gps_cnav_ephemeris_map.find(in[i][epoch].PRN); - std::map::const_iterator tmp_eph_iter_glo_gnav = d_pvt_solver->glonass_gnav_ephemeris_map.find(in[i][epoch].PRN); - std::map::const_iterator tmp_eph_iter_bds_dnav = d_pvt_solver->beidou_dnav_ephemeris_map.find(in[i][epoch].PRN); + std::map::const_iterator tmp_eph_iter_gps = d_internal_pvt_solver->gps_ephemeris_map.find(in[i][epoch].PRN); + std::map::const_iterator tmp_eph_iter_gal = d_internal_pvt_solver->galileo_ephemeris_map.find(in[i][epoch].PRN); + std::map::const_iterator tmp_eph_iter_cnav = d_internal_pvt_solver->gps_cnav_ephemeris_map.find(in[i][epoch].PRN); + std::map::const_iterator tmp_eph_iter_glo_gnav = d_internal_pvt_solver->glonass_gnav_ephemeris_map.find(in[i][epoch].PRN); + std::map::const_iterator tmp_eph_iter_bds_dnav = d_internal_pvt_solver->beidou_dnav_ephemeris_map.find(in[i][epoch].PRN); bool store_valid_observable = false; @@ -1697,32 +1846,32 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { try { - if (d_pvt_solver->gps_ephemeris_map.empty() == false) + if (d_internal_pvt_solver->gps_ephemeris_map.empty() == false) { - if (tmp_eph_iter_gps != d_pvt_solver->gps_ephemeris_map.cend()) + if (tmp_eph_iter_gps != d_internal_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->lock_time(d_pvt_solver->gps_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time + d_rtcm_printer->lock_time(d_internal_pvt_solver->gps_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time } } - if (d_pvt_solver->galileo_ephemeris_map.empty() == false) + if (d_internal_pvt_solver->galileo_ephemeris_map.empty() == false) { - if (tmp_eph_iter_gal != d_pvt_solver->galileo_ephemeris_map.cend()) + if (tmp_eph_iter_gal != d_internal_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->lock_time(d_pvt_solver->galileo_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time + d_rtcm_printer->lock_time(d_internal_pvt_solver->galileo_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time } } - if (d_pvt_solver->gps_cnav_ephemeris_map.empty() == false) + if (d_internal_pvt_solver->gps_cnav_ephemeris_map.empty() == false) { - if (tmp_eph_iter_cnav != d_pvt_solver->gps_cnav_ephemeris_map.cend()) + if (tmp_eph_iter_cnav != d_internal_pvt_solver->gps_cnav_ephemeris_map.cend()) { - d_rtcm_printer->lock_time(d_pvt_solver->gps_cnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time + d_rtcm_printer->lock_time(d_internal_pvt_solver->gps_cnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time } } - if (d_pvt_solver->glonass_gnav_ephemeris_map.empty() == false) + if (d_internal_pvt_solver->glonass_gnav_ephemeris_map.empty() == false) { - if (tmp_eph_iter_glo_gnav != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + if (tmp_eph_iter_glo_gnav != d_internal_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->lock_time(d_pvt_solver->glonass_gnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time + d_rtcm_printer->lock_time(d_internal_pvt_solver->glonass_gnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time } } } @@ -1743,38 +1892,74 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item // ############ 2 COMPUTE THE PVT ################################ if (gnss_observables_map.empty() == false) { - double current_RX_time = gnss_observables_map.begin()->second.RX_time; - auto current_RX_time_ms = static_cast(current_RX_time * 1000.0); - if (current_RX_time_ms % d_output_rate_ms == 0) + //LOG(INFO) << "diff raw obs time: " << gnss_observables_map.cbegin()->second.RX_time * 1000.0 - old_time_debug; + //old_time_debug = gnss_observables_map.cbegin()->second.RX_time * 1000.0; + uint32_t current_RX_time_ms = 0; + // #### solve PVT and store the corrected observable set + if (d_internal_pvt_solver->get_PVT(gnss_observables_map, false)) { - flag_compute_pvt_output = true; - d_rx_time = current_RX_time; - // std::cout.precision(17); - // std::cout << "current_RX_time: " << current_RX_time << " map time: " << gnss_observables_map.begin()->second.RX_time << std::endl; + double Rx_clock_offset_s = d_internal_pvt_solver->get_time_offset_s(); + if (fabs(Rx_clock_offset_s) * 1000.0 > max_obs_block_rx_clock_offset_ms) + { + if (!d_waiting_obs_block_rx_clock_offset_correction_msg) + { + this->message_port_pub(pmt::mp("pvt_to_observables"), pmt::make_any(Rx_clock_offset_s)); + d_waiting_obs_block_rx_clock_offset_correction_msg = true; + LOG(INFO) << "Sent clock offset correction to observables: " << Rx_clock_offset_s << "[s]"; + } + } + else + { + d_waiting_obs_block_rx_clock_offset_correction_msg = false; + gnss_observables_map_t0 = gnss_observables_map_t1; + apply_rx_clock_offset(gnss_observables_map, Rx_clock_offset_s); + gnss_observables_map_t1 = gnss_observables_map; + + //### select the rx_time and interpolate observables at that time + if (!gnss_observables_map_t0.empty()) + { + uint32_t t0_int_ms = static_cast(gnss_observables_map_t0.cbegin()->second.RX_time * 1000.0); + uint32_t adjust_next_20ms = 20 - t0_int_ms % 20; + current_RX_time_ms = t0_int_ms + adjust_next_20ms; + + if (current_RX_time_ms % d_output_rate_ms == 0) + { + d_rx_time = static_cast(current_RX_time_ms) / 1000.0; + // std::cout << " obs time t0: " << gnss_observables_map_t0.cbegin()->second.RX_time + // << " t1: " << gnss_observables_map_t1.cbegin()->second.RX_time + // << " interp time: " << d_rx_time << std::endl; + gnss_observables_map = interpolate_observables(gnss_observables_map_t0, + gnss_observables_map_t1, + d_rx_time); + flag_compute_pvt_output = true; + //d_rx_time = current_RX_time; + // std::cout.precision(17); + // std::cout << "current_RX_time: " << current_RX_time << " map time: " << gnss_observables_map.begin()->second.RX_time << std::endl; + } + } + } } + //debug code + // else + // { + // LOG(INFO) << "Internal PVT solver error"; + // } // compute on the fly PVT solution if (flag_compute_pvt_output == true) { - // receiver clock correction is disabled to be coherent with the RINEX and RTCM standard - // std::cout << TEXT_RED << "(internal) accumulated RX clock offset: " << d_pvt_solver->get_time_offset_s() << "[s]" << TEXT_RESET << std::endl; - // for (std::map::iterator it = gnss_observables_map.begin(); it != gnss_observables_map.cend(); ++it) - // { - // todo: check if it has effect to correct the receiver time for the internal pvt solution - // take into account that the RINEX obs with the RX time (integer ms) CAN NOT be corrected to keep the coherence in obs time - // it->second.Pseudorange_m = it->second.Pseudorange_m - d_pvt_solver->get_time_offset_s() * GPS_C_m_s; - // } - - if (d_pvt_solver->get_PVT(gnss_observables_map, false)) + if (d_user_pvt_solver->get_PVT(gnss_observables_map, false)) { - double Rx_clock_offset_s = d_pvt_solver->get_time_offset_s(); - if (fabs(Rx_clock_offset_s) > 0.001) + double Rx_clock_offset_s = d_user_pvt_solver->get_time_offset_s(); + if (fabs(Rx_clock_offset_s) > 0.000001) //1us !! { - this->message_port_pub(pmt::mp("pvt_to_observables"), pmt::make_any(Rx_clock_offset_s)); - LOG(INFO) << "Sent clock offset correction to observables: " << Rx_clock_offset_s << "[s]"; + LOG(INFO) << "Warning: Rx clock offset at interpolated RX time: " << Rx_clock_offset_s * 1000.0 << "[ms]" + << " at RX time: " << static_cast(d_rx_time * 1000.0) << " [ms]"; } else { + DLOG(INFO) << "Rx clock offset at interpolated RX time: " << Rx_clock_offset_s * 1000.0 << "[s]" + << " at RX time: " << static_cast(d_rx_time * 1000.0) << " [ms]"; //Optional debug code: export observables snapshot for rtklib unit testing //std::cout << "step 1: save gnss_synchro map" << std::endl; //save_gnss_synchro_map_xml("./gnss_synchro_map.xml"); @@ -1840,15 +2025,15 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { if (d_show_local_time_zone) { - boost::posix_time::ptime time_first_solution = d_pvt_solver->get_position_UTC_time() + d_utc_diff_time; + boost::posix_time::ptime time_first_solution = d_user_pvt_solver->get_position_UTC_time() + d_utc_diff_time; std::cout << "First position fix at " << time_first_solution << d_local_time_str; } else { - std::cout << "First position fix at " << d_pvt_solver->get_position_UTC_time() << " UTC"; + std::cout << "First position fix at " << d_user_pvt_solver->get_position_UTC_time() << " UTC"; } - std::cout << " is Lat = " << d_pvt_solver->get_latitude() << " [deg], Long = " << d_pvt_solver->get_longitude() - << " [deg], Height= " << d_pvt_solver->get_height() << " [m]" << std::endl; + std::cout << " is Lat = " << d_user_pvt_solver->get_latitude() << " [deg], Long = " << d_user_pvt_solver->get_longitude() + << " [deg], Height= " << d_user_pvt_solver->get_height() << " [m]" << std::endl; ttff_msgbuf ttff; ttff.mtype = 1; end = std::chrono::system_clock::now(); @@ -1861,28 +2046,28 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { if (current_RX_time_ms % d_kml_rate_ms == 0) { - d_kml_dump->print_position(d_pvt_solver, false); + d_kml_dump->print_position(d_user_pvt_solver, false); } } if (d_gpx_output_enabled) { if (current_RX_time_ms % d_gpx_rate_ms == 0) { - d_gpx_dump->print_position(d_pvt_solver, false); + d_gpx_dump->print_position(d_user_pvt_solver, false); } } if (d_geojson_output_enabled) { if (current_RX_time_ms % d_geojson_rate_ms == 0) { - d_geojson_printer->print_position(d_pvt_solver, false); + d_geojson_printer->print_position(d_user_pvt_solver, false); } } if (d_nmea_output_file_enabled) { if (current_RX_time_ms % d_nmea_rate_ms == 0) { - d_nmea_printer->Print_Nmea_Line(d_pvt_solver, false); + d_nmea_printer->Print_Nmea_Line(d_user_pvt_solver, false); } } @@ -1942,384 +2127,384 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item std::map::const_iterator beidou_dnav_ephemeris_iter; if (!b_rinex_header_written) // & we have utc data in nav message! { - galileo_ephemeris_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - gps_ephemeris_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - gps_cnav_ephemeris_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); - glonass_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); - beidou_dnav_ephemeris_iter = d_pvt_solver->beidou_dnav_ephemeris_map.cbegin(); + galileo_ephemeris_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); + gps_ephemeris_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); + gps_cnav_ephemeris_iter = d_user_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + glonass_gnav_ephemeris_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + beidou_dnav_ephemeris_iter = d_user_pvt_solver->beidou_dnav_ephemeris_map.cbegin(); switch (type_of_rx) { case 1: // GPS L1 C/A only - if (gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) + if (gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, d_rx_time); - rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second); - rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_ephemeris_map); + rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second); + rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->gps_ephemeris_map); b_rinex_header_written = true; // do not write header anymore } break; case 2: // GPS L2C only - if (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend()) + if (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend()) { std::string signal("2S"); rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_cnav_iono, d_pvt_solver->gps_cnav_utc_model); - rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_cnav_ephemeris_map); + rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->gps_cnav_utc_model); + rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->gps_cnav_ephemeris_map); b_rinex_header_written = true; // do not write header anymore } break; case 3: // GPS L5 only - if (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend()) + if (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend()) { std::string signal("L5"); rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_cnav_iono, d_pvt_solver->gps_cnav_utc_model); - rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_cnav_ephemeris_map); + rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->gps_cnav_utc_model); + rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->gps_cnav_ephemeris_map); b_rinex_header_written = true; // do not write header anymore } break; case 4: // Galileo E1B only - if (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + if (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time); - rp->rinex_nav_header(rp->navGalFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); + rp->rinex_nav_header(rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 5: // Galileo E5a only - if (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + if (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { std::string signal("5X"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navGalFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); + rp->rinex_nav_header(rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 6: // Galileo E5b only - if (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + if (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { std::string signal("7X"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navGalFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); - rp->log_rinex_nav(rp->navGalFile, d_pvt_solver->galileo_ephemeris_map); + rp->rinex_nav_header(rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + rp->log_rinex_nav(rp->navGalFile, d_user_pvt_solver->galileo_ephemeris_map); b_rinex_header_written = true; // do not write header anymore } break; case 7: // GPS L1 C/A + GPS L2C - if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) + 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())) { std::string signal("1C 2S"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second); - rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_cnav_ephemeris_map); + rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second); + rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->gps_cnav_ephemeris_map); b_rinex_header_written = true; // do not write header anymore } break; case 8: // GPS L1 + GPS L5 - if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) + 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())) { std::string signal("1C L5"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second); - rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_ephemeris_map); + rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second); + rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->gps_ephemeris_map); b_rinex_header_written = true; // do not write header anymore } break; case 9: // GPS L1 C/A + Galileo E1B - if ((galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend())) + if ((galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend())) { std::string gal_signal("1B"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); + rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 10: // GPS L1 C/A + Galileo E5a - if ((galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend())) + if ((galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend())) { std::string gal_signal("5X"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); + rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 11: // GPS L1 C/A + Galileo E5b - if ((galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend())) + if ((galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend())) { std::string gal_signal("7X"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); - rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_ephemeris_map, d_pvt_solver->galileo_ephemeris_map); + rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + rp->log_rinex_nav(rp->navMixFile, d_user_pvt_solver->gps_ephemeris_map, d_user_pvt_solver->galileo_ephemeris_map); b_rinex_header_written = true; // do not write header anymore } break; case 13: // L5+E5a - if ((galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) + if ((galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { std::string gal_signal("5X"); std::string gps_signal("L5"); rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gps_signal, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_cnav_iono, d_pvt_solver->gps_cnav_utc_model, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); - rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_cnav_ephemeris_map, d_pvt_solver->galileo_ephemeris_map); + rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->gps_cnav_ephemeris_map, d_user_pvt_solver->galileo_ephemeris_map); b_rinex_header_written = true; // do not write header anymore } break; case 14: // Galileo E1B + Galileo E5a - if ((galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) + if ((galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend())) { std::string gal_signal("1B 5X"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navGalFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); + rp->rinex_nav_header(rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 15: // Galileo E1B + Galileo E5b - if ((galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) + if ((galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend())) { std::string gal_signal("1B 7X"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navGalFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); - rp->log_rinex_nav(rp->navGalFile, d_pvt_solver->galileo_ephemeris_map); + rp->rinex_nav_header(rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + rp->log_rinex_nav(rp->navGalFile, d_user_pvt_solver->galileo_ephemeris_map); b_rinex_header_written = true; // do not write header anymore } break; case 23: // GLONASS L1 C/A only - if (glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { std::string signal("1G"); rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navGloFile, d_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); + rp->rinex_nav_header(rp->navGloFile, d_user_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); b_rinex_header_written = true; // do not write header anymore } break; case 24: // GLONASS L2 C/A only - if (glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { std::string signal("2G"); rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navGloFile, d_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); + rp->rinex_nav_header(rp->navGloFile, d_user_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); b_rinex_header_written = true; // do not write header anymore } break; case 25: // GLONASS L1 C/A + GLONASS L2 C/A - if (glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { std::string signal("1G 2G"); rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal); - rp->rinex_nav_header(rp->navGloFile, d_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); - rp->log_rinex_nav(rp->navGloFile, d_pvt_solver->glonass_gnav_ephemeris_map); + rp->rinex_nav_header(rp->navGloFile, d_user_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); + rp->log_rinex_nav(rp->navGloFile, d_user_pvt_solver->glonass_gnav_ephemeris_map); b_rinex_header_written = true; // do not write header anymore } break; case 26: // GPS L1 C/A + GLONASS L1 C/A - if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend())) { std::string glo_signal("1G"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); if (d_rinex_version == 3) { - rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); - rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_ephemeris_map, d_pvt_solver->glonass_gnav_ephemeris_map); + rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + rp->log_rinex_nav(rp->navMixFile, d_user_pvt_solver->gps_ephemeris_map, d_user_pvt_solver->glonass_gnav_ephemeris_map); } if (d_rinex_version == 2) { - rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second); - rp->rinex_nav_header(rp->navGloFile, d_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); - rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_ephemeris_map); - rp->log_rinex_nav(rp->navGloFile, d_pvt_solver->glonass_gnav_ephemeris_map); + rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second); + rp->rinex_nav_header(rp->navGloFile, d_user_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); + rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->gps_ephemeris_map); + rp->log_rinex_nav(rp->navGloFile, d_user_pvt_solver->glonass_gnav_ephemeris_map); } b_rinex_header_written = true; // do not write header anymore } break; case 27: // Galileo E1B + GLONASS L1 C/A - if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend())) { std::string glo_signal("1G"); std::string gal_signal("1B"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); - rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->galileo_ephemeris_map, d_pvt_solver->glonass_gnav_ephemeris_map); + rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + rp->log_rinex_nav(rp->navMixFile, d_user_pvt_solver->galileo_ephemeris_map, d_user_pvt_solver->glonass_gnav_ephemeris_map); b_rinex_header_written = true; // do not write header anymore } break; case 28: // GPS L2C + GLONASS L1 C/A - if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { std::string glo_signal("1G"); rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); - rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_cnav_iono, d_pvt_solver->gps_cnav_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); - rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_cnav_ephemeris_map, d_pvt_solver->glonass_gnav_ephemeris_map); + rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + rp->log_rinex_nav(rp->navMixFile, d_user_pvt_solver->gps_cnav_ephemeris_map, d_user_pvt_solver->glonass_gnav_ephemeris_map); b_rinex_header_written = true; // do not write header anymore } break; case 29: // GPS L1 C/A + GLONASS L2 C/A - if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend())) { std::string glo_signal("2G"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); if (d_rinex_version == 3) { - rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); - rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_ephemeris_map, d_pvt_solver->glonass_gnav_ephemeris_map); + rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + rp->log_rinex_nav(rp->navMixFile, d_user_pvt_solver->gps_ephemeris_map, d_user_pvt_solver->glonass_gnav_ephemeris_map); } if (d_rinex_version == 2) { - rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second); - rp->rinex_nav_header(rp->navGloFile, d_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); - rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_ephemeris_map); - rp->log_rinex_nav(rp->navGloFile, d_pvt_solver->glonass_gnav_ephemeris_map); + rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second); + rp->rinex_nav_header(rp->navGloFile, d_user_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second); + rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->gps_ephemeris_map); + rp->log_rinex_nav(rp->navGloFile, d_user_pvt_solver->glonass_gnav_ephemeris_map); } b_rinex_header_written = true; // do not write header anymore } break; case 30: // Galileo E1B + GLONASS L2 C/A - if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend())) { std::string glo_signal("2G"); std::string gal_signal("1B"); rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); - rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->galileo_ephemeris_map, d_pvt_solver->glonass_gnav_ephemeris_map); + rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + rp->log_rinex_nav(rp->navMixFile, d_user_pvt_solver->galileo_ephemeris_map, d_user_pvt_solver->glonass_gnav_ephemeris_map); b_rinex_header_written = true; // do not write header anymore } break; case 31: // GPS L2C + GLONASS L2 C/A - if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { std::string glo_signal("2G"); rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); - rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_cnav_iono, d_pvt_solver->gps_cnav_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); - rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_cnav_ephemeris_map, d_pvt_solver->glonass_gnav_ephemeris_map); + rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + rp->log_rinex_nav(rp->navMixFile, d_user_pvt_solver->gps_cnav_ephemeris_map, d_user_pvt_solver->glonass_gnav_ephemeris_map); b_rinex_header_written = true; // do not write header anymore } break; case 32: // L1+E1+L5+E5a - if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and - (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend()) and - (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) + 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()) and + (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend())) { std::string gal_signal("1B 5X"); std::string gps_signal("1C L5"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gps_signal, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); - rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_ephemeris_map, d_pvt_solver->galileo_ephemeris_map); + rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + rp->log_rinex_nav(rp->navMixFile, d_user_pvt_solver->gps_ephemeris_map, d_user_pvt_solver->galileo_ephemeris_map); b_rinex_header_written = true; // do not write header anymore } break; case 33: // L1+E1+E5a - if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and - (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) + if ((gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and + (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend())) { std::string gal_signal("1B 5X"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); - rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); - rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_ephemeris_map, d_pvt_solver->galileo_ephemeris_map); + rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + rp->log_rinex_nav(rp->navMixFile, d_user_pvt_solver->gps_ephemeris_map, d_user_pvt_solver->galileo_ephemeris_map); b_rinex_header_written = true; // do not write header anymore } break; case 500: // BDS B1I only - if (beidou_dnav_ephemeris_iter != d_pvt_solver->beidou_dnav_ephemeris_map.cend()) + if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1"); - rp->rinex_nav_header(rp->navFile, d_pvt_solver->beidou_dnav_iono, d_pvt_solver->beidou_dnav_utc_model); - rp->log_rinex_nav(rp->navFile, d_pvt_solver->beidou_dnav_ephemeris_map); + rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); + rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map); b_rinex_header_written = true; // do not write header anymore } break; case 501: // BeiDou B1I + GPS L1 C/A - if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (beidou_dnav_ephemeris_iter != d_pvt_solver->beidou_dnav_ephemeris_map.cend())) + if ((gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend())) { std::string bds_signal("B1"); //rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, beidou_dnav_ephemeris_iter->second, d_rx_time, bds_signal); - //rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_pvt_solver->beidou_dnav_iono, d_pvt_solver->beidou_dnav_utc_model); + //rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 502: // BeiDou B1I + Galileo E1B - if ((galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) and (beidou_dnav_ephemeris_iter != d_pvt_solver->beidou_dnav_ephemeris_map.cend())) + if ((galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) and (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend())) { std::string bds_signal("B1"); std::string gal_signal("1B"); //rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, beidou_dnav_ephemeris_iter->second, d_rx_time, gal_signal, bds_signal); - //rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model, d_pvt_solver->beidou_dnav_iono, d_pvt_solver->beidou_dnav_utc_model); + //rp->rinex_nav_header(rp->navMixFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 503: // BeiDou B1I + GLONASS L1 C/A - if (beidou_dnav_ephemeris_iter != d_pvt_solver->beidou_dnav_ephemeris_map.cend()) + if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { //rp->rinex_obs_header(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1"); - //rp->rinex_nav_header(rp->navFile, d_pvt_solver->beidou_dnav_iono, d_pvt_solver->beidou_dnav_utc_model); - //rp->log_rinex_nav(rp->navFile, d_pvt_solver->beidou_dnav_ephemeris_map); + //rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); + //rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map); b_rinex_header_written = true; // do not write header anymore } break; case 504: // BeiDou B1I + GPS L1 C/A + Galileo E1B - if (beidou_dnav_ephemeris_iter != d_pvt_solver->beidou_dnav_ephemeris_map.cend()) + if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { //rp->rinex_obs_header(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1"); - //rp->rinex_nav_header(rp->navFile, d_pvt_solver->beidou_dnav_iono, d_pvt_solver->beidou_dnav_utc_model); - //rp->log_rinex_nav(rp->navFile, d_pvt_solver->beidou_dnav_ephemeris_map); + //rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); + //rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map); b_rinex_header_written = true; // do not write header anymore } break; case 505: // BeiDou B1I + GPS L1 C/A + GLONASS L1 C/A + Galileo E1B - if (beidou_dnav_ephemeris_iter != d_pvt_solver->beidou_dnav_ephemeris_map.cend()) + if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { //rp->rinex_obs_header(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1"); - //rp->rinex_nav_header(rp->navFile, d_pvt_solver->beidou_dnav_iono, d_pvt_solver->beidou_dnav_utc_model); - //rp->log_rinex_nav(rp->navFile, d_pvt_solver->beidou_dnav_ephemeris_map); + //rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); + //rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map); b_rinex_header_written = true; // do not write header anymore } break; case 506: // BeiDou B1I + Beidou B3I - if (beidou_dnav_ephemeris_iter != d_pvt_solver->beidou_dnav_ephemeris_map.cend()) + if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { //rp->rinex_obs_header(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1"); - //rp->rinex_nav_header(rp->navFile, d_pvt_solver->beidou_dnav_iono, d_pvt_solver->beidou_dnav_utc_model); - //rp->log_rinex_nav(rp->navFile, d_pvt_solver->beidou_dnav_ephemeris_map); + //rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); + //rp->log_rinex_nav(rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map); b_rinex_header_written = true; // do not write header anymore } break; case 600: // BDS B3I only - if (beidou_dnav_ephemeris_iter != d_pvt_solver->beidou_dnav_ephemeris_map.cend()) + if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B3"); - rp->rinex_nav_header(rp->navFile, d_pvt_solver->beidou_dnav_iono, d_pvt_solver->beidou_dnav_utc_model); + rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 601: // BeiDou B3I + GPS L2C - if (beidou_dnav_ephemeris_iter != d_pvt_solver->beidou_dnav_ephemeris_map.cend()) + if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B3"); - //rp->rinex_nav_header(rp->navFile, d_pvt_solver->beidou_dnav_iono, d_pvt_solver->beidou_dnav_utc_model); + //rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 602: // BeiDou B3I + GLONASS L2 C/A - if (beidou_dnav_ephemeris_iter != d_pvt_solver->beidou_dnav_ephemeris_map.cend()) + if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B3"); - //rp->rinex_nav_header(rp->navFile, d_pvt_solver->beidou_dnav_iono, d_pvt_solver->beidou_dnav_utc_model); + //rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); b_rinex_header_written = true; // do not write header anymore } break; case 603: // BeiDou B3I + GPS L2C + GLONASS L2 C/A - if (beidou_dnav_ephemeris_iter != d_pvt_solver->beidou_dnav_ephemeris_map.cend()) + if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { rp->rinex_obs_header(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B3"); - //rp->rinex_nav_header(rp->navFile, d_pvt_solver->beidou_dnav_iono, d_pvt_solver->beidou_dnav_utc_model); + //rp->rinex_nav_header(rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); b_rinex_header_written = true; // do not write header anymore } @@ -2330,11 +2515,11 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } if (b_rinex_header_written) // The header is already written, we can now log the navigation message data { - galileo_ephemeris_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - gps_ephemeris_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - gps_cnav_ephemeris_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); - glonass_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); - beidou_dnav_ephemeris_iter = d_pvt_solver->beidou_dnav_ephemeris_map.cbegin(); + galileo_ephemeris_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); + gps_ephemeris_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); + gps_cnav_ephemeris_iter = d_user_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + glonass_gnav_ephemeris_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + beidou_dnav_ephemeris_iter = d_user_pvt_solver->beidou_dnav_ephemeris_map.cbegin(); // Log observables into the RINEX file if (flag_write_RINEX_obs_output) @@ -2342,306 +2527,306 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item switch (type_of_rx) { case 1: // GPS L1 C/A only - if (gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) + if (gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, d_rx_time, gnss_observables_map); - if (!b_rinex_header_updated and (d_pvt_solver->gps_utc_model.d_A0 != 0)) + if (!b_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model); - rp->update_nav_header(rp->navFile, d_pvt_solver->gps_utc_model, d_pvt_solver->gps_iono, gps_ephemeris_iter->second); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_utc_model); + rp->update_nav_header(rp->navFile, d_user_pvt_solver->gps_utc_model, d_user_pvt_solver->gps_iono, gps_ephemeris_iter->second); b_rinex_header_updated = true; } } break; case 2: // GPS L2C only - if (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend()) + if (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated and (d_pvt_solver->gps_cnav_utc_model.d_A0 != 0)) + if (!b_rinex_header_updated and (d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_cnav_utc_model); - rp->update_nav_header(rp->navFile, d_pvt_solver->gps_cnav_utc_model, d_pvt_solver->gps_cnav_iono); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model); + rp->update_nav_header(rp->navFile, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->gps_cnav_iono); b_rinex_header_updated = true; } break; case 3: // GPS L5 - if (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend()) + if (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated and (d_pvt_solver->gps_cnav_utc_model.d_A0 != 0)) + if (!b_rinex_header_updated and (d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_cnav_utc_model); - rp->update_nav_header(rp->navFile, d_pvt_solver->gps_cnav_utc_model, d_pvt_solver->gps_cnav_iono); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model); + rp->update_nav_header(rp->navFile, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->gps_cnav_iono); b_rinex_header_updated = true; } break; case 4: // Galileo E1B only - if (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + if (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B"); } - if (!b_rinex_header_updated and (d_pvt_solver->galileo_utc_model.A0_6 != 0)) + if (!b_rinex_header_updated and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_nav_header(rp->navGalFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); - rp->update_obs_header(rp->obsFile, d_pvt_solver->galileo_utc_model); + rp->update_nav_header(rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->galileo_utc_model); b_rinex_header_updated = true; } break; case 5: // Galileo E5a only - if (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + if (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "5X"); } - if (!b_rinex_header_updated and (d_pvt_solver->galileo_utc_model.A0_6 != 0)) + if (!b_rinex_header_updated and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_nav_header(rp->navGalFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); - rp->update_obs_header(rp->obsFile, d_pvt_solver->galileo_utc_model); + rp->update_nav_header(rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->galileo_utc_model); b_rinex_header_updated = true; } break; case 6: // Galileo E5b only - if (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + if (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "7X"); } - if (!b_rinex_header_updated and (d_pvt_solver->galileo_utc_model.A0_6 != 0)) + if (!b_rinex_header_updated and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_nav_header(rp->navGalFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); - rp->update_obs_header(rp->obsFile, d_pvt_solver->galileo_utc_model); + rp->update_nav_header(rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->galileo_utc_model); b_rinex_header_updated = true; } break; case 7: // GPS L1 C/A + GPS L2C - if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) + 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())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); - if (!b_rinex_header_updated and (d_pvt_solver->gps_utc_model.d_A0 != 0)) + if (!b_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model); - rp->update_nav_header(rp->navFile, d_pvt_solver->gps_utc_model, d_pvt_solver->gps_iono, gps_ephemeris_iter->second); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_utc_model); + rp->update_nav_header(rp->navFile, d_user_pvt_solver->gps_utc_model, d_user_pvt_solver->gps_iono, gps_ephemeris_iter->second); b_rinex_header_updated = true; } } break; case 8: // L1+L5 - if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) + 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())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); - if (!b_rinex_header_updated and ((d_pvt_solver->gps_cnav_utc_model.d_A0 != 0) or (d_pvt_solver->gps_utc_model.d_A0 != 0))) + if (!b_rinex_header_updated and ((d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0) or (d_user_pvt_solver->gps_utc_model.d_A0 != 0))) { - if (d_pvt_solver->gps_cnav_utc_model.d_A0 != 0) + if (d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0) { - rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_cnav_utc_model); - rp->update_nav_header(rp->navFile, d_pvt_solver->gps_cnav_utc_model, d_pvt_solver->gps_cnav_iono); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model); + rp->update_nav_header(rp->navFile, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->gps_cnav_iono); } else { - rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model); - rp->update_nav_header(rp->navFile, d_pvt_solver->gps_utc_model, d_pvt_solver->gps_iono, gps_ephemeris_iter->second); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_utc_model); + rp->update_nav_header(rp->navFile, d_user_pvt_solver->gps_utc_model, d_user_pvt_solver->gps_iono, gps_ephemeris_iter->second); } b_rinex_header_updated = true; } } break; case 9: // GPS L1 C/A + Galileo E1B - if ((galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend())) + if ((galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); - if (!b_rinex_header_updated and (d_pvt_solver->gps_utc_model.d_A0 != 0)) + if (!b_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model); - rp->update_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_utc_model); + rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); b_rinex_header_updated = true; } } break; case 13: // L5+E5a - if ((gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) + if ((gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated and (d_pvt_solver->gps_cnav_utc_model.d_A0 != 0) and (d_pvt_solver->galileo_utc_model.A0_6 != 0)) + if (!b_rinex_header_updated and (d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0) and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_cnav_utc_model); - rp->update_nav_header(rp->navMixFile, d_pvt_solver->gps_cnav_utc_model, d_pvt_solver->gps_cnav_iono, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model); + rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); b_rinex_header_updated = true; // do not write header anymore } break; case 14: // Galileo E1B + Galileo E5a - if (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + if (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B 5X"); } - if (!b_rinex_header_updated and (d_pvt_solver->galileo_utc_model.A0_6 != 0)) + if (!b_rinex_header_updated and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_nav_header(rp->navGalFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); - rp->update_obs_header(rp->obsFile, d_pvt_solver->galileo_utc_model); + rp->update_nav_header(rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->galileo_utc_model); b_rinex_header_updated = true; } break; case 15: // Galileo E1B + Galileo E5b - if (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + if (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B 7X"); } - if (!b_rinex_header_updated and (d_pvt_solver->galileo_utc_model.A0_6 != 0)) + if (!b_rinex_header_updated and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_nav_header(rp->navGalFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); - rp->update_obs_header(rp->obsFile, d_pvt_solver->galileo_utc_model); + rp->update_nav_header(rp->navGalFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->galileo_utc_model); b_rinex_header_updated = true; } break; case 23: // GLONASS L1 C/A only - if (glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1C"); } - if (!b_rinex_header_updated and (d_pvt_solver->glonass_gnav_utc_model.d_tau_c != 0)) + if (!b_rinex_header_updated and (d_user_pvt_solver->glonass_gnav_utc_model.d_tau_c != 0)) { - rp->update_nav_header(rp->navGloFile, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); - rp->update_obs_header(rp->obsFile, d_pvt_solver->glonass_gnav_utc_model); + rp->update_nav_header(rp->navGloFile, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->glonass_gnav_utc_model); b_rinex_header_updated = true; } break; case 24: // GLONASS L2 C/A only - if (glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "2C"); } - if (!b_rinex_header_updated and (d_pvt_solver->glonass_gnav_utc_model.d_tau_c != 0)) + if (!b_rinex_header_updated and (d_user_pvt_solver->glonass_gnav_utc_model.d_tau_c != 0)) { - rp->update_nav_header(rp->navGloFile, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); - rp->update_obs_header(rp->obsFile, d_pvt_solver->glonass_gnav_utc_model); + rp->update_nav_header(rp->navGloFile, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->glonass_gnav_utc_model); b_rinex_header_updated = true; } break; case 25: // GLONASS L1 C/A + GLONASS L2 C/A - if (glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1C 2C"); } - if (!b_rinex_header_updated and (d_pvt_solver->glonass_gnav_utc_model.d_tau_c != 0)) + if (!b_rinex_header_updated and (d_user_pvt_solver->glonass_gnav_utc_model.d_tau_c != 0)) { - rp->update_nav_header(rp->navMixFile, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); - rp->update_obs_header(rp->obsFile, d_pvt_solver->glonass_gnav_utc_model); + rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->glonass_gnav_utc_model); b_rinex_header_updated = true; } break; case 26: // GPS L1 C/A + GLONASS L1 C/A - if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); - if (!b_rinex_header_updated and (d_pvt_solver->gps_utc_model.d_A0 != 0)) + if (!b_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model); - rp->update_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_utc_model); + rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } } break; case 27: // Galileo E1B + GLONASS L1 C/A - if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated and (d_pvt_solver->galileo_utc_model.A0_6 != 0)) + if (!b_rinex_header_updated and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_obs_header(rp->obsFile, d_pvt_solver->galileo_utc_model); - rp->update_nav_header(rp->navMixFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->galileo_utc_model); + rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } break; case 28: // GPS L2C + GLONASS L1 C/A - if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated and (d_pvt_solver->gps_cnav_utc_model.d_A0 != 0)) + if (!b_rinex_header_updated and (d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_cnav_utc_model); - rp->update_nav_header(rp->navMixFile, d_pvt_solver->gps_cnav_iono, d_pvt_solver->gps_cnav_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model); + rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } break; case 29: // GPS L1 C/A + GLONASS L2 C/A - if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); - if (!b_rinex_header_updated and (d_pvt_solver->gps_utc_model.d_A0 != 0)) + if (!b_rinex_header_updated and (d_user_pvt_solver->gps_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model); - rp->update_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_utc_model); + rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } } break; case 30: // Galileo E1B + GLONASS L2 C/A - if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated and (d_pvt_solver->galileo_utc_model.A0_6 != 0)) + if (!b_rinex_header_updated and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) { - rp->update_obs_header(rp->obsFile, d_pvt_solver->galileo_utc_model); - rp->update_nav_header(rp->navMixFile, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->galileo_utc_model); + rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } break; case 31: // GPS L2C + GLONASS L2 C/A - if ((glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) + if ((glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map); } - if (!b_rinex_header_updated and (d_pvt_solver->gps_cnav_utc_model.d_A0 != 0)) + if (!b_rinex_header_updated and (d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0)) { - rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_cnav_utc_model); - rp->update_nav_header(rp->navMixFile, d_pvt_solver->gps_cnav_iono, d_pvt_solver->gps_cnav_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model); + rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->glonass_gnav_utc_model, d_user_pvt_solver->glonass_gnav_almanac); b_rinex_header_updated = true; // do not write header anymore } break; case 32: // L1+E1+L5+E5a - if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) + 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()) and (galileo_ephemeris_iter != d_user_pvt_solver->galileo_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); - if (!b_rinex_header_updated and ((d_pvt_solver->gps_cnav_utc_model.d_A0 != 0) or (d_pvt_solver->gps_utc_model.d_A0 != 0)) and (d_pvt_solver->galileo_utc_model.A0_6 != 0)) + if (!b_rinex_header_updated and ((d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0) or (d_user_pvt_solver->gps_utc_model.d_A0 != 0)) and (d_user_pvt_solver->galileo_utc_model.A0_6 != 0)) { - if (d_pvt_solver->gps_cnav_utc_model.d_A0 != 0) + if (d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0) { - rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_cnav_utc_model); - rp->update_nav_header(rp->navMixFile, d_pvt_solver->gps_cnav_utc_model, d_pvt_solver->gps_cnav_iono, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model); + rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->gps_cnav_iono, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); } else { - rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model); - rp->update_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_utc_model); + rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); } b_rinex_header_updated = true; // do not write header anymore } } break; case 33: // L1+E1+E5a - if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) + if ((gps_ephemeris_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_user_pvt_solver->galileo_ephemeris_map.cend())) { rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); - if (!b_rinex_header_updated and (d_pvt_solver->gps_utc_model.d_A0 != 0) and (d_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)) { - rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model); - rp->update_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->gps_utc_model); + rp->update_nav_header(rp->navMixFile, d_user_pvt_solver->gps_iono, d_user_pvt_solver->gps_utc_model, gps_ephemeris_iter->second, d_user_pvt_solver->galileo_iono, d_user_pvt_solver->galileo_utc_model); b_rinex_header_updated = true; // do not write header anymore } } break; case 500: // BDS B1I only - if (beidou_dnav_ephemeris_iter != d_pvt_solver->beidou_dnav_ephemeris_map.cend()) + if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { rp->log_rinex_obs(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "B1"); } - if (!b_rinex_header_updated and (d_pvt_solver->beidou_dnav_utc_model.d_A0_UTC != 0)) + if (!b_rinex_header_updated and (d_user_pvt_solver->beidou_dnav_utc_model.d_A0_UTC != 0)) { - rp->update_obs_header(rp->obsFile, d_pvt_solver->beidou_dnav_utc_model); - rp->update_nav_header(rp->navFile, d_pvt_solver->beidou_dnav_utc_model, d_pvt_solver->beidou_dnav_iono); + rp->update_obs_header(rp->obsFile, d_user_pvt_solver->beidou_dnav_utc_model); + rp->update_nav_header(rp->navFile, d_user_pvt_solver->beidou_dnav_utc_model, d_user_pvt_solver->beidou_dnav_iono); b_rinex_header_updated = true; } break; @@ -2662,15 +2847,15 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 1: // GPS L1 C/A if (flag_write_RTCM_1019_output == true) { - for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) + for (const auto& gps_eph_iter : d_user_pvt_solver->gps_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { - auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) + auto gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); + if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -2681,15 +2866,15 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 6: if (flag_write_RTCM_1045_output == true) { - for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) + for (const auto& gal_eph_iter : d_user_pvt_solver->galileo_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { - auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + auto gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -2698,16 +2883,16 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 7: // GPS L1 C/A + GPS L2C if (flag_write_RTCM_1019_output == true) { - for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) + for (const auto& gps_eph_iter : d_user_pvt_solver->gps_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { - auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - auto gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); - if ((gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) + auto gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_cnav_eph_iter = d_user_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + if ((gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -2716,16 +2901,16 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 8: // L1+L5 if (flag_write_RTCM_1019_output == true) { - for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) + for (const auto& gps_eph_iter : d_user_pvt_solver->gps_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { - auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - auto gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); - if ((gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) + auto gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_cnav_eph_iter = d_user_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + if ((gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -2734,14 +2919,14 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 9: // GPS L1 C/A + Galileo E1B if (flag_write_RTCM_1019_output == true) { - for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) + for (const auto& gps_eph_iter : d_user_pvt_solver->gps_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_1045_output == true) { - for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) + for (const auto& gal_eph_iter : d_user_pvt_solver->galileo_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } @@ -2749,8 +2934,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); + auto gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); int gps_channel = 0; int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2761,8 +2946,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (system == "G") { // This is a channel with valid GPS signal - gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) + gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { gps_channel = 1; } @@ -2772,19 +2957,19 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { if (system == "E") { - gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { gal_channel = 1; } } } } - if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) + if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -2793,7 +2978,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 13: // L5+E5a if (flag_write_RTCM_1045_output == true) { - for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) + for (const auto& gal_eph_iter : d_user_pvt_solver->galileo_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } @@ -2802,8 +2987,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_write_RTCM_MSM_output and d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - auto gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + auto gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gps_cnav_eph_iter = d_user_pvt_solver->gps_cnav_ephemeris_map.cbegin(); int gal_channel = 0; int gps_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2814,8 +2999,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (system == "G") { // This is a channel with valid GPS signal - gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend()) + gps_cnav_eph_iter = d_user_pvt_solver->gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_cnav_eph_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend()) { gps_channel = 1; } @@ -2825,8 +3010,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { if (system == "E") { - gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { gal_channel = 1; } @@ -2834,11 +3019,11 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } } - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } - if (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend() and (d_rtcm_MT1077_rate_ms != 0)) + if (gps_cnav_eph_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend() and (d_rtcm_MT1077_rate_ms != 0)) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -2848,15 +3033,15 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 15: if (flag_write_RTCM_1045_output == true) { - for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) + for (const auto& gal_eph_iter : d_user_pvt_solver->galileo_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { - auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + auto gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -2867,15 +3052,15 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 25: if (flag_write_RTCM_1020_output == true) { - for (auto glonass_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) + for (auto glonass_gnav_ephemeris_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_pvt_solver->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_user_pvt_solver->glonass_gnav_utc_model); } } if (flag_write_RTCM_MSM_output == true) { - auto glo_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); - if (glo_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + auto glo_gnav_ephemeris_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + if (glo_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -2885,23 +3070,23 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 26: // GPS L1 C/A + GLONASS L1 C/A if (flag_write_RTCM_1019_output == true) { - for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) + for (const auto& gps_eph_iter : d_user_pvt_solver->gps_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_1020_output == true) { - for (auto glonass_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) + for (auto glonass_gnav_ephemeris_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_pvt_solver->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_user_pvt_solver->glonass_gnav_utc_model); } } if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); - auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); int gps_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2912,8 +3097,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (system == "G") { // This is a channel with valid GPS signal - gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) + gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { gps_channel = 1; } @@ -2923,8 +3108,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { if (system == "R") { - glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { glo_channel = 1; } @@ -2932,11 +3117,11 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } } - if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } - if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) + if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -2945,14 +3130,14 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 27: // GLONASS L1 C/A + Galileo E1B if (flag_write_RTCM_1020_output == true) { - for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_user_pvt_solver->glonass_gnav_utc_model); } } if (flag_write_RTCM_1045_output == true) { - for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) + for (const auto& gal_eph_iter : d_user_pvt_solver->galileo_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } @@ -2960,8 +3145,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gal_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2972,8 +3157,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (system == "E") { // This is a channel with valid GPS signal - gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { gal_channel = 1; } @@ -2983,19 +3168,19 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { if (system == "R") { - glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { glo_channel = 1; } } } } - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } - if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -3004,23 +3189,23 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 29: // GPS L1 C/A + GLONASS L2 C/A if (flag_write_RTCM_1019_output == true) { - for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) + for (const auto& gps_eph_iter : d_user_pvt_solver->gps_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_1020_output == true) { - for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_user_pvt_solver->glonass_gnav_utc_model); } } if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gps_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -3031,8 +3216,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (system == "G") { // This is a channel with valid GPS signal - gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) + gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { gps_channel = 1; } @@ -3042,19 +3227,19 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { if (system == "R") { - glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { glo_channel = 1; } } } } - if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } - if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) + if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -3063,14 +3248,14 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 30: // GLONASS L2 C/A + Galileo E1B if (flag_write_RTCM_1020_output == true) { - for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_user_pvt_solver->glonass_gnav_utc_model); } } if (flag_write_RTCM_1045_output == true) { - for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) + for (const auto& gal_eph_iter : d_user_pvt_solver->galileo_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } @@ -3078,8 +3263,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gal_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -3090,8 +3275,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (system == "E") { // This is a channel with valid GPS signal - gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { gal_channel = 1; } @@ -3101,19 +3286,19 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { if (system == "R") { - glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { glo_channel = 1; } } } } - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } - if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -3122,14 +3307,14 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 32: // L1+E1+L5+E5a if (flag_write_RTCM_1019_output == true) { - for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) + for (const auto& gps_eph_iter : d_user_pvt_solver->gps_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_1045_output == true) { - for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) + for (const auto& gal_eph_iter : d_user_pvt_solver->galileo_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } @@ -3137,8 +3322,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); int gal_channel = 0; int gps_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -3149,8 +3334,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (system == "E") { // This is a channel with valid GPS signal - gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { gal_channel = 1; } @@ -3160,19 +3345,19 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { if (system == "G") { - gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) + gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { gps_channel = 1; } } } } - if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) + if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -3190,16 +3375,16 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 1: // GPS L1 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) + for (const auto& gps_eph_iter : d_user_pvt_solver->gps_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); - if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) + if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -3211,15 +3396,15 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 6: if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) + for (const auto& gal_eph_iter : d_user_pvt_solver->galileo_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { - auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + auto gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -3229,16 +3414,16 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 7: // GPS L1 C/A + GPS L2C if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) + for (const auto& gps_eph_iter : d_user_pvt_solver->gps_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { - auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - auto gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); - if ((gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) + auto gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_cnav_eph_iter = d_user_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + if ((gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -3248,16 +3433,16 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 8: // L1+L5 if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) + for (const auto& gps_eph_iter : d_user_pvt_solver->gps_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { - auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - auto gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); - if ((gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) + auto gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_cnav_eph_iter = d_user_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + if ((gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend())) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -3267,14 +3452,14 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 9: // GPS L1 C/A + Galileo E1B if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) + for (const auto& gps_eph_iter : d_user_pvt_solver->gps_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MT1045_rate_ms != 0) { - for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) + for (const auto& gal_eph_iter : d_user_pvt_solver->galileo_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } @@ -3282,8 +3467,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); int gps_channel = 0; int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -3294,8 +3479,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (system == "G") { // This is a channel with valid GPS signal - gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) + gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { gps_channel = 1; } @@ -3305,19 +3490,19 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { if (system == "E") { - gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { gal_channel = 1; } } } } - if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) + if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -3328,7 +3513,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 13: // L5+E5a if (d_rtcm_MT1045_rate_ms != 0) { - for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) + for (const auto& gal_eph_iter : d_user_pvt_solver->galileo_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } @@ -3336,7 +3521,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { @@ -3345,8 +3530,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { if (system == "E") { - gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { gal_channel = 1; } @@ -3354,7 +3539,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } } - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -3365,15 +3550,15 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 15: if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) + for (const auto& gal_eph_iter : d_user_pvt_solver->galileo_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { - auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + auto gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -3385,15 +3570,15 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 25: if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_user_pvt_solver->glonass_gnav_utc_model); } } if (d_rtcm_MSM_rate_ms != 0) { - auto glo_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); - if (glo_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + auto glo_gnav_ephemeris_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + if (glo_gnav_ephemeris_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -3403,23 +3588,23 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 26: // GPS L1 C/A + GLONASS L1 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) + for (const auto& gps_eph_iter : d_user_pvt_solver->gps_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_user_pvt_solver->glonass_gnav_utc_model); } } if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gps_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -3430,8 +3615,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (system == "G") { // This is a channel with valid GPS signal - gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) + gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { gps_channel = 1; } @@ -3441,19 +3626,19 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { if (system == "R") { - glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { glo_channel = 1; } } } } - if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } - if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) + if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -3463,14 +3648,14 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 27: // GLONASS L1 C/A + Galileo E1B if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_user_pvt_solver->glonass_gnav_utc_model); } } if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) + for (const auto& gal_eph_iter : d_user_pvt_solver->galileo_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } @@ -3480,8 +3665,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item int gal_channel = 0; int glo_channel = 0; std::map::const_iterator gnss_observables_iter; - auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); @@ -3490,8 +3675,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (system == "E") { // This is a channel with valid GPS signal - gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { gal_channel = 1; } @@ -3501,19 +3686,19 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { if (system == "R") { - glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { glo_channel = 1; } } } } - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } - if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -3523,22 +3708,22 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 29: // GPS L1 C/A + GLONASS L2 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) + for (const auto& gps_eph_iter : d_user_pvt_solver->gps_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_user_pvt_solver->glonass_gnav_utc_model); } } if (d_rtcm_MSM_rate_ms != 0) { - auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); std::map::const_iterator gnss_observables_iter; int gps_channel = 0; int glo_channel = 0; @@ -3550,8 +3735,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (system == "G") { // This is a channel with valid GPS signal - gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) + gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { gps_channel = 1; } @@ -3561,20 +3746,20 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { if (system == "R") { - glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { glo_channel = 1; } } } } - if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } - if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) + if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -3584,14 +3769,14 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 30: // GLONASS L2 C/A + Galileo E1B if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { - d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); + d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_user_pvt_solver->glonass_gnav_utc_model); } } if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) + for (const auto& gal_eph_iter : d_user_pvt_solver->galileo_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } @@ -3601,8 +3786,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item int gal_channel = 0; int glo_channel = 0; std::map::const_iterator gnss_observables_iter; - auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); @@ -3611,8 +3796,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (system == "E") { // This is a channel with valid GPS signal - gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { gal_channel = 1; } @@ -3622,19 +3807,19 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { if (system == "R") { - glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + glonass_gnav_eph_iter = d_user_pvt_solver->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { glo_channel = 1; } } } } - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } - if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) + if (glonass_gnav_eph_iter != d_user_pvt_solver->glonass_gnav_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -3644,14 +3829,14 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item case 32: // L1+E1+L5+E5a if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) + for (const auto& gps_eph_iter : d_user_pvt_solver->gps_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) + for (const auto& gal_eph_iter : d_user_pvt_solver->galileo_ephemeris_map) { d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } @@ -3659,8 +3844,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.cbegin(); int gps_channel = 0; int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -3671,8 +3856,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item if (system == "G") { // This is a channel with valid GPS signal - gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) + gps_eph_iter = d_user_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { gps_channel = 1; } @@ -3682,19 +3867,19 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { if (system == "E") { - gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + gal_eph_iter = d_user_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { gal_channel = 1; } } } } - if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) + if (gps_eph_iter != d_user_pvt_solver->gps_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } - if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + if (gal_eph_iter != d_user_pvt_solver->galileo_ephemeris_map.cend()) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } @@ -3721,18 +3906,18 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } // DEBUG MESSAGE: Display position in console output - if (d_pvt_solver->is_valid_position() and flag_display_pvt) + if (d_user_pvt_solver->is_valid_position() and flag_display_pvt) { boost::posix_time::ptime time_solution; std::string UTC_solution_str; if (d_show_local_time_zone) { - time_solution = d_pvt_solver->get_position_UTC_time() + d_utc_diff_time; + time_solution = d_user_pvt_solver->get_position_UTC_time() + d_utc_diff_time; UTC_solution_str = d_local_time_str; } else { - time_solution = d_pvt_solver->get_position_UTC_time(); + time_solution = d_user_pvt_solver->get_position_UTC_time(); UTC_solution_str = " UTC"; } std::streamsize ss = std::cout.precision(); // save current precision @@ -3742,35 +3927,35 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item std::cout << TEXT_BOLD_GREEN << "Position at " << time_solution << UTC_solution_str - << " using " << d_pvt_solver->get_num_valid_observations() + << " using " << d_user_pvt_solver->get_num_valid_observations() << std::fixed << std::setprecision(9) - << " observations is Lat = " << d_pvt_solver->get_latitude() << " [deg], Long = " << d_pvt_solver->get_longitude() + << " observations is Lat = " << d_user_pvt_solver->get_latitude() << " [deg], Long = " << d_user_pvt_solver->get_longitude() << std::fixed << std::setprecision(3) - << " [deg], Height = " << d_pvt_solver->get_height() << " [m]" << TEXT_RESET << std::endl; + << " [deg], Height = " << d_user_pvt_solver->get_height() << " [m]" << TEXT_RESET << std::endl; std::cout << std::setprecision(ss); - DLOG(INFO) << "RX clock offset: " << d_pvt_solver->get_time_offset_s() << "[s]"; + DLOG(INFO) << "RX clock offset: " << d_user_pvt_solver->get_time_offset_s() << "[s]"; // boost::posix_time::ptime p_time; - // gtime_t rtklib_utc_time = gpst2time(adjgpsweek(d_pvt_solver->gps_ephemeris_map.cbegin()->second.i_GPS_week), d_rx_time); + // gtime_t rtklib_utc_time = gpst2time(adjgpsweek(d_user_pvt_solver->gps_ephemeris_map.cbegin()->second.i_GPS_week), d_rx_time); // p_time = boost::posix_time::from_time_t(rtklib_utc_time.time); // p_time += boost::posix_time::microseconds(round(rtklib_utc_time.sec * 1e6)); // std::cout << TEXT_MAGENTA << "Observable RX time (GPST) " << boost::posix_time::to_simple_string(p_time) << TEXT_RESET << std::endl; - DLOG(INFO) << "Position at " << boost::posix_time::to_simple_string(d_pvt_solver->get_position_UTC_time()) - << " UTC using " << d_pvt_solver->get_num_valid_observations() << " observations is Lat = " << d_pvt_solver->get_latitude() << " [deg], Long = " << d_pvt_solver->get_longitude() - << " [deg], Height = " << d_pvt_solver->get_height() << " [m]"; + DLOG(INFO) << "Position at " << boost::posix_time::to_simple_string(d_user_pvt_solver->get_position_UTC_time()) + << " UTC using " << d_user_pvt_solver->get_num_valid_observations() << " observations is Lat = " << d_user_pvt_solver->get_latitude() << " [deg], Long = " << d_user_pvt_solver->get_longitude() + << " [deg], Height = " << d_user_pvt_solver->get_height() << " [m]"; - /* std::cout << "Dilution of Precision at " << boost::posix_time::to_simple_string(d_pvt_solver->get_position_UTC_time()) - << " UTC using "<< d_pvt_solver->get_num_valid_observations() <<" observations is HDOP = " << d_pvt_solver->get_hdop() << " VDOP = " - << d_pvt_solver->get_vdop() - << " GDOP = " << d_pvt_solver->get_gdop() << std::endl; */ + /* std::cout << "Dilution of Precision at " << boost::posix_time::to_simple_string(d_user_pvt_solver->get_position_UTC_time()) + << " UTC using "<< d_user_pvt_solver->get_num_valid_observations() <<" observations is HDOP = " << d_user_pvt_solver->get_hdop() << " VDOP = " + << d_user_pvt_solver->get_vdop() + << " GDOP = " << d_user_pvt_solver->get_gdop() << std::endl; */ } // PVT MONITOR - if (d_pvt_solver->is_valid_position()) + if (d_user_pvt_solver->is_valid_position()) { - std::shared_ptr monitor_pvt = std::make_shared(d_pvt_solver->get_monitor_pvt()); + std::shared_ptr monitor_pvt = std::make_shared(d_user_pvt_solver->get_monitor_pvt()); //publish new position to the gnss_flowgraph channel status monitor if (current_RX_time_ms % d_report_rate_ms == 0) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h index 18f4fcd98..b9efcc8c5 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h @@ -139,6 +139,30 @@ private: void msg_handler_telemetry(const pmt::pmt_t& msg); + + enum StringValue + { + evGPS_1C, + evGPS_2S, + evGPS_L5, + evSBAS_1C, + evGAL_1B, + evGAL_5X, + evGLO_1G, + evGLO_2G, + evBDS_B1, + evBDS_B2, + evBDS_B3 + }; + std::map mapStringValues_; + + void apply_rx_clock_offset(std::map& observables_map, + double rx_clock_offset_s); + + std::map interpolate_observables(std::map& observables_map_t0, + std::map& observables_map_t1, + double rx_time_s); + bool d_dump; bool d_dump_mat; bool b_rinex_output_enabled; @@ -184,10 +208,14 @@ private: bool d_kml_output_enabled; bool d_nmea_output_file_enabled; - std::shared_ptr d_pvt_solver; + std::shared_ptr d_internal_pvt_solver; + std::shared_ptr d_user_pvt_solver; + int32_t max_obs_block_rx_clock_offset_ms; + bool d_waiting_obs_block_rx_clock_offset_correction_msg; std::map gnss_observables_map; - bool observables_pairCompare_min(const std::pair& a, const std::pair& b); + std::map gnss_observables_map_t0; + std::map gnss_observables_map_t1; uint32_t type_of_rx; diff --git a/src/algorithms/PVT/libs/pvt_conf.cc b/src/algorithms/PVT/libs/pvt_conf.cc index c4014779f..589941658 100644 --- a/src/algorithms/PVT/libs/pvt_conf.cc +++ b/src/algorithms/PVT/libs/pvt_conf.cc @@ -40,6 +40,7 @@ Pvt_Conf::Pvt_Conf() geojson_rate_ms = 1000; nmea_rate_ms = 1000; + max_obs_block_rx_clock_offset_ms = 40; rinex_version = 0; rinexobs_rate_ms = 0; diff --git a/src/algorithms/PVT/libs/pvt_conf.h b/src/algorithms/PVT/libs/pvt_conf.h index 93352458e..7f11baeae 100644 --- a/src/algorithms/PVT/libs/pvt_conf.h +++ b/src/algorithms/PVT/libs/pvt_conf.h @@ -73,6 +73,8 @@ public: bool xml_output_enabled; bool rtcm_output_file_enabled; + int32_t max_obs_block_rx_clock_offset_ms; + std::string output_path; std::string rinex_output_path; std::string gpx_output_path; diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc index 5e58faded..89ac84a67 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc @@ -93,8 +93,7 @@ hybrid_observables_gs::hybrid_observables_gs(uint32_t nchannels_in, d_dump_filename = std::move(dump_filename); d_nchannels_out = nchannels_out; d_nchannels_in = nchannels_in; - T_rx_offset_ms = 0; - d_gnss_synchro_history = std::make_shared>(500, d_nchannels_out); + d_gnss_synchro_history = std::make_shared>(1000, d_nchannels_out); // ############# ENABLE DATA FILE LOG ################# if (d_dump) @@ -141,7 +140,6 @@ hybrid_observables_gs::hybrid_observables_gs(uint32_t nchannels_in, } } T_rx_TOW_ms = 0U; - T_rx_remnant_to_20ms = 0; T_rx_step_ms = 20; // read from config at the adapter GNSS-SDR.observable_interval_ms!! T_rx_TOW_set = false; T_status_report_timer_ms = 0; @@ -197,16 +195,14 @@ void hybrid_observables_gs::msg_handler_pvt_to_observables(const pmt::pmt_t &msg { double new_rx_clock_offset_s; new_rx_clock_offset_s = boost::any_cast(pmt::any_ref(msg)); - T_rx_offset_ms = new_rx_clock_offset_s * 1000.0; - T_rx_TOW_ms = T_rx_TOW_ms - static_cast(round(T_rx_offset_ms)); - T_rx_remnant_to_20ms = (T_rx_TOW_ms % 20); + T_rx_TOW_ms = T_rx_TOW_ms - static_cast(round(new_rx_clock_offset_s * 1000.0)); // d_Rx_clock_buffer.clear(); // Clear all the elements in the buffer for (uint32_t n = 0; n < d_nchannels_out; n++) { d_gnss_synchro_history->clear(n); } - LOG(INFO) << "Corrected new RX Time offset: " << T_rx_offset_ms << "[ms]"; + LOG(INFO) << "Corrected new RX Time offset: " << static_cast(round(new_rx_clock_offset_s * 1000.0)) << "[ms]"; } } catch (boost::bad_any_cast &e) @@ -489,8 +485,7 @@ void hybrid_observables_gs::update_TOW(const std::vector &data) } } } - T_rx_TOW_ms = TOW_ref - (TOW_ref % 20); - T_rx_remnant_to_20ms = 0; + T_rx_TOW_ms = TOW_ref; } else { @@ -509,7 +504,7 @@ void hybrid_observables_gs::compute_pranges(std::vector &data) // std::cout.precision(17); // std::cout << " T_rx_TOW_ms: " << static_cast(T_rx_TOW_ms) << std::endl; std::vector::iterator it; - double current_T_rx_TOW_ms = (static_cast(T_rx_TOW_ms - T_rx_remnant_to_20ms)); + double current_T_rx_TOW_ms = static_cast(T_rx_TOW_ms); double current_T_rx_TOW_s = current_T_rx_TOW_ms / 1000.0; for (it = data.begin(); it != data.end(); it++) { @@ -582,9 +577,7 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused) for (uint32_t n = 0; n < d_nchannels_out; n++) { Gnss_Synchro interpolated_gnss_synchro{}; - - uint32_t T_rx_remnant_to_20ms_samples = T_rx_remnant_to_20ms * in[d_nchannels_in - 1][0].fs / 1000; - if (!interp_trk_obs(interpolated_gnss_synchro, n, d_Rx_clock_buffer.front() - T_rx_remnant_to_20ms_samples)) + if (!interp_trk_obs(interpolated_gnss_synchro, n, d_Rx_clock_buffer.front())) { // Produce an empty observation interpolated_gnss_synchro = Gnss_Synchro(); @@ -666,7 +659,17 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused) d_dump = false; } } - return 1; + + if (n_valid > 0) + { + // LOG(INFO) << "OBS: diff time: " << out[0][0].RX_time * 1000.0 - old_time_debug; + // old_time_debug = out[0][0].RX_time * 1000.0; + return 1; + } + else + { + return 0; + } } return 0; } diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.h b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.h index b5c59ff9e..7ab5a1d59 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.h +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.h @@ -87,12 +87,11 @@ private: bool d_dump; bool d_dump_mat; uint32_t T_rx_TOW_ms; - uint32_t T_rx_remnant_to_20ms; uint32_t T_rx_step_ms; uint32_t T_status_report_timer_ms; uint32_t d_nchannels_in; uint32_t d_nchannels_out; - double T_rx_offset_ms; + //double T_rx_offset_ms; std::string d_dump_filename; std::ofstream d_dump_file; boost::circular_buffer d_Rx_clock_buffer; // time history