mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-31 11:19:18 +00:00
Add work on Galileo E6B HAS message decoding
This commit is contained in:
parent
1feca37b4e
commit
32b7cee871
@ -206,6 +206,7 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs(
|
||||
d_flag_PLL_180_deg_phase_locked = false;
|
||||
d_symbol_history.set_capacity(d_required_symbols + 1);
|
||||
d_cnav_dummy_page = false;
|
||||
d_print_cnav_page = true;
|
||||
|
||||
// vars for Viterbi decoder
|
||||
const int32_t max_states = 1U << static_cast<uint32_t>(d_mm); // 2^d_mm
|
||||
@ -538,10 +539,12 @@ void galileo_telemetry_decoder_gs::decode_CNAV_word(float *page_symbols, int32_t
|
||||
bool is_page_dummy = d_cnav_nav.is_HAS_page_dummy();
|
||||
if (is_page_dummy == true)
|
||||
{
|
||||
d_print_cnav_page = true;
|
||||
// Only print the message once
|
||||
if (is_page_dummy != d_cnav_dummy_page)
|
||||
{
|
||||
d_cnav_dummy_page = is_page_dummy;
|
||||
|
||||
std::cout << TEXT_MAGENTA << "Receiving Galileo E6 CNAV dummy pages in channel "
|
||||
<< d_channel << " from satellite " << d_satellite
|
||||
<< TEXT_RESET << '\n';
|
||||
@ -551,12 +554,16 @@ void galileo_telemetry_decoder_gs::decode_CNAV_word(float *page_symbols, int32_t
|
||||
{
|
||||
const std::shared_ptr<Galileo_HAS_page> tmp_obj = std::make_shared<Galileo_HAS_page>(d_cnav_nav.get_HAS_encoded_page());
|
||||
this->message_port_pub(pmt::mp("E6_HAS_from_TLM"), pmt::make_any(tmp_obj));
|
||||
std::cout << TEXT_MAGENTA << "New Galileo E6 HAS page received in channel "
|
||||
<< d_channel << " from satellite " << d_satellite
|
||||
<< (d_cnav_nav.is_HAS_in_test_mode() == true ? " (test mode)" : "")
|
||||
if (d_print_cnav_page == true)
|
||||
{
|
||||
d_print_cnav_page = false; // only print the first page
|
||||
std::cout << TEXT_MAGENTA << "Receiving Galileo E6 HAS pages"
|
||||
<< (d_cnav_nav.is_HAS_in_test_mode() == true ? " (test mode) " : " ")
|
||||
<< "in channel " << d_channel << " from satellite " << d_satellite
|
||||
<< TEXT_RESET << '\n';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -141,6 +141,7 @@ private:
|
||||
bool d_remove_dat;
|
||||
bool d_first_eph_sent;
|
||||
bool d_cnav_dummy_page;
|
||||
bool d_print_cnav_page;
|
||||
};
|
||||
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
|
||||
#include "galileo_e6_has_msg_receiver.h"
|
||||
#include "display.h"
|
||||
#include "galileo_has_page.h" // for Galileo_HAS_page
|
||||
#include "gnss_sdr_make_unique.h"
|
||||
#include "reed_solomon.h"
|
||||
@ -141,6 +142,8 @@ void galileo_e6_has_msg_receiver::process_HAS_page(const Galileo_HAS_page& has_p
|
||||
if (res == 0)
|
||||
{
|
||||
// Successful decoding, we have a valid HAS message stored at d_HAS_data
|
||||
std::cout << TEXT_MAGENTA << "New Galileo HAS message type " << static_cast<float>(has_page.message_id)
|
||||
<< " received and successfully decoded" << TEXT_RESET << '\n';
|
||||
d_new_message = true;
|
||||
}
|
||||
else
|
||||
@ -158,22 +161,23 @@ int galileo_e6_has_msg_receiver::decode_message_type1(uint8_t message_id, uint8_
|
||||
// Compute erasure positions
|
||||
std::vector<int> erasure_positions;
|
||||
erasure_positions.reserve(223); // Maximum erasure positions ( = number of parity symbols in a block)
|
||||
for (int i = 0; i < message_size; i++) // we know that from message_size to 32, the value is 0
|
||||
|
||||
for (uint8_t i = 0; i < message_size; i++) // we know that from message_size to 32, the value is 0
|
||||
{
|
||||
if (d_C_matrix[message_id][i][0] == 0)
|
||||
if (std::find(d_received_pages[message_id].begin(), d_received_pages[message_id].end(), i) == d_received_pages[message_id].end())
|
||||
{
|
||||
erasure_positions.push_back(i);
|
||||
}
|
||||
}
|
||||
for (int i = 32; i < 255; i++)
|
||||
{
|
||||
if (d_C_matrix[message_id][i][0] == 0)
|
||||
if (std::find(d_received_pages[message_id].begin(), d_received_pages[message_id].end(), static_cast<uint8_t>(i)) == d_received_pages[message_id].end())
|
||||
{
|
||||
erasure_positions.push_back(i);
|
||||
}
|
||||
}
|
||||
|
||||
// Reset HAS message matrix
|
||||
// Reset HAS decoded message matrix
|
||||
d_M_matrix = {GALILEO_CNAV_INFORMATION_VECTOR_LENGTH, std::vector<uint8_t>(GALILEO_CNAV_OCTETS_IN_SUBPAGE)};
|
||||
|
||||
// Vertical decoding of d_C_matrix
|
||||
@ -189,7 +193,7 @@ int galileo_e6_has_msg_receiver::decode_message_type1(uint8_t message_id, uint8_
|
||||
|
||||
if (result < 0)
|
||||
{
|
||||
DLOG(INFO) << "Decoding of HAS page failed";
|
||||
DLOG(ERROR) << "Decoding of HAS page failed";
|
||||
return -1;
|
||||
}
|
||||
DLOG(INFO) << "Successful HAS page decoding";
|
||||
@ -264,6 +268,7 @@ void galileo_e6_has_msg_receiver::read_MT1_body(const std::string& message_strin
|
||||
{
|
||||
// read mask
|
||||
d_HAS_data.Nsys = read_has_message_body_uint8(message.substr(0, HAS_MSG_NSYS_LENGTH));
|
||||
DLOG(INFO) << "Nsys: " << static_cast<float>(d_HAS_data.Nsys);
|
||||
message = std::string(message.begin() + HAS_MSG_NSYS_LENGTH, message.end());
|
||||
d_HAS_data.gnss_id_mask.reserve(d_HAS_data.Nsys);
|
||||
d_HAS_data.cell_mask.reserve(d_HAS_data.Nsys);
|
||||
@ -387,6 +392,7 @@ void galileo_e6_has_msg_receiver::read_MT1_body(const std::string& message_strin
|
||||
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));
|
||||
DLOG(INFO) << "Nsysprime: " << static_cast<float>(d_HAS_data.Nsysprime);
|
||||
message = std::string(message.begin() + HAS_MSG_NSYSPRIME_LENGTH, message.end());
|
||||
|
||||
d_HAS_data.gnss_id_clock_subset.reserve(d_HAS_data.Nsysprime);
|
||||
|
Loading…
Reference in New Issue
Block a user