From 605128e5e0594856283736b7f516f95ad2e364ba Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Mon, 29 Jul 2019 15:57:18 +0200 Subject: [PATCH 01/16] Improving HW reset for FPGA-accelerated receiver --- src/core/receiver/gnss_flowgraph.cc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 0c0171e18..e73c812b3 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -1466,10 +1466,19 @@ void GNSSFlowgraph::start_acquisition_helper() void GNSSFlowgraph::perform_hw_reset() { - // a stop acquisition command causes the SW to reset the HW - std::shared_ptr channel_ptr; - channel_ptr = std::dynamic_pointer_cast(channels_.at(0)); - channel_ptr->acquisition()->stop_acquisition(); + // a stop acquisition command causes the SW to reset the HW + std::shared_ptr 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(); } #endif From 4933ae3e0d7169a2fb6439f317ad7de3288b0d10 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 29 Jul 2019 21:22:44 +0200 Subject: [PATCH 02/16] No Armadillo bound checking if compiled in Release mode --- src/algorithms/PVT/libs/CMakeLists.txt | 6 ++++++ src/algorithms/PVT/libs/pvt_solution.h | 3 +++ .../acquisition/gnuradio_blocks/CMakeLists.txt | 13 ++++++++++--- .../acquisition/gnuradio_blocks/pcps_acquisition.h | 4 ++++ .../pcps_acquisition_fine_doppler_cc.h | 4 ++++ src/algorithms/libs/CMakeLists.txt | 6 ++++++ src/algorithms/libs/geofunctions.h | 4 ++++ .../gnuradio_blocks/signal_generator_c.cc | 2 +- .../tracking/gnuradio_blocks/CMakeLists.txt | 7 +++++++ .../gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h | 4 ++++ src/algorithms/tracking/libs/CMakeLists.txt | 6 ++++++ src/algorithms/tracking/libs/bayesian_estimation.h | 4 ++++ src/algorithms/tracking/libs/nonlinear_tracking.h | 4 ++++ src/core/receiver/CMakeLists.txt | 6 ++++++ src/core/receiver/control_thread.cc | 4 ++++ 15 files changed, 73 insertions(+), 4 deletions(-) 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/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..341166f64 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 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..6e45480bc 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -130,6 +130,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/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/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/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/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/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index 95435e407..ee83488d8 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -156,6 +156,12 @@ target_link_libraries(core_receiver Armadillo::armadillo ) +if(CMAKE_BUILD_TYPE MATCHES Rel) + target_compile_definitions(core_receiver + PRIVATE -DARMA_NO_BOUND_CHECKING=1 + ) +endif() + # Fix for Boost Asio < 1.70 if(OS_IS_MACOSX) if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (Boost_VERSION_STRING VERSION_LESS 1.70.0)) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 3f8107fc1..244aa4309 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -32,6 +32,10 @@ * ------------------------------------------------------------------------- */ +#if ARMA_NO_BOUND_CHECKING +#define ARMA_NO_DEBUG 1 +#endif + #include "control_thread.h" #include "channel_event.h" #include "command_event.h" From 2ec6ed6ec6d1b92300900ed6fcd0f2bd9c51aecd Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 29 Jul 2019 21:47:46 +0200 Subject: [PATCH 03/16] Clean usage of Guidelines Support Library --- .clang-format | 2 +- .../adapters/gps_l1_ca_pcps_acquisition.cc | 2 +- .../gnuradio_blocks/pcps_acquisition.h | 7 +------ src/algorithms/libs/CMakeLists.txt | 18 +++--------------- .../libs/beidou_b1i_signal_processing.h | 9 +-------- .../libs/beidou_b3i_signal_processing.h | 8 +------- .../libs/galileo_e1_signal_processing.h | 7 +------ .../libs/galileo_e5_signal_processing.h | 8 +------- .../libs/glonass_l1_signal_processing.h | 8 +------- .../libs/glonass_l2_signal_processing.h | 8 +------- src/algorithms/libs/gnss_signal_processing.h | 9 +-------- src/algorithms/libs/gps_l2c_signal.h | 9 +-------- src/algorithms/libs/gps_l5_signal.h | 8 +------- .../libs/gps_sdr_signal_processing.h | 8 +------- .../gnuradio_blocks/dll_pll_veml_tracking.cc | 8 ++++---- .../dll_pll_veml_tracking_fpga.cc | 8 ++++---- .../gps_l1_ca_kf_tracking_cc.cc | 2 +- .../arithmetic/code_generation_test.cc | 7 +------ .../arithmetic/complex_carrier_test.cc | 9 ++------- 19 files changed, 28 insertions(+), 117 deletions(-) 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/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/pcps_acquisition.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h index 341166f64..b026dae6f 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h @@ -65,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 @@ -72,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/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index 6e45480bc..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 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/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/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..b6040f1d9 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 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/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..643d2e3b9 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 -#if HAS_SPAN -#include -namespace gsl = std; -#else #include -#endif +#include +#include e DEFINE_int32(size_carrier_test, 100000, "Size of the arrays used for complex carrier testing"); From 89632374a007f7c1aa9db417807657a62c649921 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 29 Jul 2019 21:51:47 +0200 Subject: [PATCH 04/16] Fix runtime error in ARM architectures --- src/algorithms/PVT/libs/rtklib_solver.cc | 7 ++++--- src/algorithms/PVT/libs/rtklib_solver.h | 5 ++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 2bdbf95ba..45de55b96 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -94,6 +94,7 @@ Rtklib_Solver::Rtklib_Solver(int nchannels, std::string dump_filename, bool flag d_dump_filename = std::move(dump_filename); d_flag_dump_enabled = flag_dump_to_file; d_flag_dump_mat_enabled = flag_dump_to_mat; + count_valid_position = 0; this->set_averaging_flag(false); rtk_ = rtk; @@ -442,9 +443,9 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ int valid_obs = 0; // valid observations counter int glo_valid_obs = 0; // GLONASS L1/L2 valid observations counter - obs_data.fill({}); - eph_data.fill({}); - geph_data.fill({}); + std::array obs_data{}; + std::vector eph_data(MAXOBS); + std::vector geph_data(MAXOBS); // Workaround for NAV/CNAV clash problem bool gps_dual_band = false; diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h index 146a96b04..1fa4ba8dd 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.h +++ b/src/algorithms/PVT/libs/rtklib_solver.h @@ -126,6 +126,8 @@ public: Beidou_Dnav_Iono beidou_dnav_iono; std::map beidou_dnav_almanac_map; + int count_valid_position; + private: rtk_t rtk_{}; std::string d_dump_filename; @@ -135,9 +137,6 @@ private: bool d_flag_dump_mat_enabled; int d_nchannels; // Number of available channels for positioning std::array dop_{}; - std::array obs_data{}; - std::array eph_data{}; - std::array geph_data{}; Monitor_Pvt monitor_pvt{}; }; From 449afd702922d8ba3065336216a9b6ea2907181a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 29 Jul 2019 22:03:57 +0200 Subject: [PATCH 05/16] Fix typo --- src/tests/unit-tests/arithmetic/complex_carrier_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc index 643d2e3b9..ec8e9b68a 100644 --- a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc +++ b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc @@ -34,7 +34,7 @@ #include #include #include -#include e +#include DEFINE_int32(size_carrier_test, 100000, "Size of the arrays used for complex carrier testing"); From 2482f14bd8d58ce62fe123b1472f361241c588d9 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 30 Jul 2019 07:40:23 +0200 Subject: [PATCH 06/16] Apply code formatting --- src/core/receiver/gnss_flowgraph.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 7e2158dfc..060adfb5d 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -1468,19 +1468,19 @@ void GNSSFlowgraph::start_acquisition_helper() void GNSSFlowgraph::perform_hw_reset() { - // a stop acquisition command causes the SW to reset the HW - std::shared_ptr channel_ptr; + // a stop acquisition command causes the SW to reset the HW + std::shared_ptr 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(); - } + 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)); + std::this_thread::sleep_for(std::chrono::milliseconds(500)); - channel_ptr = std::dynamic_pointer_cast(channels_.at(0)); - channel_ptr->acquisition()->stop_acquisition(); + channel_ptr = std::dynamic_pointer_cast(channels_.at(0)); + channel_ptr->acquisition()->stop_acquisition(); } #endif From 1f476957e38375fe2cb421a62481d7315966d9ad Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 30 Jul 2019 08:06:05 +0200 Subject: [PATCH 07/16] Remove unused public member --- src/algorithms/PVT/libs/rtklib_solver.cc | 1 - src/algorithms/PVT/libs/rtklib_solver.h | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 45de55b96..f546ce63e 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -94,7 +94,6 @@ Rtklib_Solver::Rtklib_Solver(int nchannels, std::string dump_filename, bool flag d_dump_filename = std::move(dump_filename); d_flag_dump_enabled = flag_dump_to_file; d_flag_dump_mat_enabled = flag_dump_to_mat; - count_valid_position = 0; this->set_averaging_flag(false); rtk_ = rtk; diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h index 1fa4ba8dd..a393c1f63 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.h +++ b/src/algorithms/PVT/libs/rtklib_solver.h @@ -126,8 +126,6 @@ public: Beidou_Dnav_Iono beidou_dnav_iono; std::map beidou_dnav_almanac_map; - int count_valid_position; - private: rtk_t rtk_{}; std::string d_dump_filename; From 2fe38e937af81b11736db9f24061342f92f9987d Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 30 Jul 2019 08:06:53 +0200 Subject: [PATCH 08/16] Fix wrong assignment --- .../gnuradio_blocks/sbas_l1_telemetry_decoder_gs.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } From 9b4597572cbf414fc6d9fb61264f709083b37b23 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 30 Jul 2019 12:38:03 +0200 Subject: [PATCH 09/16] Cleaning --- src/core/system_parameters/GPS_L1_CA.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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; From cc54b4a1220e007026f93158ec1373973d2cd5d5 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 30 Jul 2019 12:51:36 +0200 Subject: [PATCH 10/16] =?UTF-8?q?Enforce=C2=A0rule=2015.1=C2=A0of=20the=20?= =?UTF-8?q?High=20Integrity=20C++=20Coding=20Standard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://www.perforce.com/resources/qac/high-integrity-c-coding-standard-exception-handling --- .clang-tidy | 1 + src/algorithms/tracking/libs/tcp_communication.cc | 5 +++-- src/utils/front-end-cal/front_end_cal.cc | 5 +++-- src/utils/front-end-cal/front_end_cal.h | 2 +- src/utils/front-end-cal/main.cc | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 3515d6a2a..33eeda4b4 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -12,6 +12,7 @@ Checks: '-*, cppcoreguidelines-slicing, google-build-namespaces, google-runtime-int, + hicpp-exception-baseclass, misc-misplaced-const, misc-new-delete-overloads, misc-non-copyable-objects, 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 #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..935bb4946 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -574,7 +574,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; } From 8ce0358de6b2e9298186c9bb65d045345a2c1f33 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 30 Jul 2019 19:00:23 +0200 Subject: [PATCH 11/16] Clang-tidy fixes --- .../tracking/cpu_multicorrelator_real_codes_test.cc | 2 +- src/utils/front-end-cal/main.cc | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) 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/main.cc b/src/utils/front-end-cal/main.cc index 935bb4946..eae79f406 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) From 5e5c68c2f980c200455c43b12f2f224f5cdd5456 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 30 Jul 2019 19:07:36 +0200 Subject: [PATCH 12/16] Add more performance and high integrity checks --- .clang-tidy | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.clang-tidy b/.clang-tidy index 33eeda4b4..4e0602b32 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -8,11 +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, @@ -25,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, From d83083a6555d6396dd33fd1d88c62b9f63e544e0 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 30 Jul 2019 20:03:02 +0200 Subject: [PATCH 13/16] Fix exception catch --- src/utils/front-end-cal/main.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index eae79f406..51eace09d 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -619,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; } From cdfe4c43d93f78420f926eebaf64dec716eb7d21 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 31 Jul 2019 10:21:32 +0200 Subject: [PATCH 14/16] Revert "Remove unused public member" This reverts commit 1f476957e38375fe2cb421a62481d7315966d9ad. --- src/algorithms/PVT/libs/rtklib_solver.cc | 1 + src/algorithms/PVT/libs/rtklib_solver.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index f546ce63e..45de55b96 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -94,6 +94,7 @@ Rtklib_Solver::Rtklib_Solver(int nchannels, std::string dump_filename, bool flag d_dump_filename = std::move(dump_filename); d_flag_dump_enabled = flag_dump_to_file; d_flag_dump_mat_enabled = flag_dump_to_mat; + count_valid_position = 0; this->set_averaging_flag(false); rtk_ = rtk; diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h index a393c1f63..1fa4ba8dd 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.h +++ b/src/algorithms/PVT/libs/rtklib_solver.h @@ -126,6 +126,8 @@ public: Beidou_Dnav_Iono beidou_dnav_iono; std::map beidou_dnav_almanac_map; + int count_valid_position; + private: rtk_t rtk_{}; std::string d_dump_filename; From 86f40ae4eb39a420ef6a37c23d84a19f0a4f3e74 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 1 Aug 2019 12:31:12 +0200 Subject: [PATCH 15/16] Fix comparison sign --- .../gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc | 2 +- .../gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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"; From dae5b715cdbcbc9fb159dfc32c2d71b4c0928c11 Mon Sep 17 00:00:00 2001 From: Marc Majoral Date: Thu, 1 Aug 2019 16:11:24 +0200 Subject: [PATCH 16/16] removed unnecessary calculations --- .../tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc | 3 --- 1 file changed, 3 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 b6040f1d9..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 @@ -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();