diff --git a/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h b/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h index dc55528cc..19682d328 100644 --- a/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h +++ b/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h @@ -53,7 +53,6 @@ private: boost::asio::ip::udp::socket socket; boost::system::error_code error; std::vector endpoints; - Monitor_Pvt monitor_pvt{}; Serdes_Monitor_Pvt serdes; bool use_protobuf; }; diff --git a/src/algorithms/libs/beidou_b3i_signal_processing.cc b/src/algorithms/libs/beidou_b3i_signal_processing.cc index a08cdd7b4..ef031e945 100644 --- a/src/algorithms/libs/beidou_b3i_signal_processing.cc +++ b/src/algorithms/libs/beidou_b3i_signal_processing.cc @@ -35,11 +35,11 @@ #include #include -auto auxCeil = [](float x) { return static_cast(static_cast((x) + 1)); }; +auto auxCeil = [](float x) { return static_cast(static_cast((x) + 1)); }; -void beidou_b3i_code_gen_int(gsl::span _dest, signed int _prn, unsigned int _chip_shift) +void beidou_b3i_code_gen_int(gsl::span _dest, int32_t _prn, uint32_t _chip_shift) { - const unsigned int _code_length = 10230; + const uint32_t _code_length = 10230; std::bitset<_code_length> G1{}; std::bitset<_code_length> G2{}; auto G1_register = std::bitset<13>{}.set(); // All true @@ -175,54 +175,54 @@ void beidou_b3i_code_gen_int(gsl::span _dest, signed int _prn, unsigned int } -void beidou_b3i_code_gen_float(gsl::span _dest, signed int _prn, unsigned int _chip_shift) +void beidou_b3i_code_gen_float(gsl::span _dest, int32_t _prn, uint32_t _chip_shift) { - const unsigned int _code_length = 10230; + const uint32_t _code_length = 10230; std::array b3i_code_int{}; beidou_b3i_code_gen_int(b3i_code_int, _prn, _chip_shift); - for (unsigned int ii = 0; ii < _code_length; ++ii) + for (uint32_t ii = 0; ii < _code_length; ++ii) { _dest[ii] = static_cast(b3i_code_int[ii]); } } -void beidou_b3i_code_gen_complex(gsl::span> _dest, signed int _prn, unsigned int _chip_shift) +void beidou_b3i_code_gen_complex(gsl::span> _dest, int32_t _prn, uint32_t _chip_shift) { - const unsigned int _code_length = 10230; + const uint32_t _code_length = 10230; std::array b3i_code_int{}; beidou_b3i_code_gen_int(b3i_code_int, _prn, _chip_shift); - for (unsigned int ii = 0; ii < _code_length; ++ii) + for (uint32_t ii = 0; ii < _code_length; ++ii) { _dest[ii] = std::complex(static_cast(b3i_code_int[ii]), 0.0F); } } -void beidou_b3i_code_gen_complex_sampled(gsl::span> _dest, unsigned int _prn, int _fs, unsigned int _chip_shift) +void beidou_b3i_code_gen_complex_sampled(gsl::span> _dest, uint32_t _prn, int _fs, uint32_t _chip_shift) { // This function is based on the GNU software GPS for MATLAB in the Kay Borre book std::array, 10230> _code{}; - signed int _samplesPerCode, _codeValueIndex; + int32_t _samplesPerCode, _codeValueIndex; float _ts; float _tc; float aux; - const signed int _codeFreqBasis = 10230000; // Hz - const signed int _codeLength = 10230; + const int32_t _codeFreqBasis = 10230000; // Hz + const int32_t _codeLength = 10230; //--- Find number of samples per spreading code ---------------------------- - _samplesPerCode = static_cast(static_cast(_fs) / static_cast(_codeFreqBasis / _codeLength)); + _samplesPerCode = static_cast(static_cast(_fs) / static_cast(_codeFreqBasis / _codeLength)); //--- Find time constants -------------------------------------------------- _ts = 1.0 / static_cast(_fs); // Sampling period in sec _tc = 1.0 / static_cast(_codeFreqBasis); // C/A chip period in sec beidou_b3i_code_gen_complex(_code, _prn, _chip_shift); // generate C/A code 1 sample per chip - for (signed int i = 0; i < _samplesPerCode; i++) + for (int32_t i = 0; i < _samplesPerCode; i++) { //=== Digitizing ======================================================= @@ -231,7 +231,6 @@ void beidou_b3i_code_gen_complex_sampled(gsl::span> _dest, u // number of samples per millisecond (because one C/A code period is one // millisecond). - // _codeValueIndex = ceil((_ts * ((float)i + 1)) / _tc) - 1; aux = (_ts * (i + 1)) / _tc; _codeValueIndex = auxCeil(aux) - 1; @@ -245,7 +244,7 @@ void beidou_b3i_code_gen_complex_sampled(gsl::span> _dest, u } else { - _dest[i] = _code[_codeValueIndex]; //repeat the chip -> upsample + _dest[i] = _code[_codeValueIndex]; // repeat the chip -> upsample } } } diff --git a/src/algorithms/libs/beidou_b3i_signal_processing.h b/src/algorithms/libs/beidou_b3i_signal_processing.h index 7093407ce..dc91c30c9 100644 --- a/src/algorithms/libs/beidou_b3i_signal_processing.h +++ b/src/algorithms/libs/beidou_b3i_signal_processing.h @@ -34,10 +34,7 @@ #define GNSS_SDR_BEIDOU_B3I_SIGNAL_PROCESSING_H_ #include -#include #include -#include -#include #if HAS_SPAN #include @@ -47,18 +44,18 @@ namespace gsl = std; #endif //! Generates int BeiDou B3I code for the desired SV ID and code shift -void beidou_b3i_code_gen_int(gsl::span _dest, signed int _prn, unsigned int _chip_shift); +void beidou_b3i_code_gen_int(gsl::span _dest, int32_t _prn, uint32_t _chip_shift); //! Generates float BeiDou B3I code for the desired SV ID and code shift -void beidou_b3i_code_gen_float(gsl::span _dest, signed int _prn, unsigned int _chip_shift); +void beidou_b3i_code_gen_float(gsl::span _dest, int32_t _prn, uint32_t _chip_shift); //! Generates complex BeiDou B3I code for the desired SV ID and code shift, and sampled to specific sampling frequency -void beidou_b3i_code_gen_complex(gsl::span> _dest, signed int _prn, unsigned int _chip_shift); +void beidou_b3i_code_gen_complex(gsl::span> _dest, int32_t _prn, uint32_t _chip_shift); //! Generates N complex BeiDou B3I codes for the desired SV ID and code shift -void beidou_b3i_code_gen_complex_sampled(gsl::span> _dest, unsigned int _prn, int _fs, unsigned int _chip_shift, unsigned int _ncodes); +void beidou_b3i_code_gen_complex_sampled(gsl::span> _dest, uint32_t _prn, int _fs, uint32_t _chip_shift, uint32_t _ncodes); //! Generates complex BeiDou B3I code for the desired SV ID and code shift -void beidou_b3i_code_gen_complex_sampled(gsl::span> _dest, unsigned int _prn, int _fs, unsigned int _chip_shift); +void beidou_b3i_code_gen_complex_sampled(gsl::span> _dest, uint32_t _prn, int _fs, uint32_t _chip_shift); #endif /* GNSS_SDR_BEIDOU_B3I_SIGNAL_PROCESSING_H_ */ diff --git a/src/algorithms/libs/galileo_e1_signal_processing.cc b/src/algorithms/libs/galileo_e1_signal_processing.cc index 59f0cfb1c..57576b2a8 100644 --- a/src/algorithms/libs/galileo_e1_signal_processing.cc +++ b/src/algorithms/libs/galileo_e1_signal_processing.cc @@ -33,7 +33,6 @@ #include "galileo_e1_signal_processing.h" #include "Galileo_E1.h" #include "gnss_signal_processing.h" -#include #include #include #include diff --git a/src/algorithms/libs/galileo_e5_signal_processing.cc b/src/algorithms/libs/galileo_e5_signal_processing.cc index dced04321..fe765b030 100644 --- a/src/algorithms/libs/galileo_e5_signal_processing.cc +++ b/src/algorithms/libs/galileo_e5_signal_processing.cc @@ -35,7 +35,6 @@ #include "Galileo_E5a.h" #include "gnss_signal_processing.h" #include -#include #include diff --git a/src/algorithms/libs/galileo_e5_signal_processing.h b/src/algorithms/libs/galileo_e5_signal_processing.h index 90d6abc5e..7806b2916 100644 --- a/src/algorithms/libs/galileo_e5_signal_processing.h +++ b/src/algorithms/libs/galileo_e5_signal_processing.h @@ -34,6 +34,7 @@ #ifndef GNSS_SDR_GALILEO_E5_SIGNAL_PROCESSING_H_ #define GNSS_SDR_GALILEO_E5_SIGNAL_PROCESSING_H_ +#include #include #include #if HAS_SPAN diff --git a/src/algorithms/libs/geofunctions.cc b/src/algorithms/libs/geofunctions.cc index ec55a9e3c..0cb0ef271 100644 --- a/src/algorithms/libs/geofunctions.cc +++ b/src/algorithms/libs/geofunctions.cc @@ -232,7 +232,7 @@ int togeod(double *dphi, double *dlambda, double *h, double a, double finv, doub } -arma::mat Gravity_ECEF(const arma::vec &r_eb_e) +arma::vec Gravity_ECEF(const arma::vec &r_eb_e) { // Parameters const double R_0 = 6378137.0; // WGS84 Equatorial radius in meters diff --git a/src/algorithms/libs/geofunctions.h b/src/algorithms/libs/geofunctions.h index 6ab773504..9fb6b6f67 100644 --- a/src/algorithms/libs/geofunctions.h +++ b/src/algorithms/libs/geofunctions.h @@ -79,7 +79,7 @@ int topocent(double *Az, double *El, double *D, const arma::vec &x, const arma:: */ int togeod(double *dphi, double *dlambda, double *h, double a, double finv, double X, double Y, double Z); -arma::mat Gravity_ECEF(const arma::vec &r_eb_e); //!< Calculates acceleration due to gravity resolved about ECEF-frame +arma::vec Gravity_ECEF(const arma::vec &r_eb_e); //!< Calculates acceleration due to gravity resolved about ECEF-frame /*! * \brief Conversion of Cartesian coordinates (X,Y,Z) to geographical diff --git a/src/algorithms/libs/glonass_l1_signal_processing.cc b/src/algorithms/libs/glonass_l1_signal_processing.cc index ee07164bf..a6f48494b 100644 --- a/src/algorithms/libs/glonass_l1_signal_processing.cc +++ b/src/algorithms/libs/glonass_l1_signal_processing.cc @@ -36,7 +36,7 @@ auto auxCeil = [](float x) { return static_cast(static_cast((x) + 1)); }; -void glonass_l1_ca_code_gen_complex(gsl::span> _dest, /* int32_t _prn,*/ uint32_t _chip_shift) +void glonass_l1_ca_code_gen_complex(gsl::span> _dest, uint32_t _chip_shift) { const uint32_t _code_length = 511; std::bitset<_code_length> G1{}; @@ -101,7 +101,7 @@ void glonass_l1_ca_code_gen_complex(gsl::span> _dest, /* int /* * Generates complex GLONASS L1 C/A code for the desired SV ID and sampled to specific sampling frequency */ -void glonass_l1_ca_code_gen_complex_sampled(gsl::span> _dest, /* uint32_t _prn,*/ int32_t _fs, uint32_t _chip_shift) +void glonass_l1_ca_code_gen_complex_sampled(gsl::span> _dest, int32_t _fs, uint32_t _chip_shift) { // This function is based on the GNU software GPS for MATLAB in the Kay Borre book std::array, 511> _code{}; diff --git a/src/algorithms/libs/glonass_l1_signal_processing.h b/src/algorithms/libs/glonass_l1_signal_processing.h index 854befe82..6cc9f5033 100644 --- a/src/algorithms/libs/glonass_l1_signal_processing.h +++ b/src/algorithms/libs/glonass_l1_signal_processing.h @@ -43,13 +43,13 @@ namespace gsl = std; #include #endif -//!Generates complex GLONASS L1 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency -void glonass_l1_ca_code_gen_complex(gsl::span> _dest, /*int32_t _prn,*/ uint32_t _chip_shift); +//! Generates complex GLONASS L1 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency +void glonass_l1_ca_code_gen_complex(gsl::span> _dest, uint32_t _chip_shift); //! Generates N complex GLONASS L1 C/A codes for the desired SV ID and code shift -void glonass_l1_ca_code_gen_complex_sampled(gsl::span> _dest, /* uint32_t _prn,*/ int32_t _fs, uint32_t _chip_shift, uint32_t _ncodes); +void glonass_l1_ca_code_gen_complex_sampled(gsl::span> _dest, int32_t _fs, uint32_t _chip_shift, uint32_t _ncodes); //! Generates complex GLONASS L1 C/A code for the desired SV ID and code shift -void glonass_l1_ca_code_gen_complex_sampled(gsl::span> _dest, /* uint32_t _prn,*/ int32_t _fs, uint32_t _chip_shift); +void glonass_l1_ca_code_gen_complex_sampled(gsl::span> _dest, int32_t _fs, uint32_t _chip_shift); #endif /* GNSS_SDR_GLONASS_SDR_SIGNAL_PROCESSING_H_ */ diff --git a/src/algorithms/libs/glonass_l2_signal_processing.cc b/src/algorithms/libs/glonass_l2_signal_processing.cc index f2223fa94..1e0c197f7 100644 --- a/src/algorithms/libs/glonass_l2_signal_processing.cc +++ b/src/algorithms/libs/glonass_l2_signal_processing.cc @@ -36,7 +36,7 @@ auto auxCeil = [](float x) { return static_cast(static_cast((x) + 1)); }; -void glonass_l2_ca_code_gen_complex(gsl::span> _dest, /* int32_t _prn,*/ uint32_t _chip_shift) +void glonass_l2_ca_code_gen_complex(gsl::span> _dest, uint32_t _chip_shift) { const uint32_t _code_length = 511; std::bitset<_code_length> G1{}; @@ -101,7 +101,7 @@ void glonass_l2_ca_code_gen_complex(gsl::span> _dest, /* int /* * Generates complex GLONASS L2 C/A code for the desired SV ID and sampled to specific sampling frequency */ -void glonass_l2_ca_code_gen_complex_sampled(gsl::span> _dest, /* uint32_t _prn,*/ int32_t _fs, uint32_t _chip_shift) +void glonass_l2_ca_code_gen_complex_sampled(gsl::span> _dest, int32_t _fs, uint32_t _chip_shift) { // This function is based on the GNU software GPS for MATLAB in the Kay Borre book std::array, 511> _code{}; diff --git a/src/algorithms/libs/glonass_l2_signal_processing.h b/src/algorithms/libs/glonass_l2_signal_processing.h index 0f46d3e9d..6bbffefff 100644 --- a/src/algorithms/libs/glonass_l2_signal_processing.h +++ b/src/algorithms/libs/glonass_l2_signal_processing.h @@ -43,13 +43,13 @@ namespace gsl = std; #include #endif -//!Generates complex GLONASS L2 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency -void glonass_l2_ca_code_gen_complex(gsl::span> _dest, /*int32_t _prn,*/ uint32_t _chip_shift); +//! Generates complex GLONASS L2 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency +void glonass_l2_ca_code_gen_complex(gsl::span> _dest, uint32_t _chip_shift); //! Generates N complex GLONASS L2 C/A codes for the desired SV ID and code shift -void glonass_l2_ca_code_gen_complex_sampled(gsl::span> _dest, /* uint32_t _prn,*/ int32_t _fs, uint32_t _chip_shift, uint32_t _ncodes); +void glonass_l2_ca_code_gen_complex_sampled(gsl::span> _dest, int32_t _fs, uint32_t _chip_shift, uint32_t _ncodes); //! Generates complex GLONASS L2 C/A code for the desired SV ID and code shift -void glonass_l2_ca_code_gen_complex_sampled(gsl::span> _dest, /* uint32_t _prn,*/ int32_t _fs, uint32_t _chip_shift); +void glonass_l2_ca_code_gen_complex_sampled(gsl::span> _dest, int32_t _fs, uint32_t _chip_shift); #endif /* GNSS_SDR_GLONASS_L2_SIGNAL_PROCESSING_H_ */ diff --git a/src/algorithms/libs/gps_l2c_signal.cc b/src/algorithms/libs/gps_l2c_signal.cc index 73d9e5b7a..422d965b2 100644 --- a/src/algorithms/libs/gps_l2c_signal.cc +++ b/src/algorithms/libs/gps_l2c_signal.cc @@ -106,7 +106,7 @@ void gps_l2c_m_code_gen_complex_sampled(gsl::span> _dest, ui //--- Find time constants -------------------------------------------------- _ts = 1.0 / static_cast(_fs); // Sampling period in sec - _tc = 1.0 / static_cast(GPS_L2_M_CODE_RATE_HZ); // C/A chip period in sec + _tc = 1.0 / static_cast(GPS_L2_M_CODE_RATE_HZ); // L2C chip period in sec for (int32_t i = 0; i < _samplesPerCode; i++) { @@ -123,7 +123,7 @@ void gps_l2c_m_code_gen_complex_sampled(gsl::span> _dest, ui } else { - _dest[i] = std::complex(1.0 - 2.0 * _code[_codeValueIndex], 0); //repeat the chip -> upsample + _dest[i] = std::complex(1.0 - 2.0 * _code[_codeValueIndex], 0); // repeat the chip -> upsample } } } diff --git a/src/algorithms/libs/gps_l5_signal.cc b/src/algorithms/libs/gps_l5_signal.cc index 8c301ee6e..231afc490 100644 --- a/src/algorithms/libs/gps_l5_signal.cc +++ b/src/algorithms/libs/gps_l5_signal.cc @@ -33,6 +33,7 @@ #include "gps_l5_signal.h" #include "GPS_L5.h" #include +#include #include std::deque l5i_xa_shift(std::deque xa) // GPS-IS-705E Figure 3-4 pp. 15 @@ -298,7 +299,6 @@ void gps_l5q_code_gen_complex_sampled(gsl::span> _dest, uint _ts = 1.0 / static_cast(_fs); // Sampling period in sec _tc = 1.0 / static_cast(GPS_L5Q_CODE_RATE_HZ); // L5Q chip period in sec - //float aux; for (int32_t i = 0; i < _samplesPerCode; i++) { //=== Digitizing ======================================================= diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc index 48a1564e6..ed4e2f07d 100644 --- a/src/algorithms/libs/rtklib/rtklib_stream.cc +++ b/src/algorithms/libs/rtklib/rtklib_stream.cc @@ -975,9 +975,8 @@ void discontcp(tcp_t *tcp, int tcon) /* open tcp server -----------------------------------------------------------*/ tcpsvr_t *opentcpsvr(const char *path, char *msg) { - tcpsvr_t *tcpsvr, tcpsvr0; // = {{0}}; + tcpsvr_t *tcpsvr, tcpsvr0{}; char port[256] = ""; - tcpsvr0 = {{0, {0}, 0, {0, 0, 0, {0}}, 0, 0, 0, 0}, {{0, {0}, 0, {0, 0, 0, {0}}, 0, 0, 0, 0}}}; tracet(3, "opentcpsvr: path=%s\n", path); if (!(tcpsvr = static_cast(malloc(sizeof(tcpsvr_t))))) @@ -1265,9 +1264,8 @@ int consock(tcpcli_t *tcpcli, char *msg) /* open tcp client -----------------------------------------------------------*/ tcpcli_t *opentcpcli(const char *path, char *msg) { - tcpcli_t *tcpcli, tcpcli0; // = {{0}}; + tcpcli_t *tcpcli, tcpcli0{}; char port[256] = ""; - tcpcli0 = {{0, {0}, 0, {0, 0, 0, {0}}, 0, 0, 0, 0}, 0, 0}; tracet(3, "opentcpcli: path=%s\n", path); diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.h index 5035c6217..8c5c2f108 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.h @@ -92,7 +92,6 @@ private: // Preamble decoding const std::array d_preambles_bits{GLONASS_GNAV_PREAMBLE}; std::array d_preambles_symbols{}; - uint32_t d_samples_per_symbol = (GLONASS_L1_CA_CODE_RATE_HZ / GLONASS_L1_CA_CODE_LENGTH_CHIPS) / GLONASS_L1_CA_SYMBOL_RATE_BPS; const int32_t d_symbols_per_preamble = GLONASS_GNAV_PREAMBLE_LENGTH_SYMBOLS; // Storage for incoming data diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.h index 04c24d0be..2ce35c95a 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.h @@ -90,7 +90,6 @@ private: // Preamble decoding const std::array d_preambles_bits{GLONASS_GNAV_PREAMBLE}; std::array d_preambles_symbols{}; - uint32_t d_samples_per_symbol = (GLONASS_L2_CA_CODE_RATE_HZ / GLONASS_L2_CA_CODE_LENGTH_CHIPS) / GLONASS_L2_CA_SYMBOL_RATE_BPS; const int32_t d_symbols_per_preamble = GLONASS_GNAV_PREAMBLE_LENGTH_SYMBOLS; // Storage for incoming data diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc index 754b3ec3a..2c435b66b 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc @@ -194,6 +194,7 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking( void GalileoE1DllPllVemlTracking::stop_tracking() { + tracking_->stop_tracking(); } diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc index e3b3a3bb6..db4c429c5 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc @@ -300,6 +300,7 @@ GalileoE1DllPllVemlTrackingFpga::~GalileoE1DllPllVemlTrackingFpga() void GalileoE1DllPllVemlTrackingFpga::stop_tracking() { + tracking_fpga_sc->stop_tracking(); } diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc index 201597bbf..97181abfb 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc @@ -190,6 +190,7 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( void GalileoE5aDllPllTracking::stop_tracking() { + tracking_->stop_tracking(); } diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc index 2c2fe882d..3a4a91176 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc @@ -290,6 +290,7 @@ void GalileoE5aDllPllTrackingFpga::start_tracking() void GalileoE5aDllPllTrackingFpga::stop_tracking() { + tracking_fpga_sc->stop_tracking(); } diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc index bbd2b1014..46219425f 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.cc @@ -252,6 +252,7 @@ void GpsL1CaDllPllTrackingFpga::start_tracking() void GpsL1CaDllPllTrackingFpga::stop_tracking() { + tracking_fpga_sc->stop_tracking(); } diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc index 5d6587d78..954524a9c 100644 --- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc @@ -172,6 +172,7 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking( void GpsL2MDllPllTracking::stop_tracking() { + tracking_->stop_tracking(); } diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc index 177a9dc13..387da089b 100644 --- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.cc @@ -163,6 +163,7 @@ void GpsL2MDllPllTrackingFpga::start_tracking() void GpsL2MDllPllTrackingFpga::stop_tracking() { + tracking_fpga_sc->stop_tracking(); } diff --git a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc index d7c4d0454..9eba7c538 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc @@ -192,6 +192,7 @@ GpsL5DllPllTracking::GpsL5DllPllTracking( void GpsL5DllPllTracking::stop_tracking() { + tracking_->stop_tracking(); } diff --git a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc index 587cc940b..9baf9e8f1 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc @@ -311,6 +311,7 @@ void GpsL5DllPllTrackingFpga::start_tracking() void GpsL5DllPllTrackingFpga::stop_tracking() { + tracking_fpga_sc->stop_tracking(); } diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc index 38c6e5300..d72d7144f 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -676,7 +676,6 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at d_rem_carrier_phase_rad = fmod(d_rem_carrier_phase_rad + d_carrier_phase_step_rad * static_cast(d_correlation_length_samples), GLONASS_TWO_PI); // UPDATE ACCUMULATED CARRIER PHASE - CORRECTED_INTEGRATION_TIME_S = (static_cast(d_correlation_length_samples) / static_cast(d_fs_in)); d_acc_carrier_phase_cycles -= d_carrier_phase_step_rad * d_correlation_length_samples / GLONASS_TWO_PI; // disable tracking loop and inform telemetry decoder diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc index 185665d12..6859321e5 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -667,7 +667,6 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at d_rem_carrier_phase_rad = fmod(d_rem_carrier_phase_rad + d_carrier_phase_step_rad * static_cast(d_correlation_length_samples), GLONASS_TWO_PI); // UPDATE ACCUMULATED CARRIER PHASE - CORRECTED_INTEGRATION_TIME_S = (static_cast(d_correlation_length_samples) / static_cast(d_fs_in)); d_acc_carrier_phase_cycles -= d_carrier_phase_step_rad * d_correlation_length_samples / GLONASS_TWO_PI; // disable tracking loop and inform telemetry decoder diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc index d49b5b13f..aaa051b17 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc @@ -674,7 +674,6 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at d_rem_carrier_phase_rad = fmod(d_rem_carrier_phase_rad + d_carrier_phase_step_rad * static_cast(d_correlation_length_samples), GLONASS_TWO_PI); // UPDATE ACCUMULATED CARRIER PHASE - CORRECTED_INTEGRATION_TIME_S = (static_cast(d_correlation_length_samples) / static_cast(d_fs_in)); d_acc_carrier_phase_cycles -= d_carrier_phase_step_rad * d_correlation_length_samples / GLONASS_TWO_PI; // disable tracking loop and inform telemetry decoder diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc index 9845d2547..b4cae0c16 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc @@ -666,7 +666,6 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at d_rem_carrier_phase_rad = fmod(d_rem_carrier_phase_rad + d_carrier_phase_step_rad * static_cast(d_correlation_length_samples), GLONASS_TWO_PI); // UPDATE ACCUMULATED CARRIER PHASE - CORRECTED_INTEGRATION_TIME_S = (static_cast(d_correlation_length_samples) / static_cast(d_fs_in)); d_acc_carrier_phase_cycles -= d_carrier_phase_step_rad * d_correlation_length_samples / GLONASS_TWO_PI; // disable tracking loop and inform telemetry decoder diff --git a/src/algorithms/tracking/libs/exponential_smoother.cc b/src/algorithms/tracking/libs/exponential_smoother.cc index aa83a494e..9bc32347c 100644 --- a/src/algorithms/tracking/libs/exponential_smoother.cc +++ b/src/algorithms/tracking/libs/exponential_smoother.cc @@ -76,7 +76,7 @@ void Exponential_Smoother::set_samples_for_initialization(int num_samples) { ns = 1; } - samples_for_initialization_ = num_samples; + samples_for_initialization_ = ns; init_buffer_.reserve(samples_for_initialization_); } diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 629957959..ba72efb94 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -194,6 +194,8 @@ void ControlThread::init() agnss_ref_time_.valid = false; } } + + receiver_on_standby_ = false; } @@ -234,11 +236,14 @@ void ControlThread::event_dispatcher(bool &valid_event, pmt::pmt_t &msg) processed_control_messages_++; if (pmt::any_ref(msg).type() == typeid(channel_event_sptr)) { - channel_event_sptr new_event; - new_event = boost::any_cast(pmt::any_ref(msg)); - DLOG(INFO) << "New channel event rx from ch id: " << new_event->channel_id - << " what: " << new_event->event_type; - flowgraph_->apply_action(new_event->channel_id, new_event->event_type); + if (receiver_on_standby_ == false) + { + channel_event_sptr new_event; + new_event = boost::any_cast(pmt::any_ref(msg)); + DLOG(INFO) << "New channel event rx from ch id: " << new_event->channel_id + << " what: " << new_event->event_type; + flowgraph_->apply_action(new_event->channel_id, new_event->event_type); + } } else if (pmt::any_ref(msg).type() == typeid(command_event_sptr)) { @@ -267,8 +272,11 @@ void ControlThread::event_dispatcher(bool &valid_event, pmt::pmt_t &msg) } else { - //perform non-priority tasks - flowgraph_->acquisition_manager(0); //start acquisition of untracked satellites + if (receiver_on_standby_ == false) + { + //perform non-priority tasks + flowgraph_->acquisition_manager(0); //start acquisition of untracked satellites + } } } @@ -852,6 +860,10 @@ void ControlThread::apply_action(unsigned int what) stop_ = true; restart_ = true; break; + case 10: // request standby mode + LOG(INFO) << "TC request standby mode"; + receiver_on_standby_ = true; + break; case 11: LOG(INFO) << "Receiver action COLDSTART"; // delete all ephemeris and almanac information from maps (also the PVT map queue) @@ -859,13 +871,16 @@ void ControlThread::apply_action(unsigned int what) pvt_ptr->clear_ephemeris(); // todo: reorder the satellite queues to the receiver default startup order. // This is required to allow repeatability. Otherwise the satellite search order will depend on the last tracked satellites + // start again the satellite acquisitions + receiver_on_standby_ = false; break; case 12: LOG(INFO) << "Receiver action HOTSTART"; visible_satellites = get_visible_sats(cmd_interface_.get_utc_time(), cmd_interface_.get_LLH()); // reorder the satellite queue to acquire first those visible satellites flowgraph_->priorize_satellites(visible_satellites); - // start again the satellite acquisitions (done in chained apply_action to flowgraph) + // start again the satellite acquisitions + receiver_on_standby_ = false; break; case 13: LOG(INFO) << "Receiver action WARMSTART"; @@ -879,7 +894,8 @@ void ControlThread::apply_action(unsigned int what) get_visible_sats(cmd_interface_.get_utc_time(), cmd_interface_.get_LLH()); // reorder the satellite queue to acquire first those visible satellites flowgraph_->priorize_satellites(visible_satellites); - // start again the satellite acquisitions (done in chained apply_action to flowgraph) + // start again the satellite acquisitions + receiver_on_standby_ = false; break; default: LOG(INFO) << "Unrecognized action."; diff --git a/src/core/receiver/control_thread.h b/src/core/receiver/control_thread.h index 0459acd50..dae3c3022 100644 --- a/src/core/receiver/control_thread.h +++ b/src/core/receiver/control_thread.h @@ -129,6 +129,7 @@ private: /* * New receiver event dispatcher */ + bool receiver_on_standby_; void event_dispatcher(bool &valid_event, pmt::pmt_t &msg); std::thread cmd_interface_thread_; diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 2562e094b..0c0171e18 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -1288,8 +1288,8 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) std::lock_guard lock(signal_list_mutex); DLOG(INFO) << "Received " << what << " from " << who; - Gnss_Signal gs = channels_[who]->get_signal(); unsigned int sat = 0; + Gnss_Signal gs; if (who < 200) { try @@ -1304,6 +1304,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) switch (what) { case 0: + gs = channels_[who]->get_signal(); DLOG(INFO) << "Channel " << who << " ACQ FAILED satellite " << gs.get_satellite() << ", Signal " << gs.get_signal_str(); channels_state_[who] = 0; if (acq_channels_count_ > 0) @@ -1319,6 +1320,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) } break; case 1: + gs = channels_[who]->get_signal(); DLOG(INFO) << "Channel " << who << " ACQ SUCCESS satellite " << gs.get_satellite(); // If the satellite is in the list of available ones, remove it. remove_signal(gs); @@ -1333,6 +1335,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) break; case 2: + gs = channels_[who]->get_signal(); DLOG(INFO) << "Channel " << who << " TRK FAILED satellite " << gs.get_satellite(); if (acq_channels_count_ < max_acq_channels_) { @@ -1359,7 +1362,6 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) } break; case 10: // request standby mode - LOG(INFO) << "TC request standby mode"; for (size_t n = 0; n < channels_.size(); n++) { if (channels_state_[n] == 1 or channels_state_[n] == 2) // channel in acquisition or in tracking @@ -1372,22 +1374,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) channels_state_[n] = 0; } } - acq_channels_count_ = 0; // all channels are in standby now - break; - case 11: // request coldstart mode - LOG(INFO) << "TC request flowgraph coldstart"; - // call the acquisition manager to assign new satellite and start next acquisition (if required) - acquisition_manager(who); - break; - case 12: // request hotstart mode - LOG(INFO) << "TC request flowgraph hotstart"; - // call the acquisition manager to assign new satellite and start next acquisition (if required) - acquisition_manager(who); - break; - case 13: // request warmstart mode - LOG(INFO) << "TC request flowgraph warmstart"; - // call the acquisition manager to assign new satellite and start next acquisition (if required) - acquisition_manager(who); + acq_channels_count_ = 0; // all channels are in standby now and no new acquisition should be started break; default: break; diff --git a/src/core/system_parameters/gnss_satellite.cc b/src/core/system_parameters/gnss_satellite.cc index 9255ce210..29a78d6b5 100644 --- a/src/core/system_parameters/gnss_satellite.cc +++ b/src/core/system_parameters/gnss_satellite.cc @@ -124,9 +124,9 @@ Gnss_Satellite& Gnss_Satellite::operator=(Gnss_Satellite&& other) noexcept { if (this != &other) { - this->system = std::move(other.get_system()); + this->system = other.get_system(); this->PRN = other.get_PRN(); - this->block = std::move(other.get_block()); + this->block = other.get_block(); this->rf_link = other.get_rf_link(); } return *this;