mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-19 05:33:02 +00:00
Integrating the RTCM message printer
Now the GPS L1 receiver generates 1002 and 1019 messages. Bugs in the Rtcm class fixed.
This commit is contained in:
parent
354a19ad64
commit
f70df3e581
@ -53,6 +53,7 @@ GalileoE1Pvt::GalileoE1Pvt(ConfigurationInterface* configuration,
|
||||
std::string default_dump_filename = "./pvt.dat";
|
||||
std::string default_nmea_dump_filename = "./nmea_pvt.nmea";
|
||||
std::string default_nmea_dump_devname = "/dev/tty1";
|
||||
std::string default_rtcm_dump_devname = "/dev/pts/1";
|
||||
DLOG(INFO) << "role " << role;
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
||||
@ -74,8 +75,15 @@ GalileoE1Pvt::GalileoE1Pvt(ConfigurationInterface* configuration,
|
||||
nmea_dump_filename = configuration->property(role + ".nmea_dump_filename", default_nmea_dump_filename);
|
||||
std::string nmea_dump_devname;
|
||||
nmea_dump_devname = configuration->property(role + ".nmea_dump_devname", default_nmea_dump_devname);
|
||||
// RTCM Printer settings
|
||||
bool flag_rtcm_tty_port;
|
||||
flag_rtcm_tty_port = configuration->property(role + ".flag_rtcm_tty_port", false);
|
||||
std::string rtcm_dump_devname;
|
||||
rtcm_dump_devname = configuration->property(role + ".rtcm_dump_devname", default_rtcm_dump_devname);
|
||||
bool flag_rtcm_server;
|
||||
flag_rtcm_server = configuration->property(role + ".flag_rtcm_server", false);
|
||||
// make PVT object
|
||||
pvt_ = galileo_e1_make_pvt_cc(in_streams_, queue_, dump_, dump_filename_, averaging_depth, flag_averaging, output_rate_ms, display_rate_ms, flag_nmea_tty_port, nmea_dump_filename, nmea_dump_devname);
|
||||
pvt_ = galileo_e1_make_pvt_cc(in_streams_, queue_, dump_, dump_filename_, averaging_depth, flag_averaging, output_rate_ms, display_rate_ms, flag_nmea_tty_port, nmea_dump_filename, nmea_dump_devname, flag_rtcm_server, flag_rtcm_tty_port, rtcm_dump_devname);
|
||||
DLOG(INFO) << "pvt(" << pvt_->unique_id() << ")";
|
||||
}
|
||||
|
||||
|
@ -52,6 +52,7 @@ GpsL1CaPvt::GpsL1CaPvt(ConfigurationInterface* configuration,
|
||||
std::string default_dump_filename = "./pvt.dat";
|
||||
std::string default_nmea_dump_filename = "./nmea_pvt.nmea";
|
||||
std::string default_nmea_dump_devname = "/dev/tty1";
|
||||
std::string default_rtcm_dump_devname = "/dev/pts/1";
|
||||
DLOG(INFO) << "role " << role;
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
||||
@ -73,8 +74,16 @@ GpsL1CaPvt::GpsL1CaPvt(ConfigurationInterface* configuration,
|
||||
nmea_dump_filename = configuration->property(role + ".nmea_dump_filename", default_nmea_dump_filename);
|
||||
std::string nmea_dump_devname;
|
||||
nmea_dump_devname = configuration->property(role + ".nmea_dump_devname", default_nmea_dump_devname);
|
||||
// RTCM Printer settings
|
||||
bool flag_rtcm_tty_port;
|
||||
flag_rtcm_tty_port = configuration->property(role + ".flag_rtcm_tty_port", false);
|
||||
std::string rtcm_dump_devname;
|
||||
rtcm_dump_devname = configuration->property(role + ".rtcm_dump_devname", default_rtcm_dump_devname);
|
||||
bool flag_rtcm_server;
|
||||
flag_rtcm_server = configuration->property(role + ".flag_rtcm_server", false);
|
||||
|
||||
// make PVT object
|
||||
pvt_ = gps_l1_ca_make_pvt_cc(in_streams_, queue_, dump_, dump_filename_, averaging_depth, flag_averaging, output_rate_ms, display_rate_ms, flag_nmea_tty_port, nmea_dump_filename, nmea_dump_devname);
|
||||
pvt_ = gps_l1_ca_make_pvt_cc(in_streams_, queue_, dump_, dump_filename_, averaging_depth, flag_averaging, output_rate_ms, display_rate_ms, flag_nmea_tty_port, nmea_dump_filename, nmea_dump_devname, flag_rtcm_server, flag_rtcm_tty_port, rtcm_dump_devname );
|
||||
DLOG(INFO) << "pvt(" << pvt_->unique_id() << ")";
|
||||
}
|
||||
|
||||
|
@ -53,6 +53,7 @@ HybridPvt::HybridPvt(ConfigurationInterface* configuration,
|
||||
std::string default_dump_filename = "./pvt.dat";
|
||||
std::string default_nmea_dump_filename = "./nmea_pvt.nmea";
|
||||
std::string default_nmea_dump_devname = "/dev/tty1";
|
||||
std::string default_rtcm_dump_devname = "/dev/pts/1";
|
||||
DLOG(INFO) << "role " << role;
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
||||
@ -74,8 +75,15 @@ HybridPvt::HybridPvt(ConfigurationInterface* configuration,
|
||||
nmea_dump_filename = configuration->property(role + ".nmea_dump_filename", default_nmea_dump_filename);
|
||||
std::string nmea_dump_devname;
|
||||
nmea_dump_devname = configuration->property(role + ".nmea_dump_devname", default_nmea_dump_devname);
|
||||
// RTCM Printer settings
|
||||
bool flag_rtcm_tty_port;
|
||||
flag_rtcm_tty_port = configuration->property(role + ".flag_rtcm_tty_port", false);
|
||||
std::string rtcm_dump_devname;
|
||||
rtcm_dump_devname = configuration->property(role + ".rtcm_dump_devname", default_rtcm_dump_devname);
|
||||
bool flag_rtcm_server;
|
||||
flag_rtcm_server = configuration->property(role + ".flag_rtcm_server", false);
|
||||
// make PVT object
|
||||
pvt_ = hybrid_make_pvt_cc(in_streams_, queue_, dump_, dump_filename_, averaging_depth, flag_averaging, output_rate_ms, display_rate_ms, flag_nmea_tty_port, nmea_dump_filename, nmea_dump_devname);
|
||||
pvt_ = hybrid_make_pvt_cc(in_streams_, queue_, dump_, dump_filename_, averaging_depth, flag_averaging, output_rate_ms, display_rate_ms, flag_nmea_tty_port, nmea_dump_filename, nmea_dump_devname, flag_rtcm_server, flag_rtcm_tty_port, rtcm_dump_devname);
|
||||
DLOG(INFO) << "pvt(" << pvt_->unique_id() << ")";
|
||||
}
|
||||
|
||||
|
@ -51,13 +51,13 @@ 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)
|
||||
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)
|
||||
{
|
||||
return galileo_e1_pvt_cc_sptr(new galileo_e1_pvt_cc(nchannels, queue, dump, dump_filename, averaging_depth, flag_averaging, output_rate_ms, display_rate_ms, flag_nmea_tty_port, nmea_dump_filename, nmea_dump_devname));
|
||||
return galileo_e1_pvt_cc_sptr(new galileo_e1_pvt_cc(nchannels, queue, dump, dump_filename, averaging_depth, flag_averaging, output_rate_ms, display_rate_ms, flag_nmea_tty_port, nmea_dump_filename, nmea_dump_devname, flag_rtcm_server, flag_rtcm_tty_port, rtcm_dump_devname));
|
||||
}
|
||||
|
||||
|
||||
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) :
|
||||
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(1, 1, sizeof(gr_complex)))
|
||||
{
|
||||
@ -84,6 +84,12 @@ galileo_e1_pvt_cc::galileo_e1_pvt_cc(unsigned int nchannels, boost::shared_ptr<g
|
||||
|
||||
//initialize nmea_printer
|
||||
d_nmea_printer = std::make_shared<Nmea_Printer>(nmea_dump_filename, flag_nmea_tty_port, nmea_dump_devname);
|
||||
|
||||
//initialize rtcm_printer
|
||||
std::string rtcm_dump_filename;
|
||||
rtcm_dump_filename = d_dump_filename;
|
||||
d_rtcm_printer = std::make_shared<Rtcm_Printer>(rtcm_dump_filename, flag_rtcm_server, flag_rtcm_tty_port, rtcm_dump_devname);
|
||||
|
||||
d_dump_filename.append("_raw.dat");
|
||||
dump_ls_pvt_filename.append("_ls_pvt.dat");
|
||||
d_averaging_depth = averaging_depth;
|
||||
|
@ -47,6 +47,7 @@
|
||||
#include "kml_printer.h"
|
||||
#include "rinex_printer.h"
|
||||
#include "geojson_printer.h"
|
||||
#include "rtcm_printer.h"
|
||||
#include "galileo_e1_ls_pvt.h"
|
||||
#include "Galileo_E1.h"
|
||||
|
||||
@ -64,7 +65,10 @@ galileo_e1_pvt_cc_sptr galileo_e1_make_pvt_cc(unsigned int n_channels,
|
||||
int display_rate_ms,
|
||||
bool flag_nmea_tty_port,
|
||||
std::string nmea_dump_filename,
|
||||
std::string nmea_dump_devname);
|
||||
std::string nmea_dump_devname,
|
||||
bool flag_rtcm_server,
|
||||
bool flag_rtcm_tty_port,
|
||||
std::string rtcm_dump_devname);
|
||||
|
||||
/*!
|
||||
* \brief This class implements a block that computes the PVT solution with Galileo E1 signals
|
||||
@ -82,7 +86,10 @@ private:
|
||||
int display_rate_ms,
|
||||
bool flag_nmea_tty_port,
|
||||
std::string nmea_dump_filename,
|
||||
std::string nmea_dump_devname);
|
||||
std::string nmea_dump_devname,
|
||||
bool flag_rtcm_server,
|
||||
bool flag_rtcm_tty_port,
|
||||
std::string rtcm_dump_devname);
|
||||
galileo_e1_pvt_cc(unsigned int nchannels,
|
||||
boost::shared_ptr<gr::msg_queue> queue,
|
||||
bool dump, std::string dump_filename,
|
||||
@ -92,7 +99,10 @@ private:
|
||||
int display_rate_ms,
|
||||
bool flag_nmea_tty_port,
|
||||
std::string nmea_dump_filename,
|
||||
std::string nmea_dump_devname);
|
||||
std::string nmea_dump_devname,
|
||||
bool flag_rtcm_server,
|
||||
bool flag_rtcm_tty_port,
|
||||
std::string rtcm_dump_devname);
|
||||
boost::shared_ptr<gr::msg_queue> d_queue;
|
||||
bool d_dump;
|
||||
bool b_rinex_header_writen;
|
||||
@ -110,6 +120,7 @@ private:
|
||||
std::shared_ptr<Kml_Printer> d_kml_dump;
|
||||
std::shared_ptr<Nmea_Printer> d_nmea_printer;
|
||||
std::shared_ptr<GeoJSON_Printer> d_geojson_printer;
|
||||
std::shared_ptr<Rtcm_Printer> d_rtcm_printer;
|
||||
|
||||
double d_rx_time;
|
||||
std::shared_ptr<galileo_e1_ls_pvt> d_ls_pvt;
|
||||
|
@ -56,9 +56,9 @@ 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)
|
||||
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)
|
||||
{
|
||||
return gps_l1_ca_pvt_cc_sptr(new gps_l1_ca_pvt_cc(nchannels, queue, dump, dump_filename, averaging_depth, flag_averaging, output_rate_ms, display_rate_ms, flag_nmea_tty_port, nmea_dump_filename, nmea_dump_devname));
|
||||
return gps_l1_ca_pvt_cc_sptr(new gps_l1_ca_pvt_cc(nchannels, queue, dump, dump_filename, averaging_depth, flag_averaging, output_rate_ms, display_rate_ms, flag_nmea_tty_port, nmea_dump_filename, nmea_dump_devname, flag_rtcm_server, flag_rtcm_tty_port, rtcm_dump_devname));
|
||||
}
|
||||
|
||||
|
||||
@ -71,7 +71,10 @@ gps_l1_ca_pvt_cc::gps_l1_ca_pvt_cc(unsigned int nchannels,
|
||||
int display_rate_ms,
|
||||
bool flag_nmea_tty_port,
|
||||
std::string nmea_dump_filename,
|
||||
std::string nmea_dump_devname) :
|
||||
std::string nmea_dump_devname,
|
||||
bool flag_rtcm_server,
|
||||
bool flag_rtcm_tty_port,
|
||||
std::string rtcm_dump_devname) :
|
||||
gr::block("gps_l1_ca_pvt_cc", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)),
|
||||
gr::io_signature::make(1, 1, sizeof(gr_complex)) )
|
||||
{
|
||||
@ -98,6 +101,12 @@ gps_l1_ca_pvt_cc::gps_l1_ca_pvt_cc(unsigned int nchannels,
|
||||
//initialize nmea_printer
|
||||
d_nmea_printer = std::make_shared<Nmea_Printer>(nmea_dump_filename, flag_nmea_tty_port, nmea_dump_devname);
|
||||
|
||||
//initialize rtcm_printer
|
||||
std::string rtcm_dump_filename;
|
||||
rtcm_dump_filename = d_dump_filename;
|
||||
d_rtcm_printer = std::make_shared<Rtcm_Printer>(rtcm_dump_filename, flag_rtcm_server, flag_rtcm_tty_port, rtcm_dump_devname);
|
||||
b_rtcm_writing_started = false;
|
||||
|
||||
d_dump_filename.append("_raw.dat");
|
||||
dump_ls_pvt_filename.append("_ls_pvt.dat");
|
||||
d_averaging_depth = averaging_depth;
|
||||
@ -303,6 +312,39 @@ int gps_l1_ca_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_ite
|
||||
b_rinex_header_updated = true;
|
||||
}
|
||||
}
|
||||
if(b_rtcm_writing_started)
|
||||
{
|
||||
if((d_sample_counter % 1000) == 0)
|
||||
{
|
||||
std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter;
|
||||
gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin();
|
||||
if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MT1002(gps_ephemeris_iter->second, d_rx_time, gnss_pseudoranges_map);
|
||||
}
|
||||
}
|
||||
if((d_sample_counter % 5000) == 0)
|
||||
{
|
||||
std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter;
|
||||
gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin();
|
||||
if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!b_rtcm_writing_started) // the first time
|
||||
{
|
||||
std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter;
|
||||
gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin();
|
||||
if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
|
||||
d_rtcm_printer->Print_Rtcm_MT1002(gps_ephemeris_iter->second, d_rx_time, gnss_pseudoranges_map);
|
||||
}
|
||||
b_rtcm_writing_started = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,6 +46,7 @@
|
||||
#include "kml_printer.h"
|
||||
#include "rinex_printer.h"
|
||||
#include "geojson_printer.h"
|
||||
#include "rtcm_printer.h"
|
||||
#include "gps_l1_ca_ls_pvt.h"
|
||||
#include "GPS_L1_CA.h"
|
||||
|
||||
@ -63,7 +64,11 @@ gps_l1_ca_pvt_cc_sptr gps_l1_ca_make_pvt_cc(unsigned int n_channels,
|
||||
int display_rate_ms,
|
||||
bool flag_nmea_tty_port,
|
||||
std::string nmea_dump_filename,
|
||||
std::string nmea_dump_devname);
|
||||
std::string nmea_dump_devname,
|
||||
bool flag_rtcm_server,
|
||||
bool flag_rtcm_tty_port,
|
||||
std::string rtcm_dump_devname
|
||||
);
|
||||
|
||||
/*!
|
||||
* \brief This class implements a block that computes the PVT solution
|
||||
@ -81,7 +86,10 @@ private:
|
||||
int display_rate_ms,
|
||||
bool flag_nmea_tty_port,
|
||||
std::string nmea_dump_filename,
|
||||
std::string nmea_dump_devname);
|
||||
std::string nmea_dump_devname,
|
||||
bool flag_rtcm_server,
|
||||
bool flag_rtcm_tty_port,
|
||||
std::string rtcm_dump_devname);
|
||||
gps_l1_ca_pvt_cc(unsigned int nchannels,
|
||||
boost::shared_ptr<gr::msg_queue> queue,
|
||||
bool dump,
|
||||
@ -92,12 +100,16 @@ private:
|
||||
int display_rate_ms,
|
||||
bool flag_nmea_tty_port,
|
||||
std::string nmea_dump_filename,
|
||||
std::string nmea_dump_devname);
|
||||
std::string nmea_dump_devname,
|
||||
bool flag_rtcm_server,
|
||||
bool flag_rtcm_tty_port,
|
||||
std::string rtcm_dump_devname);
|
||||
boost::shared_ptr<gr::msg_queue> d_queue;
|
||||
bool d_dump;
|
||||
bool b_rinex_header_writen;
|
||||
bool b_rinex_sbs_header_writen;
|
||||
bool b_rinex_header_updated;
|
||||
bool b_rtcm_writing_started;
|
||||
std::shared_ptr<Rinex_Printer> rp;
|
||||
unsigned int d_nchannels;
|
||||
std::string d_dump_filename;
|
||||
@ -111,6 +123,7 @@ private:
|
||||
std::shared_ptr<Kml_Printer> d_kml_printer;
|
||||
std::shared_ptr<Nmea_Printer> d_nmea_printer;
|
||||
std::shared_ptr<GeoJSON_Printer> d_geojson_printer;
|
||||
std::shared_ptr<Rtcm_Printer> d_rtcm_printer;
|
||||
double d_rx_time;
|
||||
std::shared_ptr<gps_l1_ca_ls_pvt> d_ls_pvt;
|
||||
|
||||
|
@ -55,13 +55,13 @@ 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)
|
||||
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)
|
||||
{
|
||||
return hybrid_pvt_cc_sptr(new hybrid_pvt_cc(nchannels, queue, dump, dump_filename, averaging_depth, flag_averaging, output_rate_ms, display_rate_ms, flag_nmea_tty_port, nmea_dump_filename, nmea_dump_devname));
|
||||
return hybrid_pvt_cc_sptr(new hybrid_pvt_cc(nchannels, queue, dump, dump_filename, averaging_depth, flag_averaging, output_rate_ms, display_rate_ms, flag_nmea_tty_port, nmea_dump_filename, nmea_dump_devname, flag_rtcm_server, flag_rtcm_tty_port, rtcm_dump_devname));
|
||||
}
|
||||
|
||||
|
||||
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) :
|
||||
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(1, 1, sizeof(gr_complex)))
|
||||
{
|
||||
@ -89,6 +89,11 @@ hybrid_pvt_cc::hybrid_pvt_cc(unsigned int nchannels, boost::shared_ptr<gr::msg_q
|
||||
//initialize nmea_printer
|
||||
d_nmea_printer = std::make_shared<Nmea_Printer>(nmea_dump_filename, flag_nmea_tty_port, nmea_dump_devname);
|
||||
|
||||
//initialize rtcm_printer
|
||||
std::string rtcm_dump_filename;
|
||||
rtcm_dump_filename = d_dump_filename;
|
||||
d_rtcm_printer = std::make_shared<Rtcm_Printer>(rtcm_dump_filename, flag_rtcm_server, flag_rtcm_tty_port, rtcm_dump_devname);
|
||||
|
||||
d_dump_filename.append("_raw.dat");
|
||||
dump_ls_pvt_filename.append("_ls_pvt.dat");
|
||||
d_averaging_depth = averaging_depth;
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include "kml_printer.h"
|
||||
#include "geojson_printer.h"
|
||||
#include "rinex_printer.h"
|
||||
#include "rtcm_printer.h"
|
||||
#include "hybrid_ls_pvt.h"
|
||||
#include "GPS_L1_CA.h"
|
||||
#include "Galileo_E1.h"
|
||||
@ -69,7 +70,10 @@ hybrid_pvt_cc_sptr hybrid_make_pvt_cc(unsigned int n_channels,
|
||||
int display_rate_ms,
|
||||
bool flag_nmea_tty_port,
|
||||
std::string nmea_dump_filename,
|
||||
std::string nmea_dump_devname);
|
||||
std::string nmea_dump_devname,
|
||||
bool flag_rtcm_server,
|
||||
bool flag_rtcm_tty_port,
|
||||
std::string rtcm_dump_devname);
|
||||
|
||||
/*!
|
||||
* \brief This class implements a block that computes the PVT solution with Galileo E1 signals
|
||||
@ -87,7 +91,10 @@ private:
|
||||
int display_rate_ms,
|
||||
bool flag_nmea_tty_port,
|
||||
std::string nmea_dump_filename,
|
||||
std::string nmea_dump_devname);
|
||||
std::string nmea_dump_devname,
|
||||
bool flag_rtcm_server,
|
||||
bool flag_rtcm_tty_port,
|
||||
std::string rtcm_dump_devname);
|
||||
hybrid_pvt_cc(unsigned int nchannels,
|
||||
boost::shared_ptr<gr::msg_queue> queue,
|
||||
bool dump, std::string dump_filename,
|
||||
@ -97,7 +104,10 @@ private:
|
||||
int display_rate_ms,
|
||||
bool flag_nmea_tty_port,
|
||||
std::string nmea_dump_filename,
|
||||
std::string nmea_dump_devname);
|
||||
std::string nmea_dump_devname,
|
||||
bool flag_rtcm_server,
|
||||
bool flag_rtcm_tty_port,
|
||||
std::string rtcm_dump_devname);
|
||||
boost::shared_ptr<gr::msg_queue> d_queue;
|
||||
bool d_dump;
|
||||
bool b_rinex_header_writen;
|
||||
@ -115,6 +125,7 @@ private:
|
||||
std::shared_ptr<Kml_Printer> d_kml_dump;
|
||||
std::shared_ptr<Nmea_Printer> d_nmea_printer;
|
||||
std::shared_ptr<GeoJSON_Printer> d_geojson_printer;
|
||||
std::shared_ptr<Rtcm_Printer> d_rtcm_printer;
|
||||
double d_rx_time;
|
||||
double d_TOW_at_curr_symbol_constellation;
|
||||
std::shared_ptr<hybrid_ls_pvt> d_ls_pvt;
|
||||
|
@ -32,6 +32,9 @@
|
||||
*/
|
||||
|
||||
#include "rtcm_printer.h"
|
||||
#include <ctime>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <fcntl.h> // for O_RDWR
|
||||
#include <termios.h> // for tcgetattr
|
||||
#include <gflags/gflags.h>
|
||||
@ -40,9 +43,56 @@
|
||||
using google::LogMessage;
|
||||
|
||||
|
||||
Rtcm_Printer::Rtcm_Printer(std::string filename, bool flag_rtcm_tty_port, std::string rtcm_dump_devname)
|
||||
Rtcm_Printer::Rtcm_Printer(std::string filename, bool flag_rtcm_server, bool flag_rtcm_tty_port, std::string rtcm_dump_devname, bool time_tag_name)
|
||||
{
|
||||
rtcm_filename = filename;
|
||||
time_t rawtime;
|
||||
struct tm * timeinfo;
|
||||
time ( &rawtime );
|
||||
timeinfo = localtime ( &rawtime );
|
||||
|
||||
if (time_tag_name)
|
||||
{
|
||||
std::stringstream strm0;
|
||||
const int year = timeinfo->tm_year - 100;
|
||||
strm0 << year;
|
||||
const int month = timeinfo->tm_mon + 1;
|
||||
if(month < 10)
|
||||
{
|
||||
strm0 << "0";
|
||||
}
|
||||
strm0 << month;
|
||||
const int day = timeinfo->tm_mday;
|
||||
if(day < 10)
|
||||
{
|
||||
strm0 << "0";
|
||||
}
|
||||
strm0 << day << "_";
|
||||
const int hour = timeinfo->tm_hour;
|
||||
if(hour < 10)
|
||||
{
|
||||
strm0 << "0";
|
||||
}
|
||||
strm0 << hour;
|
||||
const int min = timeinfo->tm_min;
|
||||
if(min < 10)
|
||||
{
|
||||
strm0 << "0";
|
||||
}
|
||||
strm0 << min;
|
||||
const int sec = timeinfo->tm_sec;
|
||||
if(sec < 10)
|
||||
{
|
||||
strm0 << "0";
|
||||
}
|
||||
strm0 << sec;
|
||||
|
||||
rtcm_filename = filename + "_" + strm0.str() + ".rtcm";
|
||||
}
|
||||
else
|
||||
{
|
||||
rtcm_filename = filename + ".rtcm";
|
||||
}
|
||||
|
||||
rtcm_file_descriptor.open(rtcm_filename.c_str(), std::ios::out);
|
||||
if (rtcm_file_descriptor.is_open())
|
||||
{
|
||||
@ -62,14 +112,21 @@ Rtcm_Printer::Rtcm_Printer(std::string filename, bool flag_rtcm_tty_port, std::s
|
||||
{
|
||||
rtcm_dev_descriptor = -1;
|
||||
}
|
||||
|
||||
rtcm = std::make_shared<Rtcm>();
|
||||
if(flag_rtcm_server)
|
||||
{
|
||||
rtcm->run_server();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Rtcm_Printer::~Rtcm_Printer()
|
||||
{
|
||||
if(rtcm->is_server_running())
|
||||
{
|
||||
rtcm->stop_server();
|
||||
}
|
||||
if (rtcm_file_descriptor.is_open())
|
||||
{
|
||||
long pos;
|
||||
@ -92,6 +149,14 @@ bool Rtcm_Printer::Print_Rtcm_MT1001(const Gps_Ephemeris& gps_eph, double obs_ti
|
||||
}
|
||||
|
||||
|
||||
bool Rtcm_Printer::Print_Rtcm_MT1002(const Gps_Ephemeris& gps_eph, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges)
|
||||
{
|
||||
std::string m1002 = rtcm->print_MT1002(gps_eph, obs_time, pseudoranges);
|
||||
Rtcm_Printer::Print_Message(m1002);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Rtcm_Printer::Print_Rtcm_MT1019(const Gps_Ephemeris & gps_eph)
|
||||
{
|
||||
std::string m1019 = rtcm->print_MT1019(gps_eph);
|
||||
@ -156,7 +221,7 @@ void Rtcm_Printer::close_serial()
|
||||
|
||||
|
||||
|
||||
bool Rtcm_Printer::Print_Message(std::string message)
|
||||
bool Rtcm_Printer::Print_Message(const std::string & message)
|
||||
{
|
||||
//write to file
|
||||
try
|
||||
|
@ -48,7 +48,7 @@ public:
|
||||
/*!
|
||||
* \brief Default constructor.
|
||||
*/
|
||||
Rtcm_Printer(std::string filename, bool flag_rtcm_tty_port, std::string rtcm_dump_filename);
|
||||
Rtcm_Printer(std::string filename, bool flag_rtcm_server, bool flag_rtcm_tty_port, std::string rtcm_dump_filename, bool time_tag_name = true);
|
||||
|
||||
/*!
|
||||
* \brief Default destructor.
|
||||
@ -56,6 +56,7 @@ public:
|
||||
~Rtcm_Printer();
|
||||
|
||||
bool Print_Rtcm_MT1001(const Gps_Ephemeris& gps_eph, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
|
||||
bool Print_Rtcm_MT1002(const Gps_Ephemeris& gps_eph, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
|
||||
bool Print_Rtcm_MT1019(const Gps_Ephemeris & gps_eph); //<! GPS Ephemeris, should be broadcast in the event that the IODC does not match the IODE, and every 2 minutes.
|
||||
bool Print_Rtcm_MT1045(const Galileo_Ephemeris & gal_eph); //<! Galileo Ephemeris, should be broadcast every 2 minutes
|
||||
|
||||
@ -69,7 +70,7 @@ private:
|
||||
int init_serial (std::string serial_device); //serial port control
|
||||
void close_serial ();
|
||||
std::shared_ptr<Rtcm> rtcm;
|
||||
bool Print_Message(std::string message);
|
||||
bool Print_Message(const std::string & message);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -409,7 +409,7 @@ std::string Rtcm::print_MT1001(const Gps_Ephemeris & gps_eph, double obs_time, c
|
||||
pseudoranges_iter != pseudoranges.end();
|
||||
pseudoranges_iter++)
|
||||
{
|
||||
std::string system_(pseudoranges_iter->second.System, 1);
|
||||
std::string system_(&pseudoranges_iter->second.System, 1);
|
||||
std::string sig_(pseudoranges_iter->second.Signal);
|
||||
if((system_.compare("G") == 0) && (sig_.compare("1C") == 0))
|
||||
{
|
||||
@ -459,7 +459,7 @@ std::string Rtcm::print_MT1002(const Gps_Ephemeris & gps_eph, double obs_time, c
|
||||
pseudoranges_iter != pseudoranges.end();
|
||||
pseudoranges_iter++)
|
||||
{
|
||||
std::string system_(pseudoranges_iter->second.System, 1);
|
||||
std::string system_(&pseudoranges_iter->second.System, 1);
|
||||
std::string sig_(pseudoranges_iter->second.Signal);
|
||||
if((system_.compare("G") == 0) && (sig_.compare("1C") == 0))
|
||||
{
|
||||
@ -533,7 +533,7 @@ std::string Rtcm::print_MT1003(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephem
|
||||
pseudoranges_iter != pseudoranges.end();
|
||||
pseudoranges_iter++)
|
||||
{
|
||||
std::string system_(pseudoranges_iter->second.System, 1);
|
||||
std::string system_(&pseudoranges_iter->second.System, 1);
|
||||
std::string sig_(pseudoranges_iter->second.Signal);
|
||||
if((system_.compare("G") == 0) && (sig_.compare("1C") == 0))
|
||||
{
|
||||
@ -643,7 +643,7 @@ std::string Rtcm::print_MT1004(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephem
|
||||
pseudoranges_iter != pseudoranges.end();
|
||||
pseudoranges_iter++)
|
||||
{
|
||||
std::string system_(pseudoranges_iter->second.System, 1);
|
||||
std::string system_(&pseudoranges_iter->second.System, 1);
|
||||
std::string sig_(pseudoranges_iter->second.Signal);
|
||||
if((system_.compare("G") == 0) && (sig_.compare("1C") == 0))
|
||||
{
|
||||
|
@ -45,7 +45,8 @@ TEST(Rtcm_Printer_Test, Instantiate)
|
||||
std::string filename = "hello.rtcm";
|
||||
bool flag_rtcm_tty_port = false;
|
||||
std::string rtcm_dump_devname = "/dev/pts/4";
|
||||
std::unique_ptr<Rtcm_Printer> RTCM_printer(new Rtcm_Printer(filename, flag_rtcm_tty_port, rtcm_dump_devname));
|
||||
bool flag_rtcm_server = false;
|
||||
std::unique_ptr<Rtcm_Printer> RTCM_printer(new Rtcm_Printer(filename, flag_rtcm_server, flag_rtcm_tty_port, rtcm_dump_devname));
|
||||
}
|
||||
|
||||
TEST(Rtcm_Printer_Test, Run)
|
||||
@ -69,8 +70,9 @@ TEST(Rtcm_Printer_Test, Run)
|
||||
std::string filename = "test.rtcm";
|
||||
bool flag_rtcm_tty_port = false;
|
||||
std::string rtcm_dump_devname = "/dev/pts/4";
|
||||
bool flag_rtcm_server = false;
|
||||
|
||||
std::unique_ptr<Rtcm_Printer> RTCM_printer(new Rtcm_Printer(filename, flag_rtcm_tty_port, rtcm_dump_devname));
|
||||
std::unique_ptr<Rtcm_Printer> RTCM_printer(new Rtcm_Printer(filename, flag_rtcm_server, flag_rtcm_tty_port, rtcm_dump_devname));
|
||||
|
||||
std::string reference_msg = "D300133ED7D30202980EDEEF34B4BD62AC0941986F33360B98";
|
||||
std::string testing_msg = RTCM_printer->print_MT1005_test();
|
||||
|
Loading…
Reference in New Issue
Block a user