diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index ccc6bcfac..69a3ff42a 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -203,6 +203,7 @@ Rtklib_Pvt::Rtklib_Pvt(const ConfigurationInterface* configuration, * 104 | Galileo E1B + Galileo E5a + Galileo E6B * 105 | Galileo E1B + Galileo E5b + Galileo E6B * 106 | GPS L1 C/A + Galileo E1B + Galileo E6B + * 107 | GPS L1 C/A + Galileo E6B * Skipped previous values to avoid overlapping * 500 | BeiDou B1I * 501 | BeiDou B1I + GPS L1 C/A @@ -400,6 +401,10 @@ Rtklib_Pvt::Rtklib_Pvt(const ConfigurationInterface* configuration, { pvt_output_parameters.type_of_receiver = 106; // GPS L1 C/A + Galileo E1B + Galileo E6B } + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (gal_E6_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0) && (bds_B3_count == 0)) + { + pvt_output_parameters.type_of_receiver = 107; // GPS L1 C/A + Galileo E6B + } // BeiDou B1I Receiver if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (gal_E6_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0) && (bds_B3_count == 0)) { diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 9038e8254..d64ee7054 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -709,6 +709,29 @@ void Rinex_Printer::print_rinex_annotation(const Rtklib_Solver* pvt_solver, cons d_rinex_header_written = true; // do not write header anymore } break; + case 107: // GPS L1 C/A + Galileo E6B + if (gps_ephemeris_iter != pvt_solver->gps_ephemeris_map.cend()) + { + if (galileo_ephemeris_iter != pvt_solver->galileo_ephemeris_map.cend()) + { + // we have Galileo ephemeris, maybe from assistance + const std::string gal_signal("E6"); + rinex_obs_header(obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, rx_time, gal_signal); + rinex_nav_header(navMixFile, pvt_solver->gps_iono, pvt_solver->gps_utc_model, gps_ephemeris_iter->second, pvt_solver->galileo_iono, pvt_solver->galileo_utc_model); + output_navfilename.push_back(navMixfilename); + log_rinex_nav(navMixFile, pvt_solver->gps_ephemeris_map, pvt_solver->galileo_ephemeris_map); + } + else + { + // we do not have galileo ephemeris, print only GPS data + rinex_obs_header(obsFile, gps_ephemeris_iter->second, rx_time); + rinex_nav_header(navFile, pvt_solver->gps_iono, pvt_solver->gps_utc_model, gps_ephemeris_iter->second); + output_navfilename.push_back(navfilename); + log_rinex_nav(navFile, pvt_solver->gps_ephemeris_map); + } + d_rinex_header_written = true; // do not write header anymore + } + break; case 500: // BDS B1I only if (beidou_dnav_ephemeris_iter != pvt_solver->beidou_dnav_ephemeris_map.cend()) { @@ -1196,6 +1219,34 @@ void Rinex_Printer::print_rinex_annotation(const Rtklib_Solver* pvt_solver, cons } } break; + case 107: + if (gps_ephemeris_iter != pvt_solver->gps_ephemeris_map.cend()) + { + if (galileo_ephemeris_iter != pvt_solver->galileo_ephemeris_map.cend()) + { + // we have Galileo ephemeris, maybe from assistance + log_rinex_obs(obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, rx_time, gnss_observables_map); + if (!d_rinex_header_updated and (pvt_solver->gps_utc_model.A0 != 0)) + { + update_obs_header(obsFile, pvt_solver->gps_utc_model); + update_nav_header(navMixFile, pvt_solver->gps_iono, pvt_solver->gps_utc_model, gps_ephemeris_iter->second, pvt_solver->galileo_iono, pvt_solver->galileo_utc_model); + d_rinex_header_updated = true; + } + } + else + { + // we do not have galileo ephemeris, print only GPS data + log_rinex_obs(obsFile, gps_ephemeris_iter->second, rx_time, gnss_observables_map); + if (!d_rinex_header_updated and (pvt_solver->gps_utc_model.A0 != 0)) + { + update_obs_header(obsFile, pvt_solver->gps_utc_model); + update_nav_header(navFile, pvt_solver->gps_utc_model, pvt_solver->gps_iono, gps_ephemeris_iter->second); + d_rinex_header_updated = true; + } + } + } + + break; case 500: // BDS B1I only if (beidou_dnav_ephemeris_iter != pvt_solver->beidou_dnav_ephemeris_map.cend()) { @@ -1321,6 +1372,16 @@ void Rinex_Printer::log_rinex_nav_gps_nav(int type_of_rx, const std::mapgps_ephemeris_map) + { + Print_Rtcm_MT1019(gps_eph_iter.second); + } + } + if (flag_write_RTCM_MSM_output == true) + { + const auto gps_eph_iter = pvt_solver->gps_ephemeris_map.cbegin(); + if (gps_eph_iter != pvt_solver->gps_ephemeris_map.cend()) + { + Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, rx_time, gnss_observables_map, enable_rx_clock_correction, 0, 0, false, false); + } + } + break; default: break; } @@ -1444,6 +1461,58 @@ void Rtcm_Printer::Print_Rtcm_Messages(const Rtklib_Solver* pvt_solver, } d_rtcm_writing_started = true; break; + case 107: + if (rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 + { + for (const auto& gps_eph_iter : pvt_solver->gps_ephemeris_map) + { + Print_Rtcm_MT1019(gps_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 gps_channel = 0; + int gal_channel = 0; + for (const auto& gnss_observables_iter : gnss_observables_map) + { + const std::string system(gnss_observables_iter.second.System, 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()) + { + gps_channel = 1; + } + } + } + if (gal_channel == 0) + { + if (system == "E") + { + 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_eph_iter != pvt_solver->gps_ephemeris_map.cend()) + { + 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; default: break; } diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index f84b3506b..b61b220ab 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -123,6 +123,7 @@ Rtklib_Solver::Rtklib_Solver(const rtk_t &rtk, d_rtklib_freq_index[1] = 3; break; case 106: // GPS L1 C/A + Galileo E1B + Galileo E6B + case 107: // GPS L1 C/A + Galileo E6B d_rtklib_band_index["E6"] = 1; d_rtklib_freq_index[1] = 3; break;