1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-04-06 02:37:20 +00:00

[TAS-208 WIP ] [Feature] Retrieve directly NavData bits from Telemetry Decoder (ADKD4 and 0/12)

- appear to retrieve data as expected.
- However, tag verification fails still (new dat file)
This commit is contained in:
cesaaargm 2024-06-13 01:13:17 +02:00
parent b39087f609
commit 1a32ccaa19
4 changed files with 64 additions and 9 deletions

View File

@ -471,7 +471,7 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(float *page_part_symbols, in
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
d_first_eph_sent = true; // do not send reduced CED anymore, since we have the full ephemeris set
d_flag_osnma_ephemeris = true;
d_flag_osnma_adkd_0_12 = true; // W1-> W5 available
}
else
{
@ -522,7 +522,6 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(float *page_part_symbols, in
<< " dB-Hz" << TEXT_RESET << std::endl;
}
d_flag_osnma_iono_and_time = true;
}
if (d_inav_nav.have_new_utc_model() == true)
@ -559,7 +558,7 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(float *page_part_symbols, in
d_delta_t = tmp_obj->A_0G + tmp_obj->A_1G * (static_cast<double>(d_TOW_at_current_symbol_ms) / 1000.0 - tmp_obj->t_0G + 604800 * (std::fmod(static_cast<float>(d_inav_nav.get_Galileo_week() - tmp_obj->WN_0G), 64.0)));
DLOG(INFO) << "delta_t=" << d_delta_t << "[s]";
d_flag_osnma_utc_model = true;
d_flag_osnma_adkd_4_utc = true;
}
if (d_inav_nav.have_new_almanac() == true)
@ -593,15 +592,28 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(float *page_part_symbols, in
DLOG(INFO) << "Current parameters:";
DLOG(INFO) << "d_TOW_at_current_symbol_ms=" << d_TOW_at_current_symbol_ms;
DLOG(INFO) << "d_nav.WN_0=" << d_inav_nav.get_Galileo_week();
d_flag_osnma_adkd_4_gst = true;
}
// get osnma message if the needed nav data is available
auto adkd_4_12_nav_data_available = d_flag_osnma_iono_and_time && d_flag_osnma_ephemeris;
auto newOSNMA = d_inav_nav.have_new_nma();
if (d_band == '1' && newOSNMA && adkd_4_12_nav_data_available == true && d_flag_osnma_utc_model == true)
bool adkd_4_nav_data_available = d_flag_osnma_adkd_4_utc && d_flag_osnma_adkd_4_gst;
auto newOSNMA = d_inav_nav.have_new_nma();if (d_band == '1' && newOSNMA && (adkd_4_nav_data_available == true || d_flag_osnma_adkd_0_12 == true))
{
const std::shared_ptr<OSNMA_msg> tmp_obj = std::make_shared<OSNMA_msg>(d_inav_nav.get_osnma_msg());
if(adkd_4_nav_data_available)
tmp_obj->TimingData_2 = d_inav_nav.get_osnma_adkd_4_nav_bits();
if(d_flag_osnma_adkd_0_12)
tmp_obj->EphemerisClockAndStatusData_2 = d_inav_nav.get_osnma_adkd_0_12_nav_bits();
this->message_port_pub(pmt::mp("OSNMA_from_TLM"), pmt::make_any(tmp_obj));
d_flag_osnma_adkd_4_utc= false;
d_flag_osnma_adkd_4_gst = false;
d_flag_osnma_adkd_0_12 = false;
}
}

View File

@ -155,9 +155,9 @@ private:
bool d_there_are_e1_channels;
bool d_there_are_e6_channels;
bool d_use_ced;
bool d_flag_osnma_ephemeris; // flag to indicate if the ephemeris is complete for OSNMA processing
bool d_flag_osnma_utc_model; // flag to indicate if the GST conversion parameters are complete for OSNMA processing
bool d_flag_osnma_iono_and_time; // flag to indicate if the iono correction and time is complete for OSNMA processing
bool d_flag_osnma_adkd_0_12; // flag to indicate if the ephemeris is complete for OSNMA processing
bool d_flag_osnma_adkd_4_gst; // flag to indicate if the GST conversion parameters are complete for OSNMA processing
bool d_flag_osnma_adkd_4_utc; // flag to indicate if the iono correction and time is complete for OSNMA processing
};

View File

@ -614,6 +614,7 @@ void Galileo_Inav_Message::read_page_1(const std::bitset<GALILEO_DATA_JK_BITS>&
DLOG(INFO) << "A_1= " << A_1;
flag_ephemeris_1 = true;
DLOG(INFO) << "flag_tow_set" << flag_TOW_set;
nav_bits_word_1 = data_bits.to_string().substr(5,120);
}
@ -635,6 +636,7 @@ void Galileo_Inav_Message::read_page_2(const std::bitset<GALILEO_DATA_JK_BITS>&
DLOG(INFO) << "iDot_2= " << iDot_2;
flag_ephemeris_2 = true;
DLOG(INFO) << "flag_tow_set" << flag_TOW_set;
nav_bits_word_2 = data_bits.to_string().substr(5,120);
}
@ -664,6 +666,7 @@ void Galileo_Inav_Message::read_page_3(const std::bitset<GALILEO_DATA_JK_BITS>&
DLOG(INFO) << "SISA_3= " << SISA_3;
flag_ephemeris_3 = true;
DLOG(INFO) << "flag_tow_set" << flag_TOW_set;
nav_bits_word_3 = data_bits.to_string().substr(5, 122);
}
@ -697,6 +700,7 @@ void Galileo_Inav_Message::read_page_4(const std::bitset<GALILEO_DATA_JK_BITS>&
DLOG(INFO) << "spare_4 = " << spare_4;
flag_ephemeris_4 = true;
DLOG(INFO) << "flag_tow_set" << flag_TOW_set;
nav_bits_word_4 = data_bits.to_string().substr(5, 120);
}
@ -1016,6 +1020,7 @@ int32_t Galileo_Inav_Message::page_jk_decoder(const char* data_jk)
flag_iono_and_GST = true; // set to false externally
flag_TOW_set = true; // set to false externally
DLOG(INFO) << "flag_tow_set" << flag_TOW_set;
nav_bits_word_5 = data_jk_bits.to_string().substr(5, 67);
break;
case 6: // Word type 6: GST-UTC conversion parameters
@ -1045,6 +1050,7 @@ int32_t Galileo_Inav_Message::page_jk_decoder(const char* data_jk)
flag_utc_model = true; // set to false externally
flag_TOW_set = true; // set to false externally
DLOG(INFO) << "flag_tow_set" << flag_TOW_set;
nav_bits_word_6 = data_jk_bits.to_string().substr(5, 99);
break;
case 7: // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number
@ -1201,6 +1207,7 @@ int32_t Galileo_Inav_Message::page_jk_decoder(const char* data_jk)
DLOG(INFO) << "WN_0G_10= " << WN_0G_10;
flag_almanac_4 = true;
DLOG(INFO) << "flag_tow_set" << flag_TOW_set;
nav_bits_word_10 = data_jk_bits.to_string().substr(85, 42);
break;
case 16: // Word type 16: Reduced Clock and Ephemeris Data (CED) parameters
@ -1425,3 +1432,20 @@ bool Galileo_Inav_Message::have_new_nma()
return false;
}
}
std::string Galileo_Inav_Message::get_osnma_adkd_4_nav_bits()
{
nav_bits_adkd_4 = nav_bits_word_6 + nav_bits_word_10;
nav_bits_word_6 = "";
nav_bits_word_10 = "";
return nav_bits_adkd_4;
}
std::string Galileo_Inav_Message::get_osnma_adkd_0_12_nav_bits()
{
nav_bits_adkd_0_12 = nav_bits_word_1 + nav_bits_word_2 + nav_bits_word_3 + nav_bits_word_4 + nav_bits_word_5;
nav_bits_word_1 = "";
nav_bits_word_2 = "";
nav_bits_word_3 = "";
nav_bits_word_4 = "";
nav_bits_word_5 = "";
return nav_bits_adkd_0_12;
}

View File

@ -139,6 +139,16 @@ public:
*/
OSNMA_msg get_osnma_msg();
/*
* @brief Retrieves the OSNMA ADKD 4 NAV bits. Resets the string.
*/
std::string get_osnma_adkd_4_nav_bits();
/*
* @brief Retrieves the OSNMA ADKD 0/12 NAV bits. Resets the string.
*/
std::string get_osnma_adkd_0_12_nav_bits();
inline bool get_flag_CRC_test() const
{
return flag_CRC_test;
@ -430,6 +440,15 @@ private:
uint8_t page_position_in_inav_subframe{255};
std::array<int8_t, 15> nma_position_filled{};
OSNMA_msg nma_msg{};
std::string nav_bits_adkd_4{};
std::string nav_bits_word_6{};
std::string nav_bits_word_10{};
std::string nav_bits_adkd_0_12{};
std::string nav_bits_word_1{};
std::string nav_bits_word_2{};
std::string nav_bits_word_3{};
std::string nav_bits_word_4{};
std::string nav_bits_word_5{};
uint8_t IODnav_LSB17{};
uint8_t IODnav_LSB18{};