mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-25 19:44:55 +00:00
Merge branch 'next' of git+ssh://github.com/gnss-sdr/gnss-sdr into next
This commit is contained in:
@@ -41,12 +41,10 @@ using google::LogMessage;
|
||||
GalileoE1Pvt::GalileoE1Pvt(ConfigurationInterface* configuration,
|
||||
std::string role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams,
|
||||
boost::shared_ptr<gr::msg_queue> queue) :
|
||||
unsigned int out_streams) :
|
||||
role_(role),
|
||||
in_streams_(in_streams),
|
||||
out_streams_(out_streams),
|
||||
queue_(queue)
|
||||
out_streams_(out_streams)
|
||||
{
|
||||
// dump parameters
|
||||
std::string default_dump_filename = "./pvt.dat";
|
||||
@@ -82,7 +80,7 @@ GalileoE1Pvt::GalileoE1Pvt(ConfigurationInterface* configuration,
|
||||
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, flag_rtcm_server, flag_rtcm_tty_port, rtcm_dump_devname);
|
||||
pvt_ = galileo_e1_make_pvt_cc(in_streams_, 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() << ")";
|
||||
}
|
||||
|
||||
@@ -93,16 +91,16 @@ GalileoE1Pvt::~GalileoE1Pvt()
|
||||
|
||||
void GalileoE1Pvt::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if(top_block) { /* top_block is not null */};
|
||||
// Nothing to connect internally
|
||||
if(top_block) { /* top_block is not null */};
|
||||
// Nothing to connect internally
|
||||
DLOG(INFO) << "nothing to connect internally";
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1Pvt::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if(top_block) { /* top_block is not null */};
|
||||
// Nothing to disconnect
|
||||
if(top_block) { /* top_block is not null */};
|
||||
// Nothing to disconnect
|
||||
}
|
||||
|
||||
gr::basic_block_sptr GalileoE1Pvt::get_left_block()
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#define GNSS_SDR_GALILEO_E1_PVT_H_
|
||||
|
||||
#include <string>
|
||||
#include <gnuradio/msg_queue.h>
|
||||
#include "pvt_interface.h"
|
||||
#include "galileo_e1_pvt_cc.h"
|
||||
|
||||
@@ -51,8 +50,7 @@ public:
|
||||
GalileoE1Pvt(ConfigurationInterface* configuration,
|
||||
std::string role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
unsigned int out_streams);
|
||||
|
||||
virtual ~GalileoE1Pvt();
|
||||
|
||||
@@ -91,7 +89,6 @@ private:
|
||||
std::string role_;
|
||||
unsigned int in_streams_;
|
||||
unsigned int out_streams_;
|
||||
boost::shared_ptr<gr::msg_queue> queue_;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -40,12 +40,10 @@ using google::LogMessage;
|
||||
GpsL1CaPvt::GpsL1CaPvt(ConfigurationInterface* configuration,
|
||||
std::string role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams,
|
||||
boost::shared_ptr<gr::msg_queue> queue) :
|
||||
unsigned int out_streams) :
|
||||
role_(role),
|
||||
in_streams_(in_streams),
|
||||
out_streams_(out_streams),
|
||||
queue_(queue)
|
||||
out_streams_(out_streams)
|
||||
{
|
||||
// dump parameters
|
||||
std::string default_dump_filename = "./pvt.dat";
|
||||
@@ -82,7 +80,7 @@ GpsL1CaPvt::GpsL1CaPvt(ConfigurationInterface* configuration,
|
||||
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, flag_rtcm_server, flag_rtcm_tty_port, rtcm_dump_devname );
|
||||
pvt_ = gps_l1_ca_make_pvt_cc(in_streams_, 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() << ")";
|
||||
}
|
||||
|
||||
@@ -93,18 +91,19 @@ GpsL1CaPvt::~GpsL1CaPvt()
|
||||
|
||||
void GpsL1CaPvt::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if(top_block) { /* top_block is not null */};
|
||||
// Nothing to connect internally
|
||||
if(top_block) { /* top_block is not null */};
|
||||
// Nothing to connect internally
|
||||
DLOG(INFO) << "nothing to connect internally";
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPvt::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if(top_block) { /* top_block is not null */};
|
||||
// Nothing to disconnect
|
||||
if(top_block) { /* top_block is not null */};
|
||||
// Nothing to disconnect
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr GpsL1CaPvt::get_left_block()
|
||||
{
|
||||
return pvt_;
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#define GNSS_SDR_GPS_L1_CA_PVT_H_
|
||||
|
||||
#include <string>
|
||||
#include <gnuradio/msg_queue.h>
|
||||
#include "pvt_interface.h"
|
||||
#include "gps_l1_ca_pvt_cc.h"
|
||||
|
||||
@@ -53,8 +52,7 @@ public:
|
||||
GpsL1CaPvt(ConfigurationInterface* configuration,
|
||||
std::string role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
unsigned int out_streams);
|
||||
|
||||
virtual ~GpsL1CaPvt();
|
||||
|
||||
@@ -92,7 +90,6 @@ private:
|
||||
std::string role_;
|
||||
unsigned int in_streams_;
|
||||
unsigned int out_streams_;
|
||||
boost::shared_ptr<gr::msg_queue> queue_;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -41,12 +41,10 @@ using google::LogMessage;
|
||||
HybridPvt::HybridPvt(ConfigurationInterface* configuration,
|
||||
std::string role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams,
|
||||
boost::shared_ptr<gr::msg_queue> queue) :
|
||||
unsigned int out_streams) :
|
||||
role_(role),
|
||||
in_streams_(in_streams),
|
||||
out_streams_(out_streams),
|
||||
queue_(queue)
|
||||
out_streams_(out_streams)
|
||||
{
|
||||
// dump parameters
|
||||
std::string default_dump_filename = "./pvt.dat";
|
||||
@@ -82,7 +80,7 @@ HybridPvt::HybridPvt(ConfigurationInterface* configuration,
|
||||
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, flag_rtcm_server, flag_rtcm_tty_port, rtcm_dump_devname);
|
||||
pvt_ = hybrid_make_pvt_cc(in_streams_, 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() << ")";
|
||||
}
|
||||
|
||||
@@ -93,18 +91,19 @@ HybridPvt::~HybridPvt()
|
||||
|
||||
void HybridPvt::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if(top_block) { /* top_block is not null */};
|
||||
// Nothing to connect internally
|
||||
if(top_block) { /* top_block is not null */};
|
||||
// Nothing to connect internally
|
||||
DLOG(INFO) << "nothing to connect internally";
|
||||
}
|
||||
|
||||
|
||||
void HybridPvt::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if(top_block) { /* top_block is not null */};
|
||||
// Nothing to disconnect
|
||||
if(top_block) { /* top_block is not null */};
|
||||
// Nothing to disconnect
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr HybridPvt::get_left_block()
|
||||
{
|
||||
return pvt_;
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#define GNSS_SDR_HYBRID_PVT_H_
|
||||
|
||||
#include <string>
|
||||
#include <gnuradio/msg_queue.h>
|
||||
#include "pvt_interface.h"
|
||||
#include "hybrid_pvt_cc.h"
|
||||
|
||||
@@ -51,8 +50,7 @@ public:
|
||||
HybridPvt(ConfigurationInterface* configuration,
|
||||
std::string role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
unsigned int out_streams);
|
||||
|
||||
virtual ~HybridPvt();
|
||||
|
||||
@@ -90,7 +88,6 @@ private:
|
||||
std::string role_;
|
||||
unsigned int in_streams_;
|
||||
unsigned int out_streams_;
|
||||
boost::shared_ptr<gr::msg_queue> queue_;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -40,11 +40,12 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
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,
|
||||
|
||||
galileo_e1_pvt_cc_sptr galileo_e1_make_pvt_cc(unsigned int nchannels, 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,
|
||||
return galileo_e1_pvt_cc_sptr(new galileo_e1_pvt_cc(nchannels, 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));
|
||||
}
|
||||
@@ -90,16 +91,20 @@ void galileo_e1_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg)
|
||||
d_ls_pvt->galileo_almanac = *galileo_almanac;
|
||||
DLOG(INFO) << "New Galileo Almanac has arrived ";
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << "msg_handler_telemetry unknown object type!";
|
||||
}
|
||||
|
||||
}
|
||||
catch(boost::bad_any_cast& e)
|
||||
{
|
||||
DLOG(WARNING) << "msg_handler_telemetry Bad any cast!\n";
|
||||
LOG(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,
|
||||
galileo_e1_pvt_cc::galileo_e1_pvt_cc(unsigned int nchannels, 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)))
|
||||
@@ -107,7 +112,6 @@ galileo_e1_pvt_cc::galileo_e1_pvt_cc(unsigned int nchannels, boost::shared_ptr<g
|
||||
|
||||
d_output_rate_ms = output_rate_ms;
|
||||
d_display_rate_ms = display_rate_ms;
|
||||
d_queue = queue;
|
||||
d_dump = dump;
|
||||
d_nchannels = nchannels;
|
||||
d_dump_filename = dump_filename;
|
||||
@@ -115,8 +119,7 @@ galileo_e1_pvt_cc::galileo_e1_pvt_cc(unsigned int nchannels, boost::shared_ptr<g
|
||||
|
||||
// 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));
|
||||
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;
|
||||
@@ -192,16 +195,17 @@ bool galileo_e1_pvt_cc::pseudoranges_pairCompare_min(const std::pair<int,Gnss_Sy
|
||||
void galileo_e1_pvt_cc::print_receiver_status(Gnss_Synchro** channels_synchronization_data)
|
||||
{
|
||||
// Print the current receiver status using std::cout every second
|
||||
int current_rx_seg=floor(channels_synchronization_data[0][0].Tracking_timestamp_secs);
|
||||
if ( current_rx_seg!= d_last_status_print_seg)
|
||||
{
|
||||
d_last_status_print_seg = current_rx_seg;
|
||||
std::cout << "Current input signal time = " << current_rx_seg << " [s]" << std::endl<< std::flush;
|
||||
//DLOG(INFO) << "GPS L1 C/A Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN)
|
||||
// << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl;
|
||||
}
|
||||
int current_rx_seg = floor(channels_synchronization_data[0][0].Tracking_timestamp_secs);
|
||||
if ( current_rx_seg != d_last_status_print_seg)
|
||||
{
|
||||
d_last_status_print_seg = current_rx_seg;
|
||||
std::cout << "Current input signal time = " << current_rx_seg << " [s]" << std::endl << std::flush;
|
||||
//DLOG(INFO) << "GPS L1 C/A Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN)
|
||||
// << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int galileo_e1_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)))
|
||||
{
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <gnuradio/block.h>
|
||||
#include <gnuradio/msg_queue.h>
|
||||
#include "nmea_printer.h"
|
||||
#include "kml_printer.h"
|
||||
#include "rinex_printer.h"
|
||||
@@ -49,7 +48,6 @@ class galileo_e1_pvt_cc;
|
||||
typedef boost::shared_ptr<galileo_e1_pvt_cc> galileo_e1_pvt_cc_sptr;
|
||||
|
||||
galileo_e1_pvt_cc_sptr galileo_e1_make_pvt_cc(unsigned int n_channels,
|
||||
boost::shared_ptr<gr::msg_queue> queue,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
int averaging_depth,
|
||||
@@ -70,7 +68,6 @@ class galileo_e1_pvt_cc : public gr::block
|
||||
{
|
||||
private:
|
||||
friend 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,
|
||||
@@ -84,7 +81,6 @@ private:
|
||||
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,
|
||||
int averaging_depth,
|
||||
bool flag_averaging,
|
||||
@@ -99,7 +95,6 @@ private:
|
||||
|
||||
void msg_handler_telemetry(pmt::pmt_t msg);
|
||||
|
||||
boost::shared_ptr<gr::msg_queue> d_queue;
|
||||
bool d_dump;
|
||||
bool b_rinex_header_writen;
|
||||
bool b_rinex_header_updated;
|
||||
|
||||
@@ -43,9 +43,9 @@
|
||||
using google::LogMessage;
|
||||
|
||||
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)
|
||||
gps_l1_ca_make_pvt_cc(unsigned int nchannels, 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, flag_rtcm_server, flag_rtcm_tty_port, rtcm_dump_devname));
|
||||
return gps_l1_ca_pvt_cc_sptr(new gps_l1_ca_pvt_cc(nchannels, 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));
|
||||
}
|
||||
|
||||
|
||||
@@ -132,17 +132,19 @@ void gps_l1_ca_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg)
|
||||
rp->log_rinex_sbs(rp->sbsFile, sbas_raw_msg);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << "msg_handler_telemetry unknown object type!";
|
||||
}
|
||||
}
|
||||
catch(boost::bad_any_cast& e)
|
||||
{
|
||||
DLOG(WARNING) << "msg_handler_telemetry Bad any cast!\n";
|
||||
LOG(WARNING) << "msg_handler_telemetry Bad any cast!\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gps_l1_ca_pvt_cc::gps_l1_ca_pvt_cc(unsigned int nchannels,
|
||||
boost::shared_ptr<gr::msg_queue> queue,
|
||||
bool dump, std::string dump_filename,
|
||||
int averaging_depth,
|
||||
bool flag_averaging,
|
||||
@@ -159,7 +161,6 @@ gps_l1_ca_pvt_cc::gps_l1_ca_pvt_cc(unsigned int nchannels,
|
||||
{
|
||||
d_output_rate_ms = output_rate_ms;
|
||||
d_display_rate_ms = display_rate_ms;
|
||||
d_queue = queue;
|
||||
d_dump = dump;
|
||||
d_nchannels = nchannels;
|
||||
d_dump_filename = dump_filename;
|
||||
@@ -238,6 +239,7 @@ bool pseudoranges_pairCompare_min(const std::pair<int,Gnss_Synchro>& a, const st
|
||||
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
|
||||
@@ -245,12 +247,13 @@ void gps_l1_ca_pvt_cc::print_receiver_status(Gnss_Synchro** channels_synchroniza
|
||||
if ( current_rx_seg!= d_last_status_print_seg)
|
||||
{
|
||||
d_last_status_print_seg = current_rx_seg;
|
||||
std::cout << "Current input signal time = " << current_rx_seg << " [s]" << std::endl<< std::flush;
|
||||
std::cout << "Current input signal time = " << current_rx_seg << " [s]" << std::endl << std::flush;
|
||||
//DLOG(INFO) << "GPS L1 C/A Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN)
|
||||
// << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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)))
|
||||
{
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <gnuradio/block.h>
|
||||
#include <gnuradio/msg_queue.h>
|
||||
#include "nmea_printer.h"
|
||||
#include "kml_printer.h"
|
||||
#include "rinex_printer.h"
|
||||
@@ -47,7 +46,6 @@ class gps_l1_ca_pvt_cc;
|
||||
typedef boost::shared_ptr<gps_l1_ca_pvt_cc> gps_l1_ca_pvt_cc_sptr;
|
||||
|
||||
gps_l1_ca_pvt_cc_sptr gps_l1_ca_make_pvt_cc(unsigned int n_channels,
|
||||
boost::shared_ptr<gr::msg_queue> queue,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
int averaging_depth,
|
||||
@@ -69,7 +67,6 @@ class gps_l1_ca_pvt_cc : public gr::block
|
||||
{
|
||||
private:
|
||||
friend 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,
|
||||
@@ -83,7 +80,6 @@ private:
|
||||
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,
|
||||
std::string dump_filename,
|
||||
int averaging_depth,
|
||||
@@ -99,7 +95,6 @@ private:
|
||||
|
||||
void msg_handler_telemetry(pmt::pmt_t msg);
|
||||
|
||||
boost::shared_ptr<gr::msg_queue> d_queue;
|
||||
bool d_dump;
|
||||
bool b_rinex_header_writen;
|
||||
bool b_rinex_sbs_header_writen;
|
||||
|
||||
@@ -41,13 +41,12 @@
|
||||
using google::LogMessage;
|
||||
|
||||
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)
|
||||
hybrid_make_pvt_cc(unsigned int nchannels, 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, flag_rtcm_server, flag_rtcm_tty_port, rtcm_dump_devname));
|
||||
return hybrid_pvt_cc_sptr(new hybrid_pvt_cc(nchannels, 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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
void hybrid_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg)
|
||||
{
|
||||
try {
|
||||
@@ -55,88 +54,93 @@ void hybrid_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));
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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));
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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));
|
||||
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;
|
||||
d_ls_pvt->galileo_almanac=*galileo_almanac;
|
||||
DLOG(INFO) << "New Galileo Almanac has arrived ";
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << "msg_handler_telemetry unknown object type!";
|
||||
}
|
||||
|
||||
}
|
||||
catch(boost::bad_any_cast& e)
|
||||
{
|
||||
DLOG(WARNING) << "msg_handler_telemetry Bad any cast!\n";
|
||||
LOG(WARNING) << "msg_handler_telemetry Bad any cast!";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
hybrid_pvt_cc::hybrid_pvt_cc(unsigned int nchannels, boost::shared_ptr<gr::msg_queue> queue, bool dump, std::string dump_filename,
|
||||
|
||||
hybrid_pvt_cc::hybrid_pvt_cc(unsigned int nchannels, 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)))
|
||||
{
|
||||
gr::io_signature::make(0, 0, sizeof(gr_complex)))
|
||||
|
||||
{
|
||||
d_output_rate_ms = output_rate_ms;
|
||||
d_display_rate_ms = display_rate_ms;
|
||||
d_queue = queue;
|
||||
d_dump = dump;
|
||||
d_nchannels = nchannels;
|
||||
d_dump_filename = dump_filename;
|
||||
@@ -144,8 +148,7 @@ hybrid_pvt_cc::hybrid_pvt_cc(unsigned int nchannels, boost::shared_ptr<gr::msg_q
|
||||
|
||||
// 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));
|
||||
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;
|
||||
@@ -183,7 +186,7 @@ hybrid_pvt_cc::hybrid_pvt_cc(unsigned int nchannels, boost::shared_ptr<gr::msg_q
|
||||
b_rinex_header_updated = false;
|
||||
rp = std::make_shared<Rinex_Printer>();
|
||||
|
||||
d_last_status_print_seg=0;
|
||||
d_last_status_print_seg = 0;
|
||||
|
||||
// ############# ENABLE DATA FILE LOG #################
|
||||
if (d_dump == true)
|
||||
@@ -220,16 +223,17 @@ bool hybrid_pvt_cc::pseudoranges_pairCompare_min(const std::pair<int,Gnss_Synchr
|
||||
void hybrid_pvt_cc::print_receiver_status(Gnss_Synchro** channels_synchronization_data)
|
||||
{
|
||||
// Print the current receiver status using std::cout every second
|
||||
int current_rx_seg=floor(channels_synchronization_data[0][0].Tracking_timestamp_secs);
|
||||
if ( current_rx_seg!= d_last_status_print_seg)
|
||||
{
|
||||
d_last_status_print_seg = current_rx_seg;
|
||||
std::cout << "Current input signal time = " << current_rx_seg << " [s]" << std::endl<< std::flush;
|
||||
//DLOG(INFO) << "GPS L1 C/A Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN)
|
||||
// << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl;
|
||||
}
|
||||
int current_rx_seg = floor(channels_synchronization_data[0][0].Tracking_timestamp_secs);
|
||||
if ( current_rx_seg != d_last_status_print_seg)
|
||||
{
|
||||
d_last_status_print_seg = current_rx_seg;
|
||||
std::cout << "Current input signal time = " << current_rx_seg << " [s]" << std::endl << std::flush;
|
||||
//DLOG(INFO) << "GPS L1 C/A Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN)
|
||||
// << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int hybrid_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)))
|
||||
{
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include <utility>
|
||||
#include <string>
|
||||
#include <gnuradio/block.h>
|
||||
#include <gnuradio/msg_queue.h>
|
||||
#include "nmea_printer.h"
|
||||
#include "kml_printer.h"
|
||||
#include "geojson_printer.h"
|
||||
@@ -49,7 +48,6 @@ class hybrid_pvt_cc;
|
||||
typedef boost::shared_ptr<hybrid_pvt_cc> hybrid_pvt_cc_sptr;
|
||||
|
||||
hybrid_pvt_cc_sptr hybrid_make_pvt_cc(unsigned int n_channels,
|
||||
boost::shared_ptr<gr::msg_queue> queue,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
int averaging_depth,
|
||||
@@ -70,7 +68,6 @@ class hybrid_pvt_cc : public gr::block
|
||||
{
|
||||
private:
|
||||
friend 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,
|
||||
@@ -84,7 +81,6 @@ private:
|
||||
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,
|
||||
int averaging_depth,
|
||||
bool flag_averaging,
|
||||
@@ -99,7 +95,6 @@ private:
|
||||
|
||||
void msg_handler_telemetry(pmt::pmt_t msg);
|
||||
|
||||
boost::shared_ptr<gr::msg_queue> d_queue;
|
||||
bool d_dump;
|
||||
bool b_rinex_header_writen;
|
||||
bool b_rinex_header_updated;
|
||||
|
||||
Reference in New Issue
Block a user