diff --git a/src/algorithms/PVT/adapters/gps_l1_ca_pvt.cc b/src/algorithms/PVT/adapters/gps_l1_ca_pvt.cc index a881d27bc..ba244b5ae 100644 --- a/src/algorithms/PVT/adapters/gps_l1_ca_pvt.cc +++ b/src/algorithms/PVT/adapters/gps_l1_ca_pvt.cc @@ -103,6 +103,10 @@ GpsL1CaPvt::GpsL1CaPvt(ConfigurationInterface* configuration, //std::string ref_time_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_ref_time_xml", ref_time_default_xml_filename); //std::string ref_location_xml_filename = configuration_->property("GNSS-SDR.SUPL_gps_ref_location_xml", ref_location_default_xml_filename); + // RINEX version + int conf_rinex_version; + conf_rinex_version = configuration->property(role + ".rinex_version", 0); + // make PVT object pvt_ = gps_l1_ca_make_pvt_cc(in_streams_, dump_, @@ -119,7 +123,8 @@ GpsL1CaPvt::GpsL1CaPvt(ConfigurationInterface* configuration, rtcm_tcp_port, rtcm_station_id, rtcm_msg_rate_ms, - rtcm_dump_devname ); + rtcm_dump_devname, + conf_rinex_version ); DLOG(INFO) << "pvt(" << pvt_->unique_id() << ")"; } @@ -129,7 +134,7 @@ bool GpsL1CaPvt::save_assistance_to_XML() { // return variable (true == succeeded) bool ret = false; - + LOG(INFO) << "SUPL: Try to save GPS ephemeris to XML file " << eph_xml_filename_; std::map eph_map = pvt_->get_GPS_L1_ephemeris_map(); @@ -243,4 +248,3 @@ gr::basic_block_sptr GpsL1CaPvt::get_right_block() { return pvt_; } - diff --git a/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.cc index 83804b97d..44dbc4bfc 100644 --- a/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.cc @@ -58,7 +58,8 @@ gps_l1_ca_make_pvt_cc(unsigned int nchannels, unsigned short rtcm_tcp_port, unsigned short rtcm_station_id, std::map rtcm_msg_rate_ms, - std::string rtcm_dump_devname) + std::string rtcm_dump_devname, + int rinex_version) { return gps_l1_ca_pvt_cc_sptr(new gps_l1_ca_pvt_cc(nchannels, dump, @@ -75,7 +76,8 @@ gps_l1_ca_make_pvt_cc(unsigned int nchannels, rtcm_tcp_port, rtcm_station_id, rtcm_msg_rate_ms, - rtcm_dump_devname)); + rtcm_dump_devname, + rinex_version)); } @@ -208,7 +210,8 @@ gps_l1_ca_pvt_cc::gps_l1_ca_pvt_cc(unsigned int nchannels, unsigned short rtcm_tcp_port, unsigned short rtcm_station_id, std::map rtcm_msg_rate_ms, - std::string rtcm_dump_devname) : + std::string rtcm_dump_devname, + int rinex_version) : gr::block("gps_l1_ca_pvt_cc", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)), gr::io_signature::make(0, 0, sizeof(gr_complex)) ) { @@ -280,7 +283,7 @@ gps_l1_ca_pvt_cc::gps_l1_ca_pvt_cc(unsigned int nchannels, b_rinex_header_written = false; b_rinex_header_updated = false; b_rinex_sbs_header_written = false; - rp = std::make_shared(); + rp = std::make_shared(rinex_version); // ############# ENABLE DATA FILE LOG ################# if (d_dump == true) @@ -496,5 +499,3 @@ int gps_l1_ca_pvt_cc::general_work (int noutput_items __attribute__((unused)), g consume_each(1); //one by one return 1; } - - diff --git a/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.h index f2234b1d9..07f9d8607 100644 --- a/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.h @@ -63,7 +63,8 @@ gps_l1_ca_pvt_cc_sptr gps_l1_ca_make_pvt_cc(unsigned int n_channels, unsigned short rtcm_tcp_port, unsigned short rtcm_station_id, std::map rtcm_msg_rate_ms, - std::string rtcm_dump_devname + std::string rtcm_dump_devname, + int rinex_version ); /*! @@ -87,7 +88,8 @@ private: unsigned short rtcm_tcp_port, unsigned short rtcm_station_id, std::map rtcm_msg_rate_ms, - std::string rtcm_dump_devname); + std::string rtcm_dump_devname, + int rinex_version); gps_l1_ca_pvt_cc(unsigned int nchannels, bool dump, std::string dump_filename, @@ -103,7 +105,8 @@ private: unsigned short rtcm_tcp_port, unsigned short rtcm_station_id, std::map rtcm_msg_rate_ms, - std::string rtcm_dump_devname); + std::string rtcm_dump_devname, + int rinex_version); void msg_handler_telemetry(pmt::pmt_t msg); @@ -157,7 +160,7 @@ public: * It is used to save the assistance data at the receiver shutdown */ std::map get_GPS_L1_ephemeris_map(); - + ~gps_l1_ca_pvt_cc (); //!< Default destructor int general_work (int noutput_items, gr_vector_int &ninput_items, diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 71cf04bf3..51d1bad0c 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -51,7 +51,7 @@ using google::LogMessage; DEFINE_string(RINEX_version, "3.02", "Specifies the RINEX version (2.11 or 3.02)"); -Rinex_Printer::Rinex_Printer() +Rinex_Printer::Rinex_Printer(int conf_version) { navfilename = Rinex_Printer::createFilename("RINEX_FILE_TYPE_GPS_NAV"); obsfilename = Rinex_Printer::createFilename("RINEX_FILE_TYPE_OBS"); @@ -179,6 +179,13 @@ Rinex_Printer::Rinex_Printer() stringVersion = "3.02"; } + if(conf_version != 0) + { + if(conf_version == 2) + version = 2; + stringVersion = "2.11"; + } + numberTypesObservations = 4; // Number of available types of observable in the system } diff --git a/src/algorithms/PVT/libs/rinex_printer.h b/src/algorithms/PVT/libs/rinex_printer.h index f90a2f5e4..0d1dc940e 100644 --- a/src/algorithms/PVT/libs/rinex_printer.h +++ b/src/algorithms/PVT/libs/rinex_printer.h @@ -78,7 +78,7 @@ public: /*! * \brief Default constructor. Creates GPS Navigation and Observables RINEX files and their headers */ - Rinex_Printer(); + Rinex_Printer(int version = 0); /*! * \brief Default destructor. Closes GPS Navigation and Observables RINEX files diff --git a/src/tests/system-tests/trk_system_test.cc b/src/tests/system-tests/trk_system_test.cc index 51e120e23..51e5c017b 100644 --- a/src/tests/system-tests/trk_system_test.cc +++ b/src/tests/system-tests/trk_system_test.cc @@ -116,7 +116,7 @@ int Trk_System_Test::configure_receiver() const float early_late_space_chips = 0.5; const int display_rate_ms = 500; - const int output_rate_ms = 100; + const int output_rate_ms = 1000; const int averaging_depth = 10; bool false_bool = false; @@ -225,6 +225,7 @@ int Trk_System_Test::configure_receiver() config->set_property("PVT.flag_rtcm_tty_port", "false"); config->set_property("PVT.rtcm_dump_devname", "/dev/pts/1"); config->set_property("PVT.dump", "false"); + config->set_property("PVT.rinex_version", std::to_string(2)); return 0; }