diff --git a/.clang-format b/.clang-format index 7ab3cb079..f13c68662 100644 --- a/.clang-format +++ b/.clang-format @@ -51,7 +51,7 @@ IncludeBlocks: Merge IncludeCategories: - Regex: '^.*.h"' Priority: 1 - - Regex: '^.*(boost|gflags|glog|gnsssdr|gpstk|gtest|gnuradio|pmt|uhd|volk)/' + - Regex: '^.*(boost|gflags|glog|gnsssdr|gnuradio|gpstk|gsl|gtest|pmt|uhd|volk)/' Priority: 2 - Regex: '^.*(armadillo|matio|pugixml)' Priority: 2 diff --git a/.clang-tidy b/.clang-tidy index 3515d6a2a..4e0602b32 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -8,10 +8,14 @@ Checks: '-*, cert-err60-cpp, cert-flp30-c, clang-analyzer-cplusplus*, + cppcoreguidelines-pro-type-cstyle-cast, cppcoreguidelines-pro-type-static-cast-downcast, cppcoreguidelines-slicing, + cppcoreguidelines-special-member-functions, google-build-namespaces, google-runtime-int, + hicpp-exception-baseclass, + hicpp-explicit-conversions, misc-misplaced-const, misc-new-delete-overloads, misc-non-copyable-objects, @@ -24,14 +28,22 @@ Checks: '-*, modernize-raw-string-literal, modernize-use-auto, modernize-use-bool-literals, + modernize-use-emplace, modernize-use-equals-default, modernize-use-equals-delete, modernize-use-noexcept, modernize-use-nullptr, performance-faster-string-find, + performance-for-range-copy, + performance-implicit-conversion-in-loop, performance-inefficient-algorithm, + performance-inefficient-string-concatenation, + performance-inefficient-vector-operation, performance-move-const-arg, + performance-move-constructor-init, + performance-noexcept-move-constructor, performance-type-promotion-in-math-fn, + performance-unnecessary-copy-initialization, performance-unnecessary-value-param, readability-container-size-empty, readability-identifier-naming, diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index 7f9dc82fb..9b97e8c5b 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -121,7 +121,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration, int rtcm_MT1077_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1077_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms); int rtcm_MT1087_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1087_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms); int rtcm_MT1097_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1097_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms); - //std::map rtcm_msg_rate_ms; + pvt_output_parameters.rtcm_msg_rate_ms[1019] = rtcm_MT1019_rate_ms; pvt_output_parameters.rtcm_msg_rate_ms[1020] = rtcm_MT1020_rate_ms; pvt_output_parameters.rtcm_msg_rate_ms[1045] = rtcm_MT1045_rate_ms; @@ -409,7 +409,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration, if (positioning_mode == -1) { - //warn user and set the default + // warn user and set the default std::cout << "WARNING: Bad specification of positioning mode." << std::endl; std::cout << "positioning_mode possible values: Single / Static / Kinematic / PPP_Static / PPP_Kinematic" << std::endl; std::cout << "positioning_mode specified value: " << positioning_mode_str << std::endl; @@ -439,14 +439,14 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration, int number_of_frequencies = configuration->property(role + ".num_bands", num_bands); /* (1:L1, 2:L1+L2, 3:L1+L2+L5) */ if ((number_of_frequencies < 1) || (number_of_frequencies > 3)) { - //warn user and set the default + // warn user and set the default number_of_frequencies = num_bands; } double elevation_mask = configuration->property(role + ".elevation_mask", 15.0); if ((elevation_mask < 0.0) || (elevation_mask > 90.0)) { - //warn user and set the default + // warn user and set the default LOG(WARNING) << "Erroneous Elevation Mask. Setting to default value of 15.0 degrees"; elevation_mask = 15.0; } @@ -454,7 +454,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration, int dynamics_model = configuration->property(role + ".dynamics_model", 0); /* dynamics model (0:none, 1:velocity, 2:accel) */ if ((dynamics_model < 0) || (dynamics_model > 2)) { - //warn user and set the default + // warn user and set the default LOG(WARNING) << "Erroneous Dynamics Model configuration. Setting to default value of (0:none)"; dynamics_model = 0; } @@ -488,7 +488,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration, } if (iono_model == -1) { - //warn user and set the default + // warn user and set the default std::cout << "WARNING: Bad specification of ionospheric model." << std::endl; std::cout << "iono_model possible values: OFF / Broadcast / SBAS / Iono-Free-LC / Estimate_STEC / IONEX" << std::endl; std::cout << "iono_model specified value: " << iono_model_str << std::endl; @@ -521,7 +521,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration, } if (trop_model == -1) { - //warn user and set the default + // warn user and set the default std::cout << "WARNING: Bad specification of tropospheric model." << std::endl; std::cout << "trop_model possible values: OFF / Saastamoinen / SBAS / Estimate_ZTD / Estimate_ZTD_Grad" << std::endl; std::cout << "trop_model specified value: " << trop_model_str << std::endl; @@ -568,7 +568,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration, int navigation_system = configuration->property(role + ".navigation_system", nsys); /* (SYS_XXX) see src/algorithms/libs/rtklib/rtklib.h */ if ((navigation_system < 1) || (navigation_system > 255)) /* GPS: 1 SBAS: 2 GPS+SBAS: 3 Galileo: 8 Galileo+GPS: 9 GPS+SBAS+Galileo: 11 All: 255 */ { - //warn user and set the default + // warn user and set the default LOG(WARNING) << "Erroneous Navigation System. Setting to default value of (0:none)"; navigation_system = nsys; } @@ -599,7 +599,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration, } if (integer_ambiguity_resolution_gps == -1) { - //warn user and set the default + // warn user and set the default std::cout << "WARNING: Bad specification of GPS ambiguity resolution method." << std::endl; std::cout << "AR_GPS possible values: OFF / Continuous / Instantaneous / Fix-and-Hold / PPP-AR" << std::endl; std::cout << "AR_GPS specified value: " << integer_ambiguity_resolution_gps_str << std::endl; @@ -610,7 +610,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration, int integer_ambiguity_resolution_glo = configuration->property(role + ".AR_GLO", 1); /* Integer Ambiguity Resolution mode for GLONASS (0:off,1:on,2:auto cal,3:ext cal) */ if ((integer_ambiguity_resolution_glo < 0) || (integer_ambiguity_resolution_glo > 3)) { - //warn user and set the default + // warn user and set the default LOG(WARNING) << "Erroneous Integer Ambiguity Resolution for GLONASS . Setting to default value of (1:on)"; integer_ambiguity_resolution_glo = 1; } @@ -618,7 +618,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration, int integer_ambiguity_resolution_bds = configuration->property(role + ".AR_DBS", 1); /* Integer Ambiguity Resolution mode for BEIDOU (0:off,1:on) */ if ((integer_ambiguity_resolution_bds < 0) || (integer_ambiguity_resolution_bds > 1)) { - //warn user and set the default + // warn user and set the default LOG(WARNING) << "Erroneous Integer Ambiguity Resolution for BEIDOU . Setting to default value of (1:on)"; integer_ambiguity_resolution_bds = 1; } @@ -644,7 +644,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration, If the baseline length is very short like 1 m, the iteration may be effective to handle the nonlinearity of measurement equation. */ - /// Statistics + // Statistics double bias_0 = configuration->property(role + ".bias_0", 30.0); double iono_0 = configuration->property(role + ".iono_0", 0.03); diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index cdb438d3d..65230c0a1 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,9 +131,21 @@ 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 + d_report_rate_ms = 1000; // report every second PVT to gnss_synchro d_dump = conf_.dump; d_dump_mat = conf_.dump_mat and d_dump; d_dump_filename = conf_.dump_filename; @@ -443,8 +457,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 +482,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 +508,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 +534,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 +564,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 +594,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 +624,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 +654,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 +684,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 +714,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 +744,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 +774,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 +804,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 +834,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 +864,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 +894,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 +924,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 +954,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 +984,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 +1039,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 +1099,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 +1116,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 +1129,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 +1172,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 +1181,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 +1190,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 +1200,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 +1219,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 +1269,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 +1286,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 +1302,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 +1323,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 +1343,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 +1404,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 +1421,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 +1442,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 +1468,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 +1485,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 +1494,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 +1512,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(); } @@ -1569,7 +1615,7 @@ bool rtklib_pvt_gs::load_gnss_synchro_map_xml(const std::string& file_name) boost::archive::xml_iarchive xml(ifs); gnss_observables_map.clear(); xml >> boost::serialization::make_nvp("GNSS-SDR_gnss_synchro_map", gnss_observables_map); - //std::cout << "Loaded gnss_synchro map data with " << gnss_synchro_map.size() << " pseudoranges" << std::endl; + // std::cout << "Loaded gnss_synchro map data with " << gnss_synchro_map.size() << " pseudoranges" << std::endl; } catch (const std::exception& e) { @@ -1602,14 +1648,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 +1664,109 @@ 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,55 +1787,91 @@ 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); - if (((tmp_eph_iter_gps->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "1C")) or - ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "2S")) or - ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "1B")) or - ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "5X")) or - ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "1G")) or - ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "2G")) or - ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "L5")) or - ((tmp_eph_iter_bds_dnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "B1")) or - ((tmp_eph_iter_bds_dnav->second.i_satellite_PRN == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "B3"))) + bool store_valid_observable = false; + + if (tmp_eph_iter_gps != d_internal_pvt_solver->gps_ephemeris_map.cend()) + { + uint32_t prn_aux = tmp_eph_iter_gps->second.i_satellite_PRN; + if ((prn_aux == in[i][epoch].PRN) and (std::string(in[i][epoch].Signal) == "1C")) + { + store_valid_observable = true; + } + } + if (tmp_eph_iter_gal != d_internal_pvt_solver->galileo_ephemeris_map.cend()) + { + uint32_t prn_aux = tmp_eph_iter_gal->second.i_satellite_PRN; + if ((prn_aux == in[i][epoch].PRN) and ((std::string(in[i][epoch].Signal) == "1B") or (std::string(in[i][epoch].Signal) == "5X"))) + { + store_valid_observable = true; + } + } + if (tmp_eph_iter_cnav != d_internal_pvt_solver->gps_cnav_ephemeris_map.cend()) + { + uint32_t prn_aux = tmp_eph_iter_cnav->second.i_satellite_PRN; + if ((prn_aux == in[i][epoch].PRN) and ((std::string(in[i][epoch].Signal) == "2S") or (std::string(in[i][epoch].Signal) == "L5"))) + { + store_valid_observable = true; + } + } + if (tmp_eph_iter_glo_gnav != d_internal_pvt_solver->glonass_gnav_ephemeris_map.cend()) + { + uint32_t prn_aux = tmp_eph_iter_glo_gnav->second.i_satellite_PRN; + if ((prn_aux == in[i][epoch].PRN) and ((std::string(in[i][epoch].Signal) == "1G") or (std::string(in[i][epoch].Signal) == "2G"))) + { + store_valid_observable = true; + } + } + if (tmp_eph_iter_bds_dnav != d_internal_pvt_solver->beidou_dnav_ephemeris_map.cend()) + { + uint32_t prn_aux = tmp_eph_iter_bds_dnav->second.i_satellite_PRN; + if ((prn_aux == in[i][epoch].PRN) and ((std::string(in[i][epoch].Signal) == "B1") or (std::string(in[i][epoch].Signal) == "B3"))) + { + store_valid_observable = true; + } + } + + if (store_valid_observable) { // store valid observables in a map. gnss_observables_map.insert(std::pair(i, in[i][epoch])); } + if (b_rtcm_enabled) { 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 } } } @@ -1707,43 +1892,79 @@ 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 { - //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"); - //getchar(); //stop the execution - //end debug + 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"); + // getchar(); // stop the execution + // end debug if (d_display_rate_ms != 0) { if (current_RX_time_ms % d_display_rate_ms == 0) @@ -1804,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(); @@ -1825,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); } } @@ -1906,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_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_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_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_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_obs_header(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1"); + // 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_obs_header(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1"); + // 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_obs_header(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1"); + // 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_obs_header(rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1"); + // 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 } @@ -2294,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) @@ -2306,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; @@ -2626,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); } @@ -2645,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); } @@ -2662,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); } @@ -2680,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); } @@ -2698,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); } @@ -2713,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++) @@ -2725,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; } @@ -2736,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); } @@ -2757,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); } @@ -2766,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++) @@ -2778,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; } @@ -2789,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; } @@ -2798,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); } @@ -2812,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); } @@ -2831,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); } @@ -2849,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++) @@ -2876,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; } @@ -2887,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; } @@ -2896,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); } @@ -2909,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); } @@ -2924,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++) @@ -2936,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; } @@ -2947,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); } @@ -2968,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++) @@ -2995,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; } @@ -3006,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); } @@ -3027,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); } @@ -3042,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++) @@ -3054,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; } @@ -3065,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); } @@ -3086,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); } @@ -3101,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++) @@ -3113,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; } @@ -3124,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); } @@ -3154,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); } @@ -3175,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); } @@ -3193,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); } @@ -3212,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); } @@ -3231,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); } @@ -3246,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++) @@ -3258,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; } @@ -3269,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); } @@ -3292,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); } @@ -3300,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++) { @@ -3309,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; } @@ -3318,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); } @@ -3329,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); } @@ -3349,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); } @@ -3367,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++) @@ -3394,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; } @@ -3405,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); } @@ -3427,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); } @@ -3444,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); @@ -3454,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; } @@ -3465,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); } @@ -3487,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; @@ -3514,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; } @@ -3525,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); } @@ -3548,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); } @@ -3565,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); @@ -3575,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; } @@ -3586,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); } @@ -3608,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); } @@ -3623,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++) @@ -3635,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; } @@ -3646,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); } @@ -3685,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 @@ -3706,37 +3927,37 @@ 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 + // publish new position to the gnss_flowgraph channel status monitor if (current_RX_time_ms % d_report_rate_ms == 0) { this->message_port_pub(pmt::mp("status"), pmt::make_any(monitor_pvt)); diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h index 18f4fcd98..e9d379521 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/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index d20cac4c6..45705ab57 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -95,6 +95,12 @@ target_include_directories(pvt_libs target_compile_definitions(pvt_libs PRIVATE -DGNSS_SDR_VERSION="${VERSION}") +if(CMAKE_BUILD_TYPE MATCHES Rel) + target_compile_definitions(pvt_libs + PUBLIC -DARMA_NO_BOUND_CHECKING=1 + ) +endif() + if(Boost_VERSION_STRING VERSION_GREATER 1.65.99) target_compile_definitions(pvt_libs PUBLIC diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc index b29e5813d..590774c1d 100644 --- a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc +++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc @@ -45,7 +45,6 @@ Hybrid_Ls_Pvt::Hybrid_Ls_Pvt(int nchannels, std::string dump_filename, bool flag d_dump_filename = std::move(dump_filename); d_flag_dump_enabled = flag_dump_to_file; d_galileo_current_time = 0; - count_valid_position = 0; this->set_averaging_flag(false); // ############# ENABLE DATA FILE LOG ################# if (d_flag_dump_enabled == true) diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.h b/src/algorithms/PVT/libs/hybrid_ls_pvt.h index 87f9d11cd..75eeb9b83 100644 --- a/src/algorithms/PVT/libs/hybrid_ls_pvt.h +++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.h @@ -69,7 +69,6 @@ public: Gps_CNAV_Utc_Model gps_cnav_utc_model; private: - int count_valid_position; bool d_flag_dump_enabled; std::string d_dump_filename; std::ofstream d_dump_file; diff --git a/src/algorithms/PVT/libs/kml_printer.cc b/src/algorithms/PVT/libs/kml_printer.cc index 5291715a1..a4af53b69 100644 --- a/src/algorithms/PVT/libs/kml_printer.cc +++ b/src/algorithms/PVT/libs/kml_printer.cc @@ -41,7 +41,7 @@ #include #include #include // for S_IXUSR | S_IRWXG | S_IRWXO -#include //for mode_t +#include // for mode_t #if HAS_STD_FILESYSTEM #include diff --git a/src/algorithms/PVT/libs/nmea_printer.cc b/src/algorithms/PVT/libs/nmea_printer.cc index 2f28f3a1d..13df7ba7f 100644 --- a/src/algorithms/PVT/libs/nmea_printer.cc +++ b/src/algorithms/PVT/libs/nmea_printer.cc @@ -175,9 +175,9 @@ int Nmea_Printer::init_serial(const std::string& serial_device) * Opens the serial device and sets the default baud rate for a NMEA transmission (9600,8,N,1) */ int fd = 0; - struct termios options - { - }; + // clang-format off + struct termios options{}; + // clang-format on int64_t BAUD; int64_t DATABITS; int64_t STOPBITS; 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/PVT/libs/pvt_solution.h b/src/algorithms/PVT/libs/pvt_solution.h index 06efc77be..292e531ff 100644 --- a/src/algorithms/PVT/libs/pvt_solution.h +++ b/src/algorithms/PVT/libs/pvt_solution.h @@ -32,6 +32,9 @@ #ifndef GNSS_SDR_PVT_SOLUTION_H_ #define GNSS_SDR_PVT_SOLUTION_H_ +#if ARMA_NO_BOUND_CHECKING +#define ARMA_NO_DEBUG 1 +#endif #include #include diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index e77aadbf7..29b4d1ed7 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -627,7 +627,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono { if (glonass_gnav_almanac.i_satellite_freq_channel) { - } //Avoid compiler warning + } // Avoid compiler warning std::string line; stringVersion = "3.02"; version = 3; @@ -772,7 +772,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps { if (glonass_gnav_almanac.i_satellite_freq_channel) { - } //Avoid compiler warning + } // Avoid compiler warning std::string line; stringVersion = "3.02"; version = 3; @@ -896,8 +896,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali { if (glonass_gnav_almanac.i_satellite_freq_channel) { - } //Avoid compiler warning - //Avoid compiler warning, there is not time system correction between Galileo and GLONASS + } // Avoid compiler warning + // Avoid compiler warning, there is not time system correction between Galileo and GLONASS if (galileo_utc_model.A_0G_10) { } @@ -1379,7 +1379,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co { line += std::string("N: GNSS NAV DATA"); line += std::string(4, ' '); - //! \todo Add here other systems... + //todo Add here other systems... line += std::string("G: GPS"); line += std::string(14, ' '); // ... @@ -1744,7 +1744,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Beidou_Dnav_Iono& { line += std::string("N: GNSS NAV DATA"); line += std::string(4, ' '); - //! \todo Add here other systems... + //todo: Add here other systems... line += std::string("F: BDS"); line += std::string(14, ' '); // ... @@ -2495,7 +2495,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Glonass_Gnav_Utc_ { if (glonass_gnav_almanac.i_satellite_freq_channel) { - } //Avoid compiler warning + } // Avoid compiler warning std::vector data; std::string line_aux; @@ -3191,7 +3191,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion { if (glonass_gnav_almanac.i_satellite_freq_channel) { - } //Avoid compiler warning + } // Avoid compiler warning std::vector data; std::string line_aux; @@ -3306,7 +3306,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gp { if (glonass_gnav_almanac.i_satellite_freq_channel) { - } //Avoid compiler warning + } // Avoid compiler warning std::vector data; std::string line_aux; @@ -3414,8 +3414,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal { if (glonass_gnav_almanac.i_satellite_freq_channel) { - } //Avoid compiler warning - //Avoid compiler warning, there is not time system correction between Galileo and GLONASS + } // Avoid compiler warning + // Avoid compiler warning, there is not time system correction between Galileo and GLONASS if (galileo_utc_model.A_0G_10) { } @@ -4270,7 +4270,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.SISA_3, 18, 2); + // line += Rinex_Printer::doub2for(galileo_ephemeris_iter->second.SISA_3, 18, 2); line += Rinex_Printer::doub2for(zero, 18, 2); // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID line += std::string(1, ' '); std::string E1B_HS; @@ -4745,7 +4745,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem { if (eph.d_m) { - } //Avoid compiler warning + } // Avoid compiler warning std::string line; std::map::const_iterator glonass_gnav_ephemeris_iter; @@ -4855,7 +4855,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem line.clear(); line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property - //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property + // line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property if (gnss_sdr_version.length() > 20) { gnss_sdr_version.resize(9, ' '); @@ -5181,7 +5181,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps line.clear(); line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property - //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property + // line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property if (gnss_sdr_version.length() > 20) { gnss_sdr_version.resize(9, ' '); @@ -5536,7 +5536,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris line.clear(); line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property - //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property + // line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property if (gnss_sdr_version.length() > 20) { gnss_sdr_version.resize(9, ' '); @@ -5845,7 +5845,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& line.clear(); line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property - //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property + // line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property if (gnss_sdr_version.length() > 20) { gnss_sdr_version.resize(9, ' '); @@ -6138,12 +6138,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph out << line << std::endl; // -------- Line MARKER TYPE - //line.clear(); - //line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property - //line += std::string(40, ' '); - //line += Rinex_Printer::leftJustify("MARKER TYPE", 20); - //Rinex_Printer::lengthCheck(line); - //out << line << std::endl; + // line.clear(); + // line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property + // line += std::string(40, ' '); + // line += Rinex_Printer::leftJustify("MARKER TYPE", 20); + // Rinex_Printer::lengthCheck(line); + // out << line << std::endl; // -------- Line OBSERVER / AGENCY line.clear(); @@ -6168,7 +6168,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph line.clear(); line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property - //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property + // line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property if (gnss_sdr_version.length() > 20) { gnss_sdr_version.resize(9, ' '); @@ -6395,12 +6395,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris out << line << std::endl; // -------- Line MARKER TYPE - //line.clear(); - //line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property - //line += std::string(40, ' '); - //line += Rinex_Printer::leftJustify("MARKER TYPE", 20); - //Rinex_Printer::lengthCheck(line); - //out << line << std::endl; + // line.clear(); + // line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property + // line += std::string(40, ' '); + // line += Rinex_Printer::leftJustify("MARKER TYPE", 20); + // Rinex_Printer::lengthCheck(line); + // out << line << std::endl; // -------- Line OBSERVER / AGENCY line.clear(); @@ -6425,7 +6425,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris line.clear(); line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property - //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property + // line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property if (gnss_sdr_version.length() > 20) { gnss_sdr_version.resize(9, ' '); @@ -6646,12 +6646,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph out << line << std::endl; // -------- Line MARKER TYPE - //line.clear(); - //line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property - //line += std::string(40, ' '); - //line += Rinex_Printer::leftJustify("MARKER TYPE", 20); - //Rinex_Printer::lengthCheck(line); - //out << line << std::endl; + // line.clear(); + // line += Rinex_Printer::leftJustify("GROUND_CRAFT", 20); // put a flag or a property + // line += std::string(40, ' '); + // line += Rinex_Printer::leftJustify("MARKER TYPE", 20); + // Rinex_Printer::lengthCheck(line); + // out << line << std::endl; // -------- Line OBSERVER / AGENCY line.clear(); @@ -6676,7 +6676,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph line.clear(); line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property - //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property + // line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property if (gnss_sdr_version.length() > 20) { gnss_sdr_version.resize(9, ' '); @@ -6927,12 +6927,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps out << line << std::endl; // -------- Line MARKER TYPE - //line.clear(); - //line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property - //line += std::string(40, ' '); - //line += Rinex_Printer::leftJustify("MARKER TYPE", 20); - //Rinex_Printer::lengthCheck(line); - //out << line << std::endl; + // line.clear(); + // line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property + // line += std::string(40, ' '); + // line += Rinex_Printer::leftJustify("MARKER TYPE", 20); + // Rinex_Printer::lengthCheck(line); + // out << line << std::endl; // -------- Line OBSERVER / AGENCY line.clear(); @@ -6957,7 +6957,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps line.clear(); line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property - //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property + // line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property if (gnss_sdr_version.length() > 20) { gnss_sdr_version.resize(9, ' '); @@ -7273,12 +7273,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris out << line << std::endl; // -------- Line MARKER TYPE - //line.clear(); - //line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property - //line += std::string(40, ' '); - //line += Rinex_Printer::leftJustify("MARKER TYPE", 20); - //Rinex_Printer::lengthCheck(line); - //out << line << std::endl; + // line.clear(); + // line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property + // line += std::string(40, ' '); + // line += Rinex_Printer::leftJustify("MARKER TYPE", 20); + // Rinex_Printer::lengthCheck(line); + // out << line << std::endl; // -------- Line OBSERVER / AGENCY line.clear(); @@ -7303,7 +7303,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris line.clear(); line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property - //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property + // line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property if (gnss_sdr_version.length() > 20) { gnss_sdr_version.resize(9, ' '); @@ -7591,12 +7591,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& out << line << std::endl; // -------- Line MARKER TYPE - //line.clear(); - //line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property - //line += std::string(40, ' '); - //line += Rinex_Printer::leftJustify("MARKER TYPE", 20); - //Rinex_Printer::lengthCheck(line); - //out << line << std::endl; + // line.clear(); + // line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property + // line += std::string(40, ' '); + // line += Rinex_Printer::leftJustify("MARKER TYPE", 20); + // Rinex_Printer::lengthCheck(line); + // out << line << std::endl; // -------- Line OBSERVER / AGENCY line.clear(); @@ -7621,7 +7621,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& line.clear(); line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property - //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property + // line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property if (gnss_sdr_version.length() > 20) { gnss_sdr_version.resize(9, ' '); @@ -7858,12 +7858,12 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps out << line << std::endl; // -------- Line MARKER TYPE - //line.clear(); - //line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property - //line += std::string(40, ' '); - //line += Rinex_Printer::leftJustify("MARKER TYPE", 20); - //Rinex_Printer::lengthCheck(line); - //out << line << std::endl; + // line.clear(); + // line += Rinex_Printer::leftJustify("NON_GEODETIC", 20); // put a flag or a property + // line += std::string(40, ' '); + // line += Rinex_Printer::leftJustify("MARKER TYPE", 20); + // Rinex_Printer::lengthCheck(line); + // out << line << std::endl; // -------- Line OBSERVER / AGENCY line.clear(); @@ -7888,7 +7888,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps line.clear(); line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property - //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property + // line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property if (gnss_sdr_version.length() > 20) { gnss_sdr_version.resize(9, ' '); @@ -8170,7 +8170,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Beidou_Dnav_Epheme line.clear(); line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property - //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property + // line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property if (gnss_sdr_version.length() > 20) { gnss_sdr_version.resize(9, ' '); @@ -8599,8 +8599,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri boost::posix_time::ptime p_glonass_time = Rinex_Printer::compute_UTC_time(eph, obs_time); std::string timestring = boost::posix_time::to_iso_string(p_glonass_time); - //double utc_t = nav_msg.utc_time(nav_msg.sv_clock_correction(obs_time)); - //double gps_t = eph.sv_clock_correction(obs_time); + // double utc_t = nav_msg.utc_time(nav_msg.sv_clock_correction(obs_time)); + // double gps_t = eph.sv_clock_correction(obs_time); std::string month(timestring, 4, 2); std::string day(timestring, 6, 2); @@ -8647,7 +8647,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri line += std::string(2, ' '); // Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event line += std::string(1, '0'); - //Number of satellites observed in current epoch + // Number of satellites observed in current epoch int32_t numSatellitesObserved = 0; std::map::const_iterator observables_iter; for (observables_iter = observables.cbegin(); @@ -8669,7 +8669,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri line += std::to_string(static_cast(observables_iter->second.PRN)); } // Receiver clock offset (optional) - //line += rightJustify(asString(clockOffset, 12), 15); + // line += rightJustify(asString(clockOffset, 12), 15); line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -8685,13 +8685,13 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri line += std::string(2, ' '); lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); - //Loss of lock indicator (LLI) + // Loss of lock indicator (LLI) int32_t lli = 0; // Include in the observation!! if (lli == 0) { lineObs += std::string(1, ' '); } - //else + // else // { // lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(lli), 1); // } @@ -8705,7 +8705,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri { lineObs += std::string(1, ' '); } - //else + // else // { // lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(lli), 1); // } @@ -8716,12 +8716,12 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri { lineObs += std::string(1, ' '); } - //else + // else // { // lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(lli), 1); // } lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); - //GLONASS L1 SIGNAL STRENGTH + // GLONASS L1 SIGNAL STRENGTH lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.CN0_dB_hz, 3), 14); if (lineObs.size() < 80) { @@ -8757,7 +8757,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri // Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event line += std::string(1, '0'); - //Number of satellites observed in current epoch + // Number of satellites observed in current epoch int32_t numSatellitesObserved = 0; std::map::const_iterator observables_iter; for (observables_iter = observables.cbegin(); @@ -8769,7 +8769,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) - //line += rightJustify(asString(clockOffset, 12), 15); + // line += rightJustify(asString(clockOffset, 12), 15); line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); @@ -8787,10 +8787,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri lineObs += std::string(1, '0'); } lineObs += std::to_string(static_cast(observables_iter->second.PRN)); - //lineObs += std::string(2, ' '); + // lineObs += std::string(2, ' '); lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); - //Loss of lock indicator (LLI) + // Loss of lock indicator (LLI) int32_t lli = 0; // Include in the observation!! if (lli == 0) { @@ -8830,7 +8830,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); - //GLONASS L1 SIGNAL STRENGTH + // GLONASS L1 SIGNAL STRENGTH lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.CN0_dB_hz, 3), 14); if (lineObs.size() < 80) @@ -8931,8 +8931,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep line += std::string(1, '0'); } - //Number of satellites observed in current epoch - //Get maps with observations + // Number of satellites observed in current epoch + // Get maps with observations std::map observablesG1C; std::map observablesR1C; std::map observablesR2C; @@ -9065,7 +9065,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep // Pseudorange Measurements lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); - //Loss of lock indicator (LLI) + // Loss of lock indicator (LLI) int32_t lli = 0; // Include in the observation!! if (lli == 0) { @@ -9136,7 +9136,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep //double leap_seconds = Rinex_Printer::get_leap_second(glonass_gnav_eph, gps_obs_time); lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); - //Loss of lock indicator (LLI) + // Loss of lock indicator (LLI) int32_t lli = 0; // Include in the observation!! if (lli == 0) { @@ -9232,8 +9232,8 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g // Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event line += std::string(1, '0'); - //Number of satellites observed in current epoch - //Get maps with observations + // Number of satellites observed in current epoch + // Get maps with observations std::map observablesG2S; std::map observablesR1C; std::map observablesR2C; @@ -9325,7 +9325,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g // Pseudorange Measurements lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); - //Loss of lock indicator (LLI) + // Loss of lock indicator (LLI) int32_t lli = 0; // Include in the observation!! if (lli == 0) { @@ -9394,7 +9394,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g //double leap_seconds = Rinex_Printer::get_leap_second(glonass_gnav_eph, gps_obs_time); lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); - //Loss of lock indicator (LLI) + // Loss of lock indicator (LLI) int32_t lli = 0; // Include in the observation!! if (lli == 0) { @@ -9489,9 +9489,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga // Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event line += std::string(1, '0'); - //Number of satellites observed in current epoch + // Number of satellites observed in current epoch - //Get maps with observations + // Get maps with observations std::map observablesE1B; std::map observablesR1C; std::map observablesR2C; @@ -9551,7 +9551,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) - //line += rightJustify(asString(clockOffset, 12), 15); + // line += rightJustify(asString(clockOffset, 12), 15); line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); @@ -9581,7 +9581,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga lineObs += std::to_string(static_cast(observables_iter->second.PRN)); lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); - //Loss of lock indicator (LLI) + // Loss of lock indicator (LLI) int32_t lli = 0; // Include in the observation!! if (lli == 0) { @@ -9647,7 +9647,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga { lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); - //Loss of lock indicator (LLI) + // Loss of lock indicator (LLI) int32_t lli = 0; // Include in the observation!! if (lli == 0) { @@ -9755,7 +9755,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c line += std::string(2, ' '); // Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event line += std::string(1, '0'); - //Number of satellites observed in current epoch + // Number of satellites observed in current epoch int32_t numSatellitesObserved = 0; std::map::const_iterator observables_iter; for (observables_iter = observables.cbegin(); @@ -9777,7 +9777,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c line += std::to_string(static_cast(observables_iter->second.PRN)); } // Receiver clock offset (optional) - //line += rightJustify(asString(clockOffset, 12), 15); + // line += rightJustify(asString(clockOffset, 12), 15); line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -9793,7 +9793,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c line += std::string(2, ' '); lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); - //Loss of lock indicator (LLI) + // Loss of lock indicator (LLI) int32_t lli = 0; // Include in the observation!! if (lli == 0) { @@ -9866,7 +9866,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c // Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event line += std::string(1, '0'); - //Number of satellites observed in current epoch + // Number of satellites observed in current epoch int32_t numSatellitesObserved = 0; std::map::const_iterator observables_iter; for (observables_iter = observables.cbegin(); @@ -9878,7 +9878,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) - //line += rightJustify(asString(clockOffset, 12), 15); + // line += rightJustify(asString(clockOffset, 12), 15); line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); @@ -9896,10 +9896,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c lineObs += std::string(1, '0'); } lineObs += std::to_string(static_cast(observables_iter->second.PRN)); - //lineObs += std::string(2, ' '); + // lineObs += std::string(2, ' '); lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); - //Loss of lock indicator (LLI) + // Loss of lock indicator (LLI) int32_t lli = 0; // Include in the observation!! if (lli == 0) { @@ -9993,7 +9993,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e // Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event line += std::string(1, '0'); - //Number of satellites observed in current epoch + // Number of satellites observed in current epoch int32_t numSatellitesObserved = 0; std::map::const_iterator observables_iter; for (observables_iter = observables.cbegin(); @@ -10005,7 +10005,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) - //line += rightJustify(asString(clockOffset, 12), 15); + // line += rightJustify(asString(clockOffset, 12), 15); line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); @@ -10023,11 +10023,11 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e lineObs += std::string(1, '0'); } lineObs += std::to_string(static_cast(observables_iter->second.PRN)); - //lineObs += std::string(2, ' '); + // lineObs += std::string(2, ' '); //GPS L2 PSEUDORANGE lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); - //Loss of lock indicator (LLI) + // Loss of lock indicator (LLI) int32_t lli = 0; // Include in the observation!! if (lli == 0) { @@ -10123,9 +10123,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c // Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event line += std::string(1, '0'); - //Number of satellites observed in current epoch + // Number of satellites observed in current epoch - //Get maps with GPS L1 and L2 observations + // Get maps with GPS L1 and L2 observations std::map observablesL1; std::map observablesL2; std::map observablesL5; @@ -10229,7 +10229,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c int32_t numSatellitesObserved = available_prns.size(); line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) - //line += rightJustify(asString(clockOffset, 12), 15); + // line += rightJustify(asString(clockOffset, 12), 15); line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -10252,7 +10252,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c { lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); - //Loss of lock indicator (LLI) + // Loss of lock indicator (LLI) int32_t lli = 0; // Include in the observation!! if (lli == 0) { @@ -10346,9 +10346,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep // Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event line += std::string(1, '0'); - //Number of satellites observed in current epoch + // Number of satellites observed in current epoch - //Get maps with Galileo observations + // Get maps with Galileo observations std::map observablesE1B; std::map observablesE5A; std::map observablesE5B; @@ -10475,7 +10475,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep int32_t numSatellitesObserved = available_prns.size(); line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) - //line += rightJustify(asString(clockOffset, 12), 15); + // line += rightJustify(asString(clockOffset, 12), 15); line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -10498,7 +10498,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep { lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); - //Loss of lock indicator (LLI) + // Loss of lock indicator (LLI) int32_t lli = 0; // Include in the observation!! if (lli == 0) { @@ -10593,9 +10593,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep // Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event line += std::string(1, '0'); - //Number of satellites observed in current epoch + // Number of satellites observed in current epoch - //Get maps with observations + // Get maps with observations std::map observablesG1C; std::map observablesE1B; std::map observablesE5A; @@ -10674,7 +10674,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) - //line += rightJustify(asString(clockOffset, 12), 15); + // line += rightJustify(asString(clockOffset, 12), 15); line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); @@ -10704,7 +10704,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep lineObs += std::to_string(static_cast(observables_iter->second.PRN)); lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); - //Loss of lock indicator (LLI) + // Loss of lock indicator (LLI) int32_t lli = 0; // Include in the observation!! if (lli == 0) { @@ -10770,7 +10770,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); - //Loss of lock indicator (LLI) + // Loss of lock indicator (LLI) int32_t lli = 0; // Include in the observation!! if (lli == 0) { @@ -10865,9 +10865,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e // Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event line += std::string(1, '0'); - //Number of satellites observed in current epoch + // Number of satellites observed in current epoch - //Get maps with observations + // Get maps with observations std::map observablesG2S; std::map observablesGL5; std::map observablesE1B; @@ -10979,7 +10979,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) - //line += rightJustify(asString(clockOffset, 12), 15); + // line += rightJustify(asString(clockOffset, 12), 15); line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); @@ -11005,7 +11005,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e { lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); - //Loss of lock indicator (LLI) + // Loss of lock indicator (LLI) int32_t lli = 0; // Include in the observation!! if (lli == 0) { @@ -11067,7 +11067,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e { lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); - //Loss of lock indicator (LLI) + // Loss of lock indicator (LLI) int32_t lli = 0; // Include in the observation!! if (lli == 0) { @@ -11162,9 +11162,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep // Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event line += std::string(1, '0'); - //Number of satellites observed in current epoch + // Number of satellites observed in current epoch - //Get maps with observations + // Get maps with observations std::map observablesG2S; std::map observablesGL5; std::map observablesG1C; @@ -11294,7 +11294,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) - //line += rightJustify(asString(clockOffset, 12), 15); + // line += rightJustify(asString(clockOffset, 12), 15); line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); @@ -11320,7 +11320,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); - //Loss of lock indicator (LLI) + // Loss of lock indicator (LLI) int32_t lli = 0; // Include in the observation!! if (lli == 0) { @@ -11382,7 +11382,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); - //Loss of lock indicator (LLI) + // Loss of lock indicator (LLI) int32_t lli = 0; // Include in the observation!! if (lli == 0) { @@ -11471,9 +11471,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Beidou_Dnav_Ephemeris // Epoch flag 0: OK 1: power failure between previous and current epoch <1: Special event line += std::string(1, '0'); - //Number of satellites observed in current epoch + // Number of satellites observed in current epoch - //Get maps with BeiDou observations + // Get maps with BeiDou observations std::map observablesB1I; std::map observablesB3I; @@ -11544,7 +11544,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Beidou_Dnav_Ephemeris int32_t numSatellitesObserved = available_prns.size(); line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) - //line += rightJustify(asString(clockOffset, 12), 15); + // line += rightJustify(asString(clockOffset, 12), 15); line += std::string(80 - line.size(), ' '); Rinex_Printer::lengthCheck(line); out << line << std::endl; @@ -11567,7 +11567,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Beidou_Dnav_Ephemeris { lineObs += Rinex_Printer::rightJustify(asString(iter->second.Pseudorange_m, 3), 14); - //Loss of lock indicator (LLI) + // Loss of lock indicator (LLI) int32_t lli = 0; // Include in the observation!! if (lli == 0) { @@ -11771,7 +11771,7 @@ int32_t Rinex_Printer::signalStrength(const double snr) boost::posix_time::ptime Rinex_Printer::compute_UTC_time(const Gps_Navigation_Message& nav_msg) { // if we are processing a file -> wait to leap second to resolve the ambiguity else take the week from the local system time - //: idea resolve the ambiguity with the leap second http://www.colorado.edu/geography/gcraft/notes/gps/gpseow.htm + // idea: resolve the ambiguity with the leap second http://www.colorado.edu/geography/gcraft/notes/gps/gpseow.htm const double utc_t = nav_msg.utc_time(nav_msg.d_TOW); boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast((utc_t + 604800 * static_cast(nav_msg.i_GPS_week)) * 1000)); if (nav_msg.i_GPS_week < 512) diff --git a/src/algorithms/PVT/libs/rtcm.cc b/src/algorithms/PVT/libs/rtcm.cc index 99ea7b14a..52ff08e3f 100644 --- a/src/algorithms/PVT/libs/rtcm.cc +++ b/src/algorithms/PVT/libs/rtcm.cc @@ -498,7 +498,7 @@ std::string Rtcm::print_MT1001(const Gps_Ephemeris& gps_eph, double obs_time, co bool sync_flag = false; bool divergence_free = false; - //Get a map with GPS L1 only observations + // Get a map with GPS L1 only observations std::map observablesL1; std::map::const_iterator observables_iter; @@ -547,7 +547,7 @@ std::string Rtcm::print_MT1002(const Gps_Ephemeris& gps_eph, double obs_time, co bool sync_flag = false; bool divergence_free = false; - //Get a map with GPS L1 only observations + // Get a map with GPS L1 only observations std::map observablesL1; std::map::const_iterator observables_iter; @@ -618,7 +618,7 @@ std::string Rtcm::print_MT1003(const Gps_Ephemeris& ephL1, const Gps_CNAV_Epheme bool sync_flag = false; bool divergence_free = false; - //Get maps with GPS L1 and L2 observations + // Get maps with GPS L1 and L2 observations std::map observablesL1; std::map observablesL2; std::map::const_iterator observables_iter; @@ -727,7 +727,7 @@ std::string Rtcm::print_MT1004(const Gps_Ephemeris& ephL1, const Gps_CNAV_Epheme bool sync_flag = false; bool divergence_free = false; - //Get maps with GPS L1 and L2 observations + // Get maps with GPS L1 and L2 observations std::map observablesL1; std::map observablesL2; std::map::const_iterator observables_iter; @@ -1177,7 +1177,7 @@ std::string Rtcm::print_MT1009(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, d bool sync_flag = false; bool divergence_free = false; - //Get a map with GLONASS L1 only observations + // Get a map with GLONASS L1 only observations std::map observablesL1; std::map::const_iterator observables_iter; @@ -1226,7 +1226,7 @@ std::string Rtcm::print_MT1010(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, d bool sync_flag = false; bool divergence_free = false; - //Get a map with GPS L1 only observations + // Get a map with GPS L1 only observations std::map observablesL1; std::map::const_iterator observables_iter; @@ -1301,7 +1301,7 @@ std::string Rtcm::print_MT1011(const Glonass_Gnav_Ephemeris& ephL1, const Glonas bool sync_flag = false; bool divergence_free = false; - //Get maps with GPS L1 and L2 observations + // Get maps with GPS L1 and L2 observations std::map observablesL1; std::map observablesL2; std::map::const_iterator observables_iter; @@ -1412,7 +1412,7 @@ std::string Rtcm::print_MT1012(const Glonass_Gnav_Ephemeris& ephL1, const Glonas bool sync_flag = false; bool divergence_free = false; - //Get maps with GLONASS L1 and L2 observations + // Get maps with GLONASS L1 and L2 observations std::map observablesL1; std::map observablesL2; std::map::const_iterator observables_iter; @@ -1887,13 +1887,13 @@ int32_t Rtcm::read_MT1020(const std::string& message, Glonass_Gnav_Ephemeris& gl index += 1; if (glonass_gnav_alm_health) { - } //Avoid comiler warning + } // Avoid compiler warning glonass_gnav_alm_health_ind = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 1))); index += 1; if (glonass_gnav_alm_health_ind) { - } //Avoid comiler warning + } // Avoid compiler warning glonass_gnav_eph.d_P_1 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 2))); glonass_gnav_eph.d_P_1 = (glonass_gnav_eph.d_P_1 + 1) * 15; @@ -2309,7 +2309,7 @@ std::string Rtcm::print_MSM_1(const Gps_Ephemeris& gps_eph, } if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) { - LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? + LOG(WARNING) << "MSM messages for observables from different systems are not defined"; // print two messages? } if (msg_number == 0) { @@ -2504,7 +2504,7 @@ std::string Rtcm::print_MSM_2(const Gps_Ephemeris& gps_eph, } if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) { - LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? + LOG(WARNING) << "MSM messages for observables from different systems are not defined"; // print two messages? } if (msg_number == 0) { @@ -2617,7 +2617,7 @@ std::string Rtcm::print_MSM_3(const Gps_Ephemeris& gps_eph, } if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) { - LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? + LOG(WARNING) << "MSM messages for observables from different systems are not defined"; // print two messages? } if (msg_number == 0) { @@ -2733,7 +2733,7 @@ std::string Rtcm::print_MSM_4(const Gps_Ephemeris& gps_eph, } if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) { - LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? + LOG(WARNING) << "MSM messages for observables from different systems are not defined"; // print two messages? } if (msg_number == 0) { @@ -2892,7 +2892,7 @@ std::string Rtcm::print_MSM_5(const Gps_Ephemeris& gps_eph, } if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) { - LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? + LOG(WARNING) << "MSM messages for observables from different systems are not defined"; // print two messages? } if (msg_number == 0) { @@ -3060,7 +3060,7 @@ std::string Rtcm::print_MSM_6(const Gps_Ephemeris& gps_eph, } if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) { - LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? + LOG(WARNING) << "MSM messages for observables from different systems are not defined"; // print two messages? } if (msg_number == 0) { @@ -3179,7 +3179,7 @@ std::string Rtcm::print_MSM_7(const Gps_Ephemeris& gps_eph, } if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (glo_gnav_eph.i_satellite_PRN != 0) && (gal_eph.i_satellite_PRN != 0)) { - LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? + LOG(WARNING) << "MSM messages for observables from different systems are not defined"; // print two messages? } if (msg_number == 0) { @@ -3709,7 +3709,7 @@ int32_t Rtcm::set_DF002(uint32_t message_number) int32_t Rtcm::set_DF003(uint32_t ref_station_ID) { - //uint32_t station_ID = ref_station_ID; + // uint32_t station_ID = ref_station_ID; if (ref_station_ID > 4095) { LOG(WARNING) << "RTCM reference station ID must be between 0 and 4095, but it has been set to " << ref_station_ID; @@ -3745,7 +3745,7 @@ int32_t Rtcm::set_DF005(bool sync_flag) int32_t Rtcm::set_DF006(const std::map& observables) { - //Number of satellites observed in current epoch + // Number of satellites observed in current epoch uint16_t nsats = 0; std::map::const_iterator observables_iter; for (observables_iter = observables.cbegin(); @@ -4007,7 +4007,7 @@ int32_t Rtcm::set_DF034(double obs_time) int32_t Rtcm::set_DF035(const std::map& observables) { - //Number of satellites observed in current epoch + // Number of satellites observed in current epoch uint16_t nsats = 0; std::map::const_iterator observables_iter; for (observables_iter = observables.begin(); @@ -4258,7 +4258,7 @@ int32_t Rtcm::set_DF052(const Gps_Ephemeris& gps_eph, double obs_time) std::string hours = now_ptime.substr(9, 2); std::string minutes = now_ptime.substr(11, 2); std::string seconds = now_ptime.substr(13, 8); - //boost::gregorian::date d(boost::gregorian::from_undelimited_string(today_ptime)); + // boost::gregorian::date d(boost::gregorian::from_undelimited_string(today_ptime)); uint32_t seconds_of_day = boost::lexical_cast(hours) * 60 * 60 + boost::lexical_cast(minutes) * 60 + boost::lexical_cast(seconds); DF052 = std::bitset<17>(seconds_of_day); return 0; @@ -4866,7 +4866,7 @@ int32_t Rtcm::set_DF290(const Galileo_Ephemeris& gal_eph) int32_t Rtcm::set_DF291(const Galileo_Ephemeris& gal_eph) { auto SISA = static_cast(gal_eph.SISA_3); - //SISA = 0; // SIS Accuracy, data content definition not given in Galileo OS SIS ICD, Issue 1.1, Sept 2010 + // SISA = 0; // SIS Accuracy, data content definition not given in Galileo OS SIS ICD, Issue 1.1, Sept 2010 DF291 = std::bitset<8>(SISA); return 0; } @@ -5047,7 +5047,7 @@ int32_t Rtcm::set_DF312(const Galileo_Ephemeris& gal_eph) int32_t Rtcm::set_DF313(const Galileo_Ephemeris& gal_eph) { auto bdg_E5b_E1 = static_cast(std::round(gal_eph.BGD_E1E5b_5)); - //bdg_E5b_E1 = 0; //reserved + // bdg_E5b_E1 = 0; // reserved DF313 = std::bitset<10>(bdg_E5b_E1); return 0; } diff --git a/src/algorithms/PVT/libs/rtcm_printer.cc b/src/algorithms/PVT/libs/rtcm_printer.cc index 44197734a..350a2ffda 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.cc +++ b/src/algorithms/PVT/libs/rtcm_printer.cc @@ -384,7 +384,9 @@ int Rtcm_Printer::init_serial(const std::string& serial_device) * Opens the serial device and sets the default baud rate for a RTCM transmission (9600,8,N,1) */ int32_t fd = 0; + // clang-format off struct termios options{}; + // clang-format on int64_t BAUD; int64_t DATABITS; int64_t STOPBITS; @@ -404,7 +406,7 @@ int Rtcm_Printer::init_serial(const std::string& serial_device) tcgetattr(fd, &options); // read serial port options BAUD = B9600; - //BAUD = B38400; + // BAUD = B38400; DATABITS = CS8; STOPBITS = 0; PARITYON = 0; @@ -412,7 +414,7 @@ int Rtcm_Printer::init_serial(const std::string& serial_device) options.c_cflag = BAUD | DATABITS | STOPBITS | PARITYON | PARITY | CLOCAL | CREAD; // enable receiver, set 8 bit data, ignore control lines - //options.c_cflag |= (CLOCAL | CREAD | CS8); + // options.c_cflag |= (CLOCAL | CREAD | CS8); options.c_iflag = IGNPAR; // set the new port options @@ -432,7 +434,7 @@ void Rtcm_Printer::close_serial() bool Rtcm_Printer::Print_Message(const std::string& message) { - //write to file + // write to file if (d_rtcm_file_dump) { try @@ -446,7 +448,7 @@ bool Rtcm_Printer::Print_Message(const std::string& message) } } - //write to serial device + // write to serial device if (rtcm_dev_descriptor != -1) { if (write(rtcm_dev_descriptor, message.c_str(), message.length()) == -1) diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 220553a8b..345d0ab58 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -3,8 +3,8 @@ * \brief PVT solver based on rtklib library functions adapted to the GNSS-SDR * data flow and structures * \authors
    - *
  • 2017, Javier Arribas - *
  • 2017, Carles Fernandez + *
  • 2017-2019, Javier Arribas + *
  • 2017-2019, Carles Fernandez *
  • 2007-2013, T. Takasu *
* @@ -94,7 +94,6 @@ Rtklib_Solver::Rtklib_Solver(int nchannels, std::string dump_filename, bool flag d_dump_filename = std::move(dump_filename); d_flag_dump_enabled = flag_dump_to_file; d_flag_dump_mat_enabled = flag_dump_to_mat; - count_valid_position = 0; this->set_averaging_flag(false); rtk_ = rtk; @@ -443,7 +442,7 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ int valid_obs = 0; // valid observations counter int glo_valid_obs = 0; // GLONASS L1/L2 valid observations counter - std::array obs_data{}; + obs_data.fill({}); std::vector eph_data(MAXOBS); std::vector geph_data(MAXOBS); @@ -719,7 +718,7 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ obs_data[i + valid_obs] = insert_obs_to_rtklib(obs_data[i + valid_obs], gnss_observables_iter->second, glonass_gnav_ephemeris_iter->second.d_WN, - 1); //Band 1 (L2) + 1); // Band 1 (L2) found_L1_obs = true; break; } @@ -914,7 +913,13 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ } /* update carrier wave length using native function call in RTKlib */ - uniqnav(&nav_data); + for (int i = 0; i < MAXSAT; i++) + { + for (int j = 0; j < NFREQ; j++) + { + nav_data.lam[i][j] = satwavelen(i + 1, j, &nav_data); + } + } result = rtkpos(&rtk_, obs_data.data(), valid_obs + glo_valid_obs, &nav_data); @@ -1001,9 +1006,9 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ << " in ECEF (X,Y,Z,t[meters]) = " << rx_position_and_time; boost::posix_time::ptime p_time; - // gtime_t rtklib_utc_time = gpst2utc(pvt_sol.time); //Corrected RX Time (Non integer multiply of 1 ms of granularity) + // gtime_t rtklib_utc_time = gpst2utc(pvt_sol.time); // Corrected RX Time (Non integer multiply of 1 ms of granularity) // Uncorrected RX Time (integer multiply of 1 ms and the same observables time reported in RTCM and RINEX) - gtime_t rtklib_time = timeadd(pvt_sol.time, rx_position_and_time(3)); //uncorrected rx time + gtime_t rtklib_time = timeadd(pvt_sol.time, rx_position_and_time(3)); // uncorrected rx time gtime_t rtklib_utc_time = gpst2utc(rtklib_time); p_time = boost::posix_time::from_time_t(rtklib_utc_time.time); p_time += boost::posix_time::microseconds(static_cast(round(rtklib_utc_time.sec * 1e6))); // NOLINT(google-runtime-int) diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h index 1fa4ba8dd..3bc11fc9d 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.h +++ b/src/algorithms/PVT/libs/rtklib_solver.h @@ -126,18 +126,17 @@ public: Beidou_Dnav_Iono beidou_dnav_iono; std::map beidou_dnav_almanac_map; - int count_valid_position; - private: rtk_t rtk_{}; + Monitor_Pvt monitor_pvt{}; + std::array obs_data{}; + std::array dop_{}; std::string d_dump_filename; std::ofstream d_dump_file; - bool save_matfile(); + int d_nchannels; // Number of available channels for positioning bool d_flag_dump_enabled; bool d_flag_dump_mat_enabled; - int d_nchannels; // Number of available channels for positioning - std::array dop_{}; - Monitor_Pvt monitor_pvt{}; + bool save_matfile(); }; #endif diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc index 00353490a..22dedce6e 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc @@ -41,8 +41,8 @@ #include "gps_sdr_signal_processing.h" #include #include -#include #include +#include GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt index 39caeb02c..ccea93400 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt @@ -69,12 +69,13 @@ endif() target_link_libraries(acquisition_gr_blocks PUBLIC algorithms_libs + acquisition_libs + channel_libs + core_system_parameters + Armadillo::armadillo Gnuradio::runtime Gnuradio::fft Volk::volk - channel_libs - acquisition_libs - core_system_parameters PRIVATE Gflags::gflags Glog::glog @@ -90,6 +91,12 @@ target_include_directories(acquisition_gr_blocks ${CMAKE_SOURCE_DIR}/src/core/receiver ) +if(CMAKE_BUILD_TYPE MATCHES Rel) + target_compile_definitions(acquisition_gr_blocks + PUBLIC -DARMA_NO_BOUND_CHECKING=1 + ) +endif() + if(OPENCL_FOUND) target_link_libraries(acquisition_gr_blocks PUBLIC OpenCL::OpenCL) target_include_directories(acquisition_gr_blocks diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h index bd3b6302b..b026dae6f 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h @@ -52,6 +52,10 @@ #ifndef GNSS_SDR_PCPS_ACQUISITION_H_ #define GNSS_SDR_PCPS_ACQUISITION_H_ +#if ARMA_NO_BOUND_CHECKING +#define ARMA_NO_DEBUG 1 +#endif + #include "acq_conf.h" #include "channel_fsm.h" #include @@ -61,6 +65,7 @@ #include // for gr_complex #include // for scoped_lock #include // for gr_vector_const_void_star +#include // for Guidelines Support Library #include // for lv_16sc_t #include #include @@ -68,12 +73,6 @@ #include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif class Gnss_Synchro; class pcps_acquisition; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h index 3556eba10..2c79f1527 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h @@ -49,6 +49,10 @@ #ifndef GNSS_SDR_PCPS_ACQUISITION_FINE_DOPPLER_CC_H_ #define GNSS_SDR_PCPS_ACQUISITION_FINE_DOPPLER_CC_H_ +#if ARMA_NO_BOUND_CHECKING +#define ARMA_NO_DEBUG 1 +#endif + #include "acq_conf.h" #include "channel_fsm.h" #include "gnss_synchro.h" diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index a304d38b5..edaf48dbc 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -236,6 +236,8 @@ void Channel::assist_acquisition_doppler(double Carrier_Doppler_hz) { acq_->set_doppler_center(static_cast(Carrier_Doppler_hz)); } + + void Channel::start_acquisition() { std::lock_guard lk(mx); diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index 4978a3d78..d8fac7598 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -92,23 +92,11 @@ else() target_link_libraries(algorithms_libs PRIVATE Boost::filesystem Boost::system) endif() -include(CheckCXXSourceCompiles) -check_cxx_source_compiles(" - #include - int main() - { std::span sv; }" - has_span +target_include_directories(algorithms_libs + PUBLIC + ${CMAKE_SOURCE_DIR}/src/algorithms/libs/gsl/include ) -if(${has_span}) - target_compile_definitions(algorithms_libs PUBLIC -DHAS_SPAN=1) -else() - target_include_directories(algorithms_libs - PUBLIC - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/gsl/include - ) -endif() - target_link_libraries(algorithms_libs PUBLIC Armadillo::armadillo @@ -130,6 +118,12 @@ if(OPENCL_FOUND) ) endif() +if(CMAKE_BUILD_TYPE MATCHES Rel) + target_compile_definitions(algorithms_libs + PUBLIC -DARMA_NO_BOUND_CHECKING=1 + ) +endif() + target_include_directories(algorithms_libs PUBLIC ${CMAKE_SOURCE_DIR}/src/core/interfaces diff --git a/src/algorithms/libs/beidou_b1i_signal_processing.cc b/src/algorithms/libs/beidou_b1i_signal_processing.cc index 3a4d310bf..400fdd621 100644 --- a/src/algorithms/libs/beidou_b1i_signal_processing.cc +++ b/src/algorithms/libs/beidou_b1i_signal_processing.cc @@ -152,10 +152,10 @@ void beidou_b1i_code_gen_complex_sampled(gsl::span> _dest, u const int32_t _codeFreqBasis = 2046000; // Hz const int32_t _codeLength = 2046; - //--- Find number of samples per spreading code ---------------------------- + // --- Find number of samples per spreading code --------------------------- _samplesPerCode = static_cast(static_cast(_fs) / static_cast(_codeFreqBasis / _codeLength)); - //--- Find time constants -------------------------------------------------- + // --- Find time constants ------------------------------------------------- _ts = 1.0 / static_cast(_fs); // Sampling period in sec _tc = 1.0 / static_cast(_codeFreqBasis); // C/A chip period in sec @@ -163,28 +163,27 @@ void beidou_b1i_code_gen_complex_sampled(gsl::span> _dest, u for (int32_t i = 0; i < _samplesPerCode; i++) { - //=== Digitizing ======================================================= + // === Digitizing ================================================== - //--- Make index array to read C/A code values ------------------------- + // --- Make index array to read C/A code values -------------------- // The length of the index array depends on the sampling frequency - // number of samples per millisecond (because one C/A code period is one // millisecond). - // _codeValueIndex = ceil((_ts * ((float)i + 1)) / _tc) - 1; aux = (_ts * (i + 1)) / _tc; _codeValueIndex = auxCeil(aux) - 1; - //--- Make the digitized version of the C/A code ----------------------- + // --- Make the digitized version of the C/A code ------------------ // The "upsampled" code is made by selecting values form the CA code // chip array (caCode) for the time instances of each sample. if (i == _samplesPerCode - 1) { - //--- Correct the last index (due to number rounding issues) ----------- + // --- Correct the last index (due to number rounding issues) ----------- _dest[i] = _code[_codeLength - 1]; } else { - _dest[i] = _code[_codeValueIndex]; //repeat the chip -> upsample + _dest[i] = _code[_codeValueIndex]; // repeat the chip -> upsample } } } diff --git a/src/algorithms/libs/beidou_b1i_signal_processing.h b/src/algorithms/libs/beidou_b1i_signal_processing.h index 367a6d7b1..c86907e06 100644 --- a/src/algorithms/libs/beidou_b1i_signal_processing.h +++ b/src/algorithms/libs/beidou_b1i_signal_processing.h @@ -33,17 +33,10 @@ #ifndef GNSS_SDR_BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_ #define GNSS_SDR_BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - - //! Generates int32_t GPS L1 C/A code for the desired SV ID and code shift void beidou_b1i_code_gen_int(gsl::span _dest, int32_t _prn, uint32_t _chip_shift); diff --git a/src/algorithms/libs/beidou_b3i_signal_processing.cc b/src/algorithms/libs/beidou_b3i_signal_processing.cc index ef031e945..cb2b8e6d6 100644 --- a/src/algorithms/libs/beidou_b3i_signal_processing.cc +++ b/src/algorithms/libs/beidou_b3i_signal_processing.cc @@ -214,19 +214,19 @@ void beidou_b3i_code_gen_complex_sampled(gsl::span> _dest, u const int32_t _codeFreqBasis = 10230000; // Hz const int32_t _codeLength = 10230; - //--- Find number of samples per spreading code ---------------------------- + // --- Find number of samples per spreading code --------------------------- _samplesPerCode = static_cast(static_cast(_fs) / static_cast(_codeFreqBasis / _codeLength)); - //--- Find time constants -------------------------------------------------- + // --- Find time constants ------------------------------------------------- _ts = 1.0 / static_cast(_fs); // Sampling period in sec _tc = 1.0 / static_cast(_codeFreqBasis); // C/A chip period in sec beidou_b3i_code_gen_complex(_code, _prn, _chip_shift); // generate C/A code 1 sample per chip for (int32_t i = 0; i < _samplesPerCode; i++) { - //=== Digitizing ======================================================= + // === Digitizing ================================================== - //--- Make index array to read C/A code values ------------------------- + // --- Make index array to read C/A code values -------------------- // The length of the index array depends on the sampling frequency - // number of samples per millisecond (because one C/A code period is one // millisecond). @@ -234,12 +234,12 @@ void beidou_b3i_code_gen_complex_sampled(gsl::span> _dest, u aux = (_ts * (i + 1)) / _tc; _codeValueIndex = auxCeil(aux) - 1; - //--- Make the digitized version of the C/A code ----------------------- + // --- Make the digitized version of the C/A code ------------------ // The "upsampled" code is made by selecting values form the CA code // chip array (caCode) for the time instances of each sample. if (i == _samplesPerCode - 1) { - //--- Correct the last index (due to number rounding issues) ----------- + // --- Correct the last index (due to number rounding issues) ----------- _dest[i] = _code[_codeLength - 1]; } else diff --git a/src/algorithms/libs/beidou_b3i_signal_processing.h b/src/algorithms/libs/beidou_b3i_signal_processing.h index dc91c30c9..0698550e9 100644 --- a/src/algorithms/libs/beidou_b3i_signal_processing.h +++ b/src/algorithms/libs/beidou_b3i_signal_processing.h @@ -33,16 +33,10 @@ #ifndef GNSS_SDR_BEIDOU_B3I_SIGNAL_PROCESSING_H_ #define GNSS_SDR_BEIDOU_B3I_SIGNAL_PROCESSING_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - //! Generates int BeiDou B3I code for the desired SV ID and code shift void beidou_b3i_code_gen_int(gsl::span _dest, int32_t _prn, uint32_t _chip_shift); diff --git a/src/algorithms/libs/galileo_e1_signal_processing.h b/src/algorithms/libs/galileo_e1_signal_processing.h index be7f5f4b9..08c4db3c8 100644 --- a/src/algorithms/libs/galileo_e1_signal_processing.h +++ b/src/algorithms/libs/galileo_e1_signal_processing.h @@ -32,15 +32,10 @@ #ifndef GNSS_SDR_GALILEO_E1_SIGNAL_PROCESSING_H_ #define GNSS_SDR_GALILEO_E1_SIGNAL_PROCESSING_H_ +#include #include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif /*! diff --git a/src/algorithms/libs/galileo_e5_signal_processing.h b/src/algorithms/libs/galileo_e5_signal_processing.h index f04e95ab5..d3e8b617f 100644 --- a/src/algorithms/libs/galileo_e5_signal_processing.h +++ b/src/algorithms/libs/galileo_e5_signal_processing.h @@ -34,16 +34,10 @@ #ifndef GNSS_SDR_GALILEO_E5_SIGNAL_PROCESSING_H_ #define GNSS_SDR_GALILEO_E5_SIGNAL_PROCESSING_H_ +#include #include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - /*! * \brief Generates Galileo E5a code at 1 sample/chip diff --git a/src/algorithms/libs/geofunctions.h b/src/algorithms/libs/geofunctions.h index ca0797e73..9aaf68387 100644 --- a/src/algorithms/libs/geofunctions.h +++ b/src/algorithms/libs/geofunctions.h @@ -32,6 +32,10 @@ #ifndef GNSS_SDR_GEOFUNCTIONS_H #define GNSS_SDR_GEOFUNCTIONS_H +#if ARMA_NO_BOUND_CHECKING +#define ARMA_NO_DEBUG 1 +#endif + #include arma::mat Skew_symmetric(const arma::vec &a); //!< Calculates skew-symmetric matrix diff --git a/src/algorithms/libs/glonass_l1_signal_processing.cc b/src/algorithms/libs/glonass_l1_signal_processing.cc index 54e2393b0..8a71b3af7 100644 --- a/src/algorithms/libs/glonass_l1_signal_processing.cc +++ b/src/algorithms/libs/glonass_l1_signal_processing.cc @@ -112,10 +112,10 @@ void glonass_l1_ca_code_gen_complex_sampled(gsl::span> _dest const int32_t _codeFreqBasis = 511000; // Hz const int32_t _codeLength = 511; - //--- Find number of samples per spreading code ---------------------------- + // --- Find number of samples per spreading code --------------------------- _samplesPerCode = static_cast(static_cast(_fs) / static_cast(_codeFreqBasis / _codeLength)); - //--- Find time constants -------------------------------------------------- + // --- Find time constants ------------------------------------------------- _ts = 1.0 / static_cast(_fs); // Sampling period in sec _tc = 1.0 / static_cast(_codeFreqBasis); // C/A chip period in sec @@ -123,9 +123,9 @@ void glonass_l1_ca_code_gen_complex_sampled(gsl::span> _dest for (int32_t i = 0; i < _samplesPerCode; i++) { - //=== Digitizing ======================================================= + // === Digitizing ================================================== - //--- Make index array to read C/A code values ------------------------- + // --- Make index array to read C/A code values -------------------- // The length of the index array depends on the sampling frequency - // number of samples per millisecond (because one C/A code period is one // millisecond). @@ -133,12 +133,12 @@ void glonass_l1_ca_code_gen_complex_sampled(gsl::span> _dest aux = (_ts * (i + 1)) / _tc; _codeValueIndex = auxCeil(aux) - 1; - //--- Make the digitized version of the C/A code ----------------------- + // --- Make the digitized version of the C/A code ------------------ // The "upsampled" code is made by selecting values form the CA code // chip array (caCode) for the time instances of each sample. if (i == _samplesPerCode - 1) { - //--- Correct the last index (due to number rounding issues) ----------- + // --- Correct the last index (due to number rounding issues) ----------- _dest[i] = _code[_codeLength - 1]; } else diff --git a/src/algorithms/libs/glonass_l1_signal_processing.h b/src/algorithms/libs/glonass_l1_signal_processing.h index f239823e6..e7c641b2d 100644 --- a/src/algorithms/libs/glonass_l1_signal_processing.h +++ b/src/algorithms/libs/glonass_l1_signal_processing.h @@ -33,16 +33,10 @@ #ifndef GNSS_SDR_GLONASS_SDR_SIGNAL_PROCESSING_H_ #define GNSS_SDR_GLONASS_SDR_SIGNAL_PROCESSING_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - //! Generates complex GLONASS L1 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency void glonass_l1_ca_code_gen_complex(gsl::span> _dest, uint32_t _chip_shift); diff --git a/src/algorithms/libs/glonass_l2_signal_processing.cc b/src/algorithms/libs/glonass_l2_signal_processing.cc index 35bda6aed..6d8b652bd 100644 --- a/src/algorithms/libs/glonass_l2_signal_processing.cc +++ b/src/algorithms/libs/glonass_l2_signal_processing.cc @@ -112,10 +112,10 @@ void glonass_l2_ca_code_gen_complex_sampled(gsl::span> _dest const int32_t _codeFreqBasis = 511000; // Hz const int32_t _codeLength = 511; - //--- Find number of samples per spreading code ---------------------------- + // --- Find number of samples per spreading code --------------------------- _samplesPerCode = static_cast(static_cast(_fs) / static_cast(_codeFreqBasis / _codeLength)); - //--- Find time constants -------------------------------------------------- + // --- Find time constants ------------------------------------------------- _ts = 1.0 / static_cast(_fs); // Sampling period in sec _tc = 1.0 / static_cast(_codeFreqBasis); // C/A chip period in sec @@ -123,9 +123,9 @@ void glonass_l2_ca_code_gen_complex_sampled(gsl::span> _dest for (int32_t i = 0; i < _samplesPerCode; i++) { - //=== Digitizing ======================================================= + // === Digitizing ================================================== - //--- Make index array to read C/A code values ------------------------- + // --- Make index array to read C/A code values -------------------- // The length of the index array depends on the sampling frequency - // number of samples per millisecond (because one C/A code period is one // millisecond). @@ -133,12 +133,12 @@ void glonass_l2_ca_code_gen_complex_sampled(gsl::span> _dest aux = (_ts * (i + 1)) / _tc; _codeValueIndex = auxCeil(aux) - 1; - //--- Make the digitized version of the C/A code ----------------------- + // --- Make the digitized version of the C/A code ------------------ // The "upsampled" code is made by selecting values form the CA code // chip array (caCode) for the time instances of each sample. if (i == _samplesPerCode - 1) { - //--- Correct the last index (due to number rounding issues) ----------- + // --- Correct the last index (due to number rounding issues) ----------- _dest[i] = _code[_codeLength - 1]; } else diff --git a/src/algorithms/libs/glonass_l2_signal_processing.h b/src/algorithms/libs/glonass_l2_signal_processing.h index aae68cb1c..fe79c4ed5 100644 --- a/src/algorithms/libs/glonass_l2_signal_processing.h +++ b/src/algorithms/libs/glonass_l2_signal_processing.h @@ -33,16 +33,10 @@ #ifndef GNSS_SDR_GLONASS_L2_SIGNAL_PROCESSING_H_ #define GNSS_SDR_GLONASS_L2_SIGNAL_PROCESSING_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - //! Generates complex GLONASS L2 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency void glonass_l2_ca_code_gen_complex(gsl::span> _dest, uint32_t _chip_shift); diff --git a/src/algorithms/libs/gnss_circular_deque.h b/src/algorithms/libs/gnss_circular_deque.h index e100e5a74..88b8ad3cf 100644 --- a/src/algorithms/libs/gnss_circular_deque.h +++ b/src/algorithms/libs/gnss_circular_deque.h @@ -41,17 +41,17 @@ template class Gnss_circular_deque { public: - Gnss_circular_deque(); // Default constructor - Gnss_circular_deque(const unsigned int max_size, const unsigned int nchann); // nchann = number of channels; max_size = channel capacity - unsigned int size(const unsigned int ch); // Returns the number of available elements in a channel - T& at(const unsigned int ch, const unsigned int pos); // Returns a reference to an element - T& front(const unsigned int ch); // Returns a reference to the first element in the deque - T& back(const unsigned int ch); // Returns a reference to the last element in the deque - void push_back(const unsigned int ch, const T& new_data); // Inserts an element at the end of the deque - void pop_front(const unsigned int ch); // Removes the first element of the deque - void clear(const unsigned int ch); // Removes all the elements of the deque (Sets size to 0). Capacity is not modified - void reset(const unsigned int max_size, const unsigned int nchann); // Removes all the elements in all the channels. Re-sets the number of channels and their capacity - void reset(); // Removes all the channels (Sets nchann to 0) + Gnss_circular_deque(); //!< Default constructor + Gnss_circular_deque(const unsigned int max_size, const unsigned int nchann); //!< nchann = number of channels; max_size = channel capacity + unsigned int size(const unsigned int ch); //!< Returns the number of available elements in a channel + T& at(const unsigned int ch, const unsigned int pos); //!< Returns a reference to an element + T& front(const unsigned int ch); //!< Returns a reference to the first element in the deque + T& back(const unsigned int ch); //!< Returns a reference to the last element in the deque + void push_back(const unsigned int ch, const T& new_data); //!< Inserts an element at the end of the deque + void pop_front(const unsigned int ch); //!< Removes the first element of the deque + void clear(const unsigned int ch); //!< Removes all the elements of the deque (Sets size to 0). Capacity is not modified + void reset(const unsigned int max_size, const unsigned int nchann); //!< Removes all the elements in all the channels. Re-sets the number of channels and their capacity + void reset(); //!< Removes all the channels (Sets nchann to 0) private: std::vector> d_data; @@ -64,18 +64,21 @@ Gnss_circular_deque::Gnss_circular_deque() reset(); } + template Gnss_circular_deque::Gnss_circular_deque(const unsigned int max_size, const unsigned int nchann) { reset(max_size, nchann); } + template unsigned int Gnss_circular_deque::size(const unsigned int ch) { return d_data.at(ch).size(); } + template T& Gnss_circular_deque::back(const unsigned int ch) { @@ -96,12 +99,14 @@ T& Gnss_circular_deque::at(const unsigned int ch, const unsigned int pos) return d_data.at(ch).at(pos); } + template void Gnss_circular_deque::clear(const unsigned int ch) { d_data.at(ch).clear(); } + template void Gnss_circular_deque::reset(const unsigned int max_size, const unsigned int nchann) { @@ -115,18 +120,21 @@ void Gnss_circular_deque::reset(const unsigned int max_size, const unsigned i } } + template void Gnss_circular_deque::reset() { d_data.clear(); } + template void Gnss_circular_deque::pop_front(const unsigned int ch) { d_data.at(ch).pop_front(); } + template void Gnss_circular_deque::push_back(const unsigned int ch, const T& new_data) { diff --git a/src/algorithms/libs/gnss_signal_processing.cc b/src/algorithms/libs/gnss_signal_processing.cc index a6f63bc82..5dff66d69 100644 --- a/src/algorithms/libs/gnss_signal_processing.cc +++ b/src/algorithms/libs/gnss_signal_processing.cc @@ -165,20 +165,20 @@ void resampler(const gsl::span _from, gsl::span _dest, float _fs_i { uint32_t _codeValueIndex; float aux; - //--- Find time constants -------------------------------------------------- + // --- Find time constants ------------------------------------------------- const float _t_in = 1 / _fs_in; // Incoming sampling period in sec const float _t_out = 1 / _fs_out; // Out sampling period in sec for (uint32_t i = 0; i < _dest.size() - 1; i++) { - //=== Digitizing =================================================== - //--- compute index array to read sampled values ------------------- + // === Digitizing ================================================== + // --- compute index array to read sampled values ------------------ aux = (_t_out * (i + 1)) / _t_in; _codeValueIndex = auxCeil2(aux) - 1; // if repeat the chip -> upsample by nearest neighborhood interpolation _dest[i] = _from[_codeValueIndex]; } - //--- Correct the last index (due to number rounding issues) ----------- + // --- Correct the last index (due to number rounding issues) ----------- _dest[_dest.size() - 1] = _from[_from.size() - 1]; } @@ -188,19 +188,19 @@ void resampler(gsl::span> _from, gsl::span upsample by nearest neighborhood interpolation _dest[i] = _from[_codeValueIndex]; } - //--- Correct the last index (due to number rounding issues) ----------- + // --- Correct the last index (due to number rounding issues) ----------- _dest[_dest.size() - 1] = _from[_from.size() - 1]; } diff --git a/src/algorithms/libs/gnss_signal_processing.h b/src/algorithms/libs/gnss_signal_processing.h index cb08cf24f..d2c68b3eb 100644 --- a/src/algorithms/libs/gnss_signal_processing.h +++ b/src/algorithms/libs/gnss_signal_processing.h @@ -35,17 +35,10 @@ #ifndef GNSS_SDR_GNSS_SIGNAL_PROCESSING_H_ #define GNSS_SDR_GNSS_SIGNAL_PROCESSING_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - - /*! * \brief This function generates a complex exponential in _dest. * diff --git a/src/algorithms/libs/gps_l2c_signal.cc b/src/algorithms/libs/gps_l2c_signal.cc index ca8f2eb2f..fe16d9f4a 100644 --- a/src/algorithms/libs/gps_l2c_signal.cc +++ b/src/algorithms/libs/gps_l2c_signal.cc @@ -101,24 +101,24 @@ void gps_l2c_m_code_gen_complex_sampled(gsl::span> _dest, ui float _tc; const int32_t _codeLength = GPS_L2_M_CODE_LENGTH_CHIPS; - //--- Find number of samples per spreading code ---------------------------- + // --- Find number of samples per spreading code --------------------------- _samplesPerCode = static_cast(static_cast(_fs) / (static_cast(GPS_L2_M_CODE_RATE_HZ) / static_cast(_codeLength))); - //--- Find time constants -------------------------------------------------- + // --- Find time constants ------------------------------------------------- _ts = 1.0 / static_cast(_fs); // Sampling period in sec _tc = 1.0 / static_cast(GPS_L2_M_CODE_RATE_HZ); // L2C chip period in sec for (int32_t i = 0; i < _samplesPerCode; i++) { - //=== Digitizing ======================================================= + // === Digitizing ================================================== - //--- Make index array to read L2C code values ------------------------- + // --- Make index array to read L2C code values -------------------- _codeValueIndex = std::ceil((_ts * (static_cast(i) + 1)) / _tc) - 1; - //--- Make the digitized version of the L2C code ----------------------- + // --- Make the digitized version of the L2C code ------------------ if (i == _samplesPerCode - 1) { - //--- Correct the last index (due to number rounding issues) ----------- + // --- Correct the last index (due to number rounding issues) ----------- _dest[i] = std::complex(1.0 - 2.0 * _code[_codeLength - 1], 0); } else diff --git a/src/algorithms/libs/gps_l2c_signal.h b/src/algorithms/libs/gps_l2c_signal.h index 3ec6a4c4e..099aa4ca2 100644 --- a/src/algorithms/libs/gps_l2c_signal.h +++ b/src/algorithms/libs/gps_l2c_signal.h @@ -33,17 +33,10 @@ #ifndef GNSS_SDR_GPS_L2C_SIGNAL_H_ #define GNSS_SDR_GPS_L2C_SIGNAL_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - - //! Generates complex GPS L2C M code for the desired SV ID void gps_l2c_m_code_gen_complex(gsl::span> _dest, uint32_t _prn); void gps_l2c_m_code_gen_float(gsl::span _dest, uint32_t _prn); diff --git a/src/algorithms/libs/gps_l5_signal.cc b/src/algorithms/libs/gps_l5_signal.cc index a6d1d938e..a05db2009 100644 --- a/src/algorithms/libs/gps_l5_signal.cc +++ b/src/algorithms/libs/gps_l5_signal.cc @@ -218,24 +218,24 @@ void gps_l5i_code_gen_complex_sampled(gsl::span> _dest, uint float _tc; const int32_t _codeLength = GPS_L5I_CODE_LENGTH_CHIPS; - //--- Find number of samples per spreading code ---------------------------- + // --- Find number of samples per spreading code --------------------------- _samplesPerCode = static_cast(static_cast(_fs) / (static_cast(GPS_L5I_CODE_RATE_HZ) / static_cast(_codeLength))); - //--- Find time constants -------------------------------------------------- + // --- Find time constants ------------------------------------------------- _ts = 1.0 / static_cast(_fs); // Sampling period in sec _tc = 1.0 / static_cast(GPS_L5I_CODE_RATE_HZ); // L5I primary chip period in sec for (int32_t i = 0; i < _samplesPerCode; i++) { - //=== Digitizing ======================================================= + // === Digitizing ================================================== - //--- Make index array to read L5 code values ------------------------- + // --- Make index array to read L5 code values --------------------- _codeValueIndex = static_cast(std::ceil(_ts * static_cast(i + 1) / _tc)) - 1; - //--- Make the digitized version of the L5I code ----------------------- + // --- Make the digitized version of the L5I code ------------------ if (i == _samplesPerCode - 1) { - //--- Correct the last index (due to number rounding issues) ----------- + // --- Correct the last index (due to number rounding issues) ----------- _dest[i] = std::complex(1.0 - 2.0 * _code[_codeLength - 1], 0.0); } else @@ -292,24 +292,24 @@ void gps_l5q_code_gen_complex_sampled(gsl::span> _dest, uint float _tc; const int32_t _codeLength = GPS_L5Q_CODE_LENGTH_CHIPS; - //--- Find number of samples per spreading code ---------------------------- + // --- Find number of samples per spreading code --------------------------- _samplesPerCode = static_cast(static_cast(_fs) / (static_cast(GPS_L5Q_CODE_RATE_HZ) / static_cast(_codeLength))); - //--- Find time constants -------------------------------------------------- + // --- Find time constants ------------------------------------------------- _ts = 1.0 / static_cast(_fs); // Sampling period in sec _tc = 1.0 / static_cast(GPS_L5Q_CODE_RATE_HZ); // L5Q chip period in sec for (int32_t i = 0; i < _samplesPerCode; i++) { - //=== Digitizing ======================================================= + // === Digitizing ================================================== - //--- Make index array to read L5 code values ------------------------- + // --- Make index array to read L5 code values --------------------- _codeValueIndex = static_cast(std::ceil(_ts * static_cast(i + 1) / _tc)) - 1; - //--- Make the digitized version of the L5Q code ----------------------- + // --- Make the digitized version of the L5Q code ------------------ if (i == _samplesPerCode - 1) { - //--- Correct the last index (due to number rounding issues) ----------- + // --- Correct the last index (due to number rounding issues) ----------- _dest[i] = std::complex(1.0 - 2.0 * _code[_codeLength - 1], 0); } else diff --git a/src/algorithms/libs/gps_l5_signal.h b/src/algorithms/libs/gps_l5_signal.h index d6e60bf4d..057d0f02a 100644 --- a/src/algorithms/libs/gps_l5_signal.h +++ b/src/algorithms/libs/gps_l5_signal.h @@ -33,16 +33,10 @@ #ifndef GNSS_SDR_GPS_L5_SIGNAL_H_ #define GNSS_SDR_GPS_L5_SIGNAL_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - //! Generates complex GPS L5I code for the desired SV ID void gps_l5i_code_gen_complex(gsl::span> _dest, uint32_t _prn); diff --git a/src/algorithms/libs/gps_sdr_signal_processing.cc b/src/algorithms/libs/gps_sdr_signal_processing.cc index b47914871..0415a12eb 100644 --- a/src/algorithms/libs/gps_sdr_signal_processing.cc +++ b/src/algorithms/libs/gps_sdr_signal_processing.cc @@ -162,19 +162,19 @@ void gps_l1_ca_code_gen_complex_sampled(gsl::span> _dest, ui const int32_t _codeFreqBasis = 1023000; // Hz const int32_t _codeLength = 1023; - //--- Find number of samples per spreading code ---------------------------- + // --- Find number of samples per spreading code --------------------------- _samplesPerCode = static_cast(static_cast(_fs) / static_cast(_codeFreqBasis / _codeLength)); - //--- Find time constants -------------------------------------------------- + // --- Find time constants ------------------------------------------------- _ts = 1.0 / static_cast(_fs); // Sampling period in sec _tc = 1.0 / static_cast(_codeFreqBasis); // C/A chip period in sec gps_l1_ca_code_gen_complex(_code, _prn, _chip_shift); // generate C/A code 1 sample per chip for (int32_t i = 0; i < _samplesPerCode; i++) { - //=== Digitizing =================================================== + // === Digitizing ================================================== - //--- Make index array to read C/A code values --------------------- + // --- Make index array to read C/A code values -------------------- // The length of the index array depends on the sampling frequency - // number of samples per millisecond (because one C/A code period is one // millisecond). @@ -182,12 +182,12 @@ void gps_l1_ca_code_gen_complex_sampled(gsl::span> _dest, ui aux = (_ts * (i + 1)) / _tc; _codeValueIndex = auxCeil(aux) - 1; - //--- Make the digitized version of the C/A code ------------------- + // --- Make the digitized version of the C/A code ------------------- // The "upsampled" code is made by selecting values form the CA code // chip array (caCode) for the time instances of each sample. if (i == _samplesPerCode - 1) { - //--- Correct the last index (due to number rounding issues) + // --- Correct the last index (due to number rounding issues) _dest[i] = _code[_codeLength - 1]; } else diff --git a/src/algorithms/libs/gps_sdr_signal_processing.h b/src/algorithms/libs/gps_sdr_signal_processing.h index 66db15886..13cacfabc 100644 --- a/src/algorithms/libs/gps_sdr_signal_processing.h +++ b/src/algorithms/libs/gps_sdr_signal_processing.h @@ -33,16 +33,10 @@ #ifndef GNSS_SDR_GPS_SDR_SIGNAL_PROCESSING_H_ #define GNSS_SDR_GPS_SDR_SIGNAL_PROCESSING_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - //! Generates int GPS L1 C/A code for the desired SV ID and code shift void gps_l1_ca_code_gen_int(gsl::span _dest, int32_t _prn, uint32_t _chip_shift); diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc index b6175f9d9..b3b4ab638 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc @@ -45,6 +45,7 @@ #include // for cerr, cout #include // for numeric_limits #include // for move +#include // for vector #if HAS_STD_FILESYSTEM #include @@ -92,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) @@ -140,8 +140,7 @@ 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_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; // rework @@ -196,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); - //d_Rx_clock_buffer.clear(); // Clear all the elements in the buffer + 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) @@ -439,8 +436,6 @@ bool hybrid_observables_gs::interp_trk_obs(Gnss_Synchro &interpolated_obs, const // << d_gnss_synchro_history->at(ch, t2_idx).RX_time - d_gnss_synchro_history->at(ch, t1_idx).RX_time // << " trx - t1: " // << T_rx_s - d_gnss_synchro_history->at(ch, t1_idx).RX_time; - - // // std::cout << "Rx samplestamp: " << T_rx_s << " Channel " << ch << " interp buff idx " << nearest_element // << " ,diff: " << old_abs_diff << " samples (" << static_cast(old_abs_diff) / static_cast(d_gnss_synchro_history->at(ch, nearest_element).fs) << " s)\n"; return true; @@ -475,7 +470,7 @@ void hybrid_observables_gs::update_TOW(const std::vector &data) std::vector::const_iterator it; if (!T_rx_TOW_set) { - //uint32_t TOW_ref = std::numeric_limits::max(); + // int32_t TOW_ref = std::numeric_limits::max(); uint32_t TOW_ref = 0U; for (it = data.cbegin(); it != data.cend(); it++) { @@ -488,8 +483,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 { @@ -508,7 +502,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)); + auto 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++) { @@ -581,9 +575,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(); @@ -622,14 +614,14 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused) out[n][0] = epoch_data.at(n); } - //report channel status every second + // report channel status every second T_status_report_timer_ms += T_rx_step_ms; if (T_status_report_timer_ms >= 1000) { for (uint32_t n = 0; n < d_nchannels_out; n++) { std::shared_ptr gnss_synchro_sptr = std::make_shared(epoch_data.at(n)); - //publish valid gnss_synchro to the gnss_flowgraph channel status monitor + // publish valid gnss_synchro to the gnss_flowgraph channel status monitor this->message_port_pub(pmt::mp("status"), pmt::make_any(gnss_synchro_sptr)); } T_status_report_timer_ms = 0; @@ -665,7 +657,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 e2bbfa299..6ab2b1955 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.h +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.h @@ -41,7 +41,6 @@ #include // for int32_t #include // for string, ofstream #include // for shared_ptr -#include // for vector class Gnss_Synchro; class hybrid_observables_gs; @@ -88,12 +87,10 @@ 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; std::string d_dump_filename; std::ofstream d_dump_file; boost::circular_buffer d_Rx_clock_buffer; // time history diff --git a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc index 6aa7462e5..d34b8e499 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc +++ b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc @@ -251,7 +251,7 @@ void signal_generator_c::generate_codes() std::array signal_1C = {{'1', 'C', '\0'}}; - galileo_e1_code_gen_complex_sampled(gsl::span(sampled_code_pilot_[sat].data(), vector_length_), signal_1C, cboc, PRN_[sat], fs_in_, + galileo_e1_code_gen_complex_sampled(sampled_code_pilot_[sat], signal_1C, cboc, PRN_[sat], fs_in_, static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS) - delay_chips_[sat], true); // Obtain the desired CN0 assuming that Pn = 1. diff --git a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h index 242900c90..0e07af4e4 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h +++ b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h @@ -78,14 +78,16 @@ public: private: boost::mutex d_mutex; - pcap_t *descr; //ethernet pcap device descriptor + pcap_t *descr; // ethernet pcap device descriptor char *fifo_buff; int fifo_read_ptr; int fifo_write_ptr; int fifo_items; int d_sock_raw; int d_udp_port; + // clang-format off struct sockaddr_in si_me{}; + // clang-format on std::string d_src_device; std::string d_origin_address; int d_udp_payload_size; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc index f2128af5a..4ba01fc22 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc @@ -287,7 +287,7 @@ void beidou_b1i_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satell // Update satellite information for DNAV decoder sat_prn = d_satellite.get_PRN(); d_nav.i_satellite_PRN = sat_prn; - d_nav.i_signal_type = 1; //!< BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q) + d_nav.i_signal_type = 1; // BDS: data source (0:unknown,1:B1I,2:B1Q,3:B2I,4:B2Q,5:B3I,6:B3Q) // Update tel dec parameters for D2 NAV Messages if (sat_prn > 0 and sat_prn < 6) @@ -315,7 +315,7 @@ void beidou_b1i_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satell } else { - //back to normal satellites + // back to normal satellites d_symbol_duration_ms = BEIDOU_B1I_TELEMETRY_SYMBOLS_PER_BIT * BEIDOU_B1I_CODE_PERIOD_MS; d_symbols_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS; d_samples_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS; @@ -395,7 +395,7 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_ if (d_symbol_history.size() >= d_required_symbols) { - //******* preamble correlation ******** + // ******* preamble correlation ******** for (int32_t i = 0; i < d_samples_per_preamble; i++) { if (d_symbol_history[i] < 0) // symbols clipping @@ -408,7 +408,7 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_ } } } - //******* frame sync ****************** + // ******* frame sync ****************** if (d_stat == 0) // no preamble information { if (abs(corr_value) >= d_samples_per_preamble) @@ -430,13 +430,13 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_ { // try to decode frame DLOG(INFO) << "Starting BeiDou DNAV frame decoding for BeiDou B1I SAT " << this->d_satellite; - d_preamble_index = d_sample_counter; //record the preamble sample stamp + d_preamble_index = d_sample_counter; // record the preamble sample stamp d_stat = 2; // ******* SAMPLES TO SYMBOLS ******* - if (corr_value > 0) //normal PLL lock + if (corr_value > 0) // normal PLL lock { for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++) { @@ -493,7 +493,7 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_ if (d_sample_counter == d_preamble_index + static_cast(d_preamble_period_samples)) { // ******* SAMPLES TO SYMBOLS ******* - if (corr_value > 0) //normal PLL lock + if (corr_value > 0) // normal PLL lock { for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++) { @@ -543,14 +543,14 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_ { // Reporting sow as gps time of week d_TOW_at_Preamble_ms = static_cast((d_nav.d_SOW + BEIDOU_DNAV_BDT2GPST_LEAP_SEC_OFFSET) * 1000.0); - //check TOW update consistency + // check TOW update consistency uint32_t last_d_TOW_at_current_symbol_ms = d_TOW_at_current_symbol_ms; - //compute new TOW + // compute new TOW d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + d_required_symbols * d_symbol_duration_ms; flag_SOW_set = true; d_nav.flag_new_SOW_available = false; - if (last_d_TOW_at_current_symbol_ms != 0 and abs(static_cast(d_TOW_at_current_symbol_ms) - int64_t(last_d_TOW_at_current_symbol_ms)) > d_symbol_duration_ms) + if (last_d_TOW_at_current_symbol_ms != 0 and abs(static_cast(d_TOW_at_current_symbol_ms) - int64_t(last_d_TOW_at_current_symbol_ms)) > static_cast(d_symbol_duration_ms)) { LOG(INFO) << "Warning: BEIDOU B1I TOW update in ch " << d_channel << " does not match the TLM TOW counter " << static_cast(d_TOW_at_current_symbol_ms) - int64_t(last_d_TOW_at_current_symbol_ms) << " ms \n"; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc index cf9e4f300..e82779644 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc @@ -387,6 +387,7 @@ void beidou_b3i_telemetry_decoder_gs::set_channel(int32_t channel) } } + void beidou_b3i_telemetry_decoder_gs::reset() { d_last_valid_preamble = d_sample_counter; @@ -397,6 +398,7 @@ void beidou_b3i_telemetry_decoder_gs::reset() return; } + int beidou_b3i_telemetry_decoder_gs::general_work( int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), @@ -420,7 +422,7 @@ int beidou_b3i_telemetry_decoder_gs::general_work( if (d_symbol_history.size() >= d_required_symbols) { - //******* preamble correlation ******** + // ******* preamble correlation ******** for (int32_t i = 0; i < d_samples_per_preamble; i++) { if (d_symbol_history[i] < 0) // symbols clipping @@ -433,7 +435,7 @@ int beidou_b3i_telemetry_decoder_gs::general_work( } } } - //******* frame sync ****************** + // ******* frame sync ****************** if (d_stat == 0) // no preamble information { if (abs(corr_value) >= d_samples_per_preamble) @@ -460,7 +462,7 @@ int beidou_b3i_telemetry_decoder_gs::general_work( d_stat = 2; // ******* SAMPLES TO SYMBOLS ******* - if (corr_value > 0) //normal PLL lock + if (corr_value > 0) // normal PLL lock { for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++) { @@ -520,7 +522,7 @@ int beidou_b3i_telemetry_decoder_gs::general_work( if (d_sample_counter == d_preamble_index + static_cast(d_preamble_period_samples)) { // ******* SAMPLES TO SYMBOLS ******* - if (corr_value > 0) //normal PLL lock + if (corr_value > 0) // normal PLL lock { for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++) { @@ -572,14 +574,14 @@ int beidou_b3i_telemetry_decoder_gs::general_work( { // Reporting sow as gps time of week d_TOW_at_Preamble_ms = static_cast((d_nav.d_SOW + BEIDOU_DNAV_BDT2GPST_LEAP_SEC_OFFSET) * 1000.0); - //check TOW update consistency + // check TOW update consistency uint32_t last_d_TOW_at_current_symbol_ms = d_TOW_at_current_symbol_ms; - //compute new TOW + // compute new TOW d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + d_required_symbols * d_symbol_duration_ms; flag_SOW_set = true; d_nav.flag_new_SOW_available = false; - if (last_d_TOW_at_current_symbol_ms != 0 and abs(static_cast(d_TOW_at_current_symbol_ms) - int64_t(last_d_TOW_at_current_symbol_ms)) > d_symbol_duration_ms) + if (last_d_TOW_at_current_symbol_ms != 0 and abs(static_cast(d_TOW_at_current_symbol_ms) - int64_t(last_d_TOW_at_current_symbol_ms)) > static_cast(d_symbol_duration_ms)) { LOG(INFO) << "Warning: BEIDOU B3I TOW update in ch " << d_channel << " does not match the TLM TOW counter " << static_cast(d_TOW_at_current_symbol_ms) - int64_t(last_d_TOW_at_current_symbol_ms) << " ms \n"; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc index 515a318c9..b234576fa 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc @@ -95,7 +95,7 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs( d_frame_length_symbols = GALILEO_INAV_PAGE_PART_SYMBOLS - GALILEO_INAV_PREAMBLE_LENGTH_BITS; CodeLength = GALILEO_INAV_PAGE_PART_SYMBOLS - GALILEO_INAV_PREAMBLE_LENGTH_BITS; DataLength = (CodeLength / nn) - mm; - d_max_symbols_without_valid_frame = GALILEO_INAV_PAGE_SYMBOLS * 30; //rise alarm 60 seconds without valid tlm + d_max_symbols_without_valid_frame = GALILEO_INAV_PAGE_SYMBOLS * 30; // rise alarm 60 seconds without valid tlm break; } @@ -112,7 +112,7 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs( d_frame_length_symbols = GALILEO_FNAV_SYMBOLS_PER_PAGE - GALILEO_FNAV_PREAMBLE_LENGTH_BITS; CodeLength = GALILEO_FNAV_SYMBOLS_PER_PAGE - GALILEO_FNAV_PREAMBLE_LENGTH_BITS; DataLength = (CodeLength / nn) - mm; - d_max_symbols_without_valid_frame = GALILEO_FNAV_SYMBOLS_PER_PAGE * 5; //rise alarm 100 seconds without valid tlm + d_max_symbols_without_valid_frame = GALILEO_FNAV_SYMBOLS_PER_PAGE * 5; // rise alarm 100 seconds without valid tlm break; } default: @@ -309,7 +309,7 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(double *page_part_symbols, i { std::shared_ptr tmp_obj = std::make_shared(d_inav_nav.get_almanac()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); - //debug + // debug std::cout << "Galileo E1 I/NAV almanac received in channel " << d_channel << " from satellite " << d_satellite << std::endl; DLOG(INFO) << "Current parameters:"; DLOG(INFO) << "d_TOW_at_current_symbol_ms=" << d_TOW_at_current_symbol_ms; @@ -469,7 +469,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__(( { if ((d_sample_counter - d_last_valid_preamble) > d_max_symbols_without_valid_frame) { - int message = 1; //bad telemetry + int message = 1; // bad telemetry DLOG(INFO) << "sent msg sat " << this->d_satellite; this->message_port_pub(pmt::mp("telemetry_to_trk"), pmt::make_any(message)); d_sent_tlm_failed_msg = true; @@ -772,7 +772,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__(( { current_symbol.TOW_at_current_symbol_ms = d_TOW_at_current_symbol_ms; // todo: Galileo to GPS time conversion should be moved to observable block. - // current_symbol.TOW_at_current_symbol_ms -= delta_t; //Galileo to GPS TOW + // current_symbol.TOW_at_current_symbol_ms -= delta_t; // Galileo to GPS TOW if (d_dump == true) { diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc index 14f54266a..0c273821d 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc @@ -342,7 +342,7 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__ { if ((d_sample_counter - d_last_valid_preamble) > d_max_symbols_without_valid_frame) { - int message = 1; //bad telemetry + int message = 1; // bad telemetry this->message_port_pub(pmt::mp("telemetry_to_trk"), pmt::make_any(message)); d_sent_tlm_failed_msg = true; } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.cc index 5ce16c667..f8101d3ac 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.cc @@ -78,7 +78,7 @@ gps_l2c_telemetry_decoder_gs::gps_l2c_telemetry_decoder_gs( d_flag_valid_word = false; d_TOW_at_current_symbol = 0; d_TOW_at_Preamble = 0; - d_state = 0; //initial state + d_state = 0; // initial state d_crc_error_count = 0; // initialize the CNAV frame decoder (libswiftcnav) @@ -170,7 +170,7 @@ int gps_l2c_telemetry_decoder_gs::general_work(int noutput_items __attribute__(( { if ((d_sample_counter - d_last_valid_preamble) > d_max_symbols_without_valid_frame) { - int message = 1; //bad telemetry + int message = 1; // bad telemetry this->message_port_pub(pmt::mp("telemetry_to_trk"), pmt::make_any(message)); d_sent_tlm_failed_msg = true; } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc index 8b9857b8c..f8b6054be 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc @@ -165,7 +165,7 @@ int gps_l5_telemetry_decoder_gs::general_work(int noutput_items __attribute__((u { if ((d_sample_counter - d_last_valid_preamble) > d_max_symbols_without_valid_frame) { - int message = 1; //bad telemetry + int message = 1; // bad telemetry this->message_port_pub(pmt::mp("telemetry_to_trk"), pmt::make_any(message)); d_sent_tlm_failed_msg = true; } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_gs.cc index 50abe691e..b1be0dd90 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_gs.cc @@ -193,7 +193,7 @@ sbas_l1_telemetry_decoder_gs::Symbol_Aligner_And_Decoder::Symbol_Aligner_And_Dec std::array g_encoder{121, 91}; d_vd1 = std::make_shared(g_encoder.data(), d_KK, nn); - d_vd1 = std::make_shared(g_encoder.data(), d_KK, nn); + d_vd2 = std::make_shared(g_encoder.data(), d_KK, nn); d_past_symbol = 0; } diff --git a/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc index 3f7a91f0e..bd25f1f1b 100644 --- a/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc @@ -50,7 +50,7 @@ BeidouB1iDllPllTracking::BeidouB1iDllPllTracking( { Dll_Pll_Conf trk_param = Dll_Pll_Conf(); DLOG(INFO) << "role " << role; - //################# CONFIGURATION PARAMETERS ######################## + // ################# CONFIGURATION PARAMETERS ######################## std::string default_item_type = "gr_complex"; std::string item_type = configuration->property(role + ".item_type", default_item_type); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); @@ -159,7 +159,7 @@ BeidouB1iDllPllTracking::BeidouB1iDllPllTracking( trk_param.max_carrier_lock_fail = configuration->property(role + ".max_carrier_lock_fail", trk_param.max_carrier_lock_fail); trk_param.carrier_lock_th = configuration->property(role + ".carrier_lock_th", trk_param.carrier_lock_th); - //################# MAKE TRACKING GNURadio object ################### + // ################# MAKE TRACKING GNURadio object ################### if (item_type == "gr_complex") { item_size_ = sizeof(gr_complex); @@ -216,7 +216,7 @@ void BeidouB1iDllPllTracking::connect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to connect, now the tracking uses gr_sync_decimator + // nothing to connect, now the tracking uses gr_sync_decimator } @@ -225,7 +225,7 @@ void BeidouB1iDllPllTracking::disconnect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to disconnect, now the tracking uses gr_sync_decimator + // nothing to disconnect, now the tracking uses gr_sync_decimator } diff --git a/src/algorithms/tracking/adapters/beidou_b3i_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/beidou_b3i_dll_pll_tracking.cc index 7d7131fa3..ea866f40d 100644 --- a/src/algorithms/tracking/adapters/beidou_b3i_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/beidou_b3i_dll_pll_tracking.cc @@ -51,7 +51,7 @@ BeidouB3iDllPllTracking::BeidouB3iDllPllTracking( { Dll_Pll_Conf trk_param = Dll_Pll_Conf(); DLOG(INFO) << "role " << role; - //################# CONFIGURATION PARAMETERS ######################## + // ################# CONFIGURATION PARAMETERS ######################## std::string default_item_type = "gr_complex"; std::string item_type = configuration->property(role + ".item_type", default_item_type); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); @@ -163,7 +163,7 @@ BeidouB3iDllPllTracking::BeidouB3iDllPllTracking( trk_param.max_carrier_lock_fail = configuration->property(role + ".max_carrier_lock_fail", trk_param.max_carrier_lock_fail); trk_param.carrier_lock_th = configuration->property(role + ".carrier_lock_th", trk_param.carrier_lock_th); - //################# MAKE TRACKING GNURadio object ################### + // ################# MAKE TRACKING GNURadio object ################### if (item_type == "gr_complex") { item_size_ = sizeof(gr_complex); @@ -220,7 +220,7 @@ void BeidouB3iDllPllTracking::connect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to connect, now the tracking uses gr_sync_decimator + // nothing to connect, now the tracking uses gr_sync_decimator } @@ -229,7 +229,7 @@ void BeidouB3iDllPllTracking::disconnect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to disconnect, now the tracking uses gr_sync_decimator + // nothing to disconnect, now the tracking uses gr_sync_decimator } diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc index e6f46d671..2421e071a 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc @@ -49,7 +49,7 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking( { Dll_Pll_Conf trk_param = Dll_Pll_Conf(); DLOG(INFO) << "role " << role; - //################# CONFIGURATION PARAMETERS ######################## + // ################# CONFIGURATION PARAMETERS ######################## std::string default_item_type = "gr_complex"; std::string item_type = configuration->property(role + ".item_type", default_item_type); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); @@ -167,7 +167,7 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking( trk_param.max_carrier_lock_fail = configuration->property(role + ".max_carrier_lock_fail", trk_param.max_carrier_lock_fail); trk_param.carrier_lock_th = configuration->property(role + ".carrier_lock_th", trk_param.carrier_lock_th); - //################# MAKE TRACKING GNURadio object ################### + // ################# MAKE TRACKING GNURadio object ################### if (item_type == "gr_complex") { item_size_ = sizeof(gr_complex); @@ -225,7 +225,7 @@ void GalileoE1DllPllVemlTracking::connect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to connect, now the tracking uses gr_sync_decimator + // nothing to connect, now the tracking uses gr_sync_decimator } @@ -234,7 +234,7 @@ void GalileoE1DllPllVemlTracking::disconnect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to disconnect, now the tracking uses gr_sync_decimator + // nothing to disconnect, now the tracking uses gr_sync_decimator } diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.h b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.h index 9cab751b3..4e5c85bd5 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.h +++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.h @@ -92,6 +92,7 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void start_tracking() override; + /*! * \brief Stop running tracking */ diff --git a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc index be52c9ff6..447d56eaf 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc @@ -48,7 +48,7 @@ GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking( unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; - //################# CONFIGURATION PARAMETERS ######################## + // ################# CONFIGURATION PARAMETERS ######################## int fs_in; int vector_length; bool dump; @@ -81,7 +81,7 @@ GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking( dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); vector_length = std::round(fs_in / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)); - //################# MAKE TRACKING GNURadio object ################### + // ################# MAKE TRACKING GNURadio object ################### if (item_type == "gr_complex") { item_size_ = sizeof(gr_complex); @@ -145,7 +145,7 @@ void GalileoE1TcpConnectorTracking::connect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to connect, now the tracking uses gr_sync_decimator + // nothing to connect, now the tracking uses gr_sync_decimator } @@ -154,7 +154,7 @@ void GalileoE1TcpConnectorTracking::disconnect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to disconnect, now the tracking uses gr_sync_decimator + // nothing to disconnect, now the tracking uses gr_sync_decimator } diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc index 76762abf8..6597226be 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc @@ -48,7 +48,7 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( { Dll_Pll_Conf trk_param = Dll_Pll_Conf(); DLOG(INFO) << "role " << role; - //################# CONFIGURATION PARAMETERS ######################## + // ################# CONFIGURATION PARAMETERS ######################## std::string default_item_type = "gr_complex"; std::string item_type = configuration->property(role + ".item_type", default_item_type); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 12000000); @@ -164,7 +164,7 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( trk_param.max_carrier_lock_fail = configuration->property(role + ".max_carrier_lock_fail", trk_param.max_carrier_lock_fail); trk_param.carrier_lock_th = configuration->property(role + ".carrier_lock_th", trk_param.carrier_lock_th); - //################# MAKE TRACKING GNURadio object ################### + // ################# MAKE TRACKING GNURadio object ################### if (item_type == "gr_complex") { item_size_ = sizeof(gr_complex); @@ -221,7 +221,7 @@ void GalileoE5aDllPllTracking::connect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to connect, now the tracking uses gr_sync_decimator + // nothing to connect, now the tracking uses gr_sync_decimator } @@ -230,7 +230,7 @@ void GalileoE5aDllPllTracking::disconnect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to disconnect, now the tracking uses gr_sync_decimator + // nothing to disconnect, now the tracking uses gr_sync_decimator } diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.h b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.h index 644b1e8cd..eedf270be 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.h @@ -89,6 +89,7 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void start_tracking() override; + /*! * \brief Stop running tracking */ diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc index 7a2a30a0e..230361bf0 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc @@ -46,7 +46,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( { Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga(); DLOG(INFO) << "role " << role; - //################# CONFIGURATION PARAMETERS ######################## + // ################# CONFIGURATION PARAMETERS ######################## int32_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 12000000); int32_t fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); trk_param_fpga.fs_in = fs_in; @@ -171,7 +171,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( uint32_t device_base = configuration->property(role + ".device_base", 27); trk_param_fpga.device_base = device_base; - //################# PRE-COMPUTE ALL THE CODES ################# + // ################# PRE-COMPUTE ALL THE CODES ################# uint32_t code_samples_per_chip = 1; auto code_length_chips = static_cast(GALILEO_E5A_CODE_LENGTH_CHIPS); @@ -260,7 +260,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( } } - //################# MAKE TRACKING GNURadio object ################### + // ################# MAKE TRACKING GNURadio object ################### tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga); channel_ = 0; @@ -311,7 +311,7 @@ void GalileoE5aDllPllTrackingFpga::connect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to connect, now the tracking uses gr_sync_decimator + // nothing to connect, now the tracking uses gr_sync_decimator } @@ -320,7 +320,7 @@ void GalileoE5aDllPllTrackingFpga::disconnect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to disconnect, now the tracking uses gr_sync_decimator + // nothing to disconnect, now the tracking uses gr_sync_decimator } diff --git a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc index e9537cc36..88c23a71d 100644 --- a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc +++ b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc @@ -49,7 +49,7 @@ GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking( unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; - //################# CONFIGURATION PARAMETERS ######################## + // ################# CONFIGURATION PARAMETERS ######################## int fs_in; int vector_length; bool dump; @@ -61,7 +61,6 @@ GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking( float dll_bw_narrow_hz; float early_late_space_chips; item_type_ = configuration->property(role + ".item_type", default_item_type); - //vector_length = configuration->property(role + ".vector_length", 2048); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump = configuration->property(role + ".dump", false); @@ -85,7 +84,7 @@ GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking( dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); vector_length = std::round(fs_in / (GLONASS_L1_CA_CODE_RATE_HZ / GLONASS_L1_CA_CODE_LENGTH_CHIPS)); - //################# MAKE TRACKING GNURadio object ################### + // ################# MAKE TRACKING GNURadio object ################### if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); @@ -201,7 +200,7 @@ void GlonassL1CaDllPllCAidTracking::connect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to connect, now the tracking uses gr_sync_decimator + // nothing to connect, now the tracking uses gr_sync_decimator } @@ -210,7 +209,7 @@ void GlonassL1CaDllPllCAidTracking::disconnect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to disconnect, now the tracking uses gr_sync_decimator + // nothing to disconnect, now the tracking uses gr_sync_decimator } diff --git a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc index 8c00f444e..38849a9a4 100644 --- a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc @@ -48,7 +48,7 @@ GlonassL1CaDllPllTracking::GlonassL1CaDllPllTracking( unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; - //################# CONFIGURATION PARAMETERS ######################## + // ################# CONFIGURATION PARAMETERS ######################## int fs_in; int vector_length; bool dump; @@ -77,7 +77,7 @@ GlonassL1CaDllPllTracking::GlonassL1CaDllPllTracking( dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); vector_length = std::round(fs_in / (GLONASS_L1_CA_CODE_RATE_HZ / GLONASS_L1_CA_CODE_LENGTH_CHIPS)); - //################# MAKE TRACKING GNURadio object ################### + // ################# MAKE TRACKING GNURadio object ################### if (item_type == "gr_complex") { item_size_ = sizeof(gr_complex); @@ -140,7 +140,7 @@ void GlonassL1CaDllPllTracking::connect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to connect, now the tracking uses gr_sync_decimator + // nothing to connect, now the tracking uses gr_sync_decimator } @@ -149,7 +149,7 @@ void GlonassL1CaDllPllTracking::disconnect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to disconnect, now the tracking uses gr_sync_decimator + // nothing to disconnect, now the tracking uses gr_sync_decimator } diff --git a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.h b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.h index 8bb8daaae..e01c93d64 100644 --- a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.h @@ -91,6 +91,7 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void start_tracking() override; + /*! * \brief Stop running tracking */ diff --git a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.cc b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.cc index 1a8cc808c..a13613ecf 100644 --- a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.cc +++ b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.cc @@ -47,7 +47,7 @@ GlonassL2CaDllPllCAidTracking::GlonassL2CaDllPllCAidTracking( unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; - //################# CONFIGURATION PARAMETERS ######################## + // ################# CONFIGURATION PARAMETERS ######################## int fs_in; int vector_length; bool dump; @@ -59,7 +59,6 @@ GlonassL2CaDllPllCAidTracking::GlonassL2CaDllPllCAidTracking( float dll_bw_narrow_hz; float early_late_space_chips; item_type_ = configuration->property(role + ".item_type", default_item_type); - //vector_length = configuration->property(role + ".vector_length", 2048); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump = configuration->property(role + ".dump", false); @@ -83,7 +82,7 @@ GlonassL2CaDllPllCAidTracking::GlonassL2CaDllPllCAidTracking( dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); vector_length = std::round(fs_in / (GLONASS_L2_CA_CODE_RATE_HZ / GLONASS_L2_CA_CODE_LENGTH_CHIPS)); - //################# MAKE TRACKING GNURadio object ################### + // ################# MAKE TRACKING GNURadio object ################### if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); @@ -199,7 +198,7 @@ void GlonassL2CaDllPllCAidTracking::connect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to connect, now the tracking uses gr_sync_decimator + // nothing to connect, now the tracking uses gr_sync_decimator } @@ -208,7 +207,7 @@ void GlonassL2CaDllPllCAidTracking::disconnect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to disconnect, now the tracking uses gr_sync_decimator + // nothing to disconnect, now the tracking uses gr_sync_decimator } diff --git a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.h b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.h index 471f4c0a5..2d6f77cc6 100644 --- a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.h +++ b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.h @@ -91,6 +91,7 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void start_tracking() override; + /*! * \brief Stop running tracking */ diff --git a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.cc index 4cd8fe21f..0e97f4e4e 100644 --- a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.cc @@ -46,7 +46,7 @@ GlonassL2CaDllPllTracking::GlonassL2CaDllPllTracking( unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; - //################# CONFIGURATION PARAMETERS ######################## + // ################# CONFIGURATION PARAMETERS ######################## int fs_in; int vector_length; bool dump; @@ -75,7 +75,7 @@ GlonassL2CaDllPllTracking::GlonassL2CaDllPllTracking( dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); vector_length = std::round(fs_in / (GLONASS_L2_CA_CODE_RATE_HZ / GLONASS_L2_CA_CODE_LENGTH_CHIPS)); - //################# MAKE TRACKING GNURadio object ################### + // ################# MAKE TRACKING GNURadio object ################### if (item_type == "gr_complex") { item_size_ = sizeof(gr_complex); @@ -138,7 +138,7 @@ void GlonassL2CaDllPllTracking::connect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to connect, now the tracking uses gr_sync_decimator + // nothing to connect, now the tracking uses gr_sync_decimator } @@ -147,7 +147,7 @@ void GlonassL2CaDllPllTracking::disconnect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to disconnect, now the tracking uses gr_sync_decimator + // nothing to disconnect, now the tracking uses gr_sync_decimator } diff --git a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.h b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.h index d6e76d14e..109fa2f11 100644 --- a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.h @@ -90,6 +90,7 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void start_tracking() override; + /*! * \brief Stop running tracking */ diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc index 251982f69..a64b373f6 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc @@ -50,7 +50,7 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking( { Dll_Pll_Conf trk_param = Dll_Pll_Conf(); DLOG(INFO) << "role " << role; - //################# CONFIGURATION PARAMETERS ######################## + // ################# CONFIGURATION PARAMETERS ######################## std::string default_item_type = "gr_complex"; std::string item_type = configuration->property(role + ".item_type", default_item_type); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); @@ -170,7 +170,7 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking( trk_param.max_carrier_lock_fail = configuration->property(role + ".max_carrier_lock_fail", trk_param.max_carrier_lock_fail); trk_param.carrier_lock_th = configuration->property(role + ".carrier_lock_th", trk_param.carrier_lock_th); - //################# MAKE TRACKING GNURadio object ################### + // ################# MAKE TRACKING GNURadio object ################### if (item_type == "gr_complex") { item_size_ = sizeof(gr_complex); @@ -227,7 +227,7 @@ void GpsL1CaDllPllTracking::connect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to connect, now the tracking uses gr_sync_decimator + // nothing to connect, now the tracking uses gr_sync_decimator } @@ -236,7 +236,7 @@ void GpsL1CaDllPllTracking::disconnect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to disconnect, now the tracking uses gr_sync_decimator + // nothing to disconnect, now the tracking uses gr_sync_decimator } diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc index be266a0dd..ec3380ac2 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc @@ -51,7 +51,7 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga( { Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga(); DLOG(INFO) << "role " << role; - //################# CONFIGURATION PARAMETERS ######################## + // ################# CONFIGURATION PARAMETERS ######################## int32_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); int32_t fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); trk_param_fpga.fs_in = fs_in; @@ -177,7 +177,7 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga( uint32_t device_base = configuration->property(role + ".device_base", 3); trk_param_fpga.device_base = device_base; - //################# PRE-COMPUTE ALL THE CODES ################# + // ################# PRE-COMPUTE ALL THE CODES ################# d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS * NUM_PRNs) * sizeof(int32_t), volk_gnsssdr_get_alignment())); for (uint32_t PRN = 1; PRN <= NUM_PRNs; PRN++) { @@ -214,8 +214,7 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga( } } - - //################# MAKE TRACKING GNURadio object ################### + // ################# MAKE TRACKING GNURadio object ################### tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga); channel_ = 0; DLOG(INFO) << "tracking(" << tracking_fpga_sc->unique_id() << ")"; @@ -261,7 +260,7 @@ void GpsL1CaDllPllTrackingFpga::connect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to connect + // nothing to connect } @@ -270,7 +269,7 @@ void GpsL1CaDllPllTrackingFpga::disconnect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to disconnect + // nothing to disconnect } diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc index f4441b084..cfaa7079e 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc @@ -50,7 +50,7 @@ GpsL1CaKfTracking::GpsL1CaKfTracking( unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; - //################# CONFIGURATION PARAMETERS ######################## + // ################# CONFIGURATION PARAMETERS ######################## int order; int fs_in; int vector_length; @@ -89,7 +89,7 @@ GpsL1CaKfTracking::GpsL1CaKfTracking( bce_nu = configuration->property(role + ".bce_nu", 0); bce_kappa = configuration->property(role + ".bce_kappa", 0); - //################# MAKE TRACKING GNURadio object ################### + // ################# MAKE TRACKING GNURadio object ################### if (item_type == "gr_complex") { item_size_ = sizeof(gr_complex); @@ -115,6 +115,16 @@ GpsL1CaKfTracking::GpsL1CaKfTracking( } channel_ = 0; DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")"; + if (in_streams_ == 0) + { + in_streams_ = 1; + // Avoid compiler warning + } + if (out_streams_ == 0) + { + out_streams_ = 1; + // Avoid compiler warning + } } @@ -150,7 +160,7 @@ void GpsL1CaKfTracking::connect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to connect, now the tracking uses gr_sync_decimator + // nothing to connect, now the tracking uses gr_sync_decimator } @@ -159,7 +169,7 @@ void GpsL1CaKfTracking::disconnect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to disconnect, now the tracking uses gr_sync_decimator + // nothing to disconnect, now the tracking uses gr_sync_decimator } diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc index 08c49e24f..9935b616d 100644 --- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc @@ -49,7 +49,7 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking( { Dll_Pll_Conf trk_param = Dll_Pll_Conf(); DLOG(INFO) << "role " << role; - //################# CONFIGURATION PARAMETERS ######################## + // ################# CONFIGURATION PARAMETERS ######################## std::string default_item_type = "gr_complex"; std::string item_type = configuration->property(role + ".item_type", default_item_type); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); @@ -146,7 +146,7 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking( trk_param.max_carrier_lock_fail = configuration->property(role + ".max_carrier_lock_fail", trk_param.max_carrier_lock_fail); trk_param.carrier_lock_th = configuration->property(role + ".carrier_lock_th", trk_param.carrier_lock_th); - //################# MAKE TRACKING GNURadio object ################### + // ################# MAKE TRACKING GNURadio object ################### if (item_type == "gr_complex") { item_size_ = sizeof(gr_complex); @@ -203,7 +203,7 @@ void GpsL2MDllPllTracking::connect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to connect, now the tracking uses gr_sync_decimator + // nothing to connect, now the tracking uses gr_sync_decimator } @@ -212,7 +212,7 @@ void GpsL2MDllPllTracking::disconnect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to disconnect, now the tracking uses gr_sync_decimator + // nothing to disconnect, now the tracking uses gr_sync_decimator } diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc index 3c48a2326..88f6a1615 100644 --- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc @@ -56,7 +56,7 @@ GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga( { Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga(); DLOG(INFO) << "role " << role; - //################# CONFIGURATION PARAMETERS ######################## + // ################# CONFIGURATION PARAMETERS ######################## int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); trk_param_fpga.fs_in = fs_in; @@ -119,7 +119,7 @@ GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga( auto* ca_codes_f = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L2_M_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment())); - //################# PRE-COMPUTE ALL THE CODES ################# + // ################# PRE-COMPUTE ALL THE CODES ################# d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L2_M_CODE_LENGTH_CHIPS * NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment())); for (uint32_t PRN = 1; PRN <= NUM_PRNs; PRN++) { @@ -136,7 +136,7 @@ GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga( trk_param_fpga.code_length_chips = GPS_L2_M_CODE_LENGTH_CHIPS; trk_param_fpga.code_samples_per_chip = 1; // 1 sample per chip - //################# MAKE TRACKING GNU Radio object ################### + // ################# MAKE TRACKING GNU Radio object ################### tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga); channel_ = 0; diff --git a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc index 48f838f3f..cf2d2e17f 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc @@ -49,7 +49,7 @@ GpsL5DllPllTracking::GpsL5DllPllTracking( { Dll_Pll_Conf trk_param = Dll_Pll_Conf(); DLOG(INFO) << "role " << role; - //################# CONFIGURATION PARAMETERS ######################## + // ################# CONFIGURATION PARAMETERS ######################## std::string default_item_type = "gr_complex"; std::string item_type = configuration->property(role + ".item_type", default_item_type); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); @@ -166,7 +166,7 @@ GpsL5DllPllTracking::GpsL5DllPllTracking( trk_param.max_carrier_lock_fail = configuration->property(role + ".max_carrier_lock_fail", trk_param.max_carrier_lock_fail); trk_param.carrier_lock_th = configuration->property(role + ".carrier_lock_th", trk_param.carrier_lock_th); - //################# MAKE TRACKING GNURadio object ################### + // ################# MAKE TRACKING GNURadio object ################### if (item_type == "gr_complex") { item_size_ = sizeof(gr_complex); @@ -223,7 +223,7 @@ void GpsL5DllPllTracking::connect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to connect, now the tracking uses gr_sync_decimator + // nothing to connect, now the tracking uses gr_sync_decimator } @@ -232,7 +232,7 @@ void GpsL5DllPllTracking::disconnect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to disconnect, now the tracking uses gr_sync_decimator + // nothing to disconnect, now the tracking uses gr_sync_decimator } diff --git a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.h b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.h index ca99dba0d..966141b1f 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.h @@ -89,6 +89,7 @@ public: void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; void start_tracking() override; + /*! * \brief Stop running tracking */ diff --git a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc index cce524561..ce8f8c534 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc @@ -53,7 +53,7 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( { Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga(); DLOG(INFO) << "role " << role; - //################# CONFIGURATION PARAMETERS ######################## + // ################# CONFIGURATION PARAMETERS ######################## int32_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 12500000); int32_t fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); trk_param_fpga.fs_in = fs_in; @@ -175,7 +175,8 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( trk_param_fpga.device_name = device_name; uint32_t device_base = configuration->property(role + ".device_base", 27); trk_param_fpga.device_base = device_base; - //################# PRE-COMPUTE ALL THE CODES ################# + + // ################# PRE-COMPUTE ALL THE CODES ################# uint32_t code_samples_per_chip = 1; auto code_length_chips = static_cast(GPS_L5I_CODE_LENGTH_CHIPS); @@ -332,7 +333,7 @@ void GpsL5DllPllTrackingFpga::connect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to connect, now the tracking uses gr_sync_decimator + // nothing to connect, now the tracking uses gr_sync_decimator } @@ -341,7 +342,7 @@ void GpsL5DllPllTrackingFpga::disconnect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to disconnect, now the tracking uses gr_sync_decimator + // nothing to disconnect, now the tracking uses gr_sync_decimator } diff --git a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt index 77c9a01f5..01d9e5378 100644 --- a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt @@ -89,6 +89,7 @@ endif() target_link_libraries(tracking_gr_blocks PUBLIC Boost::boost + Armadillo::armadillo Gnuradio::blocks Matio::matio Volkgnsssdr::volkgnsssdr @@ -108,6 +109,12 @@ if(ENABLE_CUDA AND NOT CMAKE_VERSION VERSION_GREATER 3.11) ) endif() +if(CMAKE_BUILD_TYPE MATCHES Rel) + target_compile_definitions(tracking_gr_blocks + PUBLIC -DARMA_NO_BOUND_CHECKING=1 + ) +endif() + if(ENABLE_CLANG_TIDY) if(CLANG_TIDY_EXE) set_target_properties(tracking_gr_blocks diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 2cb27d4a6..dbd6eaba8 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -57,15 +57,15 @@ #include #include // for io_signature #include // for scoped_lock -#include // for Mat_VarCreate -#include // for mp +#include +#include // for Mat_VarCreate +#include // for mp #include #include // for fill_n #include #include // for fmod, round, floor #include // for exception -#include -#include // for cout, cerr +#include // for cout, cerr #include #include @@ -92,7 +92,7 @@ dll_pll_veml_tracking_sptr dll_pll_veml_make_tracking(const Dll_Pll_Conf &conf_) dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::block("dll_pll_veml_tracking", gr::io_signature::make(1, 1, sizeof(gr_complex)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { - //prevent telemetry symbols accumulation in output buffers + // prevent telemetry symbols accumulation in output buffers this->set_max_noutput_items(1); trk_parameters = conf_; // Telemetry bit synchronization message port input @@ -326,7 +326,6 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl d_symbols_per_bit = 0; } } - else { LOG(WARNING) << "Invalid System argument when instantiating tracking blocks"; @@ -545,7 +544,7 @@ void dll_pll_veml_tracking::msg_handler_telemetry_to_trk(const pmt::pmt_t &msg) { DLOG(INFO) << "Telemetry fault received in ch " << this->d_channel; gr::thread::scoped_lock lock(d_setlock); - d_carrier_lock_fail_counter = 200000; //force loss-of-lock condition + d_carrier_lock_fail_counter = 200000; // force loss-of-lock condition } } } @@ -1049,7 +1048,7 @@ void dll_pll_veml_tracking::update_tracking_vars() K_blk_samples = T_prn_samples + d_rem_code_phase_samples; d_current_prn_length_samples = static_cast(std::floor(K_blk_samples)); // round to a discrete number of samples - //################### PLL COMMANDS ################################################# + // ################### PLL COMMANDS ################################################# // carrier phase step (NCO phase increment per sample) [rads/sample] d_carrier_phase_step_rad = PI_2 * d_carrier_doppler_hz / trk_parameters.fs_in; // carrier phase rate step (NCO phase increment rate per sample) [rads/sample^2] @@ -1083,7 +1082,7 @@ void dll_pll_veml_tracking::update_tracking_vars() // std::cout << fmod(b, PI_2) / fmod(a, PI_2) << std::endl; d_acc_carrier_phase_rad -= (d_carrier_phase_step_rad * static_cast(d_current_prn_length_samples) + 0.5 * d_carrier_phase_rate_step_rad * static_cast(d_current_prn_length_samples) * static_cast(d_current_prn_length_samples)); - //################### DLL COMMANDS ################################################# + // ################### DLL COMMANDS ################################################# // code phase step (Code resampler phase increment per sample) [chips/sample] d_code_phase_step_chips = d_code_freq_chips / trk_parameters.fs_in; if (trk_parameters.high_dyn) @@ -1537,8 +1536,6 @@ void dll_pll_veml_tracking::set_channel(uint32_t channel) { try { - //trk_parameters.dump_filename.append(boost::lexical_cast(d_channel)); - //trk_parameters.dump_filename.append(".dat"); d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(dump_filename_.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << dump_filename_.c_str(); @@ -1637,10 +1634,10 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) d_P_accu = *d_Prompt; d_L_accu = *d_Late; - //fail-safe: check if the secondary code or bit synchronization has not succeeded in a limited time period + // fail-safe: check if the secondary code or bit synchronization has not succeeded in a limited time period if (trk_parameters.bit_synchronization_time_limit_s < (d_sample_counter - d_acq_sample_stamp) / static_cast(trk_parameters.fs_in)) { - d_carrier_lock_fail_counter = 300000; //force loss-of-lock condition + d_carrier_lock_fail_counter = 300000; // force loss-of-lock condition LOG(INFO) << systemName << " " << signal_pretty_name << " tracking synchronization time limit reached in channel " << d_channel << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; } @@ -1678,9 +1675,9 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) } } } - else if (d_symbols_per_bit > 1) //Signal does not have secondary code. Search a bit transition by sign change + else if (d_symbols_per_bit > 1) // Signal does not have secondary code. Search a bit transition by sign change { - //******* preamble correlation ******** + // ******* preamble correlation ******** d_Prompt_circular_buffer.push_back(*d_Prompt); if (d_Prompt_circular_buffer.size() == d_secondary_code_length) { @@ -1701,7 +1698,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) } else { - next_state = false; //keep in state 2 during pull-in transitory + next_state = false; // keep in state 2 during pull-in transitory } if (next_state) { // reset extended correlator diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc index 3801b3cdb..5ca096839 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc @@ -49,14 +49,14 @@ #include #include // for io_signature #include // for scoped_lock -#include // for Mat_VarCreate -#include // for mp +#include +#include // for Mat_VarCreate +#include // for mp #include #include // for fill_n #include // for fmod, round, floor #include // for exception -#include -#include // for cout, cerr +#include // for cout, cerr #include #include #include @@ -83,8 +83,9 @@ dll_pll_veml_tracking_fpga_sptr dll_pll_veml_make_tracking_fpga(const Dll_Pll_Co dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga &conf_) : gr::block("dll_pll_veml_tracking_fpga", gr::io_signature::make(0, 0, sizeof(lv_16sc_t)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { - //prevent telemetry symbols accumulation in output buffers + // prevent telemetry symbols accumulation in output buffers this->set_max_noutput_items(1); + trk_parameters = conf_; // Telemetry bit synchronization message port input this->message_port_register_out(pmt::mp("events")); @@ -476,7 +477,7 @@ void dll_pll_veml_tracking_fpga::msg_handler_telemetry_to_trk(const pmt::pmt_t & { DLOG(INFO) << "Telemetry fault received in ch " << this->d_channel; gr::thread::scoped_lock lock(d_setlock); - d_carrier_lock_fail_counter = 200000; //force loss-of-lock condition + d_carrier_lock_fail_counter = 200000; // force loss-of-lock condition } } } @@ -514,6 +515,7 @@ void dll_pll_veml_tracking_fpga::start_tracking() m_condition.notify_one(); } + dll_pll_veml_tracking_fpga::~dll_pll_veml_tracking_fpga() { if (d_dump_file.is_open()) @@ -606,7 +608,6 @@ bool dll_pll_veml_tracking_fpga::cn0_and_tracking_lock_status(double coh_integra float d_CN0_SNV_dB_Hz_raw = cn0_svn_estimator(d_Prompt_buffer.data(), trk_parameters.cn0_samples, static_cast(coh_integration_time_s)); d_CN0_SNV_dB_Hz = d_cn0_smoother.smooth(d_CN0_SNV_dB_Hz_raw); // Carrier lock indicator - //d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer.data(), trk_parameters.cn0_samples); d_carrier_lock_test = d_carrier_lock_test_smoother.smooth(carrier_lock_detector(d_Prompt_buffer.data(), 1)); // Loss of lock detection if (!d_pull_in_transitory) @@ -789,15 +790,12 @@ void dll_pll_veml_tracking_fpga::update_tracking_vars() // ################## CARRIER AND CODE NCO BUFFER ALIGNMENT ####################### // keep alignment parameters for the next input buffer // Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation - //T_prn_samples_prev = T_prn_samples; T_prn_samples = T_prn_seconds * trk_parameters.fs_in; - //K_blk_samples = T_prn_samples + d_rem_code_phase_samples; // initially d_rem_code_phase_samples is zero. It is updated at the end of this function K_blk_samples = T_prn_samples * d_current_fpga_integration_period + d_rem_code_phase_samples; // initially d_rem_code_phase_samples is zero. It is updated at the end of this function - auto actual_blk_length = static_cast(std::floor(K_blk_samples)); - //d_next_integration_length_samples = 2 * actual_blk_length - d_current_integration_length_samples; d_next_integration_length_samples = actual_blk_length; - //################### PLL COMMANDS ################################################# + + // ################## PLL COMMANDS ################################################# // carrier phase step (NCO phase increment per sample) [rads/sample] d_carrier_phase_step_rad = PI_2 * d_carrier_doppler_hz / trk_parameters.fs_in; // carrier phase rate step (NCO phase increment rate per sample) [rads/sample^2] @@ -831,7 +829,7 @@ void dll_pll_veml_tracking_fpga::update_tracking_vars() // std::cout << fmod(b, PI_2) / fmod(a, PI_2) << std::endl; d_acc_carrier_phase_rad -= (d_carrier_phase_step_rad * static_cast(d_current_integration_length_samples) + 0.5 * d_carrier_phase_rate_step_rad * static_cast(d_current_integration_length_samples) * static_cast(d_current_integration_length_samples)); - //################### DLL COMMANDS ################################################# + // ################## DLL COMMANDS ################################################# // code phase step (Code resampler phase increment per sample) [chips/sample] d_code_phase_step_chips = d_code_freq_chips / trk_parameters.fs_in; if (trk_parameters.high_dyn) @@ -956,7 +954,7 @@ void dll_pll_veml_tracking_fpga::save_correlation_results() else { d_P_data_accu += *d_Prompt; - //std::cout << "s[" << d_current_data_symbol << "]=" << (int)((*d_Prompt).real() > 0) << std::endl; + // std::cout << "s[" << d_current_data_symbol << "]=" << (int)((*d_Prompt).real() > 0) << std::endl; } d_current_data_symbol += d_current_fpga_integration_period; d_current_data_symbol %= d_symbols_per_bit; @@ -1301,8 +1299,6 @@ void dll_pll_veml_tracking_fpga::set_channel(uint32_t channel) { try { - //trk_parameters.dump_filename.append(boost::lexical_cast(d_channel)); - //trk_parameters.dump_filename.append(".dat"); d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(dump_filename_.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "Tracking dump enabled on channel " << d_channel << " Log file: " << dump_filename_.c_str(); @@ -1506,13 +1502,10 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un case 1: // Pull-in { d_worker_is_done = false; - - boost::mutex::scoped_lock lock(d_mutex); while (!d_worker_is_done) m_condition.wait(lock); // Signal alignment (skip samples until the incoming signal is aligned with local replica) - int64_t acq_trk_diff_samples; double acq_trk_diff_seconds; double delta_trk_to_acq_prn_start_samples; @@ -1533,7 +1526,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un else { // test mode - acq_trk_diff_samples = -static_cast(counter_value) + static_cast(d_acq_sample_stamp); acq_trk_diff_seconds = static_cast(acq_trk_diff_samples) / trk_parameters.fs_in; delta_trk_to_acq_prn_start_samples = static_cast(acq_trk_diff_samples) + d_acq_code_phase_samples; @@ -1541,9 +1533,7 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un absolute_samples_offset = static_cast(delta_trk_to_acq_prn_start_samples); } - multicorrelator_fpga->set_initial_sample(absolute_samples_offset); - //d_absolute_samples_offset = absolute_samples_offset; d_sample_counter = absolute_samples_offset; d_sample_counter_next = d_sample_counter; @@ -1568,10 +1558,10 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un std::cout << "Tracking of " << systemName << " " << signal_pretty_name << " signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; DLOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel; - // DLOG(INFO) << "Number of samples between Acquisition and Tracking = " << acq_trk_diff_samples << " ( " << acq_trk_diff_seconds << " s)"; - // std::cout << "Number of samples between Acquisition and Tracking = " << acq_trk_diff_samples << " ( " << acq_trk_diff_seconds << " s)" << std::endl; - // DLOG(INFO) << "PULL-IN Doppler [Hz] = " << d_carrier_doppler_hz - // << ". PULL-IN Code Phase [samples] = " << d_acq_code_phase_samples; + // DLOG(INFO) << "Number of samples between Acquisition and Tracking = " << acq_trk_diff_samples << " ( " << acq_trk_diff_seconds << " s)"; + // std::cout << "Number of samples between Acquisition and Tracking = " << acq_trk_diff_samples << " ( " << acq_trk_diff_seconds << " s)" << std::endl; + // DLOG(INFO) << "PULL-IN Doppler [Hz] = " << d_carrier_doppler_hz + // << ". PULL-IN Code Phase [samples] = " << d_acq_code_phase_samples; break; } @@ -1583,7 +1573,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un do_correlation_step(); // Save single correlation step variables - if (d_veml) { d_VE_accu = *d_Very_Early; @@ -1593,16 +1582,15 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un d_P_accu = *d_Prompt; d_L_accu = *d_Late; - //fail-safe: check if the secondary code or bit synchronization has not succeeded in a limited time period + // fail-safe: check if the secondary code or bit synchronization has not succeeded in a limited time period if (trk_parameters.bit_synchronization_time_limit_s < (d_sample_counter - d_acq_sample_stamp) / static_cast(trk_parameters.fs_in)) { - d_carrier_lock_fail_counter = 300000; //force loss-of-lock condition + d_carrier_lock_fail_counter = 300000; // force loss-of-lock condition LOG(INFO) << systemName << " " << signal_pretty_name << " tracking synchronization time limit reached in channel " << d_channel << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; } // Check lock status - if (!cn0_and_tracking_lock_status(d_code_period)) { clear_tracking_vars(); @@ -1643,9 +1631,9 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un } } } - else if (d_symbols_per_bit > 1) //Signal does not have secondary code. Search a bit transition by sign change + else if (d_symbols_per_bit > 1) // Signal does not have secondary code. Search a bit transition by sign change { - //******* preamble correlation ******** + // ******* preamble correlation ******** d_Prompt_circular_buffer.push_back(*d_Prompt); if (d_Prompt_circular_buffer.size() == d_secondary_code_length) { @@ -1666,7 +1654,7 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un } else { - next_state = false; //keep in state 2 during pull-in transitory + next_state = false; // keep in state 2 during pull-in transitory } if (next_state) @@ -1692,9 +1680,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un d_current_fpga_integration_period = d_fpga_integration_period; d_current_extended_correlation_in_fpga = true; - d_P_accu_old.real(d_P_accu_old.real() * d_fpga_integration_period); - d_P_accu_old.imag(d_P_accu_old.imag() * d_fpga_integration_period); - if (d_sc_demodulate_enabled) { multicorrelator_fpga->enable_secondary_codes(); @@ -1751,7 +1736,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un } } } - break; } case 3: // coherent integration (correlation time extension) @@ -1843,7 +1827,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un } break; } - case 5: // coherent integration (correlation time extension) { d_sample_counter = d_sample_counter_next; @@ -1889,8 +1872,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un break; } - - case 6: // narrow tracking IN THE FPGA { d_sample_counter = d_sample_counter_next; @@ -1956,13 +1937,15 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un } break; } + default: + break; } } if (current_synchro_data.Flag_valid_symbol_output) { current_synchro_data.fs = static_cast(trk_parameters.fs_in); - current_synchro_data.Tracking_sample_counter = d_sample_counter_next; //d_sample_counter; + current_synchro_data.Tracking_sample_counter = d_sample_counter_next; // d_sample_counter; *out[0] = current_synchro_data; return 1; } diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc index 9853e6753..a111a44ea 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc @@ -45,12 +45,12 @@ #include "tracking_discriminators.h" #include #include +#include #include #include #include #include #include -#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h index 7aa6c57cc..674ac4ae9 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h @@ -40,6 +40,10 @@ #ifndef GNSS_SDR_GPS_L1_CA_KF_TRACKING_CC_H #define GNSS_SDR_GPS_L1_CA_KF_TRACKING_CC_H +#if ARMA_NO_BOUND_CHECKING +#define ARMA_NO_DEBUG 1 +#endif + #include "bayesian_estimation.h" #include "cpu_multicorrelator_real_codes.h" #include "gnss_synchro.h" diff --git a/src/algorithms/tracking/libs/CMakeLists.txt b/src/algorithms/tracking/libs/CMakeLists.txt index 09cc778a7..c22fd8618 100644 --- a/src/algorithms/tracking/libs/CMakeLists.txt +++ b/src/algorithms/tracking/libs/CMakeLists.txt @@ -134,6 +134,12 @@ if(OS_IS_MACOSX) endif() endif() +if(CMAKE_BUILD_TYPE MATCHES Rel) + target_compile_definitions(tracking_libs + PUBLIC -DARMA_NO_BOUND_CHECKING=1 + ) +endif() + if(ENABLE_CLANG_TIDY) if(CLANG_TIDY_EXE) set_target_properties(tracking_libs diff --git a/src/algorithms/tracking/libs/bayesian_estimation.h b/src/algorithms/tracking/libs/bayesian_estimation.h index 7867afe77..77d449b11 100644 --- a/src/algorithms/tracking/libs/bayesian_estimation.h +++ b/src/algorithms/tracking/libs/bayesian_estimation.h @@ -45,6 +45,10 @@ #ifndef GNSS_SDR_BAYESIAN_ESTIMATION_H_ #define GNSS_SDR_BAYESIAN_ESTIMATION_H_ +#if ARMA_NO_BOUND_CHECKING +#define ARMA_NO_DEBUG 1 +#endif + #include #include diff --git a/src/algorithms/tracking/libs/nonlinear_tracking.h b/src/algorithms/tracking/libs/nonlinear_tracking.h index a8c853bcf..ba8f511aa 100644 --- a/src/algorithms/tracking/libs/nonlinear_tracking.h +++ b/src/algorithms/tracking/libs/nonlinear_tracking.h @@ -43,6 +43,10 @@ #ifndef GNSS_SDR_NONLINEAR_TRACKING_H_ #define GNSS_SDR_NONLINEAR_TRACKING_H_ +#if ARMA_NO_BOUND_CHECKING +#define ARMA_NO_DEBUG 1 +#endif + #include #include diff --git a/src/algorithms/tracking/libs/tcp_communication.cc b/src/algorithms/tracking/libs/tcp_communication.cc index 30809ecc6..f0b191c3e 100644 --- a/src/algorithms/tracking/libs/tcp_communication.cc +++ b/src/algorithms/tracking/libs/tcp_communication.cc @@ -32,6 +32,7 @@ #include "tcp_communication.h" #include "tcp_packet_data.h" #include +#include #include @@ -87,7 +88,7 @@ void Tcp_Communication::send_receive_tcp_packet_galileo_e1(boost::array>(); - cmd_interface_.set_msg_queue(control_queue_); //set also the queue pointer for the telecommand thread + cmd_interface_.set_msg_queue(control_queue_); // set also the queue pointer for the telecommand thread try { flowgraph_ = std::make_shared(configuration_, control_queue_); @@ -274,8 +278,8 @@ void ControlThread::event_dispatcher(bool &valid_event, pmt::pmt_t &msg) { if (receiver_on_standby_ == false) { - //perform non-priority tasks - flowgraph_->acquisition_manager(0); //start acquisition of untracked satellites + // perform non-priority tasks + flowgraph_->acquisition_manager(0); // start acquisition of untracked satellites } } } @@ -342,9 +346,9 @@ int ControlThread::run() pmt::pmt_t msg; while (flowgraph_->running() && !stop_) { - //read event messages, triggered by event signaling with a 100 ms timeout to perform low priority receiver management tasks + // read event messages, triggered by event signaling with a 100 ms timeout to perform low priority receiver management tasks bool valid_event = control_queue_->timed_wait_and_pop(msg, 100); - //call the new sat dispatcher and receiver controller + // call the new sat dispatcher and receiver controller event_dispatcher(valid_event, msg); } std::cout << "Stopping GNSS-SDR, please wait!" << std::endl; @@ -618,7 +622,7 @@ bool ControlThread::read_assistance_from_XML() void ControlThread::assist_GNSS() { - //######### GNSS Assistance ################################# + // ######### GNSS Assistance ################################# // GNSS Assistance configuration bool enable_gps_supl_assistance = configuration_->property("GNSS-SDR.SUPL_gps_enabled", false); bool enable_agnss_xml = configuration_->property("GNSS-SDR.AGNSS_XML_enabled", false); diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 0c0171e18..060adfb5d 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -303,7 +303,7 @@ void GNSSFlowgraph::connect() int observable_interval_ms = static_cast(configuration_->property("GNSS-SDR.observable_interval_ms", 20)); ch_out_sample_counter = gnss_sdr_make_sample_counter(fs, observable_interval_ms, sig_conditioner_.at(0)->get_right_block()->output_signature()->sizeof_stream_item(0)); top_block_->connect(sig_conditioner_.at(0)->get_right_block(), 0, ch_out_sample_counter, 0); - top_block_->connect(ch_out_sample_counter, 0, observables_->get_left_block(), channels_count_); //extra port for the sample counter pulse + top_block_->connect(ch_out_sample_counter, 0, observables_->get_left_block(), channels_count_); // extra port for the sample counter pulse } catch (const std::exception& e) { @@ -327,7 +327,7 @@ void GNSSFlowgraph::connect() } int observable_interval_ms = static_cast(configuration_->property("GNSS-SDR.observable_interval_ms", 20)); ch_out_fpga_sample_counter = gnss_sdr_make_fpga_sample_counter(fs, observable_interval_ms); - top_block_->connect(ch_out_fpga_sample_counter, 0, observables_->get_left_block(), channels_count_); //extra port for the sample counter pulse + top_block_->connect(ch_out_fpga_sample_counter, 0, observables_->get_left_block(), channels_count_); // extra port for the sample counter pulse } catch (const std::exception& e) { @@ -353,7 +353,7 @@ void GNSSFlowgraph::connect() int observable_interval_ms = static_cast(configuration_->property("GNSS-SDR.observable_interval_ms", 20)); ch_out_sample_counter = gnss_sdr_make_sample_counter(fs, observable_interval_ms, sig_conditioner_.at(0)->get_right_block()->output_signature()->sizeof_stream_item(0)); top_block_->connect(sig_conditioner_.at(0)->get_right_block(), 0, ch_out_sample_counter, 0); - top_block_->connect(ch_out_sample_counter, 0, observables_->get_left_block(), channels_count_); //extra port for the sample counter pulse + top_block_->connect(ch_out_sample_counter, 0, observables_->get_left_block(), channels_count_); // extra port for the sample counter pulse } catch (const std::exception& e) { @@ -525,7 +525,7 @@ void GNSSFlowgraph::connect() top_block_->disconnect_all(); return; } - signal_conditioner_connected.at(selected_signal_conditioner_ID) = true; //notify that this signal conditioner is connected + signal_conditioner_connected.at(selected_signal_conditioner_ID) = true; // notify that this signal conditioner is connected DLOG(INFO) << "signal conditioner " << selected_signal_conditioner_ID << " connected to channel " << i; } #endif @@ -815,7 +815,7 @@ void GNSSFlowgraph::disconnect() // (if a signal source has more than 1 stream, then connect it to the multistream signal conditioner) if (sig_source_.at(i)->implementation() == "Raw_Array_Signal_Source") { - //Multichannel Array + // Multichannel Array for (int j = 0; j < GNSS_SDR_ARRAY_SIGNAL_CONDITIONER_CHANNELS; j++) { top_block_->disconnect(sig_source_.at(i)->get_right_block(), j, sig_conditioner_.at(i)->get_left_block(), j); @@ -1163,7 +1163,9 @@ void GNSSFlowgraph::remove_signal(const Gnss_Signal& gs) break; } } -//project Doppler from primary frequency to secondary frequency + + +// project Doppler from primary frequency to secondary frequency double GNSSFlowgraph::project_doppler(std::string searched_signal, double primary_freq_doppler_hz) { switch (mapStringValues_[searched_signal]) @@ -1182,6 +1184,7 @@ double GNSSFlowgraph::project_doppler(std::string searched_signal, double primar } } + void GNSSFlowgraph::acquisition_manager(unsigned int who) { unsigned int current_channel; @@ -1235,7 +1238,7 @@ void GNSSFlowgraph::acquisition_manager(unsigned int who) } else { - //set Doppler center to 0 Hz + // set Doppler center to 0 Hz channels_[current_channel]->assist_acquisition_doppler(0); } #ifndef ENABLE_FPGA @@ -1285,7 +1288,6 @@ void GNSSFlowgraph::acquisition_manager(unsigned int who) void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) { //todo: the acquisition events are initiated from the acquisition success or failure queued msg. If the acquisition is disabled for non-assisted secondary freq channels, the engine stops.. - std::lock_guard lock(signal_list_mutex); DLOG(INFO) << "Received " << what << " from " << who; unsigned int sat = 0; @@ -1313,7 +1315,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) } // call the acquisition manager to assign new satellite and start next acquisition (if required) acquisition_manager(who); - //push back the old signal AFTER assigning a new one to avoid selecting the same signal + // push back the old signal AFTER assigning a new one to avoid selecting the same signal if (sat == 0) { push_back_signal(gs); @@ -1468,6 +1470,15 @@ void GNSSFlowgraph::perform_hw_reset() { // a stop acquisition command causes the SW to reset the HW std::shared_ptr channel_ptr; + + for (uint32_t i = 0; i < channels_count_; i++) + { + channel_ptr = std::dynamic_pointer_cast(channels_.at(i)); + channel_ptr->tracking()->stop_tracking(); + } + + std::this_thread::sleep_for(std::chrono::milliseconds(500)); + channel_ptr = std::dynamic_pointer_cast(channels_.at(0)); channel_ptr->acquisition()->stop_acquisition(); } diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index 5b1cbb1cb..7bd3b7c2e 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -92,7 +92,7 @@ std::string TcpCmdInterface::reset(const std::vector &commandLine _ std::string response; if (control_queue_ != nullptr) { - command_event_sptr new_evnt = command_event_make(200, 1); //send the restart message (who=200,what=1) + command_event_sptr new_evnt = command_event_make(200, 1); // send the restart message (who=200,what=1) control_queue_->push(pmt::make_any(new_evnt)); response = "OK\n"; } @@ -109,7 +109,7 @@ std::string TcpCmdInterface::standby(const std::vector &commandLine std::string response; if (control_queue_ != nullptr) { - command_event_sptr new_evnt = command_event_make(300, 10); //send the standby message (who=300,what=10) + command_event_sptr new_evnt = command_event_make(300, 10); // send the standby message (who=300,what=10) control_queue_->push(pmt::make_any(new_evnt)); response = "OK\n"; } @@ -200,7 +200,7 @@ std::string TcpCmdInterface::hotstart(const std::vector &commandLin { if (control_queue_ != nullptr) { - command_event_sptr new_evnt = command_event_make(300, 12); //send the standby message (who=300,what=12) + command_event_sptr new_evnt = command_event_make(300, 12); // send the standby message (who=300,what=12) control_queue_->push(pmt::make_any(new_evnt)); response = "OK\n"; } diff --git a/src/core/system_parameters/GPS_L1_CA.h b/src/core/system_parameters/GPS_L1_CA.h index 420a49d01..fb0321b0f 100644 --- a/src/core/system_parameters/GPS_L1_CA.h +++ b/src/core/system_parameters/GPS_L1_CA.h @@ -71,9 +71,7 @@ const uint32_t GPS_L1_CA_OPT_ACQ_FS_HZ = 2000000; //!< Sampling frequency that */ const double MAX_TOA_DELAY_MS = 20; -//#define NAVIGATION_SOLUTION_RATE_MS 1000 // this cannot go here -//const double GPS_STARTOFFSET_ms = 68.802; //[ms] Initial sign. travel time (this cannot go here) -const double GPS_STARTOFFSET_MS = 60.0; +const double GPS_STARTOFFSET_MS = 68.802; // [ms] Initial signal travel time (only for old ls_pvt implementation) // OBSERVABLE HISTORY DEEP FOR INTERPOLATION const int32_t GPS_L1_CA_HISTORY_DEEP = 100; diff --git a/src/tests/unit-tests/arithmetic/code_generation_test.cc b/src/tests/unit-tests/arithmetic/code_generation_test.cc index 376d5c1f3..da8d04449 100644 --- a/src/tests/unit-tests/arithmetic/code_generation_test.cc +++ b/src/tests/unit-tests/arithmetic/code_generation_test.cc @@ -31,14 +31,9 @@ #include "gnss_signal_processing.h" #include "gps_sdr_signal_processing.h" +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif TEST(CodeGenerationTest, CodeGenGPSL1Test) diff --git a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc index 9a5f825e3..ec8e9b68a 100644 --- a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc +++ b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc @@ -32,14 +32,9 @@ #include "GPS_L1_CA.h" #include "gnss_signal_processing.h" #include +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif DEFINE_int32(size_carrier_test, 100000, "Size of the arrays used for complex carrier testing"); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc index c05fa53b1..4640cb73d 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc @@ -139,7 +139,7 @@ TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime) //create the concurrent correlator threads for (int current_thread = 0; current_thread < current_max_threads; current_thread++) { - thread_pool.push_back(std::thread(run_correlator_cpu_real_codes, + thread_pool.emplace_back(std::thread(run_correlator_cpu_real_codes, correlator_pool[current_thread], d_rem_carrier_phase_rad, d_carrier_phase_step_rad, diff --git a/src/utils/front-end-cal/front_end_cal.cc b/src/utils/front-end-cal/front_end_cal.cc index 2607c4efa..017325c4a 100644 --- a/src/utils/front-end-cal/front_end_cal.cc +++ b/src/utils/front-end-cal/front_end_cal.cc @@ -45,6 +45,7 @@ #include #include // for operator<< #include +#include #include extern Concurrent_Map global_gps_ephemeris_map; @@ -303,7 +304,7 @@ arma::vec FrontEndCal::geodetic2ecef(double phi, double lambda, double h, const } -double FrontEndCal::estimate_doppler_from_eph(unsigned int PRN, double TOW, double lat, double lon, double height) +double FrontEndCal::estimate_doppler_from_eph(unsigned int PRN, double TOW, double lat, double lon, double height) noexcept(false) { int num_secs = 10; double step_secs = 0.5; @@ -359,7 +360,7 @@ double FrontEndCal::estimate_doppler_from_eph(unsigned int PRN, double TOW, doub mean_Doppler_Hz = arma::mean(Doppler_Hz); return mean_Doppler_Hz; } - throw(1); + throw std::runtime_error("1"); } diff --git a/src/utils/front-end-cal/front_end_cal.h b/src/utils/front-end-cal/front_end_cal.h index 07022e505..5f23311b9 100644 --- a/src/utils/front-end-cal/front_end_cal.h +++ b/src/utils/front-end-cal/front_end_cal.h @@ -65,7 +65,7 @@ public: * 3- Approximate receiver Latitude and Longitude (WGS-84) * */ - double estimate_doppler_from_eph(unsigned int PRN, double TOW, double lat, double lon, double height); + double estimate_doppler_from_eph(unsigned int PRN, double TOW, double lat, double lon, double height) noexcept(false); /*! * \brief This function models the Elonics E4000 + RTL2832 front-end diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index efd752206..51eace09d 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -121,7 +121,6 @@ private: public: int rx_message; - ~FrontEndCal_msg_rx() override; //!< Default destructor }; @@ -155,9 +154,6 @@ FrontEndCal_msg_rx::FrontEndCal_msg_rx() : gr::block("FrontEndCal_msg_rx", gr::i } -FrontEndCal_msg_rx::~FrontEndCal_msg_rx() = default; - - void wait_message() { while (!stop) @@ -574,7 +570,7 @@ int main(int argc, char** argv) { std::cout << "Exception caught while reading ephemeris" << std::endl; } - catch (int ex) + catch (const std::exception& ex) { std::cout << " " << it.first << " " << it.second << " (Eph not found)" << std::endl; } @@ -623,7 +619,7 @@ int main(int argc, char** argv) { std::cout << "Exception caught while reading ephemeris" << std::endl; } - catch (int ex) + catch (const std::exception& ex) { std::cout << " " << it.first << " " << it.second - mean_f_if_Hz << " (Eph not found)" << std::endl; }