From 0d393dcc7e8464cc865dece4e71f258577382ebc Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 16 Sep 2022 11:27:56 +0200 Subject: [PATCH] Fix RTCM messages in the presence of E6 observables --- src/algorithms/PVT/libs/rtcm.cc | 2 + src/algorithms/PVT/libs/rtcm_printer.cc | 52 ++++++++++++++++++++++++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/src/algorithms/PVT/libs/rtcm.cc b/src/algorithms/PVT/libs/rtcm.cc index f799f81ee..7f962d4f7 100644 --- a/src/algorithms/PVT/libs/rtcm.cc +++ b/src/algorithms/PVT/libs/rtcm.cc @@ -3994,6 +3994,8 @@ std::map Rtcm::galileo_signal_map = [] { galileo_signal_map_["5I"] = 22; galileo_signal_map_["5Q"] = 23; galileo_signal_map_["5X"] = 24; + + galileo_signal_map_["E6"] = 10; return galileo_signal_map_; }(); diff --git a/src/algorithms/PVT/libs/rtcm_printer.cc b/src/algorithms/PVT/libs/rtcm_printer.cc index 34459fd48..cb07b9eea 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.cc +++ b/src/algorithms/PVT/libs/rtcm_printer.cc @@ -781,18 +781,38 @@ void Rtcm_Printer::Print_Rtcm_Messages(const Rtklib_Solver* pvt_solver, Print_Rtcm_MT1019(gps_eph_iter.second); } } + if (rtcm_MT1045_rate_ms != 0) + { + for (const auto& gal_eph_iter : pvt_solver->galileo_ephemeris_map) + { + Print_Rtcm_MT1045(gal_eph_iter.second); + } + } if (flag_write_RTCM_MSM_output == true) { + auto gal_eph_iter = pvt_solver->galileo_ephemeris_map.cbegin(); auto gps_eph_iter = pvt_solver->gps_ephemeris_map.cbegin(); + int gal_channel = 0; int gps_channel = 0; for (const auto& gnss_observables_iter : gnss_observables_map) { const std::string system(gnss_observables_iter.second.System, 1); + if (gal_channel == 0) + { + if (system == "E") + { + // This is a channel with valid GPS signal + gal_eph_iter = pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter.second.PRN); + if (gal_eph_iter != pvt_solver->galileo_ephemeris_map.cend()) + { + gal_channel = 1; + } + } + } if (gps_channel == 0) { if (system == "G") { - // This is a channel with valid GPS signal gps_eph_iter = pvt_solver->gps_ephemeris_map.find(gnss_observables_iter.second.PRN); if (gps_eph_iter != pvt_solver->gps_ephemeris_map.cend()) { @@ -805,6 +825,10 @@ void Rtcm_Printer::Print_Rtcm_Messages(const Rtklib_Solver* pvt_solver, { Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, rx_time, gnss_observables_map, enable_rx_clock_correction, 0, 0, false, false); } + if (gal_eph_iter != pvt_solver->galileo_ephemeris_map.cend()) + { + Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, rx_time, gnss_observables_map, enable_rx_clock_correction, 0, 0, false, false); + } } break; case 107: // GPS L1 C/A + Galileo E6B (print only GPS data) @@ -1386,18 +1410,38 @@ void Rtcm_Printer::Print_Rtcm_Messages(const Rtklib_Solver* pvt_solver, Print_Rtcm_MT1019(gps_eph_iter.second); } } + if (rtcm_MT1045_rate_ms != 0) + { + for (const auto& gal_eph_iter : pvt_solver->galileo_ephemeris_map) + { + Print_Rtcm_MT1045(gal_eph_iter.second); + } + } if (rtcm_MSM_rate_ms != 0) { + auto gal_eph_iter = pvt_solver->galileo_ephemeris_map.cbegin(); auto gps_eph_iter = pvt_solver->gps_ephemeris_map.cbegin(); + int gal_channel = 0; int gps_channel = 0; for (const auto& gnss_observables_iter : gnss_observables_map) { const std::string system(gnss_observables_iter.second.System, 1); + if (gal_channel == 0) + { + if (system == "E") + { + // This is a channel with valid GPS signal + gal_eph_iter = pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter.second.PRN); + if (gal_eph_iter != pvt_solver->galileo_ephemeris_map.cend()) + { + gal_channel = 1; + } + } + } if (gps_channel == 0) { if (system == "G") { - // This is a channel with valid GPS signal gps_eph_iter = pvt_solver->gps_ephemeris_map.find(gnss_observables_iter.second.PRN); if (gps_eph_iter != pvt_solver->gps_ephemeris_map.cend()) { @@ -1410,6 +1454,10 @@ void Rtcm_Printer::Print_Rtcm_Messages(const Rtklib_Solver* pvt_solver, { Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, rx_time, gnss_observables_map, enable_rx_clock_correction, 0, 0, false, false); } + if (gal_eph_iter != pvt_solver->galileo_ephemeris_map.cend()) + { + Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, rx_time, gnss_observables_map, enable_rx_clock_correction, 0, 0, false, false); + } } d_rtcm_writing_started = true; break;