1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 04:00:34 +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
*/

View File

@ -56,26 +56,14 @@
#include "file_configuration.h"
#include "control_message_factory.h"
extern concurrent_map<Gps_Almanac> global_gps_almanac_map;
extern concurrent_map<Gps_Acq_Assist> global_gps_acq_assist_map;
extern concurrent_map<Gps_Ref_Time> global_gps_ref_time_map;
extern concurrent_map<Gps_Ref_Location> global_gps_ref_location_map;
extern concurrent_queue<Gps_Almanac> global_gps_almanac_queue;
extern concurrent_queue<Gps_Acq_Assist> global_gps_acq_assist_queue;
extern concurrent_queue<Gps_Ref_Location> global_gps_ref_location_queue;
extern concurrent_queue<Gps_Ref_Time> global_gps_ref_time_queue;
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_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;
@ -149,10 +137,6 @@ void ControlThread::run()
gps_ref_location_data_collector_thread_ = boost::thread(&ControlThread::gps_ref_location_data_collector, this);
gps_ref_time_data_collector_thread_ = boost::thread(&ControlThread::gps_ref_time_data_collector, this);
galileo_ephemeris_data_collector_thread_ = boost::thread(&ControlThread::galileo_ephemeris_data_collector, this);
galileo_iono_data_collector_thread_ = boost::thread(&ControlThread::galileo_iono_data_collector, this);
galileo_almanac_data_collector_thread_ = boost::thread(&ControlThread::galileo_almanac_data_collector, this);
galileo_utc_model_data_collector_thread_ = boost::thread(&ControlThread::galileo_utc_model_data_collector, this);
// Main loop to read and process the control messages
while (flowgraph_->running() && !stop_)
{
@ -164,26 +148,15 @@ void ControlThread::run()
flowgraph_->stop();
stop_ = true;
// sending empty data to terminate the threads
global_gps_almanac_queue.push(Gps_Almanac());
global_gps_acq_assist_queue.push(Gps_Acq_Assist());
global_gps_ref_location_queue.push(Gps_Ref_Location());
global_gps_ref_time_queue.push(Gps_Ref_Time());
global_galileo_ephemeris_queue.push(Galileo_Ephemeris());
global_galileo_iono_queue.push(Galileo_Iono());
global_galileo_utc_model_queue.push(Galileo_Utc_Model());
global_galileo_almanac_queue.push(Galileo_Almanac());
// Join GPS threads
gps_acq_assist_data_collector_thread_.join();
gps_ref_location_data_collector_thread_.join();
gps_ref_time_data_collector_thread_.join();
//Join Galileo threads
galileo_ephemeris_data_collector_thread_.join();
galileo_iono_data_collector_thread_.join();
galileo_almanac_data_collector_thread_.join();
galileo_utc_model_data_collector_thread_.join();
//Join keyboard thread
#ifdef OLD_BOOST
keyboard_thread_.timed_join(boost::posix_time::seconds(1));
@ -479,7 +452,8 @@ void ControlThread::init()
gps_alm_iter++)
{
std::cout << "SUPL: Received Almanac for GPS SV " << gps_alm_iter->first << std::endl;
global_gps_almanac_queue.push(gps_alm_iter->second);
//TODO: use msg queues
//global_gps_almanac_queue.push(gps_alm_iter->second);
}
if (supl_client_ephemeris_.gps_iono.valid == true)
{
@ -622,122 +596,6 @@ void ControlThread::gps_acq_assist_data_collector()
}
}
void ControlThread::galileo_ephemeris_data_collector()
{
// ############ 1.bis READ EPHEMERIS/UTC_MODE/IONO QUEUE ####################
Galileo_Ephemeris galileo_eph;
Galileo_Ephemeris galileo_eph_old;
while(stop_ == false)
{
global_galileo_ephemeris_queue.wait_and_pop(galileo_eph);
if(galileo_eph.SV_ID_PRN_4 == 0) break;
// DEBUG MESSAGE
std::cout << "Galileo Ephemeris record has arrived from SAT ID "
<< galileo_eph.SV_ID_PRN_4 << std::endl;
// insert new ephemeris record to the global ephemeris map
if (global_galileo_ephemeris_map.read(galileo_eph.SV_ID_PRN_4, galileo_eph_old))
{
// Check the EPHEMERIS timestamp. If it is newer, then update the ephemeris
if (galileo_eph.WN_5 > galileo_eph_old.WN_5) //further check because it is not clear when IOD is reset
{
LOG(INFO) << "Galileo Ephemeris record in global map updated -- GALILEO Week Number ="
<< galileo_eph.WN_5;
global_galileo_ephemeris_map.write(galileo_eph.SV_ID_PRN_4,galileo_eph);
}
else
{
if (galileo_eph.IOD_ephemeris > galileo_eph_old.IOD_ephemeris)
{
LOG(INFO) << "Galileo Ephemeris record updated in global map-- IOD_ephemeris ="
<< galileo_eph.IOD_ephemeris;
global_galileo_ephemeris_map.write(galileo_eph.SV_ID_PRN_4, galileo_eph);
LOG(INFO) << "IOD_ephemeris OLD: " << galileo_eph_old.IOD_ephemeris;
LOG(INFO) << "satellite: " << galileo_eph.SV_ID_PRN_4;
}
else
{
LOG(INFO) << "Not updating the existing Galileo ephemeris, IOD is not changing";
}
}
}
else
{
// insert new ephemeris record
LOG(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;
global_galileo_ephemeris_map.write(galileo_eph.SV_ID_PRN_4, galileo_eph);
}
}
}
void ControlThread::galileo_almanac_data_collector()
{
// ############ 1.bis READ ALMANAC QUEUE ####################
Galileo_Almanac galileo_almanac;
while(stop_ == false)
{
global_galileo_almanac_queue.wait_and_pop(galileo_almanac);
if(galileo_almanac.WN_a_7 != 0.0)
{
LOG(INFO) << "New galileo_almanac record has arrived ";
}
// there is no timestamp for the galileo_almanac data, new entries must always be added
global_galileo_almanac_map.write(0, galileo_almanac);
}
}
void ControlThread::galileo_iono_data_collector()
{
Galileo_Iono galileo_iono;
Galileo_Iono galileo_iono_old;
while(stop_ == false)
{
global_galileo_iono_queue.wait_and_pop(galileo_iono);
// DEBUG MESSAGE
if(galileo_iono.WN_5 != 0)
{
LOG(INFO) << "Iono record has arrived";
}
// insert new Iono record to the global Iono map
if (global_galileo_iono_map.read(0, galileo_iono_old))
{
// Check the Iono timestamp from UTC page (page 6). If it is newer, then update the Iono parameters
if (galileo_iono.WN_5 > galileo_iono_old.WN_5)
{
LOG(INFO) << "IONO record updated in global map--new GALILEO UTC-IONO Week Number";
global_galileo_iono_map.write(0, galileo_iono);
}
else
{
if (galileo_iono.TOW_5 > galileo_iono_old.TOW_5)
{
LOG(INFO) << "IONO record updated in global map--new GALILEO UTC-IONO time of Week";
global_galileo_iono_map.write(0, galileo_iono);
//std::cout << "GALILEO IONO time of Week old: " << galileo_iono_old.t0t_6<<std::endl;
}
else
{
LOG(INFO) << "Not updating the existing Iono parameters in global map, Iono timestamp is not changing";
}
}
}
else
{
// insert new ephemeris record
LOG(INFO) << "New IONO record inserted in global map";
global_galileo_iono_map.write(0, galileo_iono);
}
}
}
void ControlThread::gps_ref_location_data_collector()
{
// ############ READ REF LOCATION ####################
@ -785,50 +643,6 @@ void ControlThread::gps_ref_time_data_collector()
}
}
void ControlThread::galileo_utc_model_data_collector()
{
Galileo_Utc_Model galileo_utc;
Galileo_Utc_Model galileo_utc_old;
while(stop_ == false)
{
global_galileo_utc_model_queue.wait_and_pop(galileo_utc);
// DEBUG MESSAGE
LOG(INFO) << "UTC record has arrived" << std::endl;
// insert new UTC record to the global UTC map
if (global_galileo_utc_model_map.read(0, galileo_utc_old))
{
// Check the UTC timestamp. If it is newer, then update the ephemeris
if (galileo_utc.WNot_6 > galileo_utc_old.WNot_6) //further check because it is not clear when IOD is reset
{
DLOG(INFO) << "UTC record updated --new GALILEO UTC Week Number =" << galileo_utc.WNot_6;
global_galileo_utc_model_map.write(0, galileo_utc);
}
else
{
if (galileo_utc.t0t_6 > galileo_utc_old.t0t_6)
{
DLOG(INFO) << "UTC record updated --new GALILEO UTC time of Week =" << galileo_utc.t0t_6;
global_galileo_utc_model_map.write(0, galileo_utc);
}
else
{
LOG(INFO) << "Not updating the existing UTC in global map, timestamp is not changing";
}
}
}
else
{
// insert new ephemeris record
LOG(INFO) << "New UTC record inserted in global map";
global_galileo_utc_model_map.write(0, galileo_utc);
}
}
}
void ControlThread::keyboard_listener()
{
bool read_keys = true;

View File

@ -53,11 +53,6 @@ Sbas_Telemetry_Data::Sbas_Telemetry_Data()
level_trace = 0; // level of trace
tick_trace = 0; // tick time at traceopen (ms)
raw_msg_queue = nullptr;
iono_queue = nullptr;
sat_corr_queue = nullptr;
ephemeris_queue = nullptr;
d_nav.sbssat.iodp = -1; // make sure that in any case iodp is not equal to the received one
prn_mask_changed(); // invalidate all satellite corrections
@ -68,31 +63,6 @@ Sbas_Telemetry_Data::Sbas_Telemetry_Data()
}
}
void Sbas_Telemetry_Data::set_raw_msg_queue(concurrent_queue<Sbas_Raw_Msg> *raw_msg_queue)
{
this->raw_msg_queue = raw_msg_queue;
}
void Sbas_Telemetry_Data::set_iono_queue(concurrent_queue<Sbas_Ionosphere_Correction> *iono_queue)
{
this->iono_queue = iono_queue;
}
void Sbas_Telemetry_Data::set_sat_corr_queue(concurrent_queue<Sbas_Satellite_Correction> *sat_corr_queue)
{
this->sat_corr_queue = sat_corr_queue;
}
void Sbas_Telemetry_Data::set_ephemeris_queue(concurrent_queue<Sbas_Ephemeris> *ephemeris_queue)
{
this->ephemeris_queue = ephemeris_queue;
}
Sbas_Telemetry_Data::~Sbas_Telemetry_Data()
{
@ -151,7 +121,8 @@ int Sbas_Telemetry_Data::update(Sbas_Raw_Msg sbas_raw_msg)
}
// send it to raw message queue
if(raw_msg_queue != nullptr) raw_msg_queue->push(sbas_raw_msg);
//TODO: update to new GNURadio msg queue
//if(raw_msg_queue != nullptr) raw_msg_queue->push(sbas_raw_msg);
return parsing_result;
}
@ -201,7 +172,8 @@ void Sbas_Telemetry_Data::updated_sbas_ephemeris(Sbas_Raw_Msg msg)
seph.print(ss);
VLOG(FLOW) << ss.str();
if(ephemeris_queue != nullptr) ephemeris_queue->push(seph);
//todo_Update to new GNURadio msg queue
//if(ephemeris_queue != nullptr) ephemeris_queue->push(seph);
}
@ -242,7 +214,8 @@ void Sbas_Telemetry_Data::received_iono_correction()
VLOG(EVENT) << ss.str();
// send to SBAS ionospheric correction queue
if(iono_queue != nullptr) iono_queue->push(iono_corr);
//todo_Update to new GNURadio msg queue
//if(iono_queue != nullptr) iono_queue->push(iono_corr);
}
@ -376,7 +349,8 @@ void Sbas_Telemetry_Data::updated_satellite_corrections()
if(fast_correction_updated || long_term_correction_updated)
{
if(sat_corr_queue != nullptr) sat_corr_queue->push(sbas_satelite_correction);
//todo_Update to new GNURadio msg queue
//if(sat_corr_queue != nullptr) sat_corr_queue->push(sbas_satelite_correction);
}
}
VLOG(FLOW) << ss.str(); ss.str("");

View File

@ -98,10 +98,6 @@ class Sbas_Telemetry_Data
{
public:
int update(Sbas_Raw_Msg sbas_raw_msg);
void set_raw_msg_queue(concurrent_queue<Sbas_Raw_Msg> *raw_msg_queue);
void set_iono_queue(concurrent_queue<Sbas_Ionosphere_Correction> *iono_queue);
void set_sat_corr_queue(concurrent_queue<Sbas_Satellite_Correction> *sat_corr_queue);
void set_ephemeris_queue(concurrent_queue<Sbas_Ephemeris> *ephemeris_queue);
/*!
* Default constructor
@ -118,11 +114,6 @@ private:
Sbas_Time_Relation mt12_time_ref;
concurrent_queue<Sbas_Raw_Msg> *raw_msg_queue;
concurrent_queue<Sbas_Ionosphere_Correction> *iono_queue;
concurrent_queue<Sbas_Satellite_Correction> *sat_corr_queue;
concurrent_queue<Sbas_Ephemeris> *ephemeris_queue;
int decode_mt12(Sbas_Raw_Msg sbas_raw_msg);
void updated_sbas_ephemeris(Sbas_Raw_Msg msg);

View File

@ -78,56 +78,20 @@ using google::LogMessage;
DECLARE_string(log_dir);
/*!
* \todo make this queue generic for all the GNSS systems (javi)
*/
/*
* Concurrent queues that communicates the Telemetry Decoder
* to the Observables modules
*/
// For GPS NAVIGATION (L1)
concurrent_queue<Gps_Almanac> global_gps_almanac_queue;
concurrent_queue<Gps_Acq_Assist> global_gps_acq_assist_queue;
concurrent_queue<Gps_Ref_Location> global_gps_ref_location_queue;
concurrent_queue<Gps_Ref_Time> global_gps_ref_time_queue;
concurrent_map<Gps_Ephemeris> global_gps_ephemeris_map;
concurrent_map<Gps_Iono> global_gps_iono_map;
concurrent_map<Gps_Utc_Model> global_gps_utc_model_map;
concurrent_map<Gps_Almanac> global_gps_almanac_map;
concurrent_map<Gps_Acq_Assist> global_gps_acq_assist_map;
concurrent_map<Gps_Ref_Time> global_gps_ref_time_map;
concurrent_map<Gps_Ref_Location> global_gps_ref_location_map;
// For GPS NAVIGATION (L2)
concurrent_queue<Gps_CNAV_Ephemeris> global_gps_cnav_ephemeris_queue;
concurrent_map<Gps_CNAV_Ephemeris> global_gps_cnav_ephemeris_map;
concurrent_queue<Gps_CNAV_Iono> global_gps_cnav_iono_queue;
concurrent_map<Gps_CNAV_Iono> global_gps_cnav_iono_map;
// For GALILEO NAVIGATION
concurrent_queue<Galileo_Ephemeris> global_galileo_ephemeris_queue;
concurrent_queue<Galileo_Iono> global_galileo_iono_queue;
concurrent_queue<Galileo_Utc_Model> global_galileo_utc_model_queue;
concurrent_queue<Galileo_Almanac> global_galileo_almanac_queue;
concurrent_map<Galileo_Ephemeris> global_galileo_ephemeris_map;
concurrent_map<Galileo_Iono> global_galileo_iono_map;
concurrent_map<Galileo_Utc_Model> global_galileo_utc_model_map;
concurrent_map<Galileo_Almanac> global_galileo_almanac_map;
// For SBAS CORRECTIONS
concurrent_queue<Sbas_Raw_Msg> global_sbas_raw_msg_queue;
concurrent_queue<Sbas_Ionosphere_Correction> global_sbas_iono_queue;
concurrent_queue<Sbas_Satellite_Correction> global_sbas_sat_corr_queue;
concurrent_queue<Sbas_Ephemeris> global_sbas_ephemeris_queue;
concurrent_map<Sbas_Ionosphere_Correction> global_sbas_iono_map;
concurrent_map<Sbas_Satellite_Correction> global_sbas_sat_corr_map;
concurrent_map<Sbas_Ephemeris> global_sbas_ephemeris_map;
int main(int argc, char** argv)
{
const std::string intro_help(

View File

@ -53,47 +53,15 @@
#include "sbas_ephemeris.h"
#include "sbas_satellite_correction.h"
concurrent_queue<Gps_Ephemeris> global_gps_ephemeris_queue;
concurrent_queue<Gps_Iono> global_gps_iono_queue;
concurrent_queue<Gps_Utc_Model> global_gps_utc_model_queue;
concurrent_queue<Gps_Almanac> global_gps_almanac_queue;
concurrent_queue<Gps_Acq_Assist> global_gps_acq_assist_queue;
concurrent_queue<Gps_Ref_Location> global_gps_ref_location_queue;
concurrent_queue<Gps_Ref_Time> global_gps_ref_time_queue;
concurrent_map<Gps_Ephemeris> global_gps_ephemeris_map;
concurrent_map<Gps_Iono> global_gps_iono_map;
concurrent_map<Gps_Utc_Model> global_gps_utc_model_map;
concurrent_map<Gps_Almanac> global_gps_almanac_map;
concurrent_map<Gps_Acq_Assist> global_gps_acq_assist_map;
concurrent_map<Gps_Ref_Location> global_gps_ref_location_map;
concurrent_map<Gps_Ref_Time> global_gps_ref_time_map;
concurrent_queue<Gps_CNAV_Ephemeris> global_gps_cnav_ephemeris_queue;
concurrent_map<Gps_CNAV_Ephemeris> global_gps_cnav_ephemeris_map;
concurrent_queue<Gps_CNAV_Iono> global_gps_cnav_iono_queue;
concurrent_map<Gps_CNAV_Iono> global_gps_cnav_iono_map;
concurrent_queue<Galileo_Ephemeris> global_galileo_ephemeris_queue;
concurrent_queue<Galileo_Iono> global_galileo_iono_queue;
concurrent_queue<Galileo_Utc_Model> global_galileo_utc_model_queue;
concurrent_queue<Galileo_Almanac> global_galileo_almanac_queue;
concurrent_map<Galileo_Ephemeris> global_galileo_ephemeris_map;
concurrent_map<Galileo_Iono> global_galileo_iono_map;
concurrent_map<Galileo_Utc_Model> global_galileo_utc_model_map;
concurrent_map<Galileo_Almanac> global_galileo_almanac_map;
concurrent_queue<Sbas_Raw_Msg> global_sbas_raw_msg_queue;
concurrent_queue<Sbas_Ionosphere_Correction> global_sbas_iono_queue;
concurrent_queue<Sbas_Satellite_Correction> global_sbas_sat_corr_queue;
concurrent_queue<Sbas_Ephemeris> global_sbas_ephemeris_queue;
concurrent_map<Sbas_Ionosphere_Correction> global_sbas_iono_map;
concurrent_map<Sbas_Satellite_Correction> global_sbas_sat_corr_map;
concurrent_map<Sbas_Ephemeris> global_sbas_ephemeris_map;
int main(int argc, char **argv)
{

View File

@ -114,50 +114,16 @@ DECLARE_string(log_dir);
// For GPS NAVIGATION (L1)
concurrent_queue<Gps_Ephemeris> global_gps_ephemeris_queue;
concurrent_queue<Gps_Iono> global_gps_iono_queue;
concurrent_queue<Gps_Utc_Model> global_gps_utc_model_queue;
concurrent_queue<Gps_Almanac> global_gps_almanac_queue;
concurrent_queue<Gps_Acq_Assist> global_gps_acq_assist_queue;
concurrent_queue<Gps_Ref_Location> global_gps_ref_location_queue;
concurrent_queue<Gps_Ref_Time> global_gps_ref_time_queue;
concurrent_map<Gps_Ephemeris> global_gps_ephemeris_map;
concurrent_map<Gps_Iono> global_gps_iono_map;
concurrent_map<Gps_Utc_Model> global_gps_utc_model_map;
concurrent_map<Gps_Almanac> global_gps_almanac_map;
concurrent_map<Gps_Acq_Assist> global_gps_acq_assist_map;
concurrent_map<Gps_Ref_Location> global_gps_ref_location_map;
concurrent_map<Gps_Ref_Time> global_gps_ref_time_map;
// For GPS NAVIGATION (L2)
concurrent_queue<Gps_CNAV_Ephemeris> global_gps_cnav_ephemeris_queue;
concurrent_map<Gps_CNAV_Ephemeris> global_gps_cnav_ephemeris_map;
concurrent_queue<Gps_CNAV_Iono> global_gps_cnav_iono_queue;
concurrent_map<Gps_CNAV_Iono> global_gps_cnav_iono_map;
// For GALILEO NAVIGATION
concurrent_queue<Galileo_Ephemeris> global_galileo_ephemeris_queue;
concurrent_queue<Galileo_Iono> global_galileo_iono_queue;
concurrent_queue<Galileo_Utc_Model> global_galileo_utc_model_queue;
concurrent_queue<Galileo_Almanac> global_galileo_almanac_queue;
concurrent_map<Galileo_Ephemeris> global_galileo_ephemeris_map;
concurrent_map<Galileo_Iono> global_galileo_iono_map;
concurrent_map<Galileo_Utc_Model> global_galileo_utc_model_map;
concurrent_map<Galileo_Almanac> global_galileo_almanac_map;
// For SBAS CORRECTIONS
concurrent_queue<Sbas_Raw_Msg> global_sbas_raw_msg_queue;
concurrent_queue<Sbas_Ionosphere_Correction> global_sbas_iono_queue;
concurrent_queue<Sbas_Satellite_Correction> global_sbas_sat_corr_queue;
concurrent_queue<Sbas_Ephemeris> global_sbas_ephemeris_queue;
concurrent_map<Sbas_Ionosphere_Correction> global_sbas_iono_map;
concurrent_map<Sbas_Satellite_Correction> global_sbas_sat_corr_map;
concurrent_map<Sbas_Ephemeris> global_sbas_ephemeris_map;
int main(int argc, char **argv)
{

View File

@ -100,33 +100,6 @@ concurrent_map<Gps_Utc_Model> global_gps_utc_model_map;
concurrent_map<Gps_Almanac> global_gps_almanac_map;
concurrent_map<Gps_Acq_Assist> global_gps_acq_assist_map;
// For GPS NAVIGATION (L2)
concurrent_queue<Gps_CNAV_Ephemeris> global_gps_cnav_ephemeris_queue;
concurrent_map<Gps_CNAV_Ephemeris> global_gps_cnav_ephemeris_map;
concurrent_queue<Gps_CNAV_Ephemeris> global_gps_cnav_iono_queue;
concurrent_map<Gps_CNAV_Ephemeris> global_gps_cnav_iono_map;
// For GALILEO NAVIGATION
concurrent_queue<Galileo_Ephemeris> global_galileo_ephemeris_queue;
concurrent_queue<Galileo_Iono> global_galileo_iono_queue;
concurrent_queue<Galileo_Utc_Model> global_galileo_utc_model_queue;
concurrent_queue<Galileo_Almanac> global_galileo_almanac_queue;
concurrent_map<Galileo_Ephemeris> global_galileo_ephemeris_map;
concurrent_map<Galileo_Iono> global_galileo_iono_map;
concurrent_map<Galileo_Utc_Model> global_galileo_utc_model_map;
concurrent_map<Galileo_Almanac> global_galileo_almanac_map;
// For SBAS CORRECTIONS
concurrent_queue<Sbas_Raw_Msg> global_sbas_raw_msg_queue;
concurrent_queue<Sbas_Ionosphere_Correction> global_sbas_iono_queue;
concurrent_queue<Sbas_Satellite_Correction> global_sbas_sat_corr_queue;
concurrent_queue<Sbas_Ephemeris> global_sbas_ephemeris_queue;
concurrent_map<Sbas_Ionosphere_Correction> global_sbas_iono_map;
concurrent_map<Sbas_Satellite_Correction> global_sbas_sat_corr_map;
concurrent_map<Sbas_Ephemeris> global_sbas_ephemeris_map;
bool stop;
concurrent_queue<int> channel_internal_queue;
GpsL1CaPcpsAcquisitionFineDoppler *acquisition;