From 0dbecdaa8065f30ff0116e36e8c97fece2f7332f Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 15 May 2022 13:43:59 +0200 Subject: [PATCH] Use naming as in HAS SIS ICD 1.0, document sources --- src/algorithms/PVT/libs/has_simple_printer.cc | 22 ++-- src/algorithms/PVT/libs/rtcm.cc | 4 +- src/core/libs/galileo_e6_has_msg_receiver.cc | 56 ++++---- src/core/system_parameters/Galileo_CNAV.h | 121 +++++++++--------- .../system_parameters/galileo_has_data.cc | 32 ++--- src/core/system_parameters/galileo_has_data.h | 70 +++++----- .../system-parameters/has_decoding_test.cc | 4 +- 7 files changed, 156 insertions(+), 153 deletions(-) diff --git a/src/algorithms/PVT/libs/has_simple_printer.cc b/src/algorithms/PVT/libs/has_simple_printer.cc index cf526a2a2..e29df9809 100644 --- a/src/algorithms/PVT/libs/has_simple_printer.cc +++ b/src/algorithms/PVT/libs/has_simple_printer.cc @@ -249,9 +249,9 @@ bool Has_Simple_Printer::print_message(const Galileo_HAS_data* const has_data) d_has_file << '\n'; d_has_file << indent << indent << "Clock Full-set Corrections Block\n"; d_has_file << indent << indent << "--------------------------------\n"; - d_has_file << indent << indent << "Validity interval: " << static_cast(has_data->validity_interval_index_clock_fullset_corrections) << '\n'; - d_has_file << indent << indent << "Delta Clock C0 Multiplier: " << print_vector(has_data->delta_clock_c0_multiplier) << '\n'; - d_has_file << indent << indent << "Delta Clock C0 [m]: " << print_vector(has_data->delta_clock_c0, HAS_MSG_DELTA_CLOCK_SCALE_FACTOR) << '\n'; + d_has_file << indent << indent << "Validity interval: " << static_cast(has_data->validity_interval_index_clock_fullset_corrections) << '\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'; } if (has_data->header.clock_subset_flag == true) @@ -260,12 +260,12 @@ bool Has_Simple_Printer::print_message(const Galileo_HAS_data* const has_data) d_has_file << indent << indent << "Clock Subset Corrections Block\n"; d_has_file << indent << indent << "------------------------------\n"; d_has_file << indent << indent << "Validity interval: " << static_cast(has_data->validity_interval_index_clock_subset_corrections) << '\n'; - d_has_file << indent << indent << "Nsysprime: " << static_cast(has_data->Nsysprime) << '\n'; + d_has_file << indent << indent << "Nsys_sub: " << static_cast(has_data->Nsys_sub) << '\n'; d_has_file << indent << indent << "GNSS ID: " << print_vector(has_data->gnss_id_clock_subset) << '\n'; - d_has_file << indent << indent << "Delta Clock C0 Multiplier: " << print_vector(has_data->delta_clock_c0_multiplier_clock_subset) << '\n'; + d_has_file << indent << indent << "Delta Clock Multiplier: " << print_vector(has_data->delta_clock_multiplier_clock_subset) << '\n'; d_has_file << indent << indent << "Satellite sub-mask: "; - int Nsatprime = 0; - for (uint8_t k = 0; k < has_data->Nsysprime; k++) + int Nsat_sub = 0; + for (uint8_t k = 0; k < has_data->Nsys_sub; k++) { auto it = std::find(has_data->gnss_id_mask.begin(), has_data->gnss_id_mask.end(), has_data->gnss_id_clock_subset[k]); if (it != has_data->gnss_id_mask.end()) @@ -290,14 +290,14 @@ bool Has_Simple_Printer::print_message(const Galileo_HAS_data* const has_data) mask <<= 1; } d_has_file << binary << " "; - Nsatprime += std::count(binary.begin(), binary.end(), '1'); + Nsat_sub += std::count(binary.begin(), binary.end(), '1'); } } d_has_file << '\n'; - d_has_file << " Nsat in subset = " << Nsatprime << '\n'; - const std::string text("Delta Clock C0 [m]: "); + d_has_file << " Nsat in subset = " << Nsat_sub << '\n'; + const std::string text("Delta Clock Correction [m]: "); const std::string filler(indent.length() * 2 + text.length(), ' '); - d_has_file << indent << indent << text << print_matrix(has_data->delta_clock_c0_clock_subset, filler, HAS_MSG_DELTA_CLOCK_SCALE_FACTOR); + d_has_file << indent << indent << text << print_matrix(has_data->delta_clock_correction_clock_subset, filler, HAS_MSG_DELTA_CLOCK_SCALE_FACTOR); } if (has_data->header.code_bias_flag == true) diff --git a/src/algorithms/PVT/libs/rtcm.cc b/src/algorithms/PVT/libs/rtcm.cc index 4bf7daf26..5beb3d9ea 100644 --- a/src/algorithms/PVT/libs/rtcm.cc +++ b/src/algorithms/PVT/libs/rtcm.cc @@ -3553,7 +3553,7 @@ std::string Rtcm::get_IGM02_content_sat(const Galileo_HAS_data& has_data, uint8_ std::vector prn = has_data.get_PRNs_in_mask(nsys_index); - std::vector delta_clock_c0 = has_data.get_delta_clock_c0_m(nsys_index); + std::vector delta_clock_c0 = has_data.get_delta_clock_correction_m(nsys_index); std::vector delta_clock_c1(num_sats_in_this_system); std::vector delta_clock_c2(num_sats_in_this_system); @@ -3629,7 +3629,7 @@ std::string Rtcm::get_IGM03_content_sat(const Galileo_HAS_data& has_data, uint8_ std::vector delta_orbit_radial_m = has_data.get_delta_radial_m(nsys_index); std::vector delta_orbit_in_track_m = has_data.get_delta_in_track_m(nsys_index); std::vector delta_orbit_cross_track_m = has_data.get_delta_cross_track_m(nsys_index); - std::vector delta_clock_c0 = has_data.get_delta_clock_c0_m(nsys_index); + std::vector delta_clock_c0 = has_data.get_delta_clock_correction_m(nsys_index); std::vector delta_clock_c1(num_sats_in_this_system); std::vector delta_clock_c2(num_sats_in_this_system); diff --git a/src/core/libs/galileo_e6_has_msg_receiver.cc b/src/core/libs/galileo_e6_has_msg_receiver.cc index cf2ddcaa9..53fc3d6bc 100644 --- a/src/core/libs/galileo_e6_has_msg_receiver.cc +++ b/src/core/libs/galileo_e6_has_msg_receiver.cc @@ -634,22 +634,22 @@ void galileo_e6_has_msg_receiver::read_MT1_body(const std::string& message_body) d_HAS_data.validity_interval_index_clock_fullset_corrections = read_has_message_body_uint8(message.substr(0, HAS_MSG_VALIDITY_INDEX_LENGTH)); message = std::string(message.begin() + HAS_MSG_VALIDITY_INDEX_LENGTH, message.end()); - d_HAS_data.delta_clock_c0_multiplier = std::vector(d_HAS_data.Nsys); + d_HAS_data.delta_clock_multiplier = std::vector(d_HAS_data.Nsys); for (uint8_t i = 0; i < d_HAS_data.Nsys; i++) { - d_HAS_data.delta_clock_c0_multiplier[i] = read_has_message_body_uint8(message.substr(0, HAS_MSG_DELTA_CLOCK_C0_MULTIPLIER_LENGTH)) + 1; // b00 means x1, b01 means x2, etc - message = std::string(message.begin() + HAS_MSG_DELTA_CLOCK_C0_MULTIPLIER_LENGTH, message.end()); + d_HAS_data.delta_clock_multiplier[i] = read_has_message_body_uint8(message.substr(0, HAS_MSG_DELTA_CLOCK_MULTIPLIER_LENGTH)) + 1; // b00 means x1, b01 means x2, etc + message = std::string(message.begin() + HAS_MSG_DELTA_CLOCK_MULTIPLIER_LENGTH, message.end()); } - d_HAS_data.delta_clock_c0 = std::vector(Nsat); + d_HAS_data.delta_clock_correction = std::vector(Nsat); for (int i = 0; i < Nsat; i++) { - d_HAS_data.delta_clock_c0[i] = read_has_message_body_int16(message.substr(0, HAS_MSG_DELTA_CLOCK_C0_LENGTH)); - message = std::string(message.begin() + HAS_MSG_DELTA_CLOCK_C0_LENGTH, message.end()); + 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()); } - DLOG(INFO) << debug_print_vector("delta_clock_c0_multiplier", d_HAS_data.delta_clock_c0_multiplier); - DLOG(INFO) << debug_print_vector("delta_clock_c0", d_HAS_data.delta_clock_c0); + 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); } if (d_HAS_data.header.clock_subset_flag && have_mask) @@ -658,28 +658,28 @@ void galileo_e6_has_msg_receiver::read_MT1_body(const std::string& message_body) d_HAS_data.validity_interval_index_clock_subset_corrections = read_has_message_body_uint8(message.substr(0, HAS_MSG_VALIDITY_INDEX_LENGTH)); message = std::string(message.begin() + HAS_MSG_VALIDITY_INDEX_LENGTH, message.end()); - d_HAS_data.Nsysprime = read_has_message_body_uint8(message.substr(0, HAS_MSG_NSYSPRIME_LENGTH)); - message = std::string(message.begin() + HAS_MSG_NSYSPRIME_LENGTH, message.end()); + d_HAS_data.Nsys_sub = read_has_message_body_uint8(message.substr(0, HAS_MSG_NSYS_SUB_LENGTH)); + message = std::string(message.begin() + HAS_MSG_NSYS_SUB_LENGTH, message.end()); - if (d_HAS_data.Nsysprime == 0) + if (d_HAS_data.Nsys_sub == 0) { // wrong data format, aborting have_mask = false; d_nsat_in_mask_id[d_HAS_data.header.mask_id] = 0; } - d_HAS_data.gnss_id_clock_subset = std::vector(d_HAS_data.Nsysprime); - d_HAS_data.delta_clock_c0_multiplier_clock_subset = std::vector(d_HAS_data.Nsysprime); - d_HAS_data.satellite_submask = std::vector(d_HAS_data.Nsysprime); - d_HAS_data.delta_clock_c0_clock_subset = std::vector>(d_HAS_data.Nsysprime, std::vector()); + d_HAS_data.gnss_id_clock_subset = std::vector(d_HAS_data.Nsys_sub); + d_HAS_data.delta_clock_multiplier_clock_subset = std::vector(d_HAS_data.Nsys_sub); + d_HAS_data.satellite_submask = std::vector(d_HAS_data.Nsys_sub); + d_HAS_data.delta_clock_correction_clock_subset = std::vector>(d_HAS_data.Nsys_sub, std::vector()); - for (uint8_t i = 0; i < d_HAS_data.Nsysprime; i++) + for (uint8_t i = 0; i < d_HAS_data.Nsys_sub; i++) { d_HAS_data.gnss_id_clock_subset[i] = read_has_message_body_uint8(message.substr(0, HAS_MSG_ID_CLOCK_SUBSET_LENGTH)); message = std::string(message.begin() + HAS_MSG_ID_CLOCK_SUBSET_LENGTH, message.end()); uint8_t clock_multiplier = read_has_message_body_uint8(message.substr(0, HAS_MSG_DELTA_CLOCK_MULTIPLIER_SUBSET_LENGTH)); - d_HAS_data.delta_clock_c0_multiplier_clock_subset[i] = clock_multiplier + 1; // b00 means x1, b01 means x2, etc + d_HAS_data.delta_clock_multiplier_clock_subset[i] = clock_multiplier + 1; // b00 means x1, b01 means x2, etc message = std::string(message.begin() + HAS_MSG_DELTA_CLOCK_MULTIPLIER_SUBSET_LENGTH, message.end()); // find the satellite mask corresponding to this GNSS ID @@ -711,22 +711,22 @@ void galileo_e6_has_msg_receiver::read_MT1_body(const std::string& message_body) } aux <<= 1; } - int Nsatprime = std::count(binary.begin(), binary.end(), '1'); - d_HAS_data.delta_clock_c0_clock_subset[i].reserve(Nsatprime); + int Nsat_sub = std::count(binary.begin(), binary.end(), '1'); + d_HAS_data.delta_clock_correction_clock_subset[i].reserve(Nsat_sub); - // Read Nsatprime values of delta_clock_c0_clock_subset - for (int j = 0; j < Nsatprime; j++) + // Read Nsat_sub values of delta_clock_correction_clock_subset + for (int j = 0; j < Nsat_sub; j++) { - d_HAS_data.delta_clock_c0_clock_subset[i][j] = read_has_message_body_int16(message.substr(0, HAS_MSG_DELTA_CLOCK_C0_SUBSET_LENGTH)); - message = std::string(message.begin() + HAS_MSG_DELTA_CLOCK_C0_SUBSET_LENGTH, message.end()); + d_HAS_data.delta_clock_correction_clock_subset[i][j] = read_has_message_body_int16(message.substr(0, HAS_MSG_DELTA_CLOCK_CORRECTION_SUBSET_LENGTH)); + message = std::string(message.begin() + HAS_MSG_DELTA_CLOCK_CORRECTION_SUBSET_LENGTH, message.end()); } } - DLOG(INFO) << "Nsysprime: " << static_cast(d_HAS_data.Nsysprime); - DLOG(INFO) << (d_HAS_data.Nsysprime == 0 ? "" : debug_print_vector("gnss_id_clock_subset", d_HAS_data.gnss_id_clock_subset)); - DLOG(INFO) << (d_HAS_data.Nsysprime == 0 ? "" : debug_print_vector("delta_clock_c0_multiplier_clock_subset", d_HAS_data.delta_clock_c0_multiplier_clock_subset)); - DLOG(INFO) << (d_HAS_data.Nsysprime == 0 ? "" : debug_print_vector("satellite_submask", d_HAS_data.satellite_submask)); - DLOG(INFO) << (d_HAS_data.Nsysprime == 0 ? "" : debug_print_matrix("delta_clock_c0_clock_subset", d_HAS_data.delta_clock_c0_clock_subset)); + DLOG(INFO) << "Nsys_sub: " << static_cast(d_HAS_data.Nsys_sub); + DLOG(INFO) << (d_HAS_data.Nsys_sub == 0 ? "" : debug_print_vector("gnss_id_clock_subset", d_HAS_data.gnss_id_clock_subset)); + DLOG(INFO) << (d_HAS_data.Nsys_sub == 0 ? "" : debug_print_vector("delta_clock_multiplier_clock_subset", d_HAS_data.delta_clock_multiplier_clock_subset)); + DLOG(INFO) << (d_HAS_data.Nsys_sub == 0 ? "" : debug_print_vector("satellite_submask", d_HAS_data.satellite_submask)); + DLOG(INFO) << (d_HAS_data.Nsys_sub == 0 ? "" : debug_print_matrix("delta_clock_correction_clock_subset", d_HAS_data.delta_clock_correction_clock_subset)); } if (d_HAS_data.header.code_bias_flag && have_mask) diff --git a/src/core/system_parameters/Galileo_CNAV.h b/src/core/system_parameters/Galileo_CNAV.h index 280a3999c..226b1d888 100644 --- a/src/core/system_parameters/Galileo_CNAV.h +++ b/src/core/system_parameters/Galileo_CNAV.h @@ -29,73 +29,74 @@ /** \addtogroup System_Parameters * \{ */ -// Galileo CNAV message structure -constexpr int32_t GALILEO_CNAV_SYMBOLS_PER_PAGE = 1000; //!< Total numer of symbols per HAS page including the sync pattern -constexpr int32_t GALILEO_CNAV_PREAMBLE_PERIOD_SYMBOLS = 1000; -constexpr int32_t GALILEO_CNAV_PAGE_MS = 1; //!< Duration in ms of a CNAV page -constexpr int32_t GALILEO_CNAV_INTERLEAVER_ROWS = 8; -constexpr int32_t GALILEO_CNAV_INTERLEAVER_COLS = 123; -constexpr int32_t GALILEO_CNAV_TELEMETRY_RATE_BITS_SECOND = 1000; // bps -constexpr int32_t GALILEO_CNAV_HAS_PAGE_DATA_BITS = 448; -constexpr int32_t GALILEO_CNAV_PAGE_RESERVED_BITS = 14; -constexpr int32_t GALILEO_CNAV_BITS_FOR_CRC = GALILEO_CNAV_HAS_PAGE_DATA_BITS + GALILEO_CNAV_PAGE_RESERVED_BITS; // 462 -constexpr int32_t GALILEO_CNAV_BYTES_FOR_CRC = 58; -constexpr int32_t GALILEO_CNAV_CRC_LENGTH = 24; -constexpr int32_t GALILEO_CNAV_MESSAGE_BITS_PER_PAGE = 424; -constexpr int32_t GALILEO_CNAV_PAGE_HEADER_BITS = 24; -constexpr int32_t GALILEO_CNAV_PREAMBLE_LENGTH_BITS = 16; -constexpr int32_t GALILEO_CNAV_MAX_NUMBER_SYMBOLS_ENCODED_BLOCK = 255; -constexpr int32_t GALILEO_CNAV_MT1_HEADER_BITS = 32; -constexpr int32_t GALILEO_CNAV_OCTETS_IN_SUBPAGE = 53; -constexpr int32_t GALILEO_CNAV_INFORMATION_VECTOR_LENGTH = 32; - -constexpr char GALILEO_CNAV_PREAMBLE[17] = "1011011101110000"; - // Galileo HAS message field lengths -constexpr size_t HAS_MSG_NSYS_LENGTH = 4; -constexpr size_t HAS_MSG_ID_MASK_LENGTH = 4; -constexpr size_t HAS_MSG_SATELLITE_MASK_LENGTH = 40; -constexpr size_t HAS_MSG_SIGNAL_MASK_LENGTH = 16; -constexpr size_t HAS_MSG_NAV_MESSAGE_LENGTH = 3; -constexpr size_t HAS_MSG_MASK_RESERVED_LENGTH = 6; -constexpr size_t HAS_MSG_VALIDITY_INDEX_LENGTH = 4; -constexpr size_t HAS_MSG_IOD_GPS_LENGTH = 8; -constexpr size_t HAS_MSG_IOD_GAL_LENGTH = 10; -constexpr size_t HAS_MSG_DELTA_RADIAL_LENGTH = 13; -constexpr size_t HAS_MSG_DELTA_IN_TRACK_LENGTH = 12; -constexpr size_t HAS_MSG_DELTA_CROSS_TRACK_LENGTH = 12; -constexpr size_t HAS_MSG_DELTA_CLOCK_C0_MULTIPLIER_LENGTH = 2; -constexpr size_t HAS_MSG_DELTA_CLOCK_C0_LENGTH = 13; -constexpr size_t HAS_MSG_NSYSPRIME_LENGTH = 4; -constexpr size_t HAS_MSG_ID_CLOCK_SUBSET_LENGTH = 4; -constexpr size_t HAS_MSG_DELTA_CLOCK_MULTIPLIER_SUBSET_LENGTH = 2; -constexpr size_t HAS_MSG_DELTA_CLOCK_C0_SUBSET_LENGTH = 13; -constexpr size_t HAS_MSG_CODE_BIAS_LENGTH = 11; -constexpr size_t HAS_MSG_PHASE_BIAS_LENGTH = 11; -constexpr size_t HAS_MSG_PHASE_DISCONTINUITY_INDICATOR_LENGTH = 2; +constexpr size_t HAS_MSG_NSYS_LENGTH = 4; // HAS SIS ICD 1.0 Table 15 +constexpr size_t HAS_MSG_ID_MASK_LENGTH = 4; // HAS SIS ICD 1.0 Table 16 +constexpr size_t HAS_MSG_SATELLITE_MASK_LENGTH = 40; // HAS SIS ICD 1.0 Table 16 +constexpr size_t HAS_MSG_SIGNAL_MASK_LENGTH = 16; // HAS SIS ICD 1.0 Table 16 +constexpr size_t HAS_MSG_NAV_MESSAGE_LENGTH = 3; // HAS SIS ICD 1.0 Table 16 +constexpr size_t HAS_MSG_MASK_RESERVED_LENGTH = 6; // HAS SIS ICD 1.0 Table 15 +constexpr size_t HAS_MSG_VALIDITY_INDEX_LENGTH = 4; // HAS SIS ICD 1.0 Table 22 +constexpr size_t HAS_MSG_IOD_GPS_LENGTH = 8; // HAS SIS ICD 1.0 Table 26 +constexpr size_t HAS_MSG_IOD_GAL_LENGTH = 10; // HAS SIS ICD 1.0 Table 26 +constexpr size_t HAS_MSG_DELTA_RADIAL_LENGTH = 13; // HAS SIS ICD 1.0 Table 25 +constexpr size_t HAS_MSG_DELTA_IN_TRACK_LENGTH = 12; // HAS SIS ICD 1.0 Table 25 +constexpr size_t HAS_MSG_DELTA_CROSS_TRACK_LENGTH = 12; // HAS SIS ICD 1.0 Table 25 +constexpr size_t HAS_MSG_DELTA_CLOCK_MULTIPLIER_LENGTH = 2; // HAS SIS ICD 1.0 Table 28 +constexpr size_t HAS_MSG_DELTA_CLOCK_CORRECTION_LENGTH = 13; // HAS SIS ICD 1.0 Table 31 +constexpr size_t HAS_MSG_NSYS_SUB_LENGTH = 4; // HAS SIS ICD 1.0 Table 32 +constexpr size_t HAS_MSG_ID_CLOCK_SUBSET_LENGTH = 4; // HAS SIS ICD 1.0 Table 32 +constexpr size_t HAS_MSG_DELTA_CLOCK_MULTIPLIER_SUBSET_LENGTH = 2; // HAS SIS ICD 1.0 Table 33 +constexpr size_t HAS_MSG_DELTA_CLOCK_CORRECTION_SUBSET_LENGTH = 13; // HAS SIS ICD 1.0 Table 34 +constexpr size_t HAS_MSG_CODE_BIAS_LENGTH = 11; // HAS SIS ICD 1.0 Table 37 +constexpr size_t HAS_MSG_PHASE_BIAS_LENGTH = 11; // HAS SIS ICD 1.0 Table 40 +constexpr size_t HAS_MSG_PHASE_DISCONTINUITY_INDICATOR_LENGTH = 2; // HAS SIS ICD 1.0 Table 40 -constexpr uint64_t MAX_SECONDS_REMEMBERING_MID = 100; +constexpr uint64_t MAX_SECONDS_REMEMBERING_MID = 150; // HAS SIS ICD 1.0 Section 6.4.1 HAS Message Completion Time-out -constexpr int32_t HAS_MSG_NUMBER_MASK_IDS = 32; -constexpr int32_t HAS_MSG_NUMBER_GNSS_IDS = 16; -constexpr int32_t HAS_MSG_NUMBER_MESSAGE_IDS = 32; -constexpr int32_t HAS_MSG_NUMBER_SATELLITE_IDS = 40; -constexpr int32_t HAS_MSG_NUMBER_SIGNAL_MASKS = 16; +// Galileo CNAV message structure +constexpr int32_t GALILEO_CNAV_SYMBOLS_PER_PAGE = 1000; // Total numer of symbols per HAS page including the sync pattern +constexpr int32_t GALILEO_CNAV_PREAMBLE_PERIOD_SYMBOLS = 1000; +constexpr int32_t GALILEO_CNAV_PAGE_MS = 1; // Duration in ms of a CNAV page +constexpr int32_t GALILEO_CNAV_INTERLEAVER_ROWS = 8; // HAS SIS ICD 1.0 Table 4 +constexpr int32_t GALILEO_CNAV_INTERLEAVER_COLS = 123; // HAS SIS ICD 1.0 Table 4 +constexpr int32_t GALILEO_CNAV_TELEMETRY_RATE_BITS_SECOND = 1000; // bps +constexpr int32_t GALILEO_CNAV_HAS_PAGE_DATA_BITS = 448; // HAS SIS ICD 1.0 Table 5 +constexpr int32_t GALILEO_CNAV_PAGE_RESERVED_BITS = 14; // HAS SIS ICD 1.0 Table 5 +constexpr int32_t GALILEO_CNAV_BYTES_FOR_CRC = 58; // ceil(462 / 8) +constexpr int32_t GALILEO_CNAV_CRC_LENGTH = 24; // HAS SIS ICD 1.0 Table 5 +constexpr int32_t GALILEO_CNAV_MESSAGE_BITS_PER_PAGE = 424; // HAS SIS ICD 1.0 Table 6 +constexpr int32_t GALILEO_CNAV_PAGE_HEADER_BITS = 24; // HAS SIS ICD 1.0 Table 6 +constexpr int32_t GALILEO_CNAV_PREAMBLE_LENGTH_BITS = 16; // HAS SIS ICD 1.0 Table 5 +constexpr int32_t GALILEO_CNAV_MAX_NUMBER_SYMBOLS_ENCODED_BLOCK = 255; // HAS SIS ICD 1.0 Section 6.2 Reed-Solomon Code +constexpr int32_t GALILEO_CNAV_MT1_HEADER_BITS = 32; // HAS SIS ICD 1.0 Table 11 +constexpr int32_t GALILEO_CNAV_OCTETS_IN_SUBPAGE = 53; // HAS SIS ICD 1.0 Section 6.3 HAS Encoding and Transmission +constexpr int32_t GALILEO_CNAV_INFORMATION_VECTOR_LENGTH = 32; // HAS SIS ICD 1.0 Section 6.2 Reed-Solomon Code -constexpr float HAS_MSG_DELTA_RADIAL_SCALE_FACTOR = 0.0025; -constexpr float HAS_MSG_DELTA_IN_TRACK_SCALE_FACTOR = 0.008; -constexpr float HAS_MSG_DELTA_CROSS_TRACK_SCALE_FACTOR = 0.008; -constexpr float HAS_MSG_DELTA_CLOCK_SCALE_FACTOR = 0.0025; -constexpr float HAS_MSG_CODE_BIAS_SCALE_FACTOR = 0.02; -constexpr float HAS_MSG_PHASE_BIAS_SCALE_FACTOR = 0.01; +constexpr int32_t GALILEO_CNAV_BITS_FOR_CRC = GALILEO_CNAV_HAS_PAGE_DATA_BITS + GALILEO_CNAV_PAGE_RESERVED_BITS; // 462 -constexpr uint16_t HAS_MSG_NUMBER_MAX_TOH = 3599; +constexpr int32_t HAS_MSG_NUMBER_MASK_IDS = 32; // HAS SIS ICD 1.0 Table 13 +constexpr int32_t HAS_MSG_NUMBER_GNSS_IDS = 16; // HAS SIS ICD 1.0 Table 18 +constexpr int32_t HAS_MSG_NUMBER_MESSAGE_IDS = 32; // HAS SIS ICD 1.0 Table 8 +constexpr int32_t HAS_MSG_NUMBER_SATELLITE_IDS = 40; // HAS SIS ICD 1.0 Table 19 +constexpr int32_t HAS_MSG_NUMBER_SIGNAL_MASKS = 16; // HAS SIS ICD 1.0 Table 20 -constexpr uint8_t HAS_MSG_GPS_SYSTEM = 0; // HAS SIS ICD v1.0 Table 18 -constexpr uint8_t HAS_MSG_GALILEO_SYSTEM = 2; // HAS SIS ICD v1.0 Table 18 +constexpr float HAS_MSG_DELTA_RADIAL_SCALE_FACTOR = 0.0025; // HAS SIS ICD 1.0 Table 25 +constexpr float HAS_MSG_DELTA_IN_TRACK_SCALE_FACTOR = 0.008; // HAS SIS ICD 1.0 Table 25 +constexpr float HAS_MSG_DELTA_CROSS_TRACK_SCALE_FACTOR = 0.008; // HAS SIS ICD 1.0 Table 25 +constexpr float HAS_MSG_DELTA_CLOCK_SCALE_FACTOR = 0.0025; // HAS SIS ICD 1.0 Table 31 +constexpr float HAS_MSG_CODE_BIAS_SCALE_FACTOR = 0.02; // HAS SIS ICD 1.0 Table 37 +constexpr float HAS_MSG_PHASE_BIAS_SCALE_FACTOR = 0.01; // HAS SIS ICD 1.0 Table 40 + +constexpr uint16_t HAS_MSG_NUMBER_MAX_TOH = 3599; // HAS SIS ICD 1.0 Table 13 + +constexpr uint8_t HAS_MSG_GPS_SYSTEM = 0; // HAS SIS ICD 1.0 Table 18 +constexpr uint8_t HAS_MSG_GALILEO_SYSTEM = 2; // HAS SIS ICD 1.0 Table 18 constexpr uint8_t HAS_MSG_WRONG_SYSTEM = 255; -// HAS SIS ICD v1.0 Table 7 +constexpr char GALILEO_CNAV_PREAMBLE[17] = "1011011101110000"; // HAS SIS ICD 1.0 Section 2.3.1 + +// HAS SIS ICD 1.0 Table 7 const std::pair GALILEO_HAS_STATUS({1, 2}); const std::pair GALILEO_HAS_RESERVED({3, 2}); const std::pair GALILEO_HAS_MESSAGE_TYPE({5, 2}); @@ -103,7 +104,7 @@ const std::pair GALILEO_HAS_MESSAGE_ID({7, 5}); const std::pair GALILEO_HAS_MESSAGE_SIZE({12, 5}); const std::pair GALILEO_HAS_MESSAGE_PAGE_ID({17, 8}); -// HAS SIS ICD v1.0 Table 12 +// HAS SIS ICD 1.0 Table 12 const std::pair GALILEO_MT1_HEADER_TOH({1, 12}); const std::pair GALILEO_MT1_HEADER_MASK_FLAG({13, 1}); const std::pair GALILEO_MT1_HEADER_ORBIT_CORRECTION_FLAG({14, 1}); diff --git a/src/core/system_parameters/galileo_has_data.cc b/src/core/system_parameters/galileo_has_data.cc index 3761b6f7b..f3bb628cd 100644 --- a/src/core/system_parameters/galileo_has_data.cc +++ b/src/core/system_parameters/galileo_has_data.cc @@ -593,28 +593,28 @@ std::vector Galileo_HAS_data::get_delta_cross_track_m(uint8_t nsys) const } -std::vector Galileo_HAS_data::get_delta_clock_c0_m() const +std::vector Galileo_HAS_data::get_delta_clock_correction_m() const { - std::vector delta_clock_c0_m; - delta_clock_c0_m.reserve(this->delta_clock_c0.size()); - for (const auto& d : this->delta_clock_c0) + std::vector delta_clock_correction_m; + delta_clock_correction_m.reserve(this->delta_clock_correction.size()); + for (const auto& d : this->delta_clock_correction) { - delta_clock_c0_m.push_back(static_cast(d) * HAS_MSG_DELTA_CLOCK_SCALE_FACTOR); + delta_clock_correction_m.push_back(static_cast(d) * HAS_MSG_DELTA_CLOCK_SCALE_FACTOR); } - return delta_clock_c0_m; + return delta_clock_correction_m; } -std::vector Galileo_HAS_data::get_delta_clock_c0_m(uint8_t nsys) const +std::vector Galileo_HAS_data::get_delta_clock_correction_m(uint8_t nsys) const { - std::vector delta_clock_c0_m = this->get_delta_clock_c0_m(); + std::vector delta_clock_correction_m = this->get_delta_clock_correction_m(); if (nsys >= this->Nsys) { - return delta_clock_c0_m; + return delta_clock_correction_m; } - std::vector delta_clock_c0_m_aux; + std::vector delta_clock_correction_m_aux; uint8_t num_sats_in_this_system = this->get_num_satellites()[nsys]; - delta_clock_c0_m_aux.reserve(num_sats_in_this_system); + delta_clock_correction_m_aux.reserve(num_sats_in_this_system); size_t index = 0; for (uint8_t sys = 0; sys <= nsys; sys++) @@ -628,12 +628,12 @@ std::vector Galileo_HAS_data::get_delta_clock_c0_m(uint8_t nsys) const { for (uint8_t sat = 0; sat < num_sats_in_system; sat++) { - delta_clock_c0_m_aux.push_back(delta_clock_c0_m[index]); + delta_clock_correction_m_aux.push_back(delta_clock_correction_m[index]); index++; } } } - return delta_clock_c0_m_aux; + return delta_clock_correction_m_aux; } @@ -762,8 +762,8 @@ std::vector Galileo_HAS_data::get_systems_string() const } -uint16_t Galileo_HAS_data::get_nsatprime() const +uint16_t Galileo_HAS_data::get_nsat_sub() const { - auto Nsatprime = static_cast(this->delta_clock_c0_clock_subset.size()); - return Nsatprime; + auto Nsat_sub = static_cast(this->delta_clock_correction_clock_subset.size()); + return Nsat_sub; } diff --git a/src/core/system_parameters/galileo_has_data.h b/src/core/system_parameters/galileo_has_data.h index 5841fd200..a4a3c289e 100644 --- a/src/core/system_parameters/galileo_has_data.h +++ b/src/core/system_parameters/galileo_has_data.h @@ -44,7 +44,8 @@ struct mt1_header /*! * \brief This class is a storage for Galileo HAS message type 1, as defined in * Galileo High Accuracy Service Signal-In-Space Interface Control Document - * (HAS SIS ICD) Issue 1.0, May 2022 + * (HAS SIS ICD) Issue 1.0, May 2022. + * See https://www.gsc-europa.eu/sites/default/files/sites/all/files/Galileo_HAS_SIS_ICD_v1.0.pdf */ class Galileo_HAS_data { @@ -61,59 +62,60 @@ public: std::vector get_delta_in_track_m(uint8_t nsys) const; //!< Get delta in-track corrections in [m] for system nsys, with 0 <= nsys < Nsys std::vector get_delta_cross_track_m() const; //!< Get Nsat delta cross-track corrections in [m] std::vector get_delta_cross_track_m(uint8_t nsys) const; //!< Get delta cross-track corrections in [m] for system nsys, with 0 <= nsys < Nsys - std::vector get_delta_clock_c0_m() const; //!< Get Nsat delta clock C0 corrections in [m] - std::vector get_delta_clock_c0_m(uint8_t nsys) const; //!< Get delta clock C0 corrections in [m] for system nsys, with 0 <= nsys < Nsys + std::vector get_delta_clock_correction_m() const; //!< Get Nsat delta clock C0 corrections in [m] + std::vector get_delta_clock_correction_m(uint8_t nsys) const; //!< Get delta clock C0 corrections in [m] for system nsys, with 0 <= nsys < Nsys std::vector get_PRNs_in_mask(uint8_t nsys) const; //!< Get PRNs in mask for system nsys, with 0 <= nsys < Nsys std::vector get_PRNs_in_submask(uint8_t nsys) const; //!< Get PRNs in submask for system nsys, with 0 <= nsys < Nsys std::vector get_gnss_iod(uint8_t nsys) const; //!< Get GNSS IODs for for system nsys, with 0 <= nsys < Nsys std::vector get_num_satellites() const; //!< Get Nsys number of satellites uint16_t get_nsat() const; //!< Get total number of satellites with corrections - uint16_t get_nsatprime() const; //!< Get number of satellites in clock subset corrections - uint16_t get_validity_interval_s(uint8_t validity_interval_index) const; //!< Get validity interbal in [s] from the validity_interval_index + uint16_t get_nsat_sub() const; //!< Get number of satellites in clock subset corrections + uint16_t get_validity_interval_s(uint8_t validity_interval_index) const; //!< Get validity interval in [s] from the validity_interval_index uint8_t get_gnss_id(int nsat) const; //!< Get GNSS ID from the nsat satellite // Mask - std::vector gnss_id_mask; - std::vector satellite_mask; - std::vector signal_mask; - std::vector cell_mask_availability_flag; - std::vector>> cell_mask; - std::vector nav_message; + std::vector gnss_id_mask; //!< GNSS ID. See HAS SIS ICD 1.0 Section 5.2.1.1 + std::vector satellite_mask; //!< SatM - Satellite Mask. See HAS SIS ICD 1.0 Section 5.2.1.2 + std::vector signal_mask; //!< SigM - Signal Mask. See HAS SIS ICD 1.0 Section 5.2.1.3 + std::vector cell_mask_availability_flag; //!< CMAF - Cell Mask Availability Flag. See HAS SIS ICD 1.0 Section 5.2.1.4 + std::vector>> cell_mask; //!< CM - Cell Mask. See HAS SIS ICD 1.0 Section 5.2.1.5 + std::vector nav_message; //!< NM - Navigation Message Index. See HAS SIS ICD 1.0 Section 5.2.1.6 // Orbit corrections - std::vector gnss_iod; - std::vector delta_radial; - std::vector delta_in_track; - std::vector delta_cross_track; + std::vector gnss_iod; //!< IODref - Reference Issue of Data. See HAS SIS ICD 1.0 Table 26 + std::vector delta_radial; //!< DR - Delta Radial Correction. See HAS SIS ICD 1.0 Table 25 + std::vector delta_in_track; //!< DIT - Delta In-Track Correction. See HAS SIS ICD 1.0 Table 25 + std::vector delta_cross_track; //!< DCT - Delta Cross Correction. See HAS SIS ICD 1.0 Table 25 // Clock full-set corrections - std::vector delta_clock_c0_multiplier; - std::vector delta_clock_c0; + std::vector delta_clock_multiplier; //!< DCM - Delta Clock Multipliers. See HAS SIS ICD 1.0 Section 5.2.3.1 + std::vector delta_clock_correction; //!< DCC - Delta Clock Corrections. See HAS SIS ICD 1.0 Section 5.2.3.2 // Clock subset corrections - std::vector gnss_id_clock_subset; - std::vector delta_clock_c0_multiplier_clock_subset; - std::vector satellite_submask; - std::vector> delta_clock_c0_clock_subset; + std::vector gnss_id_clock_subset; //!< GNSS ID. Specific GNSS to which the corrections refer. See HAS SIS ICD 1.0 Section 5.2.1.1 + std::vector delta_clock_multiplier_clock_subset; //!< DCM. Multiplier for all Delta Clock corrections. See HAS SIS ICD 1.0 Section 5.2.3.1 + std::vector satellite_submask; //!< SatMsub - Satellite Subset Mask. See HAS SIS ICD 1.0 Section 5.2.4.1 + std::vector> delta_clock_correction_clock_subset; //!< DCCsub - Delta Clock Subset Corrections. See HAS SIS ICD 1.0 Section 5.2.4.1 // Code bias - std::vector> code_bias; + std::vector> code_bias; //!< CB - Code bias for the m-th signal of the n-th SV. See HAS SIS ICD 1.0 Section 5.2.5 // Phase bias - std::vector> phase_bias; - std::vector> phase_discontinuity_indicator; + std::vector> phase_bias; //!< PB - Phase bias for the m-th signal of the n-th SV. See HAS SIS ICD 1.0 Section 5.2.6 + std::vector> phase_discontinuity_indicator; //!< PDI - Phase Discontinuity Indicator. See HAS SIS ICD 1.0 Section 5.2.6. - mt1_header header; - uint8_t has_status; - uint8_t message_id; + mt1_header header; //!< MT1 Header parameters. See HAS SIS ICD 1.0 Section 5.1.1 + uint8_t has_status; //!< HASS - HAS Status (from HAS page header). See HAS SIS ICD 1.0 Section 3.1.1 + uint8_t message_id; //!< MID - Message ID (from HAS page header). See HAS SIS ICD 1.0 Section 3.1 - uint8_t Nsys; //!< Number of GNSS for which corrections are provided - uint8_t validity_interval_index_orbit_corrections; // in Orbit corrections - uint8_t validity_interval_index_clock_fullset_corrections; // in Clock full-set corrections - uint8_t validity_interval_index_clock_subset_corrections; // in Clock subset corrections - uint8_t Nsysprime; // in Clock subset corrections - uint8_t validity_interval_index_code_bias_corrections; // in Code bias - uint8_t validity_interval_index_phase_bias_corrections; // in Phase bias + uint8_t Nsys; //!< Number of GNSS for which corrections are provided. See HAS SIS ICD 1.0 Setion 5.2.1 + uint8_t Nsys_sub; //!< Number of GNSS for which corrections are provided in clock subset corrections. See HAS SIS ICD 1.0 Section 5.2.2.1 + + uint8_t validity_interval_index_orbit_corrections; //!< VI - Validity Interval Index for Orbit corrections. See HAS SIS ICD 1.0 Section 5.2.2.1 + uint8_t validity_interval_index_clock_fullset_corrections; //!< VI - Validity Interval Index for Clock full-set corrections. See HAS SIS ICD 1.0 Section 5.2.2.1 + uint8_t validity_interval_index_clock_subset_corrections; //!< VI - Validity Interval Index for Clock subset corrections. See HAS SIS ICD 1.0 Section 5.2.2.1 + uint8_t validity_interval_index_code_bias_corrections; //!< VI - Validity Interval Index for Code bias. See HAS SIS ICD 1.0 Section 5.2.2.1 + uint8_t validity_interval_index_phase_bias_corrections; //!< VI - Validity Interval Index for Phase bias. See HAS SIS ICD 1.0 Section 5.2.2.1 }; diff --git a/src/tests/unit-tests/system-parameters/has_decoding_test.cc b/src/tests/unit-tests/system-parameters/has_decoding_test.cc index def3ca4af..b4dfc5a46 100644 --- a/src/tests/unit-tests/system-parameters/has_decoding_test.cc +++ b/src/tests/unit-tests/system-parameters/has_decoding_test.cc @@ -204,8 +204,8 @@ private: std::ifstream indata; std::string sat_id; std::string page_content; - int time_instant; - bool known_test_data; + int time_instant{}; + bool known_test_data{}; };