From afb2eb16c681eaf4419d960334f61a353cc7e535 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 4 Nov 2019 23:46:32 +0100 Subject: [PATCH 01/11] Update changelog --- docs/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog b/docs/changelog index 6332a3ed1..f69141725 100644 --- a/docs/changelog +++ b/docs/changelog @@ -22,6 +22,7 @@ - Fixed PVT solution in receivers processing L1 plus L2C and/or L5 signals. - Added RINEX files generation for triple-band configurations (L1 + L2C + L5 and L1 + E1 + L2C + L5 + E5a). - Fixed bugs in the decoding of BeiDou navigation messages. +- Fixed a bug in feeding Galileo channels' observations to RTKLIB, which was causing wrong date of PVT fixes in Galileo-only receivers and not considering Galileo observations in multi-constellation receivers when using signals after the GPS rollover on April 6, 2019. - Improved management of devices with the AD9361 RF transceiver. - Fixed bugs in FPGA off-loading. From 216e8dfa26a63b4929fd7c51407b99521167d411 Mon Sep 17 00:00:00 2001 From: Cillian O'Driscoll Date: Tue, 29 Aug 2017 11:27:13 +0100 Subject: [PATCH 02/11] Added velocity and clock drift to PVT Interestingly RTKLIB does not store the clock drift in its sol_t datatype, so I added this to the unused element dtr[5]. This may not be compatible with future versions of RTKLIB. Here we store velocity in ENU coordinates and the clock drift in parts per million (PPM) --- src/algorithms/PVT/libs/pvt_solution.cc | 23 ++++++++++++++++++++++- src/algorithms/PVT/libs/pvt_solution.h | 4 ++++ src/algorithms/PVT/libs/rtklib_solver.cc | 17 +++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/src/algorithms/PVT/libs/pvt_solution.cc b/src/algorithms/PVT/libs/pvt_solution.cc index 7dd0000c2..7c2417cd5 100644 --- a/src/algorithms/PVT/libs/pvt_solution.cc +++ b/src/algorithms/PVT/libs/pvt_solution.cc @@ -316,6 +316,16 @@ void Pvt_Solution::set_time_offset_s(double offset) d_rx_dt_s = offset; } +double Pvt_Solution::get_clock_drift_ppm() const +{ + return d_rx_clock_drift_ppm; +} + + +void Pvt_Solution::set_clock_drift_ppm(double clock_drift_ppm) +{ + d_rx_clock_drift_ppm = clock_drift_ppm; +} double Pvt_Solution::get_latitude() const { @@ -404,11 +414,22 @@ void Pvt_Solution::set_rx_pos(const arma::vec &pos) } -arma::vec Pvt_Solution::get_rx_pos() const +const arma::vec& Pvt_Solution::get_rx_pos() const { return d_rx_pos; } +void Pvt_Solution::set_rx_vel(arma::vec vel) +{ + d_rx_vel = vel; +} + + +const arma::vec& Pvt_Solution::get_rx_vel() const +{ + return d_rx_vel; +} + boost::posix_time::ptime Pvt_Solution::get_position_UTC_time() const { diff --git a/src/algorithms/PVT/libs/pvt_solution.h b/src/algorithms/PVT/libs/pvt_solution.h index f1f94f04d..ae8a6ab00 100644 --- a/src/algorithms/PVT/libs/pvt_solution.h +++ b/src/algorithms/PVT/libs/pvt_solution.h @@ -53,6 +53,8 @@ public: double get_time_offset_s() const; //!< Get RX time offset [s] void set_time_offset_s(double offset); //!< Set RX time offset [s] + double get_clock_drift_ppm() const; //!< Get the Rx clock drift [ppm] + void set_clock_drift_ppm(double clock_drift_ppm ); //!< Set the Rx clock drift [ppm] double get_latitude() const; //!< Get RX position Latitude WGS84 [deg] double get_longitude() const; //!< Get RX position Longitude WGS84 [deg] double get_height() const; //!< Get RX position height WGS84 [m] @@ -133,6 +135,7 @@ protected: bool d_pre_2009_file; // Flag to correct week rollover in post processing mode for signals older than 2009 private: double d_rx_dt_s; // RX time offset [s] + double d_rx_clock_drift_ppm; // RX clock drift [ppm] double d_latitude_d; // RX position Latitude WGS84 [deg] double d_longitude_d; // RX position Longitude WGS84 [deg] @@ -154,6 +157,7 @@ private: int d_averaging_depth; // Length of averaging window arma::vec d_rx_pos; + arma::vec d_rx_vel; boost::posix_time::ptime d_position_UTC_time; int d_valid_observations; }; diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 75aa0f6ea..fdf249835 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -1071,6 +1071,23 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ monitor_pvt.pdop = dop_[1]; monitor_pvt.hdop = dop_[2]; monitor_pvt.vdop = dop_[3]; + double vel_enu[3]; + double pos[3]; + pos[0] = rx_position_and_time(0); + pos[1] = rx_position_and_time(1); + pos[2] = rx_position_and_time(2); + ecef2enu( pos, &pvt_sol.rr[3], vel_enu ); + + arma::vec rx_vel_enu(3); + rx_vel_enu(0) = vel_enu[ 0 ]; + rx_vel_enu(1) = vel_enu[ 1 ]; + rx_vel_enu(2) = vel_enu[ 2 ]; + + this->set_rx_vel( rx_vel_enu ); + + double clock_drift_ppm = pvt_sol.dtr[5] / GPS_C_m_s *1e6; + + this->set_clock_drift_ppm( clock_drift_ppm ); // ######## LOG FILE ######### if (d_flag_dump_enabled == true) From f9f7884d058607b9eaf6f18402e28914b0c3dde2 Mon Sep 17 00:00:00 2001 From: Cillian O'Driscoll Date: Mon, 4 Nov 2019 11:08:59 +0000 Subject: [PATCH 03/11] Applied clang-format to the previous commit --- src/algorithms/PVT/libs/pvt_solution.cc | 6 +++--- src/algorithms/PVT/libs/pvt_solution.h | 14 +++++++------- src/algorithms/PVT/libs/rtklib_solver.cc | 16 ++++++++-------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/algorithms/PVT/libs/pvt_solution.cc b/src/algorithms/PVT/libs/pvt_solution.cc index 7c2417cd5..d9afed699 100644 --- a/src/algorithms/PVT/libs/pvt_solution.cc +++ b/src/algorithms/PVT/libs/pvt_solution.cc @@ -29,9 +29,9 @@ * ------------------------------------------------------------------------- */ -#include "pvt_solution.h" #include "GPS_L1_CA.h" #include "geofunctions.h" +#include "pvt_solution.h" #include #include #include @@ -414,7 +414,7 @@ void Pvt_Solution::set_rx_pos(const arma::vec &pos) } -const arma::vec& Pvt_Solution::get_rx_pos() const +arma::vec Pvt_Solution::get_rx_pos() const { return d_rx_pos; } @@ -425,7 +425,7 @@ void Pvt_Solution::set_rx_vel(arma::vec vel) } -const arma::vec& Pvt_Solution::get_rx_vel() const +arma::vec Pvt_Solution::get_rx_vel() const { return d_rx_vel; } diff --git a/src/algorithms/PVT/libs/pvt_solution.h b/src/algorithms/PVT/libs/pvt_solution.h index ae8a6ab00..49b823576 100644 --- a/src/algorithms/PVT/libs/pvt_solution.h +++ b/src/algorithms/PVT/libs/pvt_solution.h @@ -53,11 +53,11 @@ public: double get_time_offset_s() const; //!< Get RX time offset [s] void set_time_offset_s(double offset); //!< Set RX time offset [s] - double get_clock_drift_ppm() const; //!< Get the Rx clock drift [ppm] - void set_clock_drift_ppm(double clock_drift_ppm ); //!< Set the Rx clock drift [ppm] - double get_latitude() const; //!< Get RX position Latitude WGS84 [deg] - double get_longitude() const; //!< Get RX position Longitude WGS84 [deg] - double get_height() const; //!< Get RX position height WGS84 [m] + double get_clock_drift_ppm() const; //!< Get the Rx clock drift [ppm] + void set_clock_drift_ppm(double clock_drift_ppm); //!< Set the Rx clock drift [ppm] + double get_latitude() const; //!< Get RX position Latitude WGS84 [deg] + double get_longitude() const; //!< Get RX position Longitude WGS84 [deg] + double get_height() const; //!< Get RX position height WGS84 [m] double get_speed_over_ground() const; //!< Get RX speed over ground [m/s] void set_speed_over_ground(double speed_m_s); //!< Set RX speed over ground [m/s] @@ -134,8 +134,8 @@ public: protected: bool d_pre_2009_file; // Flag to correct week rollover in post processing mode for signals older than 2009 private: - double d_rx_dt_s; // RX time offset [s] - double d_rx_clock_drift_ppm; // RX clock drift [ppm] + double d_rx_dt_s; // RX time offset [s] + double d_rx_clock_drift_ppm; // RX clock drift [ppm] double d_latitude_d; // RX position Latitude WGS84 [deg] double d_longitude_d; // RX position Longitude WGS84 [deg] diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index fdf249835..5809e84cf 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -51,7 +51,6 @@ * * -----------------------------------------------------------------------*/ -#include "rtklib_solver.h" #include "Beidou_B1I.h" #include "Beidou_B3I.h" #include "Beidou_DNAV.h" @@ -61,6 +60,7 @@ #include "rtklib_conversions.h" #include "rtklib_rtkpos.h" #include "rtklib_solution.h" +#include "rtklib_solver.h" #include #include #include @@ -1076,18 +1076,18 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ pos[0] = rx_position_and_time(0); pos[1] = rx_position_and_time(1); pos[2] = rx_position_and_time(2); - ecef2enu( pos, &pvt_sol.rr[3], vel_enu ); + ecef2enu(pos, &pvt_sol.rr[3], vel_enu); arma::vec rx_vel_enu(3); - rx_vel_enu(0) = vel_enu[ 0 ]; - rx_vel_enu(1) = vel_enu[ 1 ]; - rx_vel_enu(2) = vel_enu[ 2 ]; + rx_vel_enu(0) = vel_enu[0]; + rx_vel_enu(1) = vel_enu[1]; + rx_vel_enu(2) = vel_enu[2]; - this->set_rx_vel( rx_vel_enu ); + this->set_rx_vel(rx_vel_enu); - double clock_drift_ppm = pvt_sol.dtr[5] / GPS_C_m_s *1e6; + double clock_drift_ppm = pvt_sol.dtr[5] / GPS_C_m_s * 1e6; - this->set_clock_drift_ppm( clock_drift_ppm ); + this->set_clock_drift_ppm(clock_drift_ppm); // ######## LOG FILE ######### if (d_flag_dump_enabled == true) From 828d3cd525086212ec16e665a0d6dd296bcf27ca Mon Sep 17 00:00:00 2001 From: Cillian O'Driscoll Date: Mon, 4 Nov 2019 12:04:46 +0000 Subject: [PATCH 04/11] [WIP] Adding velocity and clock drift --- .../PVT/gnuradio_blocks/rtklib_pvt_gs.cc | 11 ++++++++++- src/algorithms/PVT/libs/pvt_solution.cc | 2 +- src/algorithms/PVT/libs/pvt_solution.h | 3 +++ src/algorithms/PVT/libs/rtklib_solver.cc | 14 ++++---------- src/algorithms/libs/rtklib/rtklib_pntpos.cc | 1 + 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index 1e83da190..fa252b04f 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -28,7 +28,6 @@ * ------------------------------------------------------------------------- */ -#include "rtklib_pvt_gs.h" #include "MATH_CONSTANTS.h" #include "beidou_dnav_almanac.h" #include "beidou_dnav_ephemeris.h" @@ -61,6 +60,7 @@ #include "pvt_conf.h" #include "rinex_printer.h" #include "rtcm_printer.h" +#include "rtklib_pvt_gs.h" #include "rtklib_solver.h" #include // for any_cast, any #include // for xml_iarchive @@ -4168,6 +4168,15 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item std::cout << std::setprecision(ss); DLOG(INFO) << "RX clock offset: " << d_user_pvt_solver->get_time_offset_s() << "[s]"; + std::cout + << TEXT_BOLD_GREEN + << "Velocity: " << std::fixed << std::setprecision(3) + << "East: " << d_user_pvt_solver->get_rx_vel()[0] << " [m/s], North: " << d_user_pvt_solver->get_rx_vel()[1] + << " [m/s], Up = " << d_user_pvt_solver->get_rx_vel()[2] << " [m/s]" << TEXT_RESET << std::endl; + + std::cout << std::setprecision(ss); + DLOG(INFO) << "RX clock drift: " << d_user_pvt_solver->get_clock_drift_ppm() << " [ppm]"; + // boost::posix_time::ptime p_time; // gtime_t rtklib_utc_time = gpst2time(adjgpsweek(d_user_pvt_solver->gps_ephemeris_map.cbegin()->second.i_GPS_week), d_rx_time); // p_time = boost::posix_time::from_time_t(rtklib_utc_time.time); diff --git a/src/algorithms/PVT/libs/pvt_solution.cc b/src/algorithms/PVT/libs/pvt_solution.cc index d9afed699..5c5174328 100644 --- a/src/algorithms/PVT/libs/pvt_solution.cc +++ b/src/algorithms/PVT/libs/pvt_solution.cc @@ -419,7 +419,7 @@ arma::vec Pvt_Solution::get_rx_pos() const return d_rx_pos; } -void Pvt_Solution::set_rx_vel(arma::vec vel) +void Pvt_Solution::set_rx_vel(const arma::vec &vel) { d_rx_vel = vel; } diff --git a/src/algorithms/PVT/libs/pvt_solution.h b/src/algorithms/PVT/libs/pvt_solution.h index 49b823576..ede8a5881 100644 --- a/src/algorithms/PVT/libs/pvt_solution.h +++ b/src/algorithms/PVT/libs/pvt_solution.h @@ -72,6 +72,9 @@ public: void set_rx_pos(const arma::vec &pos); //!< Set position: Latitude [deg], longitude [deg], height [m] arma::vec get_rx_pos() const; + void set_rx_vel(const arma::vec &vel); //!< Set velocity: East [m/s], North [m/s], Up [m/s] + arma::vec get_rx_vel() const; + bool is_valid_position() const; void set_valid_position(bool is_valid); diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 5809e84cf..8221d2e4b 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -1071,21 +1071,15 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ monitor_pvt.pdop = dop_[1]; monitor_pvt.hdop = dop_[2]; monitor_pvt.vdop = dop_[3]; - double vel_enu[3]; - double pos[3]; - pos[0] = rx_position_and_time(0); - pos[1] = rx_position_and_time(1); - pos[2] = rx_position_and_time(2); - ecef2enu(pos, &pvt_sol.rr[3], vel_enu); arma::vec rx_vel_enu(3); - rx_vel_enu(0) = vel_enu[0]; - rx_vel_enu(1) = vel_enu[1]; - rx_vel_enu(2) = vel_enu[2]; + rx_vel_enu(0) = enuv[0]; + rx_vel_enu(1) = enuv[1]; + rx_vel_enu(2) = enuv[2]; this->set_rx_vel(rx_vel_enu); - double clock_drift_ppm = pvt_sol.dtr[5] / GPS_C_m_s * 1e6; + double clock_drift_ppm = pvt_sol.dtr[5] / GPS_C_M_S * 1e6; this->set_clock_drift_ppm(clock_drift_ppm); diff --git a/src/algorithms/libs/rtklib/rtklib_pntpos.cc b/src/algorithms/libs/rtklib/rtklib_pntpos.cc index 9f5de53bb..4a02e6df4 100644 --- a/src/algorithms/libs/rtklib/rtklib_pntpos.cc +++ b/src/algorithms/libs/rtklib/rtklib_pntpos.cc @@ -972,6 +972,7 @@ void estvel(const obsd_t *obs, int n, const double *rs, const double *dts, { sol->rr[i + 3] = x[i]; } + sol->dtr[5] = x[3]; break; } } From 2a57b6e8d5b12dc70aeef3bd310aa9624f8ac5f1 Mon Sep 17 00:00:00 2001 From: Cillian O'Driscoll Date: Tue, 5 Nov 2019 09:45:11 +0000 Subject: [PATCH 05/11] Added user_clk_drift_ppm to monitor_pvt --- docs/protobuf/monitor_pvt.proto | 2 ++ src/algorithms/PVT/libs/monitor_pvt.h | 5 +++++ src/algorithms/PVT/libs/rtklib_solver.cc | 2 ++ src/algorithms/PVT/libs/serdes_monitor_pvt.h | 2 ++ 4 files changed, 11 insertions(+) diff --git a/docs/protobuf/monitor_pvt.proto b/docs/protobuf/monitor_pvt.proto index 3a2de2397..d0ebc0673 100644 --- a/docs/protobuf/monitor_pvt.proto +++ b/docs/protobuf/monitor_pvt.proto @@ -38,4 +38,6 @@ double gdop = 25; // Geometric Dilution of Precision double pdop = 26; // Position (3D) Dilution of Precision double hdop = 27; // Horizontal Dilution of Precision double vdop = 28; // Vertical Dilution of Precision + +double user_clk_drift_ppm = 29; // User clock drift [ppm] } diff --git a/src/algorithms/PVT/libs/monitor_pvt.h b/src/algorithms/PVT/libs/monitor_pvt.h index 582877947..09b6b9370 100644 --- a/src/algorithms/PVT/libs/monitor_pvt.h +++ b/src/algorithms/PVT/libs/monitor_pvt.h @@ -89,6 +89,9 @@ public: double hdop; double vdop; + // User clock drift [ppm] + double user_clk_drift_ppm; + /*! * \brief This member function serializes and restores * Monitor_Pvt objects from a byte stream. @@ -134,6 +137,8 @@ public: ar& BOOST_SERIALIZATION_NVP(pdop); ar& BOOST_SERIALIZATION_NVP(hdop); ar& BOOST_SERIALIZATION_NVP(vdop); + + ar& BOOST_SERIALIZATION_NVP(user_clk_drift_ppm); } }; diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 8221d2e4b..518af6628 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -1082,6 +1082,8 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ double clock_drift_ppm = pvt_sol.dtr[5] / GPS_C_M_S * 1e6; this->set_clock_drift_ppm(clock_drift_ppm); + // User clock drift [ppm] + monitor_pvt.user_clk_drift_ppm = clock_drift_ppm; // ######## LOG FILE ######### if (d_flag_dump_enabled == true) diff --git a/src/algorithms/PVT/libs/serdes_monitor_pvt.h b/src/algorithms/PVT/libs/serdes_monitor_pvt.h index 07d643b9e..55b9689d4 100644 --- a/src/algorithms/PVT/libs/serdes_monitor_pvt.h +++ b/src/algorithms/PVT/libs/serdes_monitor_pvt.h @@ -116,6 +116,7 @@ public: monitor_.set_pdop(monitor->pdop); monitor_.set_hdop(monitor->hdop); monitor_.set_vdop(monitor->vdop); + monitor_.set_user_clk_drift_ppm(monitor->user_clk_drift_ppm); monitor_.SerializeToString(&data); return data; @@ -153,6 +154,7 @@ public: monitor.pdop = mon.pdop(); monitor.hdop = mon.hdop(); monitor.vdop = mon.vdop(); + monitor.user_clk_drift_ppm = mon.user_clk_drift_ppm(); return monitor; } From f3de26ceecfd6dbde52752eed102251e242d8c65 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 5 Nov 2019 12:42:56 +0100 Subject: [PATCH 06/11] Apply clang-tidy --- src/algorithms/PVT/libs/rtcm.cc | 34 ++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/algorithms/PVT/libs/rtcm.cc b/src/algorithms/PVT/libs/rtcm.cc index e5287c4ca..7e0576cbd 100644 --- a/src/algorithms/PVT/libs/rtcm.cc +++ b/src/algorithms/PVT/libs/rtcm.cc @@ -147,7 +147,7 @@ std::string Rtcm::add_CRC(const std::string& message_without_crc) const // 2) Computes CRC CRC_RTCM.process_bytes(bytes.data(), bytes.size()); - std::bitset<24> crc_frame = std::bitset<24>(CRC_RTCM.checksum()); + auto crc_frame = std::bitset<24>(CRC_RTCM.checksum()); // 3) Builds the complete message std::string complete_message = message_without_crc + crc_frame.to_string(); @@ -162,7 +162,7 @@ bool Rtcm::check_CRC(const std::string& message) const std::string message_bin = Rtcm::binary_data_to_bin(message); // Check CRC std::string crc = message_bin.substr(message_bin.length() - 24, 24); - std::bitset<24> read_crc = std::bitset<24>(crc); + auto read_crc = std::bitset<24>(crc); std::string msg_without_crc = message_bin.substr(0, message_bin.length() - 24); boost::dynamic_bitset frame_bits(msg_without_crc); @@ -171,7 +171,7 @@ bool Rtcm::check_CRC(const std::string& message) const std::reverse(bytes.begin(), bytes.end()); CRC_RTCM_CHECK.process_bytes(bytes.data(), bytes.size()); - std::bitset<24> computed_crc = std::bitset<24>(CRC_RTCM_CHECK.checksum()); + auto computed_crc = std::bitset<24>(CRC_RTCM_CHECK.checksum()); if (read_crc == computed_crc) { return true; @@ -414,7 +414,7 @@ std::string Rtcm::build_message(const std::string& data) const { uint32_t msg_length_bits = data.length(); uint32_t msg_length_bytes = std::ceil(static_cast(msg_length_bits) / 8.0); - std::bitset<10> message_length = std::bitset<10>(msg_length_bytes); + auto message_length = std::bitset<10>(msg_length_bytes); uint32_t zeros_to_fill = 8 * msg_length_bytes - msg_length_bits; std::string b(zeros_to_fill, '0'); std::string msg_content = data + b; @@ -691,7 +691,7 @@ std::bitset<101> Rtcm::get_MT1003_sat_content(const Gps_Ephemeris& ephL1, const Rtcm::set_DF011(gnss_synchroL1); Rtcm::set_DF012(gnss_synchroL1); Rtcm::set_DF013(ephL1, obs_time, gnss_synchroL1); - std::bitset<2> DF016_ = std::bitset<2>(0); // code indicator 0: C/A or L2C code 1: P(Y) code direct 2:P(Y) code cross-correlated 3: Correlated P/Y + auto DF016_ = std::bitset<2>(0); // code indicator 0: C/A or L2C code 1: P(Y) code direct 2:P(Y) code cross-correlated 3: Correlated P/Y Rtcm::set_DF017(gnss_synchroL1, gnss_synchroL2); Rtcm::set_DF018(gnss_synchroL1, gnss_synchroL2); Rtcm::set_DF019(ephL2, obs_time, gnss_synchroL2); @@ -802,7 +802,7 @@ std::bitset<125> Rtcm::get_MT1004_sat_content(const Gps_Ephemeris& ephL1, const Rtcm::set_DF013(ephL1, obs_time, gnss_synchroL1); Rtcm::set_DF014(gnss_synchroL1); Rtcm::set_DF015(gnss_synchroL1); - std::bitset<2> DF016_ = std::bitset<2>(0); // code indicator 0: C/A or L2C code 1: P(Y) code direct 2:P(Y) code cross-correlated 3: Correlated P/Y + auto DF016_ = std::bitset<2>(0); // code indicator 0: C/A or L2C code 1: P(Y) code direct 2:P(Y) code cross-correlated 3: Correlated P/Y Rtcm::set_DF017(gnss_synchroL1, gnss_synchroL2); Rtcm::set_DF018(gnss_synchroL1, gnss_synchroL2); Rtcm::set_DF019(ephL2, obs_time, gnss_synchroL2); @@ -1058,7 +1058,7 @@ std::string Rtcm::print_MT1006(uint32_t ref_id, double ecef_x, double ecef_y, do std::string Rtcm::print_MT1008(uint32_t ref_id, const std::string& antenna_descriptor, uint32_t antenna_setup_id, const std::string& antenna_serial_number) { uint32_t msg_number = 1008; - std::bitset<12> DF002_ = std::bitset<12>(msg_number); + auto DF002_ = std::bitset<12>(msg_number); Rtcm::set_DF003(ref_id); std::string ant_descriptor = antenna_descriptor; uint32_t len = ant_descriptor.length(); @@ -1072,7 +1072,7 @@ std::string Rtcm::print_MT1008(uint32_t ref_id, const std::string& antenna_descr std::string DF030_str_; for (char c : ant_descriptor) { - std::bitset<8> character = std::bitset<8>(c); + auto character = std::bitset<8>(c); DF030_str_ += character.to_string(); } @@ -1090,7 +1090,7 @@ std::string Rtcm::print_MT1008(uint32_t ref_id, const std::string& antenna_descr std::string DF033_str_; for (char c : ant_sn) { - std::bitset<8> character = std::bitset<8>(c); + auto character = std::bitset<8>(c); DF033_str_ += character.to_string(); } @@ -1375,7 +1375,7 @@ std::bitset<107> Rtcm::get_MT1011_sat_content(const Glonass_Gnav_Ephemeris& ephL Rtcm::set_DF041(gnss_synchroL1); Rtcm::set_DF042(gnss_synchroL1); Rtcm::set_DF043(ephL1, obs_time, gnss_synchroL1); - std::bitset<2> DF046_ = std::bitset<2>(0); // code indicator 0: C/A or L2C code 1: P(Y) code direct 2:P(Y) code cross-correlated 3: Correlated P/Y + auto DF046_ = std::bitset<2>(0); // code indicator 0: C/A or L2C code 1: P(Y) code direct 2:P(Y) code cross-correlated 3: Correlated P/Y Rtcm::set_DF047(gnss_synchroL1, gnss_synchroL2); Rtcm::set_DF048(gnss_synchroL1, gnss_synchroL2); Rtcm::set_DF049(ephL2, obs_time, gnss_synchroL2); @@ -1488,7 +1488,7 @@ std::bitset<130> Rtcm::get_MT1012_sat_content(const Glonass_Gnav_Ephemeris& ephL Rtcm::set_DF043(ephL1, obs_time, gnss_synchroL1); Rtcm::set_DF044(gnss_synchroL1); Rtcm::set_DF045(gnss_synchroL1); - std::bitset<2> DF046_ = std::bitset<2>(0); // code indicator 0: C/A or L2C code 1: P(Y) code direct 2:P(Y) code cross-correlated 3: Correlated P/Y + auto DF046_ = std::bitset<2>(0); // code indicator 0: C/A or L2C code 1: P(Y) code direct 2:P(Y) code cross-correlated 3: Correlated P/Y Rtcm::set_DF047(gnss_synchroL1, gnss_synchroL2); Rtcm::set_DF048(gnss_synchroL1, gnss_synchroL2); Rtcm::set_DF049(ephL2, obs_time, gnss_synchroL2); @@ -2039,12 +2039,12 @@ std::string Rtcm::print_MT1029(uint32_t ref_id, const Gps_Ephemeris& gps_eph, do first = false; } } - std::bitset<8> character = std::bitset<8>(c); + auto character = std::bitset<8>(c); text_binary += character.to_string(); } - std::bitset<7> DF138_ = std::bitset<7>(i); - std::bitset<8> DF139_ = std::bitset<8>(message.length()); + auto DF138_ = std::bitset<7>(i); + auto DF139_ = std::bitset<8>(message.length()); std::string data = DF002.to_string() + DF003.to_string() + @@ -2101,7 +2101,7 @@ std::string Rtcm::print_MT1045(const Galileo_Ephemeris& gal_eph) Rtcm::set_DF314(gal_eph); Rtcm::set_DF315(gal_eph); uint32_t seven_zero = 0; - std::bitset<7> DF001_ = std::bitset<7>(seven_zero); + auto DF001_ = std::bitset<7>(seven_zero); std::string data; data.clear(); @@ -2357,7 +2357,7 @@ std::string Rtcm::get_MSM_header(uint32_t msg_number, Rtcm::set_DF003(ref_id); Rtcm::set_DF393(more_messages); Rtcm::set_DF409(0); // Issue of Data Station. 0: not utilized - std::bitset<7> DF001_ = std::bitset<7>("0000000"); + auto DF001_ = std::bitset<7>("0000000"); Rtcm::set_DF411(clock_steering_indicator); Rtcm::set_DF412(external_clock_indicator); Rtcm::set_DF417(divergence_free); @@ -2956,7 +2956,7 @@ std::string Rtcm::get_MSM_5_content_sat_data(const std::map reserved = std::bitset<4>("0000"); + auto reserved = std::bitset<4>("0000"); first_data_type += DF397.to_string(); second_data_type += reserved.to_string(); third_data_type += DF398.to_string(); From 0e9fc67e0ebfa48e9db3ce93d9296796bba41619 Mon Sep 17 00:00:00 2001 From: Marc Majoral Date: Tue, 5 Nov 2019 13:05:01 +0100 Subject: [PATCH 07/11] Improved prn length estimation when performing extended correlation in the FPGA. --- .../gnuradio_blocks/dll_pll_veml_tracking_fpga.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc index c93ee9906..bb5596e55 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc @@ -1860,8 +1860,8 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un // this must be computed for the secondary prn code if (d_secondary) { - uint32_t first_prn_length = d_current_integration_length_samples - (d_fpga_integration_period - 1) * static_cast(std::floor(T_prn_samples)); - uint32_t next_prn_length = static_cast(std::floor(T_prn_samples)); + uint32_t next_prn_length = d_current_integration_length_samples/d_fpga_integration_period; + uint32_t first_prn_length = d_current_integration_length_samples - next_prn_length*(d_fpga_integration_period - 1); multicorrelator_fpga->update_prn_code_length(first_prn_length, next_prn_length); } @@ -1913,8 +1913,8 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un // this must be computed for the secondary prn code if (d_secondary) { - uint32_t first_prn_length = d_current_integration_length_samples - (d_fpga_integration_period - 1) * static_cast(std::floor(T_prn_samples)); - uint32_t next_prn_length = static_cast(std::floor(T_prn_samples)); + uint32_t next_prn_length = d_current_integration_length_samples/d_fpga_integration_period; + uint32_t first_prn_length = d_current_integration_length_samples - next_prn_length*(d_fpga_integration_period - 1); multicorrelator_fpga->update_prn_code_length(first_prn_length, next_prn_length); } From 85c4786528a6dfc1b0bb93ae3dd446f4341385e0 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 5 Nov 2019 14:43:41 +0100 Subject: [PATCH 08/11] Apply clang-format --- src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc | 2 +- src/algorithms/PVT/libs/pvt_solution.cc | 2 +- src/algorithms/PVT/libs/rtklib_solver.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index fa252b04f..cfcf7cc08 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -28,6 +28,7 @@ * ------------------------------------------------------------------------- */ +#include "rtklib_pvt_gs.h" #include "MATH_CONSTANTS.h" #include "beidou_dnav_almanac.h" #include "beidou_dnav_ephemeris.h" @@ -60,7 +61,6 @@ #include "pvt_conf.h" #include "rinex_printer.h" #include "rtcm_printer.h" -#include "rtklib_pvt_gs.h" #include "rtklib_solver.h" #include // for any_cast, any #include // for xml_iarchive diff --git a/src/algorithms/PVT/libs/pvt_solution.cc b/src/algorithms/PVT/libs/pvt_solution.cc index 5c5174328..8a8527845 100644 --- a/src/algorithms/PVT/libs/pvt_solution.cc +++ b/src/algorithms/PVT/libs/pvt_solution.cc @@ -29,9 +29,9 @@ * ------------------------------------------------------------------------- */ +#include "pvt_solution.h" #include "GPS_L1_CA.h" #include "geofunctions.h" -#include "pvt_solution.h" #include #include #include diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 518af6628..9381aa0bb 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -51,6 +51,7 @@ * * -----------------------------------------------------------------------*/ +#include "rtklib_solver.h" #include "Beidou_B1I.h" #include "Beidou_B3I.h" #include "Beidou_DNAV.h" @@ -60,7 +61,6 @@ #include "rtklib_conversions.h" #include "rtklib_rtkpos.h" #include "rtklib_solution.h" -#include "rtklib_solver.h" #include #include #include From bf0cba714cf7e8704517aa44b3e365915fc38dd4 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 5 Nov 2019 14:45:41 +0100 Subject: [PATCH 09/11] Apply clang-format --- .../gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.h | 2 +- .../tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.h index b01cd5586..c3391a1d8 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.h @@ -37,10 +37,10 @@ #ifndef GNSS_SDR_GLONASS_L2_CA_DLL_PLL_C_AID_TRACKING_CC_H_ #define GNSS_SDR_GLONASS_L2_CA_DLL_PLL_C_AID_TRACKING_CC_H_ +#include "cpu_multicorrelator.h" #include "gnss_synchro.h" #include "tracking_2nd_DLL_filter.h" #include "tracking_FLL_PLL_filter.h" -#include "cpu_multicorrelator.h" #include #include #include // for volk_gnsssdr::vector diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h index 0b8efb857..faa7c6a4f 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h @@ -49,9 +49,9 @@ #include "gnss_synchro.h" #include "tracking_2nd_DLL_filter.h" #include "tracking_2nd_PLL_filter.h" -#include // for volk_gnsssdr::vector #include #include +#include // for volk_gnsssdr::vector #include #include #include From 510a3a15ba07de77b3d8b95114ac21490a094b03 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 5 Nov 2019 14:47:27 +0100 Subject: [PATCH 10/11] Update BeiDou satellite names --- src/core/system_parameters/gnss_satellite.cc | 72 ++++++++++++-------- 1 file changed, 42 insertions(+), 30 deletions(-) diff --git a/src/core/system_parameters/gnss_satellite.cc b/src/core/system_parameters/gnss_satellite.cc index ec7e9fbd1..51ae72757 100644 --- a/src/core/system_parameters/gnss_satellite.cc +++ b/src/core/system_parameters/gnss_satellite.cc @@ -654,94 +654,106 @@ std::string Gnss_Satellite::what_block(const std::string& system_, uint32_t PRN_ switch (PRN_) { case 1: - block_ = std::string("Compass-G1"); // GEO 140.0°E; launched 2010/01/16 + block_ = std::string("BeiDou-2 GEO01"); // GEO 140.0°E; launched 2010/01/16 break; case 2: - block_ = std::string("Compass-G6"); // GEO 80°E; launched 2012/10/25 + block_ = std::string("BeiDou-2 GEO06"); // GEO 80°E; launched 2012/10/25 break; case 3: - block_ = std::string("Compass-G7"); // GEO 110.5°E; launched 2016/06/12 + block_ = std::string("BeiDou-2 GEO07"); // GEO 110.5°E; launched 2016/06/12 break; case 4: - block_ = std::string("Compass-G4"); // GEO 160.0°E; launched 2010/10/31 + block_ = std::string("BeiDou-2 GEO04"); // GEO 160.0°E; launched 2010/10/31 break; case 5: - block_ = std::string("Compass-G5"); // GEO 58.75°E; launched 2012/02/24 + block_ = std::string("BeiDou-2 GEO05"); // GEO 58.75°E; launched 2012/02/24 break; case 6: - block_ = std::string("Compass-IGS01"); // 55° inclination IGSO 118°E; launched 2010/07/31 + block_ = std::string("BeiDou-2 IGSO01"); // 55° inclination IGSO 118°E; launched 2010/07/31 break; case 7: - block_ = std::string("Compass-IGS02"); // 55° inclination IGSO 118°E; launched 2010/12/17 + block_ = std::string("BeiDou-2 IGSO02"); // 55° inclination IGSO 118°E; launched 2010/12/17 break; case 8: - block_ = std::string("Compass-IGS03"); // 55° inclination IGSO 118°E; launched 2011/04/09 + block_ = std::string("BeiDou-2 IGSO03"); // 55° inclination IGSO 118°E; launched 2011/04/09 break; case 9: - block_ = std::string("Compass-IGS04"); // 55° inclination IGSO 95°E; launched 2011/07/27 + block_ = std::string("BeiDou-2 IGSO04"); // 55° inclination IGSO 95°E; launched 2011/07/27 break; case 10: - block_ = std::string("Compass-IGS05"); // 55° inclination IGSO 118°E; launched 2011/12/01 + block_ = std::string("BeiDou-2 IGSO05"); // 55° inclination IGSO 118°E; launched 2011/12/01 break; case 11: - block_ = std::string("Compass-M3"); // Slot A07; launched 2012/04/29 + block_ = std::string("BeiDou-2 MEO03"); // Slot A07; launched 2012/04/29 break; case 12: - block_ = std::string("Compass-M4"); // Slot A08; launched 2012/04/29 + block_ = std::string("BeiDou-2 MEO04"); // Slot A08; launched 2012/04/29 + break; + case 13: + block_ = std::string("BeiDou-2 IGSO06"); // launched 2016/03/30 + break; + case 14: + block_ = std::string("BeiDou-2 MEO06"); // launched 2012/09/19 + break; + case 16: + block_ = std::string("BeiDou-2 IGSO07"); // launched 2018/07/10 break; case 19: - block_ = std::string("BEIDOU-3 M1"); // Slot B-7; launched 2017/11/05 + block_ = std::string("BeiDou-3 MEO01"); // Slot B-7; launched 2017/11/05 break; case 20: - block_ = std::string("BEIDOU-3 M2"); // Slot B-5; launched 2017/11/05 + block_ = std::string("BeiDou-3 MEO02"); // Slot B-5; launched 2017/11/05 break; case 21: - block_ = std::string("BEIDOU 3M5"); // Slot B-?; launched 2018/02/12 + block_ = std::string("BeiDou-3 MEO03"); // Slot B-?; launched 2018/02/12 break; case 22: - block_ = std::string("BEIDOU 3M6"); // Slot B-6; launched 2018/02/12 + block_ = std::string("BeiDou-3 MEO04"); // Slot B-6; launched 2018/02/12 break; case 23: - block_ = std::string("BEIDOU 3M9"); // Slot C-7; launched 2018/07/29 + block_ = std::string("BeiDou-3 MEO05"); // Slot C-7; launched 2018/07/29 break; case 24: - block_ = std::string("BEIDOU 3M10"); // Slot C-1; launched 2018/07/29 + block_ = std::string("BeiDou-3 MEO06"); // Slot C-1; launched 2018/07/29 break; case 25: - block_ = std::string("BEIDOU 3M12"); // Slot C-8; launched 2018/08/24 + block_ = std::string("BeiDou-3 MEO11"); // Slot C-8; launched 2018/08/24 break; case 26: - block_ = std::string("BEIDOU 3M11"); // Slot C-2; launched 2018/08/24 + block_ = std::string("BeiDou-3 MEO12"); // Slot C-2; launched 2018/08/24 break; case 27: - block_ = std::string("BEIDOU 3M3"); // Slot A-?; launched 2018/01/11 + block_ = std::string("BeiDou-3 3M3"); // Slot A-?; launched 2018/01/11 break; case 28: - block_ = std::string("BEIDOU 3M4"); // Slot A-?; launched 2018/01/11 + block_ = std::string("BeiDou-3 3M4"); // Slot A-?; launched 2018/01/11 break; case 29: - block_ = std::string("BEIDOU 3M7"); // Slot A-?; launched 2018/03/29 + block_ = std::string("BeiDou-3 3M7"); // Slot A-?; launched 2018/03/29 break; case 30: - block_ = std::string("BEIDOU 3M8"); // Slot A-?; launched 2018/03/29 + block_ = std::string("BeiDou-3 3M8"); // Slot A-?; launched 2018/03/29 break; case 32: - block_ = std::string("BEIDOU 3M13"); // Slot B-1?; launched 2018/09/19 + block_ = std::string("BeiDou-3 MEO13"); // Slot B-1?; launched 2018/09/19 break; case 33: - block_ = std::string("BEIDOU 3M14"); // Slot B-3; launched 2018/09/19 + block_ = std::string("BeiDou-3 MEO14"); // Slot B-3; launched 2018/09/19 break; case 34: - block_ = std::string("BEIDOU 3M15"); // Slot B-3; launched 2018/10/15 + block_ = std::string("BeiDou-3 MEO15"); // Slot B-3; launched 2018/10/15 break; case 35: - block_ = std::string("BEIDOU 3M16"); // Slot B-3; launched 2018/10/15 + block_ = std::string("BeiDou-3 MEO16"); // Slot B-3; launched 2018/10/15 break; case 36: - block_ = std::string("BEIDOU 3M17"); // Slot B-3; launched 2018/11/18 + block_ = std::string("BeiDou-3 MEO17"); // Slot B-3; launched 2018/11/18 break; case 37: - block_ = std::string("BEIDOU 3M18"); // Slot B-3; launched 2018/11/18 + block_ = std::string("BeiDou-3 MEO18"); // Slot B-3; launched 2018/11/18 + break; + case 38: + block_ = std::string("BeiDou-3 IGSO01"); // Slot B-3; launched 2019/04/20 break; default: block_ = std::string("Unknown(Simulated)"); From 39382d38e9fd9647065d0e01d3f66d5c11d2696c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 5 Nov 2019 16:07:24 +0100 Subject: [PATCH 11/11] Apply clang-format --- .../gnuradio_blocks/dll_pll_veml_tracking_fpga.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc index bb5596e55..df64357b1 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc @@ -1860,8 +1860,8 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un // this must be computed for the secondary prn code if (d_secondary) { - uint32_t next_prn_length = d_current_integration_length_samples/d_fpga_integration_period; - uint32_t first_prn_length = d_current_integration_length_samples - next_prn_length*(d_fpga_integration_period - 1); + uint32_t next_prn_length = d_current_integration_length_samples / d_fpga_integration_period; + uint32_t first_prn_length = d_current_integration_length_samples - next_prn_length * (d_fpga_integration_period - 1); multicorrelator_fpga->update_prn_code_length(first_prn_length, next_prn_length); } @@ -1913,8 +1913,8 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un // this must be computed for the secondary prn code if (d_secondary) { - uint32_t next_prn_length = d_current_integration_length_samples/d_fpga_integration_period; - uint32_t first_prn_length = d_current_integration_length_samples - next_prn_length*(d_fpga_integration_period - 1); + uint32_t next_prn_length = d_current_integration_length_samples / d_fpga_integration_period; + uint32_t first_prn_length = d_current_integration_length_samples - next_prn_length * (d_fpga_integration_period - 1); multicorrelator_fpga->update_prn_code_length(first_prn_length, next_prn_length); }