Add monitor to send decoded navigation message bits via UDP

This commit is contained in:
Carles Fernandez 2021-09-06 00:05:29 +02:00
parent 14fd13ddec
commit ea88993ef2
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
30 changed files with 797 additions and 9 deletions

View File

@ -12,6 +12,16 @@ SPDX-FileCopyrightText: 2011-2021 Carles Fernandez-Prades <carles.fernandez@cttc
All notable changes to GNSS-SDR will be documented in this file.
## [Unreleased](https://github.com/gnss-sdr/gnss-sdr/tree/next)
### Improvements in Usability:
- Added a new monitor to extract the raw data bits in the navigation message and
send them elsewhere via UDP. Activated by setting
`NavDataMonitor.enable_monitor=true`,
`NavDataMonitor.client_addresses=127.0.0.1` and `NavDataMonitor.port=1237` in
the configuration file. Format described in the `nav_message.proto` file.
## [GNSS-SDR v0.0.15](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.15) - 2021-08-23
### Improvements in Availability:

View File

@ -0,0 +1,16 @@
// SPDX-License-Identifier: BSD-3-Clause
// SPDX-FileCopyrightText: 2021 Carles Fernandez-Prades <carles.fernandez@cttc.es>
syntax = "proto3";
package gnss_sdr;
message navMsg {
string system = 1; // GNSS constellation: "G" for GPS, "R" for Glonass, "E" for Galileo, and "C" for Beidou.
string signal = 2; // GNSS signal: "1C" for GPS L1 C/A, "1B" for Galileo E1b/c, "1G" for Glonass L1 C/A, "2S" for GPS L2 L2C(M), "2G" for Glonass L2 C/A, "L5" for GPS L5, and "5X" for Galileo E5a
int32 prn = 3; // SV ID
int32 tow_at_current_symbol_ms = 4; // Time of week of the last symbol received, in ms
string nav_message = 5; // for Galileo I/NAV: decoded half page (even or odd), 120 bits, as described in OS SIS ICD 2.0, paragraph 4.3.2.3. I/NAV Page Part
// for Galileo F/NAV: decoded word, 244 bits, as described in OS SIS ICD 2.0, paragraph 4.2.2. F/NAV Page Layout
// For GPS LNAV: decoded subframe, 300 bits, as described in IS-GPS-200M paragraph 20.3.2 Message Structure.
// For GPS CNAV: decoded subframe, 300 bits, as described in IS-GPS-200M paragraph 30.3.3 Message Content.
}

View File

@ -52,6 +52,7 @@ target_link_libraries(telemetry_decoder_gr_blocks
PUBLIC
telemetry_decoder_libswiftcnav
telemetry_decoder_libs
core_libs
core_system_parameters
Gnuradio::runtime
Boost::headers

View File

@ -56,6 +56,15 @@ beidou_b1i_telemetry_decoder_gs::beidou_b1i_telemetry_decoder_gs(
this->message_port_register_out(pmt::mp("telemetry"));
// Control messages to tracking block
this->message_port_register_out(pmt::mp("telemetry_to_trk"));
d_enable_navdata_monitor = conf.enable_navdata_monitor;
if (d_enable_navdata_monitor)
{
// register nav message monitor out
this->message_port_register_out(pmt::mp("Nav_msg_from_TLM"));
d_nav_msg_packet.system = std::string("C");
d_nav_msg_packet.signal = std::string("B1");
}
// initialize internal vars
d_dump_filename = conf.dump_filename;
d_dump = conf.dump;
@ -240,6 +249,11 @@ void beidou_b1i_telemetry_decoder_gs::decode_subframe(float *frame_symbols)
}
}
if (d_enable_navdata_monitor)
{
d_nav_msg_packet.nav_message = data_bits;
}
if (d_satellite.get_PRN() > 0 and d_satellite.get_PRN() < 6)
{
d_nav.d2_subframe_decoder(data_bits);
@ -581,6 +595,15 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_
d_last_valid_preamble = d_sample_counter;
d_flag_valid_word = true;
}
if (d_enable_navdata_monitor && !d_nav_msg_packet.nav_message.empty())
{
d_nav_msg_packet.prn = static_cast<int32_t>(current_symbol.PRN);
d_nav_msg_packet.tow_at_current_symbol_ms = static_cast<int32_t>(d_TOW_at_current_symbol_ms);
const std::shared_ptr<Nav_Message_Packet> tmp_obj = std::make_shared<Nav_Message_Packet>(d_nav_msg_packet);
this->message_port_pub(pmt::mp("Nav_msg_from_TLM"), pmt::make_any(tmp_obj));
d_nav_msg_packet.nav_message = "";
}
}
else
{

View File

@ -22,6 +22,7 @@
#include "beidou_dnav_navigation_message.h"
#include "gnss_block_interface.h"
#include "nav_message_packet.h"
#include "gnss_satellite.h"
#include "tlm_conf.h"
#include <boost/circular_buffer.hpp>
@ -87,6 +88,8 @@ private:
// Navigation Message variable
Beidou_Dnav_Navigation_Message d_nav;
Nav_Message_Packet d_nav_msg_packet;
// Satellite Information and logging capacity
Gnss_Satellite d_satellite;
std::string d_dump_filename;
@ -119,6 +122,7 @@ private:
bool d_dump;
bool d_dump_mat;
bool d_remove_dat;
bool d_enable_navdata_monitor;
};

View File

@ -56,6 +56,14 @@ beidou_b3i_telemetry_decoder_gs::beidou_b3i_telemetry_decoder_gs(
this->message_port_register_out(pmt::mp("telemetry"));
// Control messages to tracking block
this->message_port_register_out(pmt::mp("telemetry_to_trk"));
d_enable_navdata_monitor = conf.enable_navdata_monitor;
if (d_enable_navdata_monitor)
{
// register nav message monitor out
this->message_port_register_out(pmt::mp("Nav_msg_from_TLM"));
d_nav_msg_packet.system = std::string("C");
d_nav_msg_packet.signal = std::string("B3");
}
// initialize internal vars
d_dump_filename = conf.dump_filename;
d_dump = conf.dump;
@ -241,6 +249,11 @@ void beidou_b3i_telemetry_decoder_gs::decode_subframe(float *frame_symbols)
}
}
if (d_enable_navdata_monitor)
{
d_nav_msg_packet.nav_message = data_bits;
}
if (d_satellite.get_PRN() > 0 and d_satellite.get_PRN() < 6)
{
d_nav.d2_subframe_decoder(data_bits);
@ -611,6 +624,15 @@ int beidou_b3i_telemetry_decoder_gs::general_work(
d_last_valid_preamble = d_sample_counter;
d_flag_valid_word = true;
}
if (d_enable_navdata_monitor && !d_nav_msg_packet.nav_message.empty())
{
d_nav_msg_packet.prn = static_cast<int32_t>(current_symbol.PRN);
d_nav_msg_packet.tow_at_current_symbol_ms = static_cast<int32_t>(d_TOW_at_current_symbol_ms);
const std::shared_ptr<Nav_Message_Packet> tmp_obj = std::make_shared<Nav_Message_Packet>(d_nav_msg_packet);
this->message_port_pub(pmt::mp("Nav_msg_from_TLM"), pmt::make_any(tmp_obj));
d_nav_msg_packet.nav_message = "";
}
}
else
{

View File

@ -20,6 +20,7 @@
#include "beidou_dnav_navigation_message.h"
#include "gnss_block_interface.h"
#include "gnss_satellite.h"
#include "nav_message_packet.h"
#include "tlm_conf.h"
#include <boost/circular_buffer.hpp>
#include <gnuradio/block.h> // for block
@ -85,6 +86,8 @@ private:
// Navigation Message variable
Beidou_Dnav_Navigation_Message d_nav;
Nav_Message_Packet d_nav_msg_packet;
Gnss_Satellite d_satellite;
std::string d_dump_filename;
@ -116,6 +119,7 @@ private:
bool d_dump;
bool d_dump_mat;
bool d_remove_dat;
bool d_enable_navdata_monitor;
};

View File

@ -68,7 +68,12 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs(
this->message_port_register_out(pmt::mp("telemetry_to_trk"));
// register Gal E6 messages HAS out
this->message_port_register_out(pmt::mp("E6_HAS_from_TLM"));
d_enable_navdata_monitor = conf.enable_navdata_monitor;
if (d_enable_navdata_monitor)
{
// register nav message monitor out
this->message_port_register_out(pmt::mp("Nav_msg_from_TLM"));
}
d_last_valid_preamble = 0;
d_sent_tlm_failed_msg = false;
d_band = '1';
@ -323,6 +328,11 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(float *page_part_symbols, in
}
}
if (d_enable_navdata_monitor)
{
d_nav_msg_packet.nav_message = page_String;
}
if (page_part_bits[0] == 1)
{
// DECODE COMPLETE WORD (even + odd) and TEST CRC
@ -471,6 +481,11 @@ void galileo_telemetry_decoder_gs::decode_FNAV_word(float *page_symbols, int32_t
}
}
if (d_enable_navdata_monitor)
{
d_nav_msg_packet.nav_message = page_String;
}
// DECODE COMPLETE WORD (even + odd) and TEST CRC
d_fnav_nav.split_page(page_String);
if (d_fnav_nav.get_flag_CRC_test() == true)
@ -882,6 +897,16 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
d_TOW_at_current_symbol_ms += d_PRN_code_period_ms;
}
}
if (d_enable_navdata_monitor && !d_nav_msg_packet.nav_message.empty())
{
d_nav_msg_packet.system = std::string(1, current_symbol.System);
d_nav_msg_packet.signal = std::string(current_symbol.Signal);
d_nav_msg_packet.prn = static_cast<int32_t>(current_symbol.PRN);
d_nav_msg_packet.tow_at_current_symbol_ms = static_cast<int32_t>(d_TOW_at_current_symbol_ms);
const std::shared_ptr<Nav_Message_Packet> tmp_obj = std::make_shared<Nav_Message_Packet>(d_nav_msg_packet);
this->message_port_pub(pmt::mp("Nav_msg_from_TLM"), pmt::make_any(tmp_obj));
d_nav_msg_packet.nav_message = "";
}
break;
}
case 2: // FNAV
@ -920,6 +945,16 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
{
d_TOW_at_current_symbol_ms += static_cast<uint32_t>(GALILEO_FNAV_CODES_PER_SYMBOL * GALILEO_E5A_CODE_PERIOD_MS);
}
if (d_enable_navdata_monitor && !d_nav_msg_packet.nav_message.empty())
{
d_nav_msg_packet.system = std::string(1, current_symbol.System);
d_nav_msg_packet.signal = std::string(current_symbol.Signal);
d_nav_msg_packet.prn = static_cast<int32_t>(current_symbol.PRN);
d_nav_msg_packet.tow_at_current_symbol_ms = static_cast<int32_t>(d_TOW_at_current_symbol_ms);
const std::shared_ptr<Nav_Message_Packet> tmp_obj = std::make_shared<Nav_Message_Packet>(d_nav_msg_packet);
this->message_port_pub(pmt::mp("Nav_msg_from_TLM"), pmt::make_any(tmp_obj));
d_nav_msg_packet.nav_message = "";
}
break;
}
}

View File

@ -24,6 +24,7 @@
#include "galileo_fnav_message.h"
#include "galileo_inav_message.h"
#include "gnss_block_interface.h"
#include "nav_message_packet.h"
#include "gnss_satellite.h"
#include "tlm_conf.h"
#include "tlm_crc_stats.h"
@ -110,6 +111,8 @@ private:
bool d_dump_crc_stats;
Tlm_CRC_Stats d_Tlm_CRC_Stats;
Nav_Message_Packet d_nav_msg_packet;
double d_delta_t; // GPS-GALILEO time offset
uint64_t d_sample_counter;
@ -147,6 +150,7 @@ private:
bool d_first_eph_sent;
bool d_cnav_dummy_page;
bool d_print_cnav_page;
bool d_enable_navdata_monitor;
};

View File

@ -53,6 +53,14 @@ glonass_l1_ca_telemetry_decoder_gs::glonass_l1_ca_telemetry_decoder_gs(
this->message_port_register_out(pmt::mp("telemetry"));
// Control messages to tracking block
this->message_port_register_out(pmt::mp("telemetry_to_trk"));
d_enable_navdata_monitor = conf.enable_navdata_monitor;
if (d_enable_navdata_monitor)
{
// register nav message monitor out
this->message_port_register_out(pmt::mp("Nav_msg_from_TLM"));
d_nav_msg_packet.system = std::string("R");
d_nav_msg_packet.signal = std::string("1G");
}
// initialize internal vars
d_dump_filename = conf.dump_filename;
d_dump = conf.dump;
@ -187,6 +195,11 @@ void glonass_l1_ca_telemetry_decoder_gs::decode_string(const double *frame_symbo
data_bits.push_back(((relative_code[i - 1] - '0') ^ (relative_code[i] - '0')) + '0');
}
if (d_enable_navdata_monitor)
{
d_nav_msg_packet.nav_message = data_bits;
}
// 2. Call the GLONASS GNAV string decoder
d_nav.string_decoder(data_bits);
@ -414,17 +427,26 @@ int glonass_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribu
// delta_t = d_nav.A_0G + d_nav.A_1G * (d_TOW_at_current_symbol - d_nav.t_0G + 604800.0 * (fmod((d_nav.WN_0 - d_nav.WN_0G), 64)));
// }
current_symbol.PRN = this->d_satellite.get_PRN();
current_symbol.TOW_at_current_symbol_ms = round(d_TOW_at_current_symbol * 1000.0);
if (d_flag_frame_sync == true and d_nav.is_flag_TOW_set() == true)
{
current_symbol.Flag_valid_word = true;
if (d_enable_navdata_monitor && !d_nav_msg_packet.nav_message.empty())
{
d_nav_msg_packet.prn = static_cast<int32_t>(current_symbol.PRN);
d_nav_msg_packet.tow_at_current_symbol_ms = static_cast<int32_t>(current_symbol.TOW_at_current_symbol_ms);
const std::shared_ptr<Nav_Message_Packet> tmp_obj = std::make_shared<Nav_Message_Packet>(d_nav_msg_packet);
this->message_port_pub(pmt::mp("Nav_msg_from_TLM"), pmt::make_any(tmp_obj));
d_nav_msg_packet.nav_message = "";
}
}
else
{
current_symbol.Flag_valid_word = false;
}
current_symbol.PRN = this->d_satellite.get_PRN();
current_symbol.TOW_at_current_symbol_ms = round(d_TOW_at_current_symbol * 1000.0);
// todo: glonass time to gps time should be done in observables block
// current_symbol.TOW_at_current_symbol_ms -= -= static_cast<uint32_t>(delta_t) * 1000; // Galileo to GPS TOW

View File

@ -25,6 +25,7 @@
#include "gnss_satellite.h"
#include "gnss_synchro.h"
#include "tlm_conf.h"
#include "nav_message_packet.h"
#include <boost/circular_buffer.hpp>
#include <gnuradio/block.h> // for block
#include <gnuradio/types.h> // for gr_vector_const_void_star
@ -93,6 +94,8 @@ private:
// Navigation Message variable
Glonass_Gnav_Navigation_Message d_nav;
Nav_Message_Packet d_nav_msg_packet;
Gnss_Satellite d_satellite;
std::string d_dump_filename;
@ -118,6 +121,7 @@ private:
bool d_dump;
bool d_dump_mat;
bool d_remove_dat;
bool d_enable_navdata_monitor;
};

View File

@ -53,6 +53,14 @@ glonass_l2_ca_telemetry_decoder_gs::glonass_l2_ca_telemetry_decoder_gs(
this->message_port_register_out(pmt::mp("telemetry"));
// Control messages to tracking block
this->message_port_register_out(pmt::mp("telemetry_to_trk"));
d_enable_navdata_monitor = conf.enable_navdata_monitor;
if (d_enable_navdata_monitor)
{
// register nav message monitor out
this->message_port_register_out(pmt::mp("Nav_msg_from_TLM"));
d_nav_msg_packet.system = std::string("R");
d_nav_msg_packet.signal = std::string("2G");
}
// initialize internal vars
d_dump_filename = conf.dump_filename;
d_dump = conf.dump;
@ -187,6 +195,11 @@ void glonass_l2_ca_telemetry_decoder_gs::decode_string(const double *frame_symbo
data_bits.push_back(((relative_code[i - 1] - '0') ^ (relative_code[i] - '0')) + '0');
}
if (d_enable_navdata_monitor)
{
d_nav_msg_packet.nav_message = data_bits;
}
// 2. Call the GLONASS GNAV string decoder
d_nav.string_decoder(data_bits);
@ -413,17 +426,30 @@ int glonass_l2_ca_telemetry_decoder_gs::general_work(int noutput_items __attribu
// delta_t = d_nav.A_0G + d_nav.A_1G * (d_TOW_at_current_symbol - d_nav.t_0G + 604800.0 * (fmod((d_nav.WN_0 - d_nav.WN_0G), 64)));
// }
current_symbol.PRN = this->d_satellite.get_PRN();
current_symbol.TOW_at_current_symbol_ms = round(d_TOW_at_current_symbol * 1000.0);
if (d_flag_frame_sync == true and d_nav.is_flag_TOW_set() == true)
{
current_symbol.Flag_valid_word = true;
if (d_flag_frame_sync == true and d_nav.is_flag_TOW_set() == true)
{
current_symbol.Flag_valid_word = true;
if (d_enable_navdata_monitor && !d_nav_msg_packet.nav_message.empty())
{
d_nav_msg_packet.prn = static_cast<int32_t>(current_symbol.PRN);
d_nav_msg_packet.tow_at_current_symbol_ms = static_cast<int32_t>(current_symbol.TOW_at_current_symbol_ms);
const std::shared_ptr<Nav_Message_Packet> tmp_obj = std::make_shared<Nav_Message_Packet>(d_nav_msg_packet);
this->message_port_pub(pmt::mp("Nav_msg_from_TLM"), pmt::make_any(tmp_obj));
d_nav_msg_packet.nav_message = "";
}
}
}
else
{
current_symbol.Flag_valid_word = false;
}
current_symbol.PRN = this->d_satellite.get_PRN();
current_symbol.TOW_at_current_symbol_ms = round(d_TOW_at_current_symbol * 1000.0);
// todo: glonass time to gps time should be done in observables block
// current_symbol.TOW_at_current_symbol_ms -= static_cast<uint32_t>(delta_t) * 1000;

View File

@ -24,6 +24,7 @@
#include "gnss_satellite.h"
#include "gnss_synchro.h"
#include "tlm_conf.h"
#include "nav_message_packet.h"
#include <boost/circular_buffer.hpp>
#include <gnuradio/block.h>
#include <gnuradio/types.h> // for gr_vector_const_void_star
@ -88,6 +89,8 @@ private:
// Navigation Message variable
Glonass_Gnav_Navigation_Message d_nav;
Nav_Message_Packet d_nav_msg_packet;
Gnss_Satellite d_satellite;
std::string d_dump_filename;
@ -112,6 +115,7 @@ private:
bool d_dump;
bool d_dump_mat;
bool d_remove_dat;
bool d_enable_navdata_monitor;
};

View File

@ -27,6 +27,7 @@
#include <gnuradio/io_signature.h>
#include <pmt/pmt.h> // for make_any
#include <pmt/pmt_sugar.h> // for mp
#include <bitset> // for bitset
#include <cmath> // for round
#include <cstddef> // for size_t
#include <cstring> // for memcpy
@ -68,6 +69,15 @@ gps_l1_ca_telemetry_decoder_gs::gps_l1_ca_telemetry_decoder_gs(
this->message_port_register_out(pmt::mp("telemetry"));
// Control messages to tracking block
this->message_port_register_out(pmt::mp("telemetry_to_trk"));
d_enable_navdata_monitor = conf.enable_navdata_monitor;
if (d_enable_navdata_monitor)
{
// register nav message monitor out
this->message_port_register_out(pmt::mp("Nav_msg_from_TLM"));
d_nav_msg_packet.system = std::string("G");
d_nav_msg_packet.signal = std::string("1C");
}
d_last_valid_preamble = 0;
d_sent_tlm_failed_msg = false;
@ -284,6 +294,22 @@ bool gps_l1_ca_telemetry_decoder_gs::decode_subframe()
// NEW GPS SUBFRAME HAS ARRIVED!
if (subframe_synchro_confirmation)
{
if (d_enable_navdata_monitor)
{
uint32_t gps_word;
std::bitset<GPS_SUBFRAME_BITS> subframe_bits;
std::bitset<GPS_WORD_BITS + 2> word_bits;
for (int32_t i = 0; i < 10; i++)
{
memcpy(&gps_word, &subframe[i * 4], sizeof(char) * 4);
word_bits = std::bitset<(GPS_WORD_BITS + 2)>(gps_word);
for (int32_t j = 0; j < GPS_WORD_BITS; j++)
{
subframe_bits[GPS_WORD_BITS * (9 - i) + j] = word_bits[j];
}
}
d_nav_msg_packet.nav_message = subframe_bits.to_string();
}
const int32_t subframe_ID = d_nav.subframe_decoder(subframe.data()); // decode the subframe
if (subframe_ID > 0 and subframe_ID < 6)
{
@ -500,6 +526,15 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__
current_symbol.TOW_at_current_symbol_ms = d_TOW_at_current_symbol_ms;
current_symbol.Flag_valid_word = d_flag_TOW_set;
if (d_enable_navdata_monitor && !d_nav_msg_packet.nav_message.empty())
{
d_nav_msg_packet.prn = static_cast<int32_t>(current_symbol.PRN);
d_nav_msg_packet.tow_at_current_symbol_ms = static_cast<int32_t>(d_TOW_at_current_symbol_ms);
const std::shared_ptr<Nav_Message_Packet> tmp_obj = std::make_shared<Nav_Message_Packet>(d_nav_msg_packet);
this->message_port_pub(pmt::mp("Nav_msg_from_TLM"), pmt::make_any(tmp_obj));
d_nav_msg_packet.nav_message = "";
}
if (d_flag_PLL_180_deg_phase_locked == true)
{
// correct the accumulated phase for the Costas loop phase shift, if required

View File

@ -22,6 +22,7 @@
#include "gnss_satellite.h"
#include "gnss_synchro.h"
#include "gps_navigation_message.h"
#include "nav_message_packet.h"
#include "tlm_conf.h"
#include <boost/circular_buffer.hpp>
#include <gnuradio/block.h> // for block
@ -75,6 +76,7 @@ private:
Gps_Navigation_Message d_nav;
Gnss_Satellite d_satellite;
Nav_Message_Packet d_nav_msg_packet;
std::array<int32_t, GPS_CA_PREAMBLE_LENGTH_BITS> d_preamble_samples{};
@ -110,6 +112,7 @@ private:
bool d_dump;
bool d_dump_mat;
bool d_remove_dat;
bool d_enable_navdata_monitor;
};

View File

@ -54,6 +54,15 @@ gps_l2c_telemetry_decoder_gs::gps_l2c_telemetry_decoder_gs(
this->message_port_register_out(pmt::mp("telemetry"));
// Control messages to tracking block
this->message_port_register_out(pmt::mp("telemetry_to_trk"));
d_enable_navdata_monitor = conf.enable_navdata_monitor;
if (d_enable_navdata_monitor)
{
// register nav message monitor out
this->message_port_register_out(pmt::mp("Nav_msg_from_TLM"));
d_nav_msg_packet.system = std::string("G");
d_nav_msg_packet.signal = std::string("2S");
}
d_last_valid_preamble = 0;
d_sent_tlm_failed_msg = false;
d_max_symbols_without_valid_frame = GPS_L2_CNAV_DATA_PAGE_BITS * GPS_L2_SYMBOLS_PER_BIT * 5; // rise alarm if 5 consecutive subframes have no valid CRC
@ -214,6 +223,11 @@ int gps_l2c_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
raw_bits[GPS_L2_CNAV_DATA_PAGE_BITS - 1 - i] = ((msg.raw_msg[i / 8] >> (7 - i % 8)) & 1U);
}
if (d_enable_navdata_monitor)
{
d_nav_msg_packet.nav_message = raw_bits.to_string();
}
d_CNAV_Message.decode_page(raw_bits);
// Push the new navigation data to the queues
@ -248,6 +262,15 @@ int gps_l2c_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
d_TOW_at_current_symbol = static_cast<double>(msg.tow) * 6.0 + static_cast<double>(delay) * GPS_L2_M_PERIOD_S + 12 * GPS_L2_M_PERIOD_S;
// d_TOW_at_current_symbol = floor(d_TOW_at_current_symbol * 1000.0) / 1000.0;
d_flag_valid_word = true;
if (d_enable_navdata_monitor && !d_nav_msg_packet.nav_message.empty())
{
d_nav_msg_packet.prn = static_cast<int32_t>(current_synchro_data.PRN);
d_nav_msg_packet.tow_at_current_symbol_ms = static_cast<int32_t>(d_TOW_at_current_symbol * 1000.0);
const std::shared_ptr<Nav_Message_Packet> tmp_obj = std::make_shared<Nav_Message_Packet>(d_nav_msg_packet);
this->message_port_pub(pmt::mp("Nav_msg_from_TLM"), pmt::make_any(tmp_obj));
d_nav_msg_packet.nav_message = "";
}
}
else
{

View File

@ -21,6 +21,7 @@
#include "gnss_block_interface.h"
#include "gnss_satellite.h"
#include "gps_cnav_navigation_message.h"
#include "nav_message_packet.h"
#include "tlm_conf.h"
#include <gnuradio/block.h>
#include <gnuradio/types.h> // for gr_vector_const_void_star
@ -77,6 +78,8 @@ private:
Gps_CNAV_Navigation_Message d_CNAV_Message;
Nav_Message_Packet d_nav_msg_packet;
std::string d_dump_filename;
std::ofstream d_dump_file;
@ -98,6 +101,7 @@ private:
bool d_flag_valid_word;
bool d_dump_mat;
bool d_remove_dat;
bool d_enable_navdata_monitor;
};

View File

@ -52,6 +52,15 @@ gps_l5_telemetry_decoder_gs::gps_l5_telemetry_decoder_gs(
this->message_port_register_out(pmt::mp("telemetry"));
// Control messages to tracking block
this->message_port_register_out(pmt::mp("telemetry_to_trk"));
d_enable_navdata_monitor = conf.enable_navdata_monitor;
if (d_enable_navdata_monitor)
{
// register nav message monitor out
this->message_port_register_out(pmt::mp("Nav_msg_from_TLM"));
d_nav_msg_packet.system = std::string("G");
d_nav_msg_packet.signal = std::string("L5");
}
d_last_valid_preamble = 0;
d_sent_tlm_failed_msg = false;
d_max_symbols_without_valid_frame = GPS_L5_CNAV_DATA_PAGE_BITS * GPS_L5_SYMBOLS_PER_BIT * 10; // rise alarm if 20 consecutive subframes have no valid CRC
@ -205,6 +214,11 @@ int gps_l5_telemetry_decoder_gs::general_work(int noutput_items __attribute__((u
raw_bits[GPS_L5_CNAV_DATA_PAGE_BITS - 1 - i] = ((msg.raw_msg[i / 8] >> (7 - i % 8)) & 1U);
}
if (d_enable_navdata_monitor)
{
d_nav_msg_packet.nav_message = raw_bits.to_string();
}
d_CNAV_Message.decode_page(raw_bits);
// Push the new navigation data to the queues
@ -254,6 +268,15 @@ int gps_l5_telemetry_decoder_gs::general_work(int noutput_items __attribute__((u
d_last_valid_preamble = d_sample_counter;
d_flag_valid_word = true;
}
if (d_enable_navdata_monitor && !d_nav_msg_packet.nav_message.empty())
{
d_nav_msg_packet.prn = static_cast<int32_t>(current_synchro_data.PRN);
d_nav_msg_packet.tow_at_current_symbol_ms = static_cast<int32_t>(d_TOW_at_current_symbol_ms);
const std::shared_ptr<Nav_Message_Packet> tmp_obj = std::make_shared<Nav_Message_Packet>(d_nav_msg_packet);
this->message_port_pub(pmt::mp("Nav_msg_from_TLM"), pmt::make_any(tmp_obj));
d_nav_msg_packet.nav_message = "";
}
}
else
{

View File

@ -21,6 +21,7 @@
#include "gnss_block_interface.h"
#include "gnss_satellite.h" // for Gnss_Satellite
#include "gps_cnav_navigation_message.h" // for Gps_CNAV_Navigation_Message
#include "nav_message_packet.h"
#include "tlm_conf.h"
#include <boost/circular_buffer.hpp>
#include <gnuradio/block.h>
@ -75,6 +76,8 @@ private:
Gps_CNAV_Navigation_Message d_CNAV_Message;
Nav_Message_Packet d_nav_msg_packet;
std::string d_dump_filename;
std::ofstream d_dump_file;
@ -93,6 +96,7 @@ private:
bool d_dump;
bool d_dump_mat;
bool d_remove_dat;
bool d_enable_navdata_monitor;
};

View File

@ -38,4 +38,5 @@ void Tlm_Conf::SetFromConfiguration(const ConfigurationInterface *configuration,
dump_crc_stats = configuration->property(role + ".dump_crc_stats", false);
const std::string default_crc_stats_dumpname("telemetry_crc_stats");
dump_crc_stats_filename = configuration->property(role + ".dump_crc_stats_filename", default_crc_stats_dumpname);
enable_navdata_monitor = configuration->property("NavDataMonitor.enable_monitor", false);
}

View File

@ -40,6 +40,7 @@ public:
bool remove_dat;
bool enable_reed_solomon; // for INAV message in Galileo E1B
bool dump_crc_stats; // telemetry CRC statistics
bool enable_navdata_monitor;
std::string dump_crc_stats_filename;
};

View File

@ -4,6 +4,8 @@
# SPDX-FileCopyrightText: 2010-2020 C. Fernandez-Prades cfernandez(at)cttc.es
# SPDX-License-Identifier: BSD-3-Clause
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${CMAKE_SOURCE_DIR}/docs/protobuf/nav_message.proto)
add_subdirectory(supl)
set(CORE_LIBS_SOURCES
@ -16,6 +18,8 @@ set(CORE_LIBS_SOURCES
channel_event.cc
command_event.cc
galileo_e6_has_msg_receiver.cc
nav_message_monitor.cc
nav_message_udp_sink.cc
)
set(CORE_LIBS_HEADERS
@ -27,6 +31,10 @@ set(CORE_LIBS_HEADERS
channel_status_msg_receiver.h
channel_event.h
command_event.h
nav_message_packet.h
nav_message_udp_sink.h
serdes_nav_message.h
nav_message_monitor.h
)
if(ENABLE_FPGA)
@ -61,12 +69,14 @@ if(USE_CMAKE_TARGET_SOURCES)
target_sources(core_libs
PRIVATE
${CORE_LIBS_SOURCES}
${PROTO_SRCS}
${PROTO_HDRS}
PUBLIC
${CORE_LIBS_HEADERS}
)
else()
source_group(Headers FILES ${CORE_LIBS_HEADERS})
add_library(core_libs ${CORE_LIBS_SOURCES} ${CORE_LIBS_HEADERS})
source_group(Headers FILES ${CORE_LIBS_HEADERS} ${PROTO_HDRS})
add_library(core_libs ${CORE_LIBS_SOURCES} ${CORE_LIBS_HEADERS} ${PROTO_SRCS} ${PROTO_HDRS})
endif()
target_link_libraries(core_libs
@ -74,10 +84,12 @@ target_link_libraries(core_libs
Gnuradio::blocks
Gnuradio::runtime
Gnuradio::pmt
protobuf::libprotobuf
core_libs_supl
core_system_parameters
pvt_libs
PRIVATE
algorithms_libs
Boost::serialization
Gflags::gflags
Glog::glog
@ -123,10 +135,20 @@ if(USE_BOOST_BIND_PLACEHOLDERS)
)
endif()
if(ENABLE_FPGA OR ENABLE_AD9361)
target_link_libraries(core_libs PRIVATE algorithms_libs)
if(USE_BOOST_ASIO_IO_CONTEXT)
target_compile_definitions(core_libs
PUBLIC
-DUSE_BOOST_ASIO_IO_CONTEXT=1
)
endif()
# Do not apply clang-tidy fixes to protobuf generated headers
get_filename_component(PROTO_INCLUDE_HEADERS_DIR ${PROTO_HDRS} DIRECTORY)
target_include_directories(core_libs
SYSTEM PUBLIC
${PROTO_INCLUDE_HEADERS_DIR}
)
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(core_libs

View File

@ -0,0 +1,77 @@
/*!
* \file nav_message_monitor.cc
* \brief GNU Radio block that processes Nav_Message_Packet received from
* telemetry blocks and sends them via UDP.
* \author Carles Fernandez-Prades, 2021. cfernandez(at)cttc.es
*
* -----------------------------------------------------------------------------
*
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
* This file is part of GNSS-SDR.
*
* Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors)
* SPDX-License-Identifier: GPL-3.0-or-later
*
* -----------------------------------------------------------------------------
*/
#include "nav_message_monitor.h"
#include "gnss_sdr_make_unique.h"
#include <boost/any.hpp>
#include <glog/logging.h>
#include <gnuradio/io_signature.h>
#include <cstddef> // size_t
#include <typeinfo> // typeid
#if HAS_GENERIC_LAMBDA
#else
#include <boost/bind/bind.hpp>
#endif
nav_message_monitor_sptr nav_message_monitor_make(const std::vector<std::string>& addresses, uint16_t port)
{
return nav_message_monitor_sptr(new nav_message_monitor(addresses, port));
}
nav_message_monitor::nav_message_monitor(const std::vector<std::string>& addresses, uint16_t port) : gr::block("nav_message_monitor", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0))
{
// register Nav_msg_from_TLM input message port from telemetry blocks
this->message_port_register_in(pmt::mp("Nav_msg_from_TLM"));
this->set_msg_handler(pmt::mp("Nav_msg_from_TLM"),
#if HAS_GENERIC_LAMBDA
[this](auto&& PH1) { msg_handler_nav_message(PH1); });
#else
#if USE_BOOST_BIND_PLACEHOLDERS
boost::bind(&nav_message_monitor::msg_handler_nav_message, this, boost::placeholders::_1));
#else
boost::bind(&nav_message_monitor::msg_handler_nav_message, this, _1));
#endif
#endif
nav_message_udp_sink_ = std::make_unique<Nav_Message_Udp_Sink>(addresses, port);
}
void nav_message_monitor::msg_handler_nav_message(const pmt::pmt_t& msg)
{
gr::thread::scoped_lock lock(d_setlock); // require mutex with msg_handler_galileo_e6_has function called by the scheduler
try
{
const size_t msg_type_hash_code = pmt::any_ref(msg).type().hash_code();
if (msg_type_hash_code == typeid(std::shared_ptr<Nav_Message_Packet>).hash_code())
{
const auto nav_message_packet = boost::any_cast<std::shared_ptr<Nav_Message_Packet>>(pmt::any_ref(msg));
nav_message_udp_sink_->write_nav_message(nav_message_packet);
}
else
{
LOG(WARNING) << "nav_message_monitor received an unknown object type!";
}
}
catch (const boost::bad_any_cast& e)
{
LOG(WARNING) << "nav_message_monitor Bad any_cast: " << e.what();
}
}

View File

@ -0,0 +1,60 @@
/*!
* \file nav_message_monitor.h
* \brief GNU Radio block that processes Nav_Message_Packet received from
* telemetry blocks and sends them via UDP.
* \author Carles Fernandez-Prades, 2021. cfernandez(at)cttc.es
*
* -----------------------------------------------------------------------------
*
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
* This file is part of GNSS-SDR.
*
* Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors)
* SPDX-License-Identifier: GPL-3.0-or-later
*
* -----------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_NAV_MESSAGE_MONITOR_H
#define GNSS_SDR_NAV_MESSAGE_MONITOR_H
#include "nav_message_udp_sink.h"
#include "gnss_block_interface.h"
#include <gnuradio/block.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <memory>
#include <string>
#include <vector>
/** \addtogroup Core
* \{ */
/** \addtogroup Core_Receiver_Library
* \{ */
class nav_message_monitor;
using nav_message_monitor_sptr = gnss_shared_ptr<nav_message_monitor>;
nav_message_monitor_sptr nav_message_monitor_make(const std::vector<std::string>& addresses, uint16_t port);
/*!
* \brief GNU Radio block that receives asynchronous Nav_Message_Packet obkects
* from the telemetry blocks and sends them via UDP
*/
class nav_message_monitor : public gr::block
{
public:
~nav_message_monitor() = default; //!< Default destructor
private:
friend nav_message_monitor_sptr nav_message_monitor_make(const std::vector<std::string>& addresses, uint16_t port);
nav_message_monitor(const std::vector<std::string>& addresses, uint16_t port);
void msg_handler_nav_message(const pmt::pmt_t& msg);
std::unique_ptr<Nav_Message_Udp_Sink> nav_message_udp_sink_;
};
/** \} */
/** \} */
#endif // GNSS_SDR_NAV_MESSAGE_MONITOR_H

View File

@ -0,0 +1,85 @@
/*!
* \file nav_message_packet.h
* \brief Class for storage of decoded navigation messages
* \author Carles Fernandez-Prades, 2021. cfernandez(at)cttc.es
*
* -----------------------------------------------------------------------------
*
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
* This file is part of GNSS-SDR.
*
* Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors)
* SPDX-License-Identifier: GPL-3.0-or-later
*
* -----------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_NAV_MESSAGE_PACKET_H
#define GNSS_SDR_NAV_MESSAGE_PACKET_H
#include <cstdint>
#include <string>
/** \addtogroup Core
* \{ */
/** \addtogroup Core_Receiver_Library
* \{ */
class Nav_Message_Packet
{
public:
Nav_Message_Packet() = default; //!< Default constructor
~Nav_Message_Packet() = default; //!< Default destructor
std::string system; //!< GNSS constellation: "G" for GPS, "R" for Glonass, "S" for SBAS, "E" for Galileo and "C" for Beidou.
std::string signal; //!< GNSS signal: "1C" for GPS L1 C/A, "1B" for Galileo E1b/c, "1G" for Glonass L1 C/A, "2S" for GPS L2 L2C(M), "2G" for Glonass L2 C/A, "L5" for GPS L5 and "5X" for Galileo E5a
int32_t prn; //!< SV ID
int32_t tow_at_current_symbol_ms; //!< Time of week of the current symbol, in ms
std::string nav_message; //!< Content of the navigation page
/// Copy constructor
Nav_Message_Packet(const Nav_Message_Packet& other) noexcept
{
*this = other;
};
/// Copy assignment operator
Nav_Message_Packet& operator=(const Nav_Message_Packet& rhs) noexcept
{
// Only do assignment if RHS is a different object from this.
if (this != &rhs)
{
this->system = rhs.system;
this->signal = rhs.signal;
this->prn = rhs.prn;
this->tow_at_current_symbol_ms = rhs.tow_at_current_symbol_ms;
this->nav_message = rhs.nav_message;
}
return *this;
};
/// Move constructor
Nav_Message_Packet(Nav_Message_Packet&& other) noexcept
{
*this = std::move(other);
};
/// Move assignment operator
Nav_Message_Packet& operator=(Nav_Message_Packet&& other) noexcept
{
if (this != &other)
{
this->system = other.system;
this->signal = other.signal;
this->prn = other.prn;
this->tow_at_current_symbol_ms = other.tow_at_current_symbol_ms;
this->nav_message = other.nav_message;
}
return *this;
};
};
/** \} */
/** \} */
#endif // GNSS_SDR_NAV_MESSAGE_PACKET_H

View File

@ -0,0 +1,56 @@
/*!
* \file nav_message_udp_sink.cc
* \brief Implementation of a class that sends serialized Nav_Message_Packet
* objects over UDP to one or multiple endpoints.
* \author Carles Fernandez-Prades, 2021. cfernandez(at)cttc.es
*
* -----------------------------------------------------------------------------
*
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
* This file is part of GNSS-SDR.
*
* Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors)
* SPDX-License-Identifier: GPL-3.0-or-later
*
* -----------------------------------------------------------------------------
*/
#include "nav_message_udp_sink.h"
#include <iostream>
#include <sstream>
Nav_Message_Udp_Sink::Nav_Message_Udp_Sink(const std::vector<std::string>& addresses, const uint16_t& port) : socket{io_context}
{
for (const auto& address : addresses)
{
boost::asio::ip::udp::endpoint endpoint(boost::asio::ip::address::from_string(address, error), port);
endpoints.push_back(endpoint);
}
serdes_nav = Serdes_Nav_Message();
}
bool Nav_Message_Udp_Sink::write_nav_message(const std::shared_ptr<Nav_Message_Packet>& nav_meg_packet)
{
std::string outbound_data = serdes_nav.createProtobuffer(nav_meg_packet);
for (const auto& endpoint : endpoints)
{
socket.open(endpoint.protocol(), error);
socket.connect(endpoint, error);
try
{
if (socket.send(boost::asio::buffer(outbound_data)) == 0)
{
return false;
}
}
catch (boost::system::system_error const& e)
{
return false;
}
}
return true;
}

View File

@ -0,0 +1,56 @@
/*!
* \file nav_message_udp_sink.h
* \brief Interface of a class that sends serialized Nav_Message_Packet objects
* over UDP to one or multiple endpoints.
* \author Carles Fernandez-Prades, 2021. cfernandez(at)cttc.es
*
* -----------------------------------------------------------------------------
*
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
* This file is part of GNSS-SDR.
*
* Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors)
* SPDX-License-Identifier: GPL-3.0-or-later
*
* -----------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_NAV_MESSAGE_UDP_SINK_H
#define GNSS_SDR_NAV_MESSAGE_UDP_SINK_H
#include "nav_message_packet.h"
#include "serdes_nav_message.h"
#include <boost/asio.hpp>
#include <memory>
#include <string>
#include <vector>
/** \addtogroup Core
* \{ */
/** \addtogroup Core_Receiver_Library
* \{ */
#if USE_BOOST_ASIO_IO_CONTEXT
using b_io_context = boost::asio::io_context;
#else
using b_io_context = boost::asio::io_service;
#endif
class Nav_Message_Udp_Sink
{
public:
Nav_Message_Udp_Sink(const std::vector<std::string>& addresses, const uint16_t& port);
bool write_nav_message(const std::shared_ptr<Nav_Message_Packet>& nav_meg_packet);
private:
Serdes_Nav_Message serdes_nav;
b_io_context io_context;
boost::asio::ip::udp::socket socket;
std::vector<boost::asio::ip::udp::endpoint> endpoints;
boost::system::error_code error;
};
/** \} */
/** \} */
#endif // GNSS_SDR_NAV_MESSAGE_UDP_SINK_H

View File

@ -0,0 +1,112 @@
/*!
* \file serdes_nav_message.h
* \brief Serialization / Deserialization of Nav_Message_Packet objects using
* Protocol Buffers
* \author Carles Fernandez-Prades, 2021. cfernandez(at)cttc.es
*
* -----------------------------------------------------------------------------
*
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
* This file is part of GNSS-SDR.
*
* Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors)
* SPDX-License-Identifier: GPL-3.0-or-later
*
* -----------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_SERDES_NAV_MESSAGE_H
#define GNSS_SDR_SERDES_NAV_MESSAGE_H
#include "nav_message.pb.h" // file created by Protocol Buffers at compile time
#include "nav_message_packet.h"
#include <cstdint>
#include <string>
/** \addtogroup Telemetry_Decoder
* \{ */
/** \addtogroup Telemetry_Decoder_libs
* \{ */
/*!
* \brief This class implements serialization and deserialization of
* Nav_Message_Packet objects using Protocol Buffers.
*/
class Serdes_Nav_Message
{
public:
Serdes_Nav_Message()
{
// Verify that the version of the library that we linked against is
// compatible with the version of the headers we compiled against.
GOOGLE_PROTOBUF_VERIFY_VERSION;
}
~Serdes_Nav_Message()
{
// google::protobuf::ShutdownProtobufLibrary();
}
inline Serdes_Nav_Message(const Serdes_Nav_Message& other) noexcept //!< Copy constructor
{
this->navmsg_ = other.navmsg_;
}
inline Serdes_Nav_Message& operator=(const Serdes_Nav_Message& rhs) noexcept //!< Copy assignment operator
{
this->navmsg_ = rhs.navmsg_;
return *this;
}
inline Serdes_Nav_Message(Serdes_Nav_Message&& other) noexcept //!< Move constructor
{
this->navmsg_ = std::move(other.navmsg_);
}
inline Serdes_Nav_Message& operator=(Serdes_Nav_Message&& other) noexcept //!< Move assignment operator
{
if (this != &other)
{
this->navmsg_ = std::move(other.navmsg_);
}
return *this;
}
inline std::string createProtobuffer(const std::shared_ptr<Nav_Message_Packet> nav_msg_packet) //!< Serialization into a string
{
navmsg_.Clear();
std::string data;
navmsg_.set_system(nav_msg_packet->system);
navmsg_.set_signal(nav_msg_packet->signal);
navmsg_.set_prn(nav_msg_packet->prn);
navmsg_.set_tow_at_current_symbol_ms(nav_msg_packet->tow_at_current_symbol_ms);
navmsg_.set_nav_message(nav_msg_packet->nav_message);
navmsg_.SerializeToString(&data);
return data;
}
inline Nav_Message_Packet readProtobuffer(const gnss_sdr::navMsg& msg) const //!< Deserialization
{
Nav_Message_Packet navmsg;
navmsg.system = msg.system();
navmsg.signal = msg.signal();
navmsg.prn = msg.prn();
navmsg.tow_at_current_symbol_ms = msg.tow_at_current_symbol_ms();
navmsg.nav_message = msg.nav_message();
return navmsg;
}
private:
gnss_sdr::navMsg navmsg_{};
};
/** \} */
/** \} */
#endif // GNSS_SDR_SERDES_NAV_MESSAGE_H

View File

@ -36,6 +36,7 @@
#include "gnss_satellite.h"
#include "gnss_sdr_make_unique.h"
#include "gnss_synchro_monitor.h"
#include "nav_message_monitor.h"
#include "signal_source_interface.h"
#include <boost/lexical_cast.hpp> // for boost::lexical_cast
#include <boost/tokenizer.hpp> // for boost::tokenizer
@ -236,6 +237,20 @@ void GNSSFlowgraph::init()
configuration_->property("TrackingMonitor.udp_port", 1236),
udp_addr_vec, enable_protobuf);
}
/*
* Instantiate the receiver av message monitor block, if required
*/
enable_navdata_monitor_ = configuration_->property("NavDataMonitor.enable_monitor", false);
if (enable_navdata_monitor_)
{
// Retrieve monitor properties
std::string address_string = configuration_->property("NavDataMonitor.client_addresses", std::string("127.0.0.1"));
std::vector<std::string> udp_addr_vec = split_string(address_string, '_');
std::sort(udp_addr_vec.begin(), udp_addr_vec.end());
udp_addr_vec.erase(std::unique(udp_addr_vec.begin(), udp_addr_vec.end()), udp_addr_vec.end());
NavDataMonitor_ = nav_message_monitor_make(udp_addr_vec, configuration_->property("NavDataMonitor.port", 1237));
}
}
@ -1512,6 +1527,25 @@ int GNSSFlowgraph::connect_tracking_monitor()
return 0;
}
int GNSSFlowgraph::connect_navdata_monitor()
{
try
{
for (int i = 0; i < channels_count_; i++)
{
top_block_->msg_connect(channels_.at(i)->get_right_block(), pmt::mp("Nav_msg_from_TLM"), NavDataMonitor_, pmt::mp("Nav_msg_from_TLM"));
}
}
catch (const std::exception& e)
{
LOG(ERROR) << "Can't connect TlM outputs to Monitor block: " << e.what();
top_block_->disconnect_all();
return 1;
}
DLOG(INFO) << "navdata monitor successfully connected to Channel blocks";
return 0;
}
int GNSSFlowgraph::connect_monitors()
{
@ -1542,9 +1576,18 @@ int GNSSFlowgraph::connect_monitors()
}
}
// NAVIGATION DATA MONITOR
if (enable_navdata_monitor_)
{
if (connect_navdata_monitor() != 0)
{
return 1;
}
}
return 0;
}
int GNSSFlowgraph::connect_gal_e6_has()
{
try
@ -1582,6 +1625,7 @@ int GNSSFlowgraph::connect_gal_e6_has()
return 0;
}
int GNSSFlowgraph::disconnect_monitors()
{
try
@ -1600,6 +1644,10 @@ int GNSSFlowgraph::disconnect_monitors()
{
top_block_->disconnect(channels_.at(i)->get_right_block_trk(), 0, GnssSynchroTrackingMonitor_, i);
}
if (enable_navdata_monitor_)
{
top_block_->msg_disconnect(channels_.at(i)->get_right_block(), pmt::mp("Nav_msg_from_TLM"), NavDataMonitor_, pmt::mp("Nav_msg_from_TLM"));
}
}
}
catch (const std::exception& e)

View File

@ -181,6 +181,7 @@ private:
int connect_gnss_synchro_monitor();
int connect_acquisition_monitor();
int connect_tracking_monitor();
int connect_navdata_monitor();
int disconnect_desktop_flowgraph();
@ -245,6 +246,7 @@ private:
gr::basic_block_sptr GnssSynchroMonitor_;
gr::basic_block_sptr GnssSynchroAcquisitionMonitor_;
gr::basic_block_sptr GnssSynchroTrackingMonitor_;
gr::basic_block_sptr NavDataMonitor_;
channel_status_msg_receiver_sptr channels_status_; // class that receives and stores the current status of the receiver channels
galileo_e6_has_msg_receiver_sptr gal_e6_has_rx_;
@ -301,6 +303,7 @@ private:
bool enable_monitor_;
bool enable_acquisition_monitor_;
bool enable_tracking_monitor_;
bool enable_navdata_monitor_;
bool enable_fpga_offloading_;
};