From 7cd99e4b2b4157274b35bad8d7b522bdfd55e1e4 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 7 Nov 2024 13:02:00 +0100 Subject: [PATCH] Print IODref in clock correction HAS message --- src/algorithms/PVT/libs/has_simple_printer.cc | 6 +++++- src/core/libs/galileo_e6_has_msg_receiver.cc | 6 ++++++ src/core/libs/galileo_e6_has_msg_receiver.h | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/algorithms/PVT/libs/has_simple_printer.cc b/src/algorithms/PVT/libs/has_simple_printer.cc index 01cb7143d..d57aeb281 100644 --- a/src/algorithms/PVT/libs/has_simple_printer.cc +++ b/src/algorithms/PVT/libs/has_simple_printer.cc @@ -246,7 +246,7 @@ bool Has_Simple_Printer::print_message(const Galileo_HAS_data* const has_data) d_has_file << indent << indent << "Orbit Corrections Block\n"; d_has_file << indent << indent << "-----------------------\n"; d_has_file << indent << indent << "Validity interval [s]: " << static_cast(has_data->get_validity_interval_s(has_data->validity_interval_index_orbit_corrections)) << '\n'; - d_has_file << indent << indent << "GNSS IOD: " << print_vector(has_data->gnss_iod) << '\n'; + d_has_file << indent << indent << "GNSS IODref: " << print_vector(has_data->gnss_iod) << '\n'; d_has_file << indent << indent << "Delta Radial [m]: " << print_vector(has_data->delta_radial, HAS_MSG_DELTA_RADIAL_SCALE_FACTOR) << '\n'; d_has_file << indent << indent << "Delta In-Track [m]: " << print_vector(has_data->delta_in_track, HAS_MSG_DELTA_IN_TRACK_SCALE_FACTOR) << '\n'; d_has_file << indent << indent << "Delta Cross Track [m]: " << print_vector(has_data->delta_cross_track, HAS_MSG_DELTA_CROSS_TRACK_SCALE_FACTOR) << '\n'; @@ -258,6 +258,10 @@ bool Has_Simple_Printer::print_message(const Galileo_HAS_data* const has_data) d_has_file << indent << indent << "Clock Full-set Corrections Block\n"; d_has_file << indent << indent << "--------------------------------\n"; d_has_file << indent << indent << "Validity interval [s]: " << static_cast(has_data->get_validity_interval_s(has_data->validity_interval_index_clock_fullset_corrections)) << '\n'; + if (!has_data->gnss_iod.empty()) + { + d_has_file << indent << indent << "GNSS IODref: " << print_vector(has_data->gnss_iod) << '\n'; + } d_has_file << indent << indent << "Delta Clock Multiplier: " << print_vector(has_data->delta_clock_multiplier) << '\n'; d_has_file << indent << indent << "Delta Clock Correction [m]: " << print_vector(has_data->delta_clock_correction, HAS_MSG_DELTA_CLOCK_SCALE_FACTOR) << '\n'; } diff --git a/src/core/libs/galileo_e6_has_msg_receiver.cc b/src/core/libs/galileo_e6_has_msg_receiver.cc index db0dc3fd7..250e599a4 100644 --- a/src/core/libs/galileo_e6_has_msg_receiver.cc +++ b/src/core/libs/galileo_e6_has_msg_receiver.cc @@ -635,6 +635,7 @@ void galileo_e6_has_msg_receiver::read_MT1_body(const std::string& message_body) } } + d_iod_ref_map[std::make_pair(d_HAS_data.header.iod_set_id, d_HAS_data.header.mask_id)] = d_HAS_data.gnss_iod; DLOG(INFO) << debug_print_vector("gnss_iod", d_HAS_data.gnss_iod); DLOG(INFO) << debug_print_vector("delta_radial", d_HAS_data.delta_radial); DLOG(INFO) << debug_print_vector("delta_in_track", d_HAS_data.delta_in_track); @@ -660,6 +661,11 @@ void galileo_e6_has_msg_receiver::read_MT1_body(const std::string& message_body) d_HAS_data.delta_clock_correction[i] = read_has_message_body_int16(message.substr(0, HAS_MSG_DELTA_CLOCK_CORRECTION_LENGTH)); message = std::string(message.begin() + HAS_MSG_DELTA_CLOCK_CORRECTION_LENGTH, message.end()); } + auto ref_it = d_iod_ref_map.find(std::make_pair(d_HAS_data.header.iod_set_id, d_HAS_data.header.mask_id)); + if (ref_it != d_iod_ref_map.end()) + { + d_HAS_data.gnss_iod = ref_it->second; + } DLOG(INFO) << debug_print_vector("delta_clock_multiplier", d_HAS_data.delta_clock_multiplier); DLOG(INFO) << debug_print_vector("delta_clock_correction", d_HAS_data.delta_clock_correction); diff --git a/src/core/libs/galileo_e6_has_msg_receiver.h b/src/core/libs/galileo_e6_has_msg_receiver.h index e564ecdc7..8c42c806b 100644 --- a/src/core/libs/galileo_e6_has_msg_receiver.h +++ b/src/core/libs/galileo_e6_has_msg_receiver.h @@ -28,6 +28,7 @@ #include // for pmt::pmt_t #include #include +#include #include // for std::unique_ptr #include #include // std::pair @@ -108,6 +109,8 @@ private: std::vector d_nsys_in_mask; std::vector> d_nav_message_mask; + std::map, std::vector> d_iod_ref_map; + uint8_t d_current_has_status{}; uint8_t d_current_message_id{}; bool d_new_message{};