1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-11-18 08:05:17 +00:00

Replacing Galileo E1, SBAS, and GPS L2C telemetry shared queues and maps

with GNURadio asynchronous messages (TLM -> PVT)
This commit is contained in:
Javier Arribas
2016-04-12 17:29:16 +02:00
parent 588864e19e
commit b56183f93b
24 changed files with 239 additions and 748 deletions

View File

@@ -40,11 +40,6 @@
using google::LogMessage;
extern concurrent_map<Galileo_Ephemeris> global_galileo_ephemeris_map;
extern concurrent_map<Galileo_Iono> global_galileo_iono_map;
extern concurrent_map<Galileo_Utc_Model> global_galileo_utc_model_map;
extern concurrent_map<Galileo_Almanac> global_galileo_almanac_map;
galileo_e1_pvt_cc_sptr
galileo_e1_make_pvt_cc(unsigned int nchannels, boost::shared_ptr<gr::msg_queue> queue, bool dump, std::string dump_filename, int averaging_depth, bool flag_averaging, int output_rate_ms, int display_rate_ms, bool flag_nmea_tty_port, std::string nmea_dump_filename, std::string nmea_dump_devname, bool flag_rtcm_server, bool flag_rtcm_tty_port, std::string rtcm_dump_devname)
{
@@ -52,6 +47,50 @@ galileo_e1_make_pvt_cc(unsigned int nchannels, boost::shared_ptr<gr::msg_queue>
}
void galileo_e1_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg)
{
try {
if( pmt::any_ref(msg).type() == typeid(std::shared_ptr<Galileo_Ephemeris>) )
{
// ### Galileo EPHEMERIS ###
std::shared_ptr<Galileo_Ephemeris> galileo_eph;
galileo_eph= boost::any_cast<std::shared_ptr<Galileo_Ephemeris>>(pmt::any_ref(msg));
// insert new ephemeris record
DLOG(INFO) << "Galileo New Ephemeris record inserted in global map with TOW =" << galileo_eph->TOW_5
<< ", GALILEO Week Number =" << galileo_eph->WN_5
<< " and Ephemeris IOD = " << galileo_eph->IOD_ephemeris;
// update/insert new ephemeris record to the global ephemeris map
d_ls_pvt->galileo_ephemeris_map[galileo_eph->i_satellite_PRN]=*galileo_eph;
}else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr<Galileo_Iono>) )
{
// ### Galileo IONO ###
std::shared_ptr<Galileo_Iono> galileo_iono;
galileo_iono= boost::any_cast<std::shared_ptr<Galileo_Iono>>(pmt::any_ref(msg));
d_ls_pvt->galileo_iono=*galileo_iono;
DLOG(INFO) << "New IONO record has arrived ";
}else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr<Galileo_Utc_Model>) )
{
// ### Galileo UTC MODEL ###
std::shared_ptr<Galileo_Utc_Model> galileo_utc_model;
galileo_utc_model= boost::any_cast<std::shared_ptr<Galileo_Utc_Model>>(pmt::any_ref(msg));
d_ls_pvt->galileo_utc_model=*galileo_utc_model;
DLOG(INFO) << "New UTC record has arrived ";
}else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr<Galileo_Almanac>) )
{
// ### Galileo Almanac ###
std::shared_ptr<Galileo_Almanac> galileo_almanac;
galileo_almanac= boost::any_cast<std::shared_ptr<Galileo_Almanac>>(pmt::any_ref(msg));
// update/insert new ephemeris record to the global ephemeris map
d_ls_pvt->galileo_almanac=*galileo_almanac;
DLOG(INFO) << "New Galileo Almanac has arrived ";
}
}
catch(boost::bad_any_cast& e)
{
DLOG(WARNING) << "msg_handler_telemetry Bad any cast!\n";
}
}
galileo_e1_pvt_cc::galileo_e1_pvt_cc(unsigned int nchannels, boost::shared_ptr<gr::msg_queue> queue, bool dump, std::string dump_filename, int averaging_depth, bool flag_averaging, int output_rate_ms, int display_rate_ms, bool flag_nmea_tty_port, std::string nmea_dump_filename, std::string nmea_dump_devname, bool flag_rtcm_server, bool flag_rtcm_tty_port, std::string rtcm_dump_devname) :
gr::block("galileo_e1_pvt_cc", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)),
gr::io_signature::make(0, 0, sizeof(gr_complex)))
@@ -65,6 +104,11 @@ galileo_e1_pvt_cc::galileo_e1_pvt_cc(unsigned int nchannels, boost::shared_ptr<g
d_dump_filename = dump_filename;
std::string dump_ls_pvt_filename = dump_filename;
// GPS Ephemeris data message port in
this->message_port_register_in(pmt::mp("telemetry"));
this->set_msg_handler(pmt::mp("telemetry"),
boost::bind(&galileo_e1_pvt_cc::msg_handler_telemetry, this, _1));
//initialize kml_printer
std::string kml_dump_filename;
kml_dump_filename = d_dump_filename;
@@ -169,71 +213,6 @@ int galileo_e1_pvt_cc::general_work (int noutput_items __attribute__((unused)),
}
}
// ############ 1. READ EPHEMERIS/UTC_MODE/IONO FROM GLOBAL MAPS ####
if (global_galileo_ephemeris_map.size() > 0)
{
d_ls_pvt->galileo_ephemeris_map = global_galileo_ephemeris_map.get_map_copy();
}
if (global_galileo_utc_model_map.size() > 0)
{
// UTC MODEL data is shared for all the Galileo satellites. Read always at a locked channel
signed int i = 0;
while(true)
{
if (in[i][0].Flag_valid_pseudorange == true)
{
global_galileo_utc_model_map.read(i, d_ls_pvt->galileo_utc_model);
break;
}
i++;
if (i == (signed int)d_nchannels - 1)
{
break;
}
}
}
if (global_galileo_iono_map.size() > 0)
{
// IONO data is shared for all Galileo satellites. Read always at a locked channel
signed int i = 0;
while(true)
{
if (in[i][0].Flag_valid_pseudorange == true)
{
global_galileo_iono_map.read(i, d_ls_pvt->galileo_iono);
break;
}
i++;
if (i == (signed int)d_nchannels - 1)
{
break;
}
}
}
if (global_galileo_almanac_map.size() > 0)
{
// ALMANAC data is shared for all Galileo satellites. Read always at a locked channel
signed int i = 0;
while(true)
{
if (in[i][0].Flag_valid_pseudorange == true)
{
global_galileo_almanac_map.read(i, d_ls_pvt->galileo_almanac);
break;
}
i++;
if (i == (signed int)d_nchannels - 1)
{
break;
}
}
}
// ############ 2 COMPUTE THE PVT ################################
if (gnss_pseudoranges_map.size() > 0 and d_ls_pvt->galileo_ephemeris_map.size() > 0)
{

View File

@@ -96,6 +96,9 @@ private:
bool flag_rtcm_server,
bool flag_rtcm_tty_port,
std::string rtcm_dump_devname);
void msg_handler_telemetry(pmt::pmt_t msg);
boost::shared_ptr<gr::msg_queue> d_queue;
bool d_dump;
bool b_rinex_header_writen;

View File

@@ -42,11 +42,6 @@
using google::LogMessage;
extern concurrent_queue<Sbas_Raw_Msg> global_sbas_raw_msg_queue;
extern concurrent_map<Sbas_Ionosphere_Correction> global_sbas_iono_map;
extern concurrent_map<Sbas_Satellite_Correction> global_sbas_sat_corr_map;
extern concurrent_map<Sbas_Ephemeris> global_sbas_ephemeris_map;
gps_l1_ca_pvt_cc_sptr
gps_l1_ca_make_pvt_cc(unsigned int nchannels, boost::shared_ptr<gr::msg_queue> queue, bool dump, std::string dump_filename, int averaging_depth, bool flag_averaging, int output_rate_ms, int display_rate_ms, bool flag_nmea_tty_port, std::string nmea_dump_filename, std::string nmea_dump_devname, bool flag_rtcm_server, bool flag_rtcm_tty_port, std::string rtcm_dump_devname)
{
@@ -62,7 +57,7 @@ void gps_l1_ca_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg)
// ### GPS EPHEMERIS ###
std::shared_ptr<Gps_Ephemeris> gps_eph;
gps_eph= boost::any_cast<std::shared_ptr<Gps_Ephemeris>>(pmt::any_ref(msg));
LOG(INFO) << "Ephemeris record has arrived from SAT ID "
DLOG(INFO) << "Ephemeris record has arrived from SAT ID "
<< gps_eph->i_satellite_PRN << " (Block "
<< gps_eph->satelliteBlock[gps_eph->i_satellite_PRN] << ")"
<< "inserted with Toe="<< gps_eph->d_Toe<<" and GPS Week="
@@ -71,20 +66,70 @@ void gps_l1_ca_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg)
d_ls_pvt->gps_ephemeris_map[gps_eph->i_satellite_PRN]=*gps_eph;
}else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr<Gps_Iono>) )
{
// ### IONO ###
// ### GPS IONO ###
std::shared_ptr<Gps_Iono> gps_iono;
gps_iono= boost::any_cast<std::shared_ptr<Gps_Iono>>(pmt::any_ref(msg));
d_ls_pvt->gps_iono=*gps_iono;
LOG(INFO) << "New IONO record has arrived ";
DLOG(INFO) << "New IONO record has arrived ";
}else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr<Gps_Utc_Model>) )
{
// ### UTC MODEL ###
// ### GPS UTC MODEL ###
std::shared_ptr<Gps_Utc_Model> gps_utc_model;
gps_utc_model= boost::any_cast<std::shared_ptr<Gps_Utc_Model>>(pmt::any_ref(msg));
d_ls_pvt->gps_utc_model=*gps_utc_model;
LOG(INFO) << "New UTC record has arrived ";
DLOG(INFO) << "New UTC record has arrived ";
}else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr<Sbas_Ionosphere_Correction>) )
{
// ### SBAS IONO ###
std::shared_ptr<Sbas_Ionosphere_Correction> sbas_iono;
sbas_iono= boost::any_cast<std::shared_ptr<Sbas_Ionosphere_Correction>>(pmt::any_ref(msg));
d_ls_pvt->sbas_iono=*sbas_iono;
DLOG(INFO) << "New SBAS IONO record has arrived ";
}
//TODO: add SBAS correction maps here
//d_ls_pvt->sbas_sat_corr_map = global_sbas_sat_corr_map.get_map_copy();
//d_ls_pvt->sbas_ephemeris_map = global_sbas_ephemeris_map.get_map_copy();
else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr<Sbas_Raw_Msg>) )
{
std::shared_ptr<Sbas_Raw_Msg> sbas_raw_msg_ptr;
sbas_raw_msg_ptr= boost::any_cast<std::shared_ptr<Sbas_Raw_Msg>>(pmt::any_ref(msg));
Sbas_Raw_Msg sbas_raw_msg=*sbas_raw_msg_ptr;
// read SBAS raw messages directly from queue and write them into rinex file
// create the header of not yet done
if(!b_rinex_sbs_header_writen)
{
rp->rinex_sbs_header(rp->sbsFile);
b_rinex_sbs_header_writen = true;
}
// Define the RX time of the SBAS message by using the GPS time.
// It has only an effect if there has not been yet a SBAS MT12 available
// when the message was received.
if(sbas_raw_msg.get_rx_time_obj().is_related() == false
&& gnss_pseudoranges_map.size() > 0
&& d_ls_pvt->gps_ephemeris_map.size() > 0)
{
// doesn't matter which channel/satellite we choose
Gnss_Synchro gs = gnss_pseudoranges_map.begin()->second;
Gps_Ephemeris eph = d_ls_pvt->gps_ephemeris_map.begin()->second;
double relative_rx_time = gs.Tracking_timestamp_secs;
int gps_week = eph.i_GPS_week;
double gps_sec = gs.d_TOW_at_current_symbol;
Sbas_Time_Relation time_rel(relative_rx_time, gps_week, gps_sec);
sbas_raw_msg.relate(time_rel);
}
// send the message to the rinex logger if it has a valid GPS time stamp
if(sbas_raw_msg.get_rx_time_obj().is_related())
{
rp->log_rinex_sbs(rp->sbsFile, sbas_raw_msg);
}
}
}
catch(boost::bad_any_cast& e)
{
@@ -180,19 +225,15 @@ gps_l1_ca_pvt_cc::gps_l1_ca_pvt_cc(unsigned int nchannels,
}
}
gps_l1_ca_pvt_cc::~gps_l1_ca_pvt_cc()
{}
bool pseudoranges_pairCompare_min(const std::pair<int,Gnss_Synchro>& a, const std::pair<int,Gnss_Synchro>& b)
{
return (a.second.Pseudorange_m) < (b.second.Pseudorange_m);
}
void gps_l1_ca_pvt_cc::print_receiver_status(Gnss_Synchro** channels_synchronization_data)
{
// Print the current receiver status using std::cout every second
@@ -209,14 +250,13 @@ void gps_l1_ca_pvt_cc::print_receiver_status(Gnss_Synchro** channels_synchroniza
int gps_l1_ca_pvt_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items __attribute__((unused)))
{
gnss_pseudoranges_map.clear();
d_sample_counter++;
std::map<int,Gnss_Synchro> gnss_pseudoranges_map;
Gnss_Synchro **in = (Gnss_Synchro **) &input_items[0]; //Get the input pointer
print_receiver_status(in);
// ############ 1. READ EPHEMERIS ####
// ############ 1. READ PSEUDORANGES ####
for (unsigned int i = 0; i < d_nchannels; i++)
{
std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter;
@@ -232,52 +272,6 @@ int gps_l1_ca_pvt_cc::general_work (int noutput_items __attribute__((unused)), g
d_rtcm_printer->lock_time(gps_ephemeris_iter->second, 0.0, in[i][0]);
}
}
// update SBAS data collections
if (global_sbas_iono_map.size() > 0)
{
// SBAS ionospheric correction is shared for all the GPS satellites. Read always at ID=0
global_sbas_iono_map.read(0, d_ls_pvt->sbas_iono);
}
d_ls_pvt->sbas_sat_corr_map = global_sbas_sat_corr_map.get_map_copy();
d_ls_pvt->sbas_ephemeris_map = global_sbas_ephemeris_map.get_map_copy();
// read SBAS raw messages directly from queue and write them into rinex file
Sbas_Raw_Msg sbas_raw_msg;
while (global_sbas_raw_msg_queue.try_pop(sbas_raw_msg))
{
// create the header of not yet done
if(!b_rinex_sbs_header_writen)
{
rp->rinex_sbs_header(rp->sbsFile);
b_rinex_sbs_header_writen = true;
}
// Define the RX time of the SBAS message by using the GPS time.
// It has only an effect if there has not been yet a SBAS MT12 available
// when the message was received.
if(sbas_raw_msg.get_rx_time_obj().is_related() == false
&& gnss_pseudoranges_map.size() > 0
&& d_ls_pvt->gps_ephemeris_map.size() > 0)
{
// doesn't matter which channel/satellite we choose
Gnss_Synchro gs = gnss_pseudoranges_map.begin()->second;
Gps_Ephemeris eph = d_ls_pvt->gps_ephemeris_map.begin()->second;
double relative_rx_time = gs.Tracking_timestamp_secs;
int gps_week = eph.i_GPS_week;
double gps_sec = gs.d_TOW_at_current_symbol;
Sbas_Time_Relation time_rel(relative_rx_time, gps_week, gps_sec);
sbas_raw_msg.relate(time_rel);
}
// send the message to the rinex logger if it has a valid GPS time stamp
if(sbas_raw_msg.get_rx_time_obj().is_related())
{
rp->log_rinex_sbs(rp->sbsFile, sbas_raw_msg);
}
}
// ############ 2 COMPUTE THE PVT ################################
if (gnss_pseudoranges_map.size() > 0 and d_ls_pvt->gps_ephemeris_map.size() > 0)
{

View File

@@ -127,6 +127,8 @@ private:
double d_rx_time;
std::shared_ptr<gps_l1_ca_ls_pvt> d_ls_pvt;
std::map<int,Gnss_Synchro> gnss_pseudoranges_map;
public:
~gps_l1_ca_pvt_cc (); //!< Default destructor

View File

@@ -40,15 +40,6 @@
using google::LogMessage;
extern concurrent_map<Galileo_Ephemeris> global_galileo_ephemeris_map;
extern concurrent_map<Galileo_Iono> global_galileo_iono_map;
extern concurrent_map<Galileo_Utc_Model> global_galileo_utc_model_map;
extern concurrent_map<Galileo_Almanac> global_galileo_almanac_map;
extern concurrent_map<Gps_Ephemeris> global_gps_ephemeris_map;
extern concurrent_map<Gps_Iono> global_gps_iono_map;
extern concurrent_map<Gps_Utc_Model> global_gps_utc_model_map;
hybrid_pvt_cc_sptr
hybrid_make_pvt_cc(unsigned int nchannels, boost::shared_ptr<gr::msg_queue> queue, bool dump, std::string dump_filename, int averaging_depth, bool flag_averaging, int output_rate_ms, int display_rate_ms, bool flag_nmea_tty_port, std::string nmea_dump_filename, std::string nmea_dump_devname, bool flag_rtcm_server, bool flag_rtcm_tty_port, std::string rtcm_dump_devname)
{
@@ -56,6 +47,85 @@ hybrid_make_pvt_cc(unsigned int nchannels, boost::shared_ptr<gr::msg_queue> queu
}
void hybrid_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg)
{
try {
if( pmt::any_ref(msg).type() == typeid(std::shared_ptr<Gps_Ephemeris>) )
{
// ### GPS EPHEMERIS ###
std::shared_ptr<Gps_Ephemeris> gps_eph;
gps_eph= boost::any_cast<std::shared_ptr<Gps_Ephemeris>>(pmt::any_ref(msg));
DLOG(INFO) << "Ephemeris record has arrived from SAT ID "
<< gps_eph->i_satellite_PRN << " (Block "
<< gps_eph->satelliteBlock[gps_eph->i_satellite_PRN] << ")"
<< "inserted with Toe="<< gps_eph->d_Toe<<" and GPS Week="
<< gps_eph->i_GPS_week;
// update/insert new ephemeris record to the global ephemeris map
d_ls_pvt->gps_ephemeris_map[gps_eph->i_satellite_PRN]=*gps_eph;
}
else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr<Gps_Iono>) )
{
// ### GPS IONO ###
std::shared_ptr<Gps_Iono> gps_iono;
gps_iono= boost::any_cast<std::shared_ptr<Gps_Iono>>(pmt::any_ref(msg));
d_ls_pvt->gps_iono=*gps_iono;
DLOG(INFO) << "New IONO record has arrived ";
}
else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr<Gps_Utc_Model>) )
{
// ### GPS UTC MODEL ###
std::shared_ptr<Gps_Utc_Model> gps_utc_model;
gps_utc_model= boost::any_cast<std::shared_ptr<Gps_Utc_Model>>(pmt::any_ref(msg));
d_ls_pvt->gps_utc_model=*gps_utc_model;
DLOG(INFO) << "New UTC record has arrived ";
}
if( pmt::any_ref(msg).type() == typeid(std::shared_ptr<Galileo_Ephemeris>) )
{
// ### Galileo EPHEMERIS ###
std::shared_ptr<Galileo_Ephemeris> galileo_eph;
galileo_eph= boost::any_cast<std::shared_ptr<Galileo_Ephemeris>>(pmt::any_ref(msg));
// insert new ephemeris record
DLOG(INFO) << "Galileo New Ephemeris record inserted in global map with TOW =" << galileo_eph->TOW_5
<< ", GALILEO Week Number =" << galileo_eph->WN_5
<< " and Ephemeris IOD = " << galileo_eph->IOD_ephemeris;
// update/insert new ephemeris record to the global ephemeris map
d_ls_pvt->galileo_ephemeris_map[galileo_eph->i_satellite_PRN]=*galileo_eph;
}
else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr<Galileo_Iono>) )
{
// ### Galileo IONO ###
std::shared_ptr<Galileo_Iono> galileo_iono;
galileo_iono= boost::any_cast<std::shared_ptr<Galileo_Iono>>(pmt::any_ref(msg));
d_ls_pvt->galileo_iono=*galileo_iono;
DLOG(INFO) << "New IONO record has arrived ";
}
else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr<Galileo_Utc_Model>) )
{
// ### Galileo UTC MODEL ###
std::shared_ptr<Galileo_Utc_Model> galileo_utc_model;
galileo_utc_model= boost::any_cast<std::shared_ptr<Galileo_Utc_Model>>(pmt::any_ref(msg));
d_ls_pvt->galileo_utc_model=*galileo_utc_model;
DLOG(INFO) << "New UTC record has arrived ";
}
else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr<Galileo_Almanac>) )
{
// ### Galileo Almanac ###
std::shared_ptr<Galileo_Almanac> galileo_almanac;
galileo_almanac= boost::any_cast<std::shared_ptr<Galileo_Almanac>>(pmt::any_ref(msg));
// update/insert new ephemeris record to the global ephemeris map
d_ls_pvt->galileo_almanac=*galileo_almanac;
DLOG(INFO) << "New Galileo Almanac has arrived ";
}
}
catch(boost::bad_any_cast& e)
{
DLOG(WARNING) << "msg_handler_telemetry Bad any cast!\n";
}
}
hybrid_pvt_cc::hybrid_pvt_cc(unsigned int nchannels, boost::shared_ptr<gr::msg_queue> queue, bool dump, std::string dump_filename, int averaging_depth, bool flag_averaging, int output_rate_ms, int display_rate_ms, bool flag_nmea_tty_port, std::string nmea_dump_filename, std::string nmea_dump_devname, bool flag_rtcm_server, bool flag_rtcm_tty_port, std::string rtcm_dump_devname) :
gr::block("hybrid_pvt_cc", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)),
gr::io_signature::make(0, 0, sizeof(gr_complex)))
@@ -69,6 +139,11 @@ hybrid_pvt_cc::hybrid_pvt_cc(unsigned int nchannels, boost::shared_ptr<gr::msg_q
d_dump_filename = dump_filename;
std::string dump_ls_pvt_filename = dump_filename;
// GPS Ephemeris data message port in
this->message_port_register_in(pmt::mp("telemetry"));
this->set_msg_handler(pmt::mp("telemetry"),
boost::bind(&hybrid_pvt_cc::msg_handler_telemetry, this, _1));
//initialize kml_printer
std::string kml_dump_filename;
kml_dump_filename = d_dump_filename;
@@ -158,7 +233,7 @@ int hybrid_pvt_cc::general_work (int noutput_items __attribute__((unused)), gr_v
d_sample_counter++;
bool arrived_galileo_almanac = false;
std::map<int,Gnss_Synchro> gnss_pseudoranges_map;
gnss_pseudoranges_map.clear();
Gnss_Synchro **in = (Gnss_Synchro **) &input_items[0]; //Get the input pointer
@@ -175,116 +250,6 @@ int hybrid_pvt_cc::general_work (int noutput_items __attribute__((unused)), gr_v
}
}
// ############ 1. READ GALILEO EPHEMERIS/UTC_MODE/IONO FROM GLOBAL MAPS ####
if (global_galileo_ephemeris_map.size() > 0)
{
d_ls_pvt->galileo_ephemeris_map = global_galileo_ephemeris_map.get_map_copy();
}
if (global_galileo_utc_model_map.size() > 0)
{
// UTC MODEL data is shared for all the Galileo satellites. Read always at a locked channel
signed int i = 0;
while(true)
{
if (in[i][0].Flag_valid_pseudorange == true)
{
global_galileo_utc_model_map.read(i, d_ls_pvt->galileo_utc_model);
break;
}
i++;
if (i == (signed int)d_nchannels - 1)
{
break;
}
}
}
if (global_galileo_iono_map.size() > 0)
{
// IONO data is shared for all Galileo satellites. Read always at a locked channel
signed int i = 0;
while(true)
{
if (in[i][0].Flag_valid_pseudorange == true)
{
global_galileo_iono_map.read(i, d_ls_pvt->galileo_iono);
break;
}
i++;
if (i == (signed int)d_nchannels - 1)
{
break;
}
}
}
if (global_galileo_almanac_map.size() > 0)
{
// data is shared for all Galileo satellites. Read always at a locked channel
signed int i = 0;
while(true)
{
if (in[i][0].Flag_valid_pseudorange == true)
{
arrived_galileo_almanac = global_galileo_almanac_map.read(i, d_ls_pvt->galileo_almanac);
break;
}
i++;
if (i == (signed int)d_nchannels - 1)
{
break;
}
}
}
// ############ 1. READ GPS EPHEMERIS/UTC_MODE/IONO FROM GLOBAL MAPS ####
if (global_gps_ephemeris_map.size() > 0)
{
d_ls_pvt->gps_ephemeris_map = global_gps_ephemeris_map.get_map_copy();
}
if (global_gps_utc_model_map.size() > 0)
{
// UTC MODEL data is shared for all the GPS satellites. Read always at a locked channel
signed int i = 0;
while(true)
{
if (in[i][0].Flag_valid_pseudorange == true)
{
global_gps_utc_model_map.read(i, d_ls_pvt->gps_utc_model);
break;
}
i++;
if (i == (signed int)d_nchannels - 1)
{
break;
}
}
}
if (global_gps_iono_map.size() > 0)
{
// IONO data is shared for all the GPS satellites. Read always at a locked channel
signed int i = 0;
while(true)
{
if (in[i][0].Flag_valid_pseudorange == true)
{
global_gps_iono_map.read(i, d_ls_pvt->gps_iono);
break;
}
i++;
if (i == (signed int)d_nchannels - 1)
{
break;
}
}
}
// ############ 2 COMPUTE THE PVT ################################
// ToDo: relax this condition because the receiver should work even with NO GALILEO SATELLITES
//if (gnss_pseudoranges_map.size() > 0 and d_ls_pvt->galileo_ephemeris_map.size() > 0 and d_ls_pvt->gps_ephemeris_map.size() > 0)

View File

@@ -96,6 +96,9 @@ private:
bool flag_rtcm_server,
bool flag_rtcm_tty_port,
std::string rtcm_dump_devname);
void msg_handler_telemetry(pmt::pmt_t msg);
boost::shared_ptr<gr::msg_queue> d_queue;
bool d_dump;
bool b_rinex_header_writen;
@@ -122,6 +125,7 @@ private:
double d_rx_time;
double d_TOW_at_curr_symbol_constellation;
std::shared_ptr<hybrid_ls_pvt> d_ls_pvt;
std::map<int,Gnss_Synchro> gnss_pseudoranges_map;
bool pseudoranges_pairCompare_min(const std::pair<int,Gnss_Synchro>& a, const std::pair<int,Gnss_Synchro>& b);
public:

View File

@@ -41,14 +41,6 @@
#include "galileo_iono.h"
#include "galileo_utc_model.h"
extern concurrent_queue<Galileo_Ephemeris> global_galileo_ephemeris_queue;
extern concurrent_queue<Galileo_Iono> global_galileo_iono_queue;
extern concurrent_queue<Galileo_Utc_Model> global_galileo_utc_model_queue;
extern concurrent_queue<Galileo_Almanac> global_galileo_almanac_queue;
using google::LogMessage;
GalileoE1BTelemetryDecoder::GalileoE1BTelemetryDecoder(ConfigurationInterface* configuration,
@@ -69,11 +61,6 @@ GalileoE1BTelemetryDecoder::GalileoE1BTelemetryDecoder(ConfigurationInterface* c
// make telemetry decoder object
telemetry_decoder_ = galileo_e1b_make_telemetry_decoder_cc(satellite_, queue_, dump_); // TODO fix me
DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
// set the navigation msg queue;
telemetry_decoder_->set_ephemeris_queue(&global_galileo_ephemeris_queue);
telemetry_decoder_->set_iono_queue(&global_galileo_iono_queue);
telemetry_decoder_->set_almanac_queue(&global_galileo_almanac_queue);
telemetry_decoder_->set_utc_model_queue(&global_galileo_utc_model_queue);
//decimation factor
int decimation_factor = configuration->property(role + ".decimation_factor", 1);

View File

@@ -45,12 +45,6 @@
#include "configuration_interface.h"
extern concurrent_queue<Galileo_Ephemeris> global_galileo_ephemeris_queue;
extern concurrent_queue<Galileo_Iono> global_galileo_iono_queue;
extern concurrent_queue<Galileo_Utc_Model> global_galileo_utc_model_queue;
extern concurrent_queue<Galileo_Almanac> global_galileo_almanac_queue;
using google::LogMessage;
GalileoE5aTelemetryDecoder::GalileoE5aTelemetryDecoder(ConfigurationInterface* configuration,
@@ -71,12 +65,6 @@ GalileoE5aTelemetryDecoder::GalileoE5aTelemetryDecoder(ConfigurationInterface* c
// make telemetry decoder object
telemetry_decoder_ = galileo_e5a_make_telemetry_decoder_cc(satellite_, queue_, dump_); // TODO fix me
DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
// set the navigation msg queue;
telemetry_decoder_->set_ephemeris_queue(&global_galileo_ephemeris_queue);
telemetry_decoder_->set_iono_queue(&global_galileo_iono_queue);
telemetry_decoder_->set_almanac_queue(&global_galileo_almanac_queue);
telemetry_decoder_->set_utc_model_queue(&global_galileo_utc_model_queue);
DLOG(INFO) << "global navigation message queue assigned to telemetry_decoder ("<< telemetry_decoder_->unique_id() << ")";
channel_ = 0;
}

View File

@@ -40,9 +40,6 @@
#include "gps_utc_model.h"
#include "configuration_interface.h"
extern concurrent_queue<Gps_Almanac> global_gps_almanac_queue;
using google::LogMessage;
GpsL1CaTelemetryDecoder::GpsL1CaTelemetryDecoder(ConfigurationInterface* configuration,
@@ -63,8 +60,6 @@ GpsL1CaTelemetryDecoder::GpsL1CaTelemetryDecoder(ConfigurationInterface* configu
// make telemetry decoder object
telemetry_decoder_ = gps_l1_ca_make_telemetry_decoder_cc(satellite_, queue_, dump_); // TODO fix me
DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
// set the navigation msg queue;
telemetry_decoder_->set_almanac_queue(&global_gps_almanac_queue);
//decimation factor
int decimation_factor = configuration->property(role + ".decimation_factor", 1);

View File

@@ -41,12 +41,6 @@
#include "configuration_interface.h"
extern concurrent_queue<Gps_CNAV_Ephemeris> global_gps_cnav_ephemeris_queue;
extern concurrent_queue<Gps_CNAV_Iono> global_gps_cnav_iono_queue;
//extern concurrent_queue<Gps_Utc_Model> global_gps_utc_model_queue;
//extern concurrent_queue<Gps_Almanac> global_gps_almanac_queue;
using google::LogMessage;
GpsL2MTelemetryDecoder::GpsL2MTelemetryDecoder(ConfigurationInterface* configuration,
@@ -67,11 +61,6 @@ GpsL2MTelemetryDecoder::GpsL2MTelemetryDecoder(ConfigurationInterface* configura
// make telemetry decoder object
telemetry_decoder_ = gps_l2_m_make_telemetry_decoder_cc(satellite_, queue_, dump_); // TODO fix me
DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
// set the navigation msg queue;
telemetry_decoder_->set_ephemeris_queue(&global_gps_cnav_ephemeris_queue);
telemetry_decoder_->set_iono_queue(&global_gps_cnav_iono_queue);
//telemetry_decoder_->set_almanac_queue(&global_gps_almanac_queue);
//telemetry_decoder_->set_utc_model_queue(&global_gps_utc_model_queue);
//decimation factor
int decimation_factor = configuration->property(role + ".decimation_factor", 1);

View File

@@ -41,12 +41,6 @@
#include "configuration_interface.h"
#include "sbas_l1_telemetry_decoder_cc.h"
extern concurrent_queue<Sbas_Raw_Msg> global_sbas_raw_msg_queue;
extern concurrent_queue<Sbas_Ionosphere_Correction> global_sbas_iono_queue;
extern concurrent_queue<Sbas_Satellite_Correction> global_sbas_sat_corr_queue;
extern concurrent_queue<Sbas_Ephemeris> global_sbas_ephemeris_queue;
using google::LogMessage;
SbasL1TelemetryDecoder::SbasL1TelemetryDecoder(ConfigurationInterface* configuration,
@@ -68,11 +62,6 @@ SbasL1TelemetryDecoder::SbasL1TelemetryDecoder(ConfigurationInterface* configura
telemetry_decoder_ = sbas_l1_make_telemetry_decoder_cc(satellite_, queue_, dump_); // TODO fix me
channel_ = 0;
DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
// set the queues;
telemetry_decoder_->set_raw_msg_queue(&global_sbas_raw_msg_queue);
telemetry_decoder_->set_iono_queue(&global_sbas_iono_queue);
telemetry_decoder_->set_sat_corr_queue(&global_sbas_sat_corr_queue);
telemetry_decoder_->set_ephemeris_queue(&global_sbas_ephemeris_queue);
}

View File

@@ -122,6 +122,8 @@ galileo_e1b_telemetry_decoder_cc::galileo_e1b_telemetry_decoder_cc(
{
// Telemetry Bit transition synchronization port out
this->message_port_register_out(pmt::mp("preamble_timestamp_s"));
// Ephemeris data port out
this->message_port_register_out(pmt::mp("telemetry"));
// initialize internal vars
d_queue = queue;
d_dump = dump;
@@ -168,10 +170,6 @@ galileo_e1b_telemetry_decoder_cc::galileo_e1b_telemetry_decoder_cc(
d_CRC_error_counter = 0;
flag_even_word_arrived = 0;
d_flag_preamble = false;
d_ephemeris_queue = 0;
d_utc_model_queue = 0;
d_almanac_queue = 0;
d_iono_queue = 0;
d_channel = 0;
Prn_timestamp_at_preamble_ms = 0.0;
flag_TOW_set = false;
@@ -251,38 +249,41 @@ void galileo_e1b_telemetry_decoder_cc::decode_word(double *page_part_symbols,int
// 4. Push the new navigation data to the queues
if (d_nav.have_new_ephemeris() == true)
{
// get ephemeris object for this SV
Galileo_Ephemeris ephemeris = d_nav.get_ephemeris();//notice that the read operation will clear the valid flag
//std::cout<<"New Galileo Ephemeris received for SV "<<d_satellite.get_PRN()<<std::endl;
d_ephemeris_queue->push(ephemeris);
// get object for this SV (mandatory)
std::shared_ptr<Galileo_Ephemeris> tmp_obj= std::make_shared<Galileo_Ephemeris>();
*tmp_obj = d_nav.get_ephemeris();//notice that the read operation will clear the valid flag
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
}
if (d_nav.have_new_iono_and_GST() == true)
{
Galileo_Iono iono = d_nav.get_iono(); //notice that the read operation will clear the valid flag
//std::cout<<"New Galileo IONO model (and UTC) received for SV "<<d_satellite.get_PRN()<<std::endl;
d_iono_queue->push(iono);
// get object for this SV (mandatory)
std::shared_ptr<Galileo_Iono> tmp_obj= std::make_shared<Galileo_Iono>();
*tmp_obj = d_nav.get_iono(); //notice that the read operation will clear the valid flag
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
}
if (d_nav.have_new_utc_model() == true)
{
Galileo_Utc_Model utc_model = d_nav.get_utc_model(); //notice that the read operation will clear the valid flag
//std::cout<<"New Galileo UTC model received for SV "<<d_satellite.get_PRN()<<std::endl;
d_utc_model_queue->push(utc_model);
// get object for this SV (mandatory)
std::shared_ptr<Galileo_Utc_Model> tmp_obj= std::make_shared<Galileo_Utc_Model>();
*tmp_obj = d_nav.get_utc_model(); //notice that the read operation will clear the valid flag
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
}
if (d_nav.have_new_almanac() == true)
{
Galileo_Almanac almanac = d_nav.get_almanac();
d_almanac_queue->push(almanac);
std::shared_ptr<Galileo_Almanac> tmp_obj= std::make_shared<Galileo_Almanac>();
*tmp_obj = d_nav.get_almanac();
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
//debug
std::cout << "Galileo almanac received!" << std::endl;
LOG(INFO) << "GPS_to_Galileo time conversion:";
LOG(INFO) << "A0G=" << almanac.A_0G_10;
LOG(INFO) << "A1G=" << almanac.A_1G_10;
LOG(INFO) << "T0G=" << almanac.t_0G_10;
LOG(INFO) << "WN_0G_10=" << almanac.WN_0G_10;
LOG(INFO) << "A0G=" << tmp_obj->A_0G_10;
LOG(INFO) << "A1G=" << tmp_obj->A_1G_10;
LOG(INFO) << "T0G=" << tmp_obj->t_0G_10;
LOG(INFO) << "WN_0G_10=" << tmp_obj->WN_0G_10;
LOG(INFO) << "Current parameters:";
LOG(INFO) << "d_TOW_at_current_symbol=" << d_TOW_at_current_symbol;
LOG(INFO) << "d_nav.WN_0=" << d_nav.WN_0;
delta_t = almanac.A_0G_10 + almanac.A_1G_10 * (d_TOW_at_current_symbol - almanac.t_0G_10 + 604800 * (fmod((d_nav.WN_0 - almanac.WN_0G_10), 64)));
delta_t = tmp_obj->A_0G_10 + tmp_obj->A_1G_10 * (d_TOW_at_current_symbol - tmp_obj->t_0G_10 + 604800 * (fmod((d_nav.WN_0 - tmp_obj->WN_0G_10), 64)));
LOG(INFO) << "delta_t=" << delta_t << "[s]";
}
}
@@ -551,27 +552,4 @@ void galileo_e1b_telemetry_decoder_cc::set_channel(int channel)
}
void galileo_e1b_telemetry_decoder_cc::set_ephemeris_queue(concurrent_queue<Galileo_Ephemeris> *ephemeris_queue)
{
d_ephemeris_queue = ephemeris_queue;
}
void galileo_e1b_telemetry_decoder_cc::set_iono_queue(concurrent_queue<Galileo_Iono> *iono_queue)
{
d_iono_queue = iono_queue;
}
void galileo_e1b_telemetry_decoder_cc::set_almanac_queue(concurrent_queue<Galileo_Almanac> *almanac_queue)
{
d_almanac_queue = almanac_queue;
}
void galileo_e1b_telemetry_decoder_cc::set_utc_model_queue(concurrent_queue<Galileo_Utc_Model> *utc_model_queue)
{
d_utc_model_queue = utc_model_queue;
}

View File

@@ -115,15 +115,6 @@ private:
// navigation message vars
Galileo_Navigation_Message d_nav;
// Galileo ephemeris queue
concurrent_queue<Galileo_Ephemeris> *d_ephemeris_queue;
// ionospheric parameters queue
concurrent_queue<Galileo_Iono> *d_iono_queue;
// UTC model parameters queue
concurrent_queue<Galileo_Utc_Model> *d_utc_model_queue;
// Almanac queue
concurrent_queue<Galileo_Almanac> *d_almanac_queue;
boost::shared_ptr<gr::msg_queue> d_queue;
bool d_dump;
Gnss_Satellite d_satellite;

View File

@@ -199,6 +199,8 @@ galileo_e5a_telemetry_decoder_cc::galileo_e5a_telemetry_decoder_cc(
{
// Telemetry Bit transition synchronization port out
this->message_port_register_out(pmt::mp("preamble_timestamp_s"));
// Ephemeris data port out
this->message_port_register_out(pmt::mp("telemetry"));
// initialize internal vars
d_queue = queue;
d_dump = dump;

View File

@@ -65,6 +65,8 @@ gps_l2_m_telemetry_decoder_cc::gps_l2_m_telemetry_decoder_cc(
{
// Telemetry Bit transition synchronization port out
this->message_port_register_out(pmt::mp("preamble_timestamp_s"));
// Ephemeris data port out
this->message_port_register_out(pmt::mp("telemetry"));
// initialize internal vars
d_dump = dump;
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());

View File

@@ -65,6 +65,8 @@ sbas_l1_telemetry_decoder_cc::sbas_l1_telemetry_decoder_cc(
{
// Telemetry Bit transition synchronization port out
this->message_port_register_out(pmt::mp("preamble_timestamp_s"));
// Ephemeris data port out
this->message_port_register_out(pmt::mp("telemetry"));
// initialize internal vars
d_dump = dump;
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
@@ -519,26 +521,3 @@ void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_front_and_convert_to_b
<< std::setfill(' ') << std::resetiosflags(std::ios::hex);
}
void sbas_l1_telemetry_decoder_cc::set_raw_msg_queue(concurrent_queue<Sbas_Raw_Msg> *raw_msg_queue)
{
sbas_telemetry_data.set_raw_msg_queue(raw_msg_queue);
}
void sbas_l1_telemetry_decoder_cc::set_iono_queue(concurrent_queue<Sbas_Ionosphere_Correction> *iono_queue)
{
sbas_telemetry_data.set_iono_queue(iono_queue);
}
void sbas_l1_telemetry_decoder_cc::set_sat_corr_queue(concurrent_queue<Sbas_Satellite_Correction> *sat_corr_queue)
{
sbas_telemetry_data.set_sat_corr_queue(sat_corr_queue);
}
void sbas_l1_telemetry_decoder_cc::set_ephemeris_queue(concurrent_queue<Sbas_Ephemeris> *ephemeris_queue)
{
sbas_telemetry_data.set_ephemeris_queue(ephemeris_queue);
}

View File

@@ -62,12 +62,6 @@ public:
void set_satellite(Gnss_Satellite satellite); //!< Set satellite PRN
void set_channel(int channel); //!< Set receiver's channel
// queues to communicate broadcasted SBAS data to other blocks of GNSS-SDR
void set_raw_msg_queue(concurrent_queue<Sbas_Raw_Msg> *raw_msg_queue); //!< Set raw msg queue
void set_iono_queue(concurrent_queue<Sbas_Ionosphere_Correction> *iono_queue); //!< Set iono queue
void set_sat_corr_queue(concurrent_queue<Sbas_Satellite_Correction> *sat_corr_queue); //!< Set sat correction queue
void set_ephemeris_queue(concurrent_queue<Sbas_Ephemeris> *ephemeris_queue); //!< Set SBAS ephemeis queue
/*!
* \brief This is where all signal processing takes place
*/