From 1e19fd9aff05d1cfaea69792bd23261d4cc4318b Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 12 Nov 2021 17:01:29 +0100 Subject: [PATCH] Add IGM01, IGM02, IGM03 and IGM05 messages to the Rtcm_Printer --- src/algorithms/PVT/libs/rtcm_printer.cc | 81 ++++++++++++++++++++++++- src/algorithms/PVT/libs/rtcm_printer.h | 7 ++- 2 files changed, 86 insertions(+), 2 deletions(-) diff --git a/src/algorithms/PVT/libs/rtcm_printer.cc b/src/algorithms/PVT/libs/rtcm_printer.cc index ef69509ee..a562c14a9 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.cc +++ b/src/algorithms/PVT/libs/rtcm_printer.cc @@ -1462,6 +1462,40 @@ void Rtcm_Printer::Print_Rtcm_Messages(const Rtklib_Solver* pvt_solver, } +void Rtcm_Printer::Print_IGM_Messages(const Galileo_HAS_data& has_data) +{ + try + { + if (has_data.header.orbit_correction_flag && has_data.header.clock_fullset_flag) + { + Print_IGM03(has_data); + } + if (has_data.header.orbit_correction_flag && !has_data.header.clock_fullset_flag) + { + Print_IGM01(has_data); + } + if (!has_data.header.orbit_correction_flag && has_data.header.clock_fullset_flag) + { + Print_IGM02(has_data); + } + if (has_data.header.code_bias_flag) + { + Print_IGM05(has_data); + } + } + catch (const boost::exception& ex) + { + std::cout << "RTCM boost exception: " << boost::diagnostic_information(ex) << '\n'; + LOG(ERROR) << "RTCM boost exception: " << boost::diagnostic_information(ex); + } + catch (const std::exception& ex) + { + std::cout << "RTCM std exception: " << ex.what() << '\n'; + LOG(ERROR) << "RTCM std exception: " << ex.what(); + } +} + + bool Rtcm_Printer::Print_Rtcm_MT1001(const Gps_Ephemeris& gps_eph, double obs_time, const std::map& observables) { const std::string m1001 = rtcm->print_MT1001(gps_eph, obs_time, observables, station_id); @@ -1601,7 +1635,7 @@ bool Rtcm_Printer::Print_Rtcm_MSM(uint32_t msm_number, const Gps_Ephemeris& gps_ } -bool Rtcm_Printer::Print_Rtcm_IGM01(const Galileo_HAS_data& has_data) +bool Rtcm_Printer::Print_IGM01(const Galileo_HAS_data& has_data) { const std::vector msgs = rtcm->print_IGM01(has_data); if (msgs.empty()) @@ -1616,6 +1650,51 @@ bool Rtcm_Printer::Print_Rtcm_IGM01(const Galileo_HAS_data& has_data) } +bool Rtcm_Printer::Print_IGM02(const Galileo_HAS_data& has_data) +{ + const std::vector msgs = rtcm->print_IGM02(has_data); + if (msgs.empty()) + { + return false; + } + for (const auto& s : msgs) + { + Rtcm_Printer::Print_Message(s); + } + return true; +} + + +bool Rtcm_Printer::Print_IGM03(const Galileo_HAS_data& has_data) +{ + const std::vector msgs = rtcm->print_IGM03(has_data); + if (msgs.empty()) + { + return false; + } + for (const auto& s : msgs) + { + Rtcm_Printer::Print_Message(s); + } + return true; +} + + +bool Rtcm_Printer::Print_IGM05(const Galileo_HAS_data& has_data) +{ + const std::vector msgs = rtcm->print_IGM05(has_data); + if (msgs.empty()) + { + return false; + } + for (const auto& s : msgs) + { + Rtcm_Printer::Print_Message(s); + } + return true; +} + + int Rtcm_Printer::init_serial(const std::string& serial_device) { /* diff --git a/src/algorithms/PVT/libs/rtcm_printer.h b/src/algorithms/PVT/libs/rtcm_printer.h index 7b3fdacbe..66a5959b4 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.h +++ b/src/algorithms/PVT/libs/rtcm_printer.h @@ -99,6 +99,8 @@ public: */ uint32_t lock_time(const Glonass_Gnav_Ephemeris& eph, double obs_time, const Gnss_Synchro& gnss_synchro); + void Print_IGM_Messages(const Galileo_HAS_data& has_data); + std::string print_MT1005_test(); //!< For testing purposes private: @@ -179,7 +181,10 @@ private: bool divergence_free, bool more_messages); - bool Print_Rtcm_IGM01(const Galileo_HAS_data& has_data); // SSR Orbit Corrections + bool Print_IGM01(const Galileo_HAS_data& has_data); // SSR Orbit Corrections + bool Print_IGM02(const Galileo_HAS_data& has_data); // SSR Clock Corrections + bool Print_IGM03(const Galileo_HAS_data& has_data); // SSR Combined Orbit & Clock Corrections + bool Print_IGM05(const Galileo_HAS_data& has_data); // SSR Bias Corrections int32_t init_serial(const std::string& serial_device); // serial port control void close_serial() const;