diff --git a/.clang-format b/.clang-format index 7ab3cb079..f13c68662 100644 --- a/.clang-format +++ b/.clang-format @@ -51,7 +51,7 @@ IncludeBlocks: Merge IncludeCategories: - Regex: '^.*.h"' Priority: 1 - - Regex: '^.*(boost|gflags|glog|gnsssdr|gpstk|gtest|gnuradio|pmt|uhd|volk)/' + - Regex: '^.*(boost|gflags|glog|gnsssdr|gnuradio|gpstk|gsl|gtest|pmt|uhd|volk)/' Priority: 2 - Regex: '^.*(armadillo|matio|pugixml)' Priority: 2 diff --git a/.clang-tidy b/.clang-tidy index 3515d6a2a..4e0602b32 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -8,10 +8,14 @@ Checks: '-*, cert-err60-cpp, cert-flp30-c, clang-analyzer-cplusplus*, + cppcoreguidelines-pro-type-cstyle-cast, cppcoreguidelines-pro-type-static-cast-downcast, cppcoreguidelines-slicing, + cppcoreguidelines-special-member-functions, google-build-namespaces, google-runtime-int, + hicpp-exception-baseclass, + hicpp-explicit-conversions, misc-misplaced-const, misc-new-delete-overloads, misc-non-copyable-objects, @@ -24,14 +28,22 @@ Checks: '-*, modernize-raw-string-literal, modernize-use-auto, modernize-use-bool-literals, + modernize-use-emplace, modernize-use-equals-default, modernize-use-equals-delete, modernize-use-noexcept, modernize-use-nullptr, performance-faster-string-find, + performance-for-range-copy, + performance-implicit-conversion-in-loop, performance-inefficient-algorithm, + performance-inefficient-string-concatenation, + performance-inefficient-vector-operation, performance-move-const-arg, + performance-move-constructor-init, + performance-noexcept-move-constructor, performance-type-promotion-in-math-fn, + performance-unnecessary-copy-initialization, performance-unnecessary-value-param, readability-container-size-empty, readability-identifier-naming, diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index d20cac4c6..45705ab57 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -95,6 +95,12 @@ target_include_directories(pvt_libs target_compile_definitions(pvt_libs PRIVATE -DGNSS_SDR_VERSION="${VERSION}") +if(CMAKE_BUILD_TYPE MATCHES Rel) + target_compile_definitions(pvt_libs + PUBLIC -DARMA_NO_BOUND_CHECKING=1 + ) +endif() + if(Boost_VERSION_STRING VERSION_GREATER 1.65.99) target_compile_definitions(pvt_libs PUBLIC diff --git a/src/algorithms/PVT/libs/pvt_solution.h b/src/algorithms/PVT/libs/pvt_solution.h index 06efc77be..292e531ff 100644 --- a/src/algorithms/PVT/libs/pvt_solution.h +++ b/src/algorithms/PVT/libs/pvt_solution.h @@ -32,6 +32,9 @@ #ifndef GNSS_SDR_PVT_SOLUTION_H_ #define GNSS_SDR_PVT_SOLUTION_H_ +#if ARMA_NO_BOUND_CHECKING +#define ARMA_NO_DEBUG 1 +#endif #include #include diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc index 00353490a..22dedce6e 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc @@ -41,8 +41,8 @@ #include "gps_sdr_signal_processing.h" #include #include -#include #include +#include GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt index 39caeb02c..ccea93400 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt @@ -69,12 +69,13 @@ endif() target_link_libraries(acquisition_gr_blocks PUBLIC algorithms_libs + acquisition_libs + channel_libs + core_system_parameters + Armadillo::armadillo Gnuradio::runtime Gnuradio::fft Volk::volk - channel_libs - acquisition_libs - core_system_parameters PRIVATE Gflags::gflags Glog::glog @@ -90,6 +91,12 @@ target_include_directories(acquisition_gr_blocks ${CMAKE_SOURCE_DIR}/src/core/receiver ) +if(CMAKE_BUILD_TYPE MATCHES Rel) + target_compile_definitions(acquisition_gr_blocks + PUBLIC -DARMA_NO_BOUND_CHECKING=1 + ) +endif() + if(OPENCL_FOUND) target_link_libraries(acquisition_gr_blocks PUBLIC OpenCL::OpenCL) target_include_directories(acquisition_gr_blocks diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h index bd3b6302b..b026dae6f 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h @@ -52,6 +52,10 @@ #ifndef GNSS_SDR_PCPS_ACQUISITION_H_ #define GNSS_SDR_PCPS_ACQUISITION_H_ +#if ARMA_NO_BOUND_CHECKING +#define ARMA_NO_DEBUG 1 +#endif + #include "acq_conf.h" #include "channel_fsm.h" #include @@ -61,6 +65,7 @@ #include // for gr_complex #include // for scoped_lock #include // for gr_vector_const_void_star +#include // for Guidelines Support Library #include // for lv_16sc_t #include #include @@ -68,12 +73,6 @@ #include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif class Gnss_Synchro; class pcps_acquisition; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h index 3556eba10..2c79f1527 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h @@ -49,6 +49,10 @@ #ifndef GNSS_SDR_PCPS_ACQUISITION_FINE_DOPPLER_CC_H_ #define GNSS_SDR_PCPS_ACQUISITION_FINE_DOPPLER_CC_H_ +#if ARMA_NO_BOUND_CHECKING +#define ARMA_NO_DEBUG 1 +#endif + #include "acq_conf.h" #include "channel_fsm.h" #include "gnss_synchro.h" diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index 4978a3d78..d8fac7598 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -92,23 +92,11 @@ else() target_link_libraries(algorithms_libs PRIVATE Boost::filesystem Boost::system) endif() -include(CheckCXXSourceCompiles) -check_cxx_source_compiles(" - #include - int main() - { std::span sv; }" - has_span +target_include_directories(algorithms_libs + PUBLIC + ${CMAKE_SOURCE_DIR}/src/algorithms/libs/gsl/include ) -if(${has_span}) - target_compile_definitions(algorithms_libs PUBLIC -DHAS_SPAN=1) -else() - target_include_directories(algorithms_libs - PUBLIC - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/gsl/include - ) -endif() - target_link_libraries(algorithms_libs PUBLIC Armadillo::armadillo @@ -130,6 +118,12 @@ if(OPENCL_FOUND) ) endif() +if(CMAKE_BUILD_TYPE MATCHES Rel) + target_compile_definitions(algorithms_libs + PUBLIC -DARMA_NO_BOUND_CHECKING=1 + ) +endif() + target_include_directories(algorithms_libs PUBLIC ${CMAKE_SOURCE_DIR}/src/core/interfaces diff --git a/src/algorithms/libs/beidou_b1i_signal_processing.h b/src/algorithms/libs/beidou_b1i_signal_processing.h index 367a6d7b1..c86907e06 100644 --- a/src/algorithms/libs/beidou_b1i_signal_processing.h +++ b/src/algorithms/libs/beidou_b1i_signal_processing.h @@ -33,17 +33,10 @@ #ifndef GNSS_SDR_BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_ #define GNSS_SDR_BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - - //! Generates int32_t GPS L1 C/A code for the desired SV ID and code shift void beidou_b1i_code_gen_int(gsl::span _dest, int32_t _prn, uint32_t _chip_shift); diff --git a/src/algorithms/libs/beidou_b3i_signal_processing.h b/src/algorithms/libs/beidou_b3i_signal_processing.h index dc91c30c9..0698550e9 100644 --- a/src/algorithms/libs/beidou_b3i_signal_processing.h +++ b/src/algorithms/libs/beidou_b3i_signal_processing.h @@ -33,16 +33,10 @@ #ifndef GNSS_SDR_BEIDOU_B3I_SIGNAL_PROCESSING_H_ #define GNSS_SDR_BEIDOU_B3I_SIGNAL_PROCESSING_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - //! Generates int BeiDou B3I code for the desired SV ID and code shift void beidou_b3i_code_gen_int(gsl::span _dest, int32_t _prn, uint32_t _chip_shift); diff --git a/src/algorithms/libs/galileo_e1_signal_processing.h b/src/algorithms/libs/galileo_e1_signal_processing.h index be7f5f4b9..08c4db3c8 100644 --- a/src/algorithms/libs/galileo_e1_signal_processing.h +++ b/src/algorithms/libs/galileo_e1_signal_processing.h @@ -32,15 +32,10 @@ #ifndef GNSS_SDR_GALILEO_E1_SIGNAL_PROCESSING_H_ #define GNSS_SDR_GALILEO_E1_SIGNAL_PROCESSING_H_ +#include #include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif /*! diff --git a/src/algorithms/libs/galileo_e5_signal_processing.h b/src/algorithms/libs/galileo_e5_signal_processing.h index f04e95ab5..d3e8b617f 100644 --- a/src/algorithms/libs/galileo_e5_signal_processing.h +++ b/src/algorithms/libs/galileo_e5_signal_processing.h @@ -34,16 +34,10 @@ #ifndef GNSS_SDR_GALILEO_E5_SIGNAL_PROCESSING_H_ #define GNSS_SDR_GALILEO_E5_SIGNAL_PROCESSING_H_ +#include #include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - /*! * \brief Generates Galileo E5a code at 1 sample/chip diff --git a/src/algorithms/libs/geofunctions.h b/src/algorithms/libs/geofunctions.h index ca0797e73..9aaf68387 100644 --- a/src/algorithms/libs/geofunctions.h +++ b/src/algorithms/libs/geofunctions.h @@ -32,6 +32,10 @@ #ifndef GNSS_SDR_GEOFUNCTIONS_H #define GNSS_SDR_GEOFUNCTIONS_H +#if ARMA_NO_BOUND_CHECKING +#define ARMA_NO_DEBUG 1 +#endif + #include arma::mat Skew_symmetric(const arma::vec &a); //!< Calculates skew-symmetric matrix diff --git a/src/algorithms/libs/glonass_l1_signal_processing.h b/src/algorithms/libs/glonass_l1_signal_processing.h index f239823e6..e7c641b2d 100644 --- a/src/algorithms/libs/glonass_l1_signal_processing.h +++ b/src/algorithms/libs/glonass_l1_signal_processing.h @@ -33,16 +33,10 @@ #ifndef GNSS_SDR_GLONASS_SDR_SIGNAL_PROCESSING_H_ #define GNSS_SDR_GLONASS_SDR_SIGNAL_PROCESSING_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#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, uint32_t _chip_shift); diff --git a/src/algorithms/libs/glonass_l2_signal_processing.h b/src/algorithms/libs/glonass_l2_signal_processing.h index aae68cb1c..fe79c4ed5 100644 --- a/src/algorithms/libs/glonass_l2_signal_processing.h +++ b/src/algorithms/libs/glonass_l2_signal_processing.h @@ -33,16 +33,10 @@ #ifndef GNSS_SDR_GLONASS_L2_SIGNAL_PROCESSING_H_ #define GNSS_SDR_GLONASS_L2_SIGNAL_PROCESSING_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#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, uint32_t _chip_shift); diff --git a/src/algorithms/libs/gnss_signal_processing.h b/src/algorithms/libs/gnss_signal_processing.h index cb08cf24f..d2c68b3eb 100644 --- a/src/algorithms/libs/gnss_signal_processing.h +++ b/src/algorithms/libs/gnss_signal_processing.h @@ -35,17 +35,10 @@ #ifndef GNSS_SDR_GNSS_SIGNAL_PROCESSING_H_ #define GNSS_SDR_GNSS_SIGNAL_PROCESSING_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - - /*! * \brief This function generates a complex exponential in _dest. * diff --git a/src/algorithms/libs/gps_l2c_signal.h b/src/algorithms/libs/gps_l2c_signal.h index 3ec6a4c4e..099aa4ca2 100644 --- a/src/algorithms/libs/gps_l2c_signal.h +++ b/src/algorithms/libs/gps_l2c_signal.h @@ -33,17 +33,10 @@ #ifndef GNSS_SDR_GPS_L2C_SIGNAL_H_ #define GNSS_SDR_GPS_L2C_SIGNAL_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - - //! Generates complex GPS L2C M code for the desired SV ID void gps_l2c_m_code_gen_complex(gsl::span> _dest, uint32_t _prn); void gps_l2c_m_code_gen_float(gsl::span _dest, uint32_t _prn); diff --git a/src/algorithms/libs/gps_l5_signal.h b/src/algorithms/libs/gps_l5_signal.h index d6e60bf4d..057d0f02a 100644 --- a/src/algorithms/libs/gps_l5_signal.h +++ b/src/algorithms/libs/gps_l5_signal.h @@ -33,16 +33,10 @@ #ifndef GNSS_SDR_GPS_L5_SIGNAL_H_ #define GNSS_SDR_GPS_L5_SIGNAL_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - //! Generates complex GPS L5I code for the desired SV ID void gps_l5i_code_gen_complex(gsl::span> _dest, uint32_t _prn); diff --git a/src/algorithms/libs/gps_sdr_signal_processing.h b/src/algorithms/libs/gps_sdr_signal_processing.h index 66db15886..13cacfabc 100644 --- a/src/algorithms/libs/gps_sdr_signal_processing.h +++ b/src/algorithms/libs/gps_sdr_signal_processing.h @@ -33,16 +33,10 @@ #ifndef GNSS_SDR_GPS_SDR_SIGNAL_PROCESSING_H_ #define GNSS_SDR_GPS_SDR_SIGNAL_PROCESSING_H_ +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif - //! Generates int GPS L1 C/A code for the desired SV ID and code shift void gps_l1_ca_code_gen_int(gsl::span _dest, int32_t _prn, uint32_t _chip_shift); diff --git a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc index 6aa7462e5..d34b8e499 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc +++ b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc @@ -251,7 +251,7 @@ void signal_generator_c::generate_codes() std::array signal_1C = {{'1', 'C', '\0'}}; - galileo_e1_code_gen_complex_sampled(gsl::span(sampled_code_pilot_[sat].data(), vector_length_), signal_1C, cboc, PRN_[sat], fs_in_, + galileo_e1_code_gen_complex_sampled(sampled_code_pilot_[sat], signal_1C, cboc, PRN_[sat], fs_in_, static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS) - delay_chips_[sat], true); // Obtain the desired CN0 assuming that Pn = 1. diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc index 8ec99b2c5..4ba01fc22 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc @@ -550,7 +550,7 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_ flag_SOW_set = true; d_nav.flag_new_SOW_available = false; - if (last_d_TOW_at_current_symbol_ms != 0 and abs(static_cast(d_TOW_at_current_symbol_ms) - int64_t(last_d_TOW_at_current_symbol_ms)) > d_symbol_duration_ms) + if (last_d_TOW_at_current_symbol_ms != 0 and abs(static_cast(d_TOW_at_current_symbol_ms) - int64_t(last_d_TOW_at_current_symbol_ms)) > static_cast(d_symbol_duration_ms)) { LOG(INFO) << "Warning: BEIDOU B1I TOW update in ch " << d_channel << " does not match the TLM TOW counter " << static_cast(d_TOW_at_current_symbol_ms) - int64_t(last_d_TOW_at_current_symbol_ms) << " ms \n"; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc index ff04bdf59..e82779644 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc @@ -581,7 +581,7 @@ int beidou_b3i_telemetry_decoder_gs::general_work( flag_SOW_set = true; d_nav.flag_new_SOW_available = false; - if (last_d_TOW_at_current_symbol_ms != 0 and abs(static_cast(d_TOW_at_current_symbol_ms) - int64_t(last_d_TOW_at_current_symbol_ms)) > d_symbol_duration_ms) + if (last_d_TOW_at_current_symbol_ms != 0 and abs(static_cast(d_TOW_at_current_symbol_ms) - int64_t(last_d_TOW_at_current_symbol_ms)) > static_cast(d_symbol_duration_ms)) { LOG(INFO) << "Warning: BEIDOU B3I TOW update in ch " << d_channel << " does not match the TLM TOW counter " << static_cast(d_TOW_at_current_symbol_ms) - int64_t(last_d_TOW_at_current_symbol_ms) << " ms \n"; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_gs.cc index 50abe691e..b1be0dd90 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_gs.cc @@ -193,7 +193,7 @@ sbas_l1_telemetry_decoder_gs::Symbol_Aligner_And_Decoder::Symbol_Aligner_And_Dec std::array g_encoder{121, 91}; d_vd1 = std::make_shared(g_encoder.data(), d_KK, nn); - d_vd1 = std::make_shared(g_encoder.data(), d_KK, nn); + d_vd2 = std::make_shared(g_encoder.data(), d_KK, nn); d_past_symbol = 0; } diff --git a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt index 77c9a01f5..01d9e5378 100644 --- a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt @@ -89,6 +89,7 @@ endif() target_link_libraries(tracking_gr_blocks PUBLIC Boost::boost + Armadillo::armadillo Gnuradio::blocks Matio::matio Volkgnsssdr::volkgnsssdr @@ -108,6 +109,12 @@ if(ENABLE_CUDA AND NOT CMAKE_VERSION VERSION_GREATER 3.11) ) endif() +if(CMAKE_BUILD_TYPE MATCHES Rel) + target_compile_definitions(tracking_gr_blocks + PUBLIC -DARMA_NO_BOUND_CHECKING=1 + ) +endif() + if(ENABLE_CLANG_TIDY) if(CLANG_TIDY_EXE) set_target_properties(tracking_gr_blocks diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 9fb0c408f..dbd6eaba8 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -57,15 +57,15 @@ #include #include // for io_signature #include // for scoped_lock -#include // for Mat_VarCreate -#include // for mp +#include +#include // for Mat_VarCreate +#include // for mp #include #include // for fill_n #include #include // for fmod, round, floor #include // for exception -#include -#include // for cout, cerr +#include // for cout, cerr #include #include 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 028e8fbde..5ca096839 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 @@ -49,14 +49,14 @@ #include #include // for io_signature #include // for scoped_lock -#include // for Mat_VarCreate -#include // for mp +#include +#include // for Mat_VarCreate +#include // for mp #include #include // for fill_n #include // for fmod, round, floor #include // for exception -#include -#include // for cout, cerr +#include // for cout, cerr #include #include #include @@ -1680,9 +1680,6 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un d_current_fpga_integration_period = d_fpga_integration_period; d_current_extended_correlation_in_fpga = true; - d_P_accu_old.real(d_P_accu_old.real() * d_fpga_integration_period); - d_P_accu_old.imag(d_P_accu_old.imag() * d_fpga_integration_period); - if (d_sc_demodulate_enabled) { multicorrelator_fpga->enable_secondary_codes(); diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc index 9853e6753..a111a44ea 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc @@ -45,12 +45,12 @@ #include "tracking_discriminators.h" #include #include +#include #include #include #include #include #include -#include #include #include #include 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 7aa6c57cc..674ac4ae9 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 @@ -40,6 +40,10 @@ #ifndef GNSS_SDR_GPS_L1_CA_KF_TRACKING_CC_H #define GNSS_SDR_GPS_L1_CA_KF_TRACKING_CC_H +#if ARMA_NO_BOUND_CHECKING +#define ARMA_NO_DEBUG 1 +#endif + #include "bayesian_estimation.h" #include "cpu_multicorrelator_real_codes.h" #include "gnss_synchro.h" diff --git a/src/algorithms/tracking/libs/CMakeLists.txt b/src/algorithms/tracking/libs/CMakeLists.txt index 09cc778a7..c22fd8618 100644 --- a/src/algorithms/tracking/libs/CMakeLists.txt +++ b/src/algorithms/tracking/libs/CMakeLists.txt @@ -134,6 +134,12 @@ if(OS_IS_MACOSX) endif() endif() +if(CMAKE_BUILD_TYPE MATCHES Rel) + target_compile_definitions(tracking_libs + PUBLIC -DARMA_NO_BOUND_CHECKING=1 + ) +endif() + if(ENABLE_CLANG_TIDY) if(CLANG_TIDY_EXE) set_target_properties(tracking_libs diff --git a/src/algorithms/tracking/libs/bayesian_estimation.h b/src/algorithms/tracking/libs/bayesian_estimation.h index 7867afe77..77d449b11 100644 --- a/src/algorithms/tracking/libs/bayesian_estimation.h +++ b/src/algorithms/tracking/libs/bayesian_estimation.h @@ -45,6 +45,10 @@ #ifndef GNSS_SDR_BAYESIAN_ESTIMATION_H_ #define GNSS_SDR_BAYESIAN_ESTIMATION_H_ +#if ARMA_NO_BOUND_CHECKING +#define ARMA_NO_DEBUG 1 +#endif + #include #include diff --git a/src/algorithms/tracking/libs/nonlinear_tracking.h b/src/algorithms/tracking/libs/nonlinear_tracking.h index a8c853bcf..ba8f511aa 100644 --- a/src/algorithms/tracking/libs/nonlinear_tracking.h +++ b/src/algorithms/tracking/libs/nonlinear_tracking.h @@ -43,6 +43,10 @@ #ifndef GNSS_SDR_NONLINEAR_TRACKING_H_ #define GNSS_SDR_NONLINEAR_TRACKING_H_ +#if ARMA_NO_BOUND_CHECKING +#define ARMA_NO_DEBUG 1 +#endif + #include #include diff --git a/src/algorithms/tracking/libs/tcp_communication.cc b/src/algorithms/tracking/libs/tcp_communication.cc index 30809ecc6..f0b191c3e 100644 --- a/src/algorithms/tracking/libs/tcp_communication.cc +++ b/src/algorithms/tracking/libs/tcp_communication.cc @@ -32,6 +32,7 @@ #include "tcp_communication.h" #include "tcp_packet_data.h" #include +#include #include @@ -87,7 +88,7 @@ void Tcp_Communication::send_receive_tcp_packet_galileo_e1(boost::array channel_ptr; + + for (uint32_t i = 0; i < channels_count_; i++) + { + channel_ptr = std::dynamic_pointer_cast(channels_.at(i)); + channel_ptr->tracking()->stop_tracking(); + } + + std::this_thread::sleep_for(std::chrono::milliseconds(500)); + channel_ptr = std::dynamic_pointer_cast(channels_.at(0)); channel_ptr->acquisition()->stop_acquisition(); } diff --git a/src/core/system_parameters/GPS_L1_CA.h b/src/core/system_parameters/GPS_L1_CA.h index 420a49d01..fb0321b0f 100644 --- a/src/core/system_parameters/GPS_L1_CA.h +++ b/src/core/system_parameters/GPS_L1_CA.h @@ -71,9 +71,7 @@ const uint32_t GPS_L1_CA_OPT_ACQ_FS_HZ = 2000000; //!< Sampling frequency that */ const double MAX_TOA_DELAY_MS = 20; -//#define NAVIGATION_SOLUTION_RATE_MS 1000 // this cannot go here -//const double GPS_STARTOFFSET_ms = 68.802; //[ms] Initial sign. travel time (this cannot go here) -const double GPS_STARTOFFSET_MS = 60.0; +const double GPS_STARTOFFSET_MS = 68.802; // [ms] Initial signal travel time (only for old ls_pvt implementation) // OBSERVABLE HISTORY DEEP FOR INTERPOLATION const int32_t GPS_L1_CA_HISTORY_DEEP = 100; diff --git a/src/tests/unit-tests/arithmetic/code_generation_test.cc b/src/tests/unit-tests/arithmetic/code_generation_test.cc index 376d5c1f3..da8d04449 100644 --- a/src/tests/unit-tests/arithmetic/code_generation_test.cc +++ b/src/tests/unit-tests/arithmetic/code_generation_test.cc @@ -31,14 +31,9 @@ #include "gnss_signal_processing.h" #include "gps_sdr_signal_processing.h" +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif TEST(CodeGenerationTest, CodeGenGPSL1Test) diff --git a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc index 9a5f825e3..ec8e9b68a 100644 --- a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc +++ b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc @@ -32,14 +32,9 @@ #include "GPS_L1_CA.h" #include "gnss_signal_processing.h" #include +#include #include #include -#if HAS_SPAN -#include -namespace gsl = std; -#else -#include -#endif DEFINE_int32(size_carrier_test, 100000, "Size of the arrays used for complex carrier testing"); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc index c05fa53b1..4640cb73d 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc @@ -139,7 +139,7 @@ TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime) //create the concurrent correlator threads for (int current_thread = 0; current_thread < current_max_threads; current_thread++) { - thread_pool.push_back(std::thread(run_correlator_cpu_real_codes, + thread_pool.emplace_back(std::thread(run_correlator_cpu_real_codes, correlator_pool[current_thread], d_rem_carrier_phase_rad, d_carrier_phase_step_rad, diff --git a/src/utils/front-end-cal/front_end_cal.cc b/src/utils/front-end-cal/front_end_cal.cc index 2607c4efa..017325c4a 100644 --- a/src/utils/front-end-cal/front_end_cal.cc +++ b/src/utils/front-end-cal/front_end_cal.cc @@ -45,6 +45,7 @@ #include #include // for operator<< #include +#include #include extern Concurrent_Map global_gps_ephemeris_map; @@ -303,7 +304,7 @@ arma::vec FrontEndCal::geodetic2ecef(double phi, double lambda, double h, const } -double FrontEndCal::estimate_doppler_from_eph(unsigned int PRN, double TOW, double lat, double lon, double height) +double FrontEndCal::estimate_doppler_from_eph(unsigned int PRN, double TOW, double lat, double lon, double height) noexcept(false) { int num_secs = 10; double step_secs = 0.5; @@ -359,7 +360,7 @@ double FrontEndCal::estimate_doppler_from_eph(unsigned int PRN, double TOW, doub mean_Doppler_Hz = arma::mean(Doppler_Hz); return mean_Doppler_Hz; } - throw(1); + throw std::runtime_error("1"); } diff --git a/src/utils/front-end-cal/front_end_cal.h b/src/utils/front-end-cal/front_end_cal.h index 07022e505..5f23311b9 100644 --- a/src/utils/front-end-cal/front_end_cal.h +++ b/src/utils/front-end-cal/front_end_cal.h @@ -65,7 +65,7 @@ public: * 3- Approximate receiver Latitude and Longitude (WGS-84) * */ - double estimate_doppler_from_eph(unsigned int PRN, double TOW, double lat, double lon, double height); + double estimate_doppler_from_eph(unsigned int PRN, double TOW, double lat, double lon, double height) noexcept(false); /*! * \brief This function models the Elonics E4000 + RTL2832 front-end diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index efd752206..51eace09d 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -121,7 +121,6 @@ private: public: int rx_message; - ~FrontEndCal_msg_rx() override; //!< Default destructor }; @@ -155,9 +154,6 @@ FrontEndCal_msg_rx::FrontEndCal_msg_rx() : gr::block("FrontEndCal_msg_rx", gr::i } -FrontEndCal_msg_rx::~FrontEndCal_msg_rx() = default; - - void wait_message() { while (!stop) @@ -574,7 +570,7 @@ int main(int argc, char** argv) { std::cout << "Exception caught while reading ephemeris" << std::endl; } - catch (int ex) + catch (const std::exception& ex) { std::cout << " " << it.first << " " << it.second << " (Eph not found)" << std::endl; } @@ -623,7 +619,7 @@ int main(int argc, char** argv) { std::cout << "Exception caught while reading ephemeris" << std::endl; } - catch (int ex) + catch (const std::exception& ex) { std::cout << " " << it.first << " " << it.second - mean_f_if_Hz << " (Eph not found)" << std::endl; }