From c04948fd027c69b6289d57a14de235ee68bb377c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 10 Jul 2020 00:37:55 +0200 Subject: [PATCH] Reduce number of warnings raised by bugprone-* clang-tidy checks --- src/algorithms/PVT/adapters/rtklib_pvt.cc | 28 +- .../PVT/gnuradio_blocks/rtklib_pvt_gs.cc | 112 +------- src/algorithms/PVT/libs/nmea_printer.cc | 13 +- src/algorithms/PVT/libs/rinex_printer.cc | 42 +-- src/algorithms/PVT/libs/rtcm.cc | 72 ++--- src/algorithms/PVT/libs/rtklib_solver.cc | 4 +- .../adapters/beidou_b1i_pcps_acquisition.cc | 20 +- .../adapters/beidou_b3i_pcps_acquisition.cc | 20 +- ...lileo_e1_pcps_8ms_ambiguous_acquisition.cc | 14 +- .../galileo_e1_pcps_ambiguous_acquisition.cc | 20 +- ...ileo_e1_pcps_ambiguous_acquisition_fpga.cc | 2 +- ...eo_e1_pcps_cccwsr_ambiguous_acquisition.cc | 10 +- ...e1_pcps_quicksync_ambiguous_acquisition.cc | 14 +- ...ileo_e1_pcps_tong_ambiguous_acquisition.cc | 14 +- ...ileo_e5a_noncoherent_iq_acquisition_caf.cc | 10 +- .../adapters/galileo_e5a_pcps_acquisition.cc | 14 +- .../galileo_e5a_pcps_acquisition_fpga.cc | 4 +- .../glonass_l1_ca_pcps_acquisition.cc | 20 +- .../glonass_l2_ca_pcps_acquisition.cc | 20 +- .../adapters/gps_l1_ca_pcps_acquisition.cc | 20 +- ...gps_l1_ca_pcps_acquisition_fine_doppler.cc | 4 +- .../gps_l1_ca_pcps_acquisition_fpga.cc | 2 +- .../gps_l1_ca_pcps_assisted_acquisition.cc | 4 +- .../gps_l1_ca_pcps_opencl_acquisition.cc | 8 +- .../gps_l1_ca_pcps_quicksync_acquisition.cc | 8 +- .../gps_l1_ca_pcps_tong_acquisition.cc | 8 +- .../adapters/gps_l2_m_pcps_acquisition.cc | 20 +- .../gps_l2_m_pcps_acquisition_fpga.cc | 2 +- .../adapters/gps_l5i_pcps_acquisition.cc | 20 +- .../adapters/gps_l5i_pcps_acquisition_fpga.cc | 2 +- ...o_e5a_noncoherent_iq_acquisition_caf_cc.cc | 2 +- .../gnuradio_blocks/pcps_acquisition.cc | 14 +- .../pcps_cccwsr_acquisition_cc.cc | 2 +- .../pcps_quicksync_acquisition_cc.cc | 2 +- .../pcps_tong_acquisition_cc.cc | 2 +- src/algorithms/acquisition/libs/acq_conf.cc | 2 +- src/algorithms/channel/adapters/channel.cc | 4 +- src/algorithms/channel/adapters/channel.h | 6 +- .../adapters/byte_to_short.cc | 6 +- .../adapters/ibyte_to_cbyte.cc | 6 +- .../adapters/ibyte_to_complex.cc | 6 +- .../adapters/ibyte_to_cshort.cc | 6 +- .../adapters/ishort_to_complex.cc | 6 +- .../adapters/ishort_to_cshort.cc | 6 +- .../interleaved_byte_to_complex_byte.cc | 2 +- .../interleaved_byte_to_complex_short.cc | 2 +- .../interleaved_short_to_complex_short.cc | 2 +- .../adapters/beamformer_filter.cc | 4 +- .../input_filter/adapters/fir_filter.cc | 22 +- .../adapters/freq_xlating_fir_filter.cc | 28 +- .../input_filter/adapters/notch_filter.cc | 29 +- .../adapters/notch_filter_lite.cc | 36 ++- .../adapters/pulse_blanking_filter.cc | 22 +- .../input_filter/gnuradio_blocks/notch_cc.cc | 7 +- .../gnuradio_blocks/notch_lite_cc.cc | 5 +- src/algorithms/libs/cshort_to_float_x2.cc | 2 +- src/algorithms/libs/pass_through.cc | 2 +- .../libs/rtklib/rtklib_conversions.cc | 2 +- .../gnuradio_blocks/hybrid_observables_gs.cc | 10 +- .../adapters/direct_resampler_conditioner.cc | 10 +- .../adapters/mmse_resampler_conditioner.cc | 14 +- .../adapters/signal_generator.cc | 2 +- .../adapters/ad9361_fpga_signal_source.cc | 4 +- .../adapters/custom_udp_signal_source.cc | 13 +- .../adapters/fmcomms2_signal_source.cc | 4 +- .../adapters/labsat_signal_source.cc | 2 +- .../multichannel_file_signal_source.cc | 16 +- .../multichannel_file_signal_source.h | 2 +- .../adapters/osmosdr_signal_source.cc | 6 +- .../adapters/plutosdr_signal_source.cc | 4 +- .../adapters/raw_array_signal_source.cc | 2 +- .../adapters/rtl_tcp_signal_source.cc | 17 +- .../adapters/rtl_tcp_signal_source.h | 8 +- .../spir_gss6450_file_signal_source.cc | 12 +- .../spir_gss6450_file_signal_source.h | 4 +- .../adapters/uhd_signal_source.cc | 4 +- .../gr_complex_ip_packet_source.cc | 10 - .../gnuradio_blocks/labsat23_source.cc | 4 +- .../rtl_tcp_signal_source_c.cc | 6 +- .../unpack_spir_gss6450_samples.cc | 24 +- .../unpack_spir_gss6450_samples.h | 10 +- .../gps_l1_ca_telemetry_decoder_gs.cc | 1 - .../telemetry_decoder/libs/viterbi_decoder.cc | 20 +- .../adapters/beidou_b1i_dll_pll_tracking.cc | 2 +- .../adapters/beidou_b3i_dll_pll_tracking.cc | 2 +- .../galileo_e1_dll_pll_veml_tracking.cc | 2 +- .../galileo_e1_dll_pll_veml_tracking_fpga.cc | 2 +- .../galileo_e1_tcp_connector_tracking.cc | 34 +-- .../adapters/galileo_e5a_dll_pll_tracking.cc | 2 +- .../galileo_e5a_dll_pll_tracking_fpga.cc | 2 +- .../glonass_l1_ca_dll_pll_c_aid_tracking.cc | 34 +-- .../glonass_l1_ca_dll_pll_tracking.cc | 28 +- .../glonass_l2_ca_dll_pll_c_aid_tracking.cc | 34 +-- .../glonass_l2_ca_dll_pll_tracking.cc | 28 +- .../adapters/gps_l1_ca_dll_pll_tracking.cc | 2 +- .../gps_l1_ca_dll_pll_tracking_fpga.cc | 2 +- .../gps_l1_ca_dll_pll_tracking_gpu.cc | 4 +- .../adapters/gps_l1_ca_kf_tracking.cc | 47 ++-- .../gps_l1_ca_tcp_connector_tracking.cc | 25 +- .../adapters/gps_l2_m_dll_pll_tracking.cc | 2 +- .../gps_l2_m_dll_pll_tracking_fpga.cc | 2 +- .../adapters/gps_l5_dll_pll_tracking.cc | 2 +- .../adapters/gps_l5_dll_pll_tracking_fpga.cc | 2 +- src/algorithms/tracking/libs/dll_pll_conf.cc | 2 +- .../tracking/libs/dll_pll_conf_fpga.cc | 2 +- .../tracking/libs/exponential_smoother.cc | 4 +- .../tracking/libs/lock_detectors.cc | 6 +- .../tracking/libs/nonlinear_tracking.cc | 12 +- .../tracking/libs/tracking_2nd_DLL_filter.cc | 6 +- .../tracking/libs/tracking_2nd_PLL_filter.cc | 6 +- .../tracking/libs/tracking_FLL_PLL_filter.cc | 16 +- .../tracking/libs/tracking_loop_filter.cc | 10 +- src/core/monitor/gnss_synchro_monitor.cc | 6 +- src/core/monitor/gnss_synchro_monitor.h | 8 +- src/core/receiver/gnss_block_factory.cc | 20 +- src/core/receiver/gnss_flowgraph.cc | 48 ++-- src/core/receiver/gnss_flowgraph.h | 7 +- src/core/receiver/tcp_cmd_interface.cc | 6 +- src/core/system_parameters/CMakeLists.txt | 2 + src/core/system_parameters/Galileo_E1.h | 227 ---------------- src/core/system_parameters/Galileo_E5a.h | 150 ----------- src/core/system_parameters/Galileo_E5b.h | 232 ---------------- src/core/system_parameters/Galileo_FNAV.h | 177 ++++++++++++ src/core/system_parameters/Galileo_INAV.h | 252 ++++++++++++++++++ .../beidou_dnav_navigation_message.cc | 8 +- .../beidou_dnav_navigation_message.h | 2 +- .../system_parameters/beidou_dnav_utc_model.h | 4 +- .../system_parameters/galileo_fnav_message.h | 1 + .../galileo_navigation_message.h | 1 + .../glonass_gnav_ephemeris.cc | 2 +- .../glonass_gnav_ephemeris.h | 4 +- src/core/system_parameters/gnss_satellite.cc | 29 +- src/tests/benchmarks/CMakeLists.txt | 2 + .../signal-processing-blocks/pvt/rtcm_test.cc | 3 +- .../glonass_gnav_ephemeris_test.cc | 6 +- 135 files changed, 981 insertions(+), 1533 deletions(-) create mode 100644 src/core/system_parameters/Galileo_FNAV.h create mode 100644 src/core/system_parameters/Galileo_INAV.h diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index 97c3b0c92..18fd61d33 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -48,10 +48,10 @@ Rtklib_Pvt::Rtklib_Pvt(const ConfigurationInterface* configuration, { Pvt_Conf pvt_output_parameters = Pvt_Conf(); // dump parameters - std::string default_dump_filename = "./pvt.dat"; - std::string default_nmea_dump_filename = "./nmea_pvt.nmea"; - std::string default_nmea_dump_devname = "/dev/tty1"; - std::string default_rtcm_dump_devname = "/dev/pts/1"; + const std::string default_dump_filename("./pvt.dat"); + const std::string default_nmea_dump_filename("./nmea_pvt.nmea"); + const std::string default_nmea_dump_devname("/dev/tty1"); + const std::string default_rtcm_dump_devname("/dev/pts/1"); DLOG(INFO) << "role " << role; pvt_output_parameters.dump = configuration->property(role + ".dump", false); pvt_output_parameters.dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); @@ -73,27 +73,11 @@ Rtklib_Pvt::Rtklib_Pvt(const ConfigurationInterface* configuration, // RINEX version pvt_output_parameters.rinex_version = configuration->property(role + ".rinex_version", 3); - if (FLAGS_RINEX_version == "3.01") + if (FLAGS_RINEX_version == "3.01" || FLAGS_RINEX_version == "3.02" || FLAGS_RINEX_version == "3") { pvt_output_parameters.rinex_version = 3; } - else if (FLAGS_RINEX_version == "3.02") - { - pvt_output_parameters.rinex_version = 3; - } - else if (FLAGS_RINEX_version == "3") - { - pvt_output_parameters.rinex_version = 3; - } - else if (FLAGS_RINEX_version == "2.11") - { - pvt_output_parameters.rinex_version = 2; - } - else if (FLAGS_RINEX_version == "2.10") - { - pvt_output_parameters.rinex_version = 2; - } - else if (FLAGS_RINEX_version == "2") + else if (FLAGS_RINEX_version == "2.10" || FLAGS_RINEX_version == "2.11" || FLAGS_RINEX_version == "2") { pvt_output_parameters.rinex_version = 2; } diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index 67acba92e..8858a22d6 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -1090,17 +1090,11 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) switch (d_type_of_rx) { case 1: // GPS L1 C/A only - d_rp->log_rinex_nav(d_rp->navFile, new_eph); - break; case 8: // L1+L5 d_rp->log_rinex_nav(d_rp->navFile, new_eph); break; - case 9: // GPS L1 C/A + Galileo E1B - d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); - break; + case 9: // GPS L1 C/A + Galileo E1B case 10: // GPS L1 C/A + Galileo E5a - d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); - break; case 11: // GPS L1 C/A + Galileo E5b d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); break; @@ -1125,8 +1119,6 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) } break; case 32: // L1+E1+L5+E5a - d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); - break; case 33: // L1+E1+E5a d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); break; @@ -1201,11 +1193,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) switch (d_type_of_rx) { case 2: // GPS L2C only - d_rp->log_rinex_nav(d_rp->navFile, new_cnav_eph); - break; case 3: // GPS L5 only - d_rp->log_rinex_nav(d_rp->navFile, new_cnav_eph); - break; case 7: // GPS L1 C/A + GPS L2C d_rp->log_rinex_nav(d_rp->navFile, new_cnav_eph); break; @@ -1213,8 +1201,6 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) d_rp->log_rinex_nav(d_rp->navMixFile, new_cnav_eph, new_gal_eph); break; case 28: // GPS L2C + GLONASS L1 C/A - d_rp->log_rinex_nav(d_rp->navMixFile, new_cnav_eph, new_glo_eph); - break; case 31: // GPS L2C + GLONASS L2 C/A d_rp->log_rinex_nav(d_rp->navMixFile, new_cnav_eph, new_glo_eph); break; @@ -1303,20 +1289,12 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) switch (d_type_of_rx) { case 4: // Galileo E1B only - d_rp->log_rinex_nav(d_rp->navGalFile, new_gal_eph); - break; case 5: // Galileo E5a only - d_rp->log_rinex_nav(d_rp->navGalFile, new_gal_eph); - break; case 6: // Galileo E5b only d_rp->log_rinex_nav(d_rp->navGalFile, new_gal_eph); break; - case 9: // GPS L1 C/A + Galileo E1B - d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); - break; + case 9: // GPS L1 C/A + Galileo E1B case 10: // GPS L1 C/A + Galileo E5a - d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); - break; case 11: // GPS L1 C/A + Galileo E5b d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); break; @@ -1327,17 +1305,11 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) d_rp->log_rinex_nav(d_rp->navGalFile, new_gal_eph); break; case 27: // Galileo E1B + GLONASS L1 C/A - d_rp->log_rinex_nav(d_rp->navMixFile, new_gal_eph, new_glo_eph); - break; case 30: // Galileo E1B + GLONASS L2 C/A d_rp->log_rinex_nav(d_rp->navMixFile, new_gal_eph, new_glo_eph); break; - case 32: // L1+E1+L5+E5a - d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); - break; - case 33: // L1+E1+E5a - d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); - break; + case 32: // L1+E1+L5+E5a + case 33: // L1+E1+E5a case 1001: // L1+E1+L2+L5+E5a d_rp->log_rinex_nav(d_rp->navMixFile, new_eph, new_gal_eph); break; @@ -1463,11 +1435,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) switch (d_type_of_rx) { case 23: // GLONASS L1 C/A - d_rp->log_rinex_nav(d_rp->navGloFile, new_glo_eph); - break; case 24: // GLONASS L2 C/A - d_rp->log_rinex_nav(d_rp->navGloFile, new_glo_eph); - break; case 25: // GLONASS L1 C/A + GLONASS L2 C/A d_rp->log_rinex_nav(d_rp->navGloFile, new_glo_eph); break; @@ -1574,8 +1542,6 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) switch (d_type_of_rx) { case 500: // BDS B1I only - d_rp->log_rinex_nav(d_rp->navFile, new_bds_eph); - break; case 600: // BDS B3I only d_rp->log_rinex_nav(d_rp->navFile, new_bds_eph); break; @@ -1830,17 +1796,11 @@ void rtklib_pvt_gs::apply_rx_clock_offset(std::map& observabl switch (d_mapStringValues[observables_iter->second.Signal]) { case evGPS_1C: - observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ1 * TWO_PI; - break; - case evGPS_L5: - observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ5 * TWO_PI; - break; case evSBAS_1C: - observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ1 * TWO_PI; - break; case evGAL_1B: observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ1 * TWO_PI; break; + case evGPS_L5: case evGAL_5X: observables_iter->second.Carrier_phase_rads -= rx_clock_offset_s * FREQ5 * TWO_PI; break; @@ -1932,17 +1892,11 @@ void rtklib_pvt_gs::initialize_and_apply_carrier_phase_offset() switch (d_mapStringValues[observables_iter->second.Signal]) { case evGPS_1C: - wavelength_m = SPEED_OF_LIGHT_M_S / FREQ1; - break; - case evGPS_L5: - wavelength_m = SPEED_OF_LIGHT_M_S / FREQ5; - break; case evSBAS_1C: - wavelength_m = SPEED_OF_LIGHT_M_S / FREQ1; - break; case evGAL_1B: wavelength_m = SPEED_OF_LIGHT_M_S / FREQ1; break; + case evGPS_L5: case evGAL_5X: wavelength_m = SPEED_OF_LIGHT_M_S / FREQ5; break; @@ -2688,35 +2642,8 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item break; case 503: // BeiDou B1I + GLONASS L1 C/A - if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) - { - // d_rp->rinex_obs_header(d_rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1"); - // d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); - // d_rp->log_rinex_nav(d_rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map); - d_rinex_header_written = true; // do not write header anymore - } - - break; case 504: // BeiDou B1I + GPS L1 C/A + Galileo E1B - if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) - { - // d_rp->rinex_obs_header(d_rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1"); - // d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); - // d_rp->log_rinex_nav(d_rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map); - d_rinex_header_written = true; // do not write header anymore - } - - break; case 505: // BeiDou B1I + GPS L1 C/A + GLONASS L1 C/A + Galileo E1B - if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) - { - // d_rp->rinex_obs_header(d_rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B1"); - // d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); - // d_rp->log_rinex_nav(d_rp->navFile, d_user_pvt_solver->beidou_dnav_ephemeris_map); - d_rinex_header_written = true; // do not write header anymore - } - - break; case 506: // BeiDou B1I + Beidou B3I if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { @@ -2738,23 +2665,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item break; case 601: // BeiDou B3I + GPS L2C - if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) - { - d_rp->rinex_obs_header(d_rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B3"); - // d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); - d_rinex_header_written = true; // do not write header anymore - } - - break; case 602: // BeiDou B3I + GLONASS L2 C/A - if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) - { - d_rp->rinex_obs_header(d_rp->obsFile, beidou_dnav_ephemeris_iter->second, d_rx_time, "B3"); - // d_rp->rinex_nav_header(d_rp->navFile, d_user_pvt_solver->beidou_dnav_iono, d_user_pvt_solver->beidou_dnav_utc_model); - d_rinex_header_written = true; // do not write header anymore - } - - break; case 603: // BeiDou B3I + GPS L2C + GLONASS L2 C/A if (beidou_dnav_ephemeris_iter != d_user_pvt_solver->beidou_dnav_ephemeris_map.cend()) { @@ -2818,17 +2729,6 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item } break; case 2: // GPS L2C only - if (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend()) - { - d_rp->log_rinex_obs(d_rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, d_gnss_observables_map); - } - if (!d_rinex_header_updated and (d_user_pvt_solver->gps_cnav_utc_model.d_A0 != 0)) - { - d_rp->update_obs_header(d_rp->obsFile, d_user_pvt_solver->gps_cnav_utc_model); - d_rp->update_nav_header(d_rp->navFile, d_user_pvt_solver->gps_cnav_utc_model, d_user_pvt_solver->gps_cnav_iono); - d_rinex_header_updated = true; - } - break; case 3: // GPS L5 if (gps_cnav_ephemeris_iter != d_user_pvt_solver->gps_cnav_ephemeris_map.cend()) { diff --git a/src/algorithms/PVT/libs/nmea_printer.cc b/src/algorithms/PVT/libs/nmea_printer.cc index fc5ec8933..8bd8d0e91 100644 --- a/src/algorithms/PVT/libs/nmea_printer.cc +++ b/src/algorithms/PVT/libs/nmea_printer.cc @@ -379,15 +379,10 @@ std::string Nmea_Printer::get_UTC_NMEA_time(boost::posix_time::ptime d_position_ std::stringstream sentence_str; boost::posix_time::time_duration td = d_position_UTC_time.time_of_day(); - int utc_hours; - int utc_mins; - int utc_seconds; - int utc_milliseconds; - - utc_hours = td.hours(); - utc_mins = td.minutes(); - utc_seconds = td.seconds(); - utc_milliseconds = td.total_milliseconds() - td.total_seconds() * 1000; + int utc_hours = td.hours(); + int utc_mins = td.minutes(); + int utc_seconds = td.seconds(); + auto utc_milliseconds = static_cast(td.total_milliseconds() - td.total_seconds() * 1000); if (utc_hours < 10) { diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 30806d685..ea77c7fdb 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -916,7 +916,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali { } // Avoid compiler warning // Avoid compiler warning, there is not time system correction between Galileo and GLONASS - if (galileo_utc_model.A_0G_10) + if (galileo_utc_model.A_0G_10 > 0.0) { } std::string line; @@ -1884,7 +1884,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Beidou_Dnav_Iono& // -------- Line 6 leap seconds // For leap second information, see https://endruntechnologies.com/support/leap-seconds line.clear(); - line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DeltaT_LS), 6); line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); @@ -2282,7 +2282,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M // -------- Line 6 leap seconds // For leap second information, see https://endruntechnologies.com/support/leap-seconds line.clear(); - line += Rinex_Printer::rightJustify(std::to_string(bds_dnav_utc_model.d_DeltaT_LS), 6); + line += Rinex_Printer::rightJustify(std::to_string(bds_dnav_utc_model.i_DeltaT_LS), 6); line += Rinex_Printer::rightJustify(std::to_string(bds_dnav_utc_model.d_DeltaT_LSF), 6); line += Rinex_Printer::rightJustify(std::to_string(bds_dnav_utc_model.i_WN_LSF), 6); line += Rinex_Printer::rightJustify(std::to_string(bds_dnav_utc_model.i_DN), 6); @@ -3504,7 +3504,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal { } // Avoid compiler warning // Avoid compiler warning, there is not time system correction between Galileo and GLONASS - if (galileo_utc_model.A_0G_10) + if (galileo_utc_model.A_0G_10 > 0.0) { } std::vector data; @@ -3655,7 +3655,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Beidou_Dnav_Utc_M } else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) { - line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DeltaT_LS), 6); line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); @@ -4838,7 +4838,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map 0.0) { } // Avoid compiler warning std::string line; @@ -5171,7 +5171,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glonass_bands) { - if (glonass_gnav_eph.d_m) + if (glonass_gnav_eph.d_m > 0.0) { } // avoid warning, not needed std::string line; @@ -5527,7 +5527,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glonass_bands) { - if (glonass_gnav_eph.d_m) + if (glonass_gnav_eph.d_m > 0.0) { } // avoid warning, not needed std::string line; @@ -5847,7 +5847,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& galileo_bands, const std::string& glonass_bands) { - if (glonass_gnav_eph.d_m) + if (glonass_gnav_eph.d_m > 0.0) { } // avoid warning, not needed std::string line; @@ -6679,7 +6679,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph, const Gps_CNAV_Ephemeris& eph_cnav, const double d_TOW_first_observation, const std::string& gps_bands) { - if (eph_cnav.d_i_0) + if (eph_cnav.d_i_0 > 0.0) { } // avoid warning, not needed std::string line; @@ -7890,7 +7890,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Galileo_Ephemeris& galileo_eph, const double d_TOW_first_observation, const std::string& galileo_bands) { - if (galileo_eph.e_1) + if (galileo_eph.e_1 > 0.0) { } // avoid warning, not needed std::string line; @@ -8415,7 +8415,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Beidou_Dnav_Epheme void Rinex_Printer::update_obs_header(std::fstream& out __attribute__((unused)), const Glonass_Gnav_Utc_Model& utc_model) { - if (utc_model.d_N_4) + if (utc_model.d_N_4 > 0.0) { // do nothing } @@ -8644,7 +8644,7 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Beidou_Dnav_Utc_M if (line_str.find("TIME OF FIRST OBS", 59) != std::string::npos) { data.push_back(line_str); - line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DeltaT_LS), 6); line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); @@ -8940,7 +8940,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double gps_obs_time, const std::map& observables) { - if (glonass_gnav_eph.d_m) + if (glonass_gnav_eph.d_m > 0.0) { } // avoid warning, not needed std::string line; @@ -9285,7 +9285,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double gps_obs_time, const std::map& observables) { - if (glonass_gnav_eph.d_m) + if (glonass_gnav_eph.d_m > 0.0) { } // avoid warning, not needed std::string line; @@ -9543,7 +9543,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double galileo_obs_time, const std::map& observables) { - if (glonass_gnav_eph.d_m) + if (glonass_gnav_eph.d_m > 0.0) { } // avoid warning, not needed std::string line; @@ -10176,7 +10176,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, const Gps_CNAV_Ephemeris& eph_cnav, double obs_time, const std::map& observables, bool triple_band) { - if (eph_cnav.d_i_0) + if (eph_cnav.d_i_0 > 0.0) { } // avoid warning, not needed // RINEX observations timestamps are GPS timestamps. @@ -10658,7 +10658,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map& observables) { - if (galileo_eph.e_1) + if (galileo_eph.e_1 > 0.0) { } // avoid warning, not needed std::string line; @@ -10930,7 +10930,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map& observables) { - if (galileo_eph.e_1) + if (galileo_eph.e_1 > 0.0) { } // avoid warning, not needed std::string line; @@ -11224,10 +11224,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map& observables, bool triple_band) { - if (galileo_eph.e_1) + if (galileo_eph.e_1 > 0.0) { } // avoid warning, not needed - if (gps_cnav_eph.d_e_eccentricity) + if (gps_cnav_eph.d_e_eccentricity > 0.0) { } // avoid warning, not needed std::string line; diff --git a/src/algorithms/PVT/libs/rtcm.cc b/src/algorithms/PVT/libs/rtcm.cc index 28b3a5b5c..95a7e8bb1 100644 --- a/src/algorithms/PVT/libs/rtcm.cc +++ b/src/algorithms/PVT/libs/rtcm.cc @@ -23,6 +23,9 @@ #include "GPS_L2C.h" #include "Galileo_E1.h" #include "Galileo_E5a.h" +#include "Galileo_E5b.h" +#include "Galileo_FNAV.h" +#include "Galileo_INAV.h" #include // for to_upper_copy #include #include @@ -1896,7 +1899,7 @@ int32_t Rtcm::read_MT1020(const std::string& message, Glonass_Gnav_Ephemeris& gl glonass_gnav_eph.d_B_n = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 1))); index += 1; - glonass_gnav_eph.d_P_2 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 1))); + glonass_gnav_eph.d_P_2 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 1))); index += 1; glonass_gnav_eph.d_t_b = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 7))) * 15 * 60.0; @@ -1930,7 +1933,7 @@ int32_t Rtcm::read_MT1020(const std::string& message, Glonass_Gnav_Ephemeris& gl glonass_gnav_eph.d_AZn = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 5))) * TWO_N30; index += 5; - glonass_gnav_eph.d_P_3 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 1))); + glonass_gnav_eph.d_P_3 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 1))); index += 1; glonass_gnav_eph.d_gamma_n = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 11))) * TWO_N30; @@ -1939,7 +1942,7 @@ int32_t Rtcm::read_MT1020(const std::string& message, Glonass_Gnav_Ephemeris& gl glonass_gnav_eph.d_P = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 2))); index += 2; - glonass_gnav_eph.d_l3rd_n = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 1))); + glonass_gnav_eph.d_l3rd_n = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 1))); index += 1; glonass_gnav_eph.d_tau_n = static_cast(Rtcm::bin_to_sint(message_bin.substr(index, 22))) * TWO_N30; @@ -1951,7 +1954,7 @@ int32_t Rtcm::read_MT1020(const std::string& message, Glonass_Gnav_Ephemeris& gl glonass_gnav_eph.d_E_n = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 5))); index += 5; - glonass_gnav_eph.d_P_4 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 1))); + glonass_gnav_eph.d_P_4 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 1))); index += 1; glonass_gnav_eph.d_F_T = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 4))); @@ -2007,12 +2010,7 @@ std::string Rtcm::print_MT1029(uint32_t ref_id, const Gps_Ephemeris& gps_eph, do std::string text_binary; for (char c : message) { - if (isgraph(c)) - { - i++; - first = true; - } - else if (c == ' ') + if (isgraph(c) || c == ' ') { i++; first = true; @@ -4529,14 +4527,14 @@ int32_t Rtcm::set_DF107(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) int32_t Rtcm::set_DF108(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - DF108 = std::bitset<1>(glonass_gnav_eph.d_B_n); + DF108 = std::bitset<1>(static_cast(glonass_gnav_eph.d_B_n)); return 0; } int32_t Rtcm::set_DF109(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - DF109 = std::bitset<1>(glonass_gnav_eph.d_P_2); + DF109 = std::bitset<1>(static_cast(glonass_gnav_eph.d_P_2)); return 0; } @@ -5289,11 +5287,7 @@ int32_t Rtcm::set_DF397(const Gnss_Synchro& gnss_synchro) uint32_t int_ms = 0; - if (rough_range_s == 0.0) - { - int_ms = 255; - } - else if ((rough_range_s < 0.0) || (rough_range_s > meters_to_miliseconds * 255.0)) + if (rough_range_s == 0.0 || ((rough_range_s < 0.0) || (rough_range_s > meters_to_miliseconds * 255.0))) { int_ms = 255; } @@ -5349,7 +5343,7 @@ int32_t Rtcm::set_DF399(const Gnss_Synchro& gnss_synchro) } if (sig == "7X") { - lambda = SPEED_OF_LIGHT_M_S / 1.207140e9; // Galileo_E1b_FREQ_HZ; + lambda = SPEED_OF_LIGHT_M_S / GALILEO_E5B_FREQ_HZ; } double rough_phase_range_rate_ms = std::round(-gnss_synchro.Carrier_Doppler_hz * lambda); @@ -5376,11 +5370,7 @@ int32_t Rtcm::set_DF400(const Gnss_Synchro& gnss_synchro) psrng_s = gnss_synchro.Pseudorange_m - rough_range_m; - if (psrng_s == 0) - { - fine_pseudorange = -16384; - } - else if (std::fabs(psrng_s) > 292.7) + if (psrng_s == 0 || (std::fabs(psrng_s) > 292.7)) { fine_pseudorange = -16384; // 4000h: invalid value } @@ -5424,7 +5414,7 @@ int32_t Rtcm::set_DF401(const Gnss_Synchro& gnss_synchro) } if ((sig == "7X") && (sys == "E")) { - lambda = SPEED_OF_LIGHT_M_S / 1.207140e9; // Galileo_E1b_FREQ_HZ; + lambda = SPEED_OF_LIGHT_M_S / GALILEO_E5B_FREQ_HZ; } if ((sig == "1C") && (sys == "R")) { @@ -5447,11 +5437,7 @@ int32_t Rtcm::set_DF401(const Gnss_Synchro& gnss_synchro) } phrng_m -= cp; - if (phrng_m == 0.0) - { - fine_phaserange = -2097152; - } - else if (std::fabs(phrng_m) > 1171.0) + if (phrng_m == 0.0 || (std::fabs(phrng_m) > 1171.0)) { fine_phaserange = -2097152; } @@ -5484,11 +5470,7 @@ int32_t Rtcm::set_DF402(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& e { lock_time_period_s = Rtcm::lock_time(ephFNAV, obs_time, gnss_synchro); } - if ((sig_ == "1C") && (sys == "R")) - { - lock_time_period_s = Rtcm::lock_time(ephGNAV, obs_time, gnss_synchro); - } - if ((sig_ == "2C") && (sys == "R")) + if (((sig_ == "1C") && (sys == "R")) || ((sig_ == "2C") && (sys == "R"))) { lock_time_period_s = Rtcm::lock_time(ephGNAV, obs_time, gnss_synchro); } @@ -5533,7 +5515,7 @@ int32_t Rtcm::set_DF404(const Gnss_Synchro& gnss_synchro) } if ((sig_ == "7X") && (sys_ == "E")) { - lambda = SPEED_OF_LIGHT_M_S / 1.207140e9; // Galileo_E1b_FREQ_HZ; + lambda = SPEED_OF_LIGHT_M_S / GALILEO_E5B_FREQ_HZ; } if ((sig_ == "1C") && (sys_ == "R")) { @@ -5547,11 +5529,7 @@ int32_t Rtcm::set_DF404(const Gnss_Synchro& gnss_synchro) double rough_phase_range_rate = std::round(-gnss_synchro.Carrier_Doppler_hz * lambda); double phrr = (-gnss_synchro.Carrier_Doppler_hz * lambda - rough_phase_range_rate); - if (phrr == 0.0) - { - fine_phaserange_rate = -16384; - } - else if (std::fabs(phrr) > 1.6384) + if (phrr == 0.0 || (std::fabs(phrr) > 1.6384)) { fine_phaserange_rate = -16384; } @@ -5574,11 +5552,7 @@ int32_t Rtcm::set_DF405(const Gnss_Synchro& gnss_synchro) psrng_s = gnss_synchro.Pseudorange_m - rough_range_m; - if (psrng_s == 0.0) - { - fine_pseudorange = -524288; - } - else if (std::fabs(psrng_s) > 292.7) + if (psrng_s == 0.0 || (std::fabs(psrng_s) > 292.7)) { fine_pseudorange = -524288; } @@ -5620,7 +5594,7 @@ int32_t Rtcm::set_DF406(const Gnss_Synchro& gnss_synchro) } if ((sig_ == "7X") && (sys_ == "E")) { - lambda = SPEED_OF_LIGHT_M_S / 1.207140e9; // Galileo_E1b_FREQ_HZ; + lambda = SPEED_OF_LIGHT_M_S / GALILEO_E5B_FREQ_HZ; } if ((sig_ == "1C") && (sys_ == "R")) { @@ -5642,11 +5616,7 @@ int32_t Rtcm::set_DF406(const Gnss_Synchro& gnss_synchro) } phrng_m -= cp; - if (phrng_m == 0.0) - { - fine_phaserange_ex = -8388608; - } - else if (std::fabs(phrng_m) > 1171.0) + if (phrng_m == 0.0 || (std::fabs(phrng_m) > 1171.0)) { fine_phaserange_ex = -8388608; } diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 1624a260d..e5123d145 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -890,7 +890,7 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ nav_data.utc_cmp[1] = beidou_dnav_utc_model.d_A1_UTC; nav_data.utc_cmp[2] = 0.0; // ?? nav_data.utc_cmp[3] = 0.0; // ?? - nav_data.leaps = beidou_dnav_utc_model.d_DeltaT_LS; + nav_data.leaps = beidou_dnav_utc_model.i_DeltaT_LS; } /* update carrier wave length using native function call in RTKlib */ @@ -928,7 +928,7 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ std::vector azel; azel.reserve(used_sats * 2); - unsigned int index_aux = 0; + int index_aux = 0; for (auto &i : rtk_.ssat) { if (i.vs == 1) diff --git a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc index 2fb560536..de23d88b9 100644 --- a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc @@ -64,7 +64,7 @@ BeidouB1iPcpsAcquisition::BeidouB1iPcpsAcquisition( num_codes_ = acq_parameters_.sampled_ms; code_length_ = static_cast(std::floor(static_cast(fs_in_) / (BEIDOU_B1I_CODE_RATE_CPS / BEIDOU_B1I_CODE_LENGTH_CHIPS))); - vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); + vector_length_ = static_cast(std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2.0 : 1.0)); code_ = std::vector>(vector_length_); acquisition_ = pcps_make_acquisition(acq_parameters_); @@ -172,11 +172,7 @@ void BeidouB1iPcpsAcquisition::set_state(int state) void BeidouB1iPcpsAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_ == "gr_complex") - { - // nothing to connect - } - else if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { // nothing to connect } @@ -197,11 +193,7 @@ void BeidouB1iPcpsAcquisition::connect(gr::top_block_sptr top_block) void BeidouB1iPcpsAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_ == "gr_complex") - { - // nothing to disconnect - } - else if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { // nothing to disconnect } @@ -220,11 +212,7 @@ void BeidouB1iPcpsAcquisition::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr BeidouB1iPcpsAcquisition::get_left_block() { - if (item_type_ == "gr_complex") - { - return acquisition_; - } - if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { return acquisition_; } diff --git a/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.cc index a1e26ffef..03f8919ea 100644 --- a/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/beidou_b3i_pcps_acquisition.cc @@ -62,7 +62,7 @@ BeidouB3iPcpsAcquisition::BeidouB3iPcpsAcquisition( num_codes_ = acq_parameters_.sampled_ms; code_length_ = static_cast(std::floor(static_cast(fs_in_) / (BEIDOU_B3I_CODE_RATE_CPS / BEIDOU_B3I_CODE_LENGTH_CHIPS))); - vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); + vector_length_ = static_cast(std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2.0 : 1.0)); code_ = std::vector>(vector_length_); acquisition_ = pcps_make_acquisition(acq_parameters_); @@ -169,11 +169,7 @@ void BeidouB3iPcpsAcquisition::set_state(int state) void BeidouB3iPcpsAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_ == "gr_complex") - { - // nothing to connect - } - else if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { // nothing to connect } @@ -194,11 +190,7 @@ void BeidouB3iPcpsAcquisition::connect(gr::top_block_sptr top_block) void BeidouB3iPcpsAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_ == "gr_complex") - { - // nothing to disconnect - } - else if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { // nothing to disconnect } @@ -217,11 +209,7 @@ void BeidouB3iPcpsAcquisition::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr BeidouB3iPcpsAcquisition::get_left_block() { - if (item_type_ == "gr_complex") - { - return acquisition_; - } - if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { return acquisition_; } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc index 5fb5dbcc8..f203abeb2 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc @@ -44,8 +44,8 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( out_streams_(out_streams) { configuration_ = configuration; - std::string default_item_type = "gr_complex"; - std::string default_dump_filename = "../data/acquisition.dat"; + const std::string default_item_type("gr_complex"); + const std::string default_dump_filename("../data/acquisition.dat"); DLOG(INFO) << "role " << role; @@ -76,12 +76,12 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( default_dump_filename); // -- Find number of samples per spreading code (4 ms) ----------------- - code_length_ = round( - fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)); + code_length_ = static_cast(round( + fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS))); vector_length_ = code_length_ * static_cast(sampled_ms_ / 4); - int samples_per_ms = code_length_ / 4; + auto samples_per_ms = static_cast(code_length_) / 4; code_ = std::vector>(vector_length_); @@ -127,11 +127,11 @@ void GalileoE1Pcps8msAmbiguousAcquisition::stop_acquisition() void GalileoE1Pcps8msAmbiguousAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", static_cast(0.0)); if (pfa == 0.0) { - pfa = configuration_->property(role_ + ".pfa", 0.0); + pfa = configuration_->property(role_ + ".pfa", static_cast(0.0)); } if (pfa == 0.0) diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc index 631aa964a..5abfc1b76 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc @@ -62,7 +62,7 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( acquire_pilot_ = configuration->property(role + ".acquire_pilot", false); code_length_ = static_cast(std::floor(static_cast(acq_parameters_.resampled_fs) / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS))); - vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); + vector_length_ = static_cast(std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2.0 : 1.0)); code_ = std::vector>(vector_length_); sampled_ms_ = acq_parameters_.sampled_ms; @@ -214,11 +214,7 @@ void GalileoE1PcpsAmbiguousAcquisition::set_state(int state) void GalileoE1PcpsAmbiguousAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_ == "gr_complex") - { - // nothing to connect - } - else if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { // nothing to connect } @@ -239,11 +235,7 @@ void GalileoE1PcpsAmbiguousAcquisition::connect(gr::top_block_sptr top_block) void GalileoE1PcpsAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_ == "gr_complex") - { - // nothing to disconnect - } - else if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { // nothing to disconnect } @@ -262,11 +254,7 @@ void GalileoE1PcpsAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisition::get_left_block() { - if (item_type_ == "gr_complex") - { - return acquisition_; - } - if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { return acquisition_; } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc index 192c4ba9d..a234be35c 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc @@ -159,7 +159,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( acq_parameters.all_fft_codes = d_all_fft_codes_.data(); acq_parameters.num_doppler_bins_step2 = configuration->property(role + ".second_nbins", 4); - acq_parameters.doppler_step2 = configuration->property(role + ".second_doppler_step", 125.0); + acq_parameters.doppler_step2 = configuration->property(role + ".second_doppler_step", static_cast(125.0)); acq_parameters.make_2_steps = configuration->property(role + ".make_two_steps", false); acq_parameters.max_num_acqs = configuration->property(role + ".max_num_acqs", 2); // reference for the FPGA FFT-IFFT attenuation factor diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc index 402a10b87..5ec7bee3e 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc @@ -36,8 +36,8 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition out_streams_(out_streams) { configuration_ = configuration; - std::string default_item_type = "gr_complex"; - std::string default_dump_filename = "../data/acquisition.dat"; + const std::string default_item_type("gr_complex"); + const std::string default_dump_filename("../data/acquisition.dat"); DLOG(INFO) << "role " << role; @@ -68,12 +68,12 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition // -- Find number of samples per spreading code (4 ms) ----------------- - code_length_ = round( - fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)); + code_length_ = static_cast(round( + fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS))); vector_length_ = code_length_ * static_cast(sampled_ms_ / 4); - int samples_per_ms = code_length_ / 4; + auto samples_per_ms = static_cast(code_length_) / 4; code_data_ = std::vector>(vector_length_); code_pilot_ = std::vector>(vector_length_); diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc index 92dda1fe5..a83903ad0 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc @@ -44,8 +44,8 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui out_streams_(out_streams) { configuration_ = configuration; - std::string default_item_type = "gr_complex"; - std::string default_dump_filename = "../data/acquisition.dat"; + const std::string default_item_type("gr_complex"); + const std::string default_dump_filename("../data/acquisition.dat"); DLOG(INFO) << "role " << role; @@ -63,10 +63,10 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 8); /* --- Find number of samples per spreading code (4 ms) -----------------*/ - code_length_ = round( - fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)); + code_length_ = static_cast(round( + fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS))); - int samples_per_ms = round(code_length_ / 4.0); + auto samples_per_ms = static_cast(round(code_length_ / 4.0)); /*Calculate the folding factor value based on the formula described in the paper. This may be a bug, but acquisition also work by variying the folding factor at va- @@ -162,11 +162,11 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::stop_acquisition() void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", static_cast(0.0)); if (pfa == 0.0) { - pfa = configuration_->property(role_ + ".pfa", 0.0); + pfa = configuration_->property(role_ + ".pfa", static_cast(0.0)); } if (pfa == 0.0) diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc index db2ab95f8..0132abcb1 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc @@ -44,8 +44,8 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( out_streams_(out_streams) { configuration_ = configuration; - std::string default_item_type = "gr_complex"; - std::string default_dump_filename = "../data/acquisition.dat"; + const std::string default_item_type("gr_complex"); + const std::string default_dump_filename("../data/acquisition.dat"); DLOG(INFO) << "role " << role; @@ -79,12 +79,12 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( // -- Find number of samples per spreading code (4 ms) ----------------- - code_length_ = round( - fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)); + code_length_ = static_cast(round( + fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS))); vector_length_ = code_length_ * static_cast(sampled_ms_ / 4); - int samples_per_ms = code_length_ / 4; + auto samples_per_ms = static_cast(code_length_) / 4; code_ = std::vector>(vector_length_); @@ -132,11 +132,11 @@ void GalileoE1PcpsTongAmbiguousAcquisition::stop_acquisition() void GalileoE1PcpsTongAmbiguousAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", static_cast(0.0)); if (pfa == 0.0) { - pfa = configuration_->property(role_ + ".pfa", 0.0); + pfa = configuration_->property(role_ + ".pfa", static_cast(0.0)); } if (pfa == 0.0) diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc index 728556a08..679896849 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc @@ -50,8 +50,8 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( out_streams_(out_streams) { configuration_ = configuration; - std::string default_item_type = "gr_complex"; - std::string default_dump_filename = "../data/acquisition.dat"; + const std::string default_item_type("gr_complex"); + const std::string default_dump_filename("../data/acquisition.dat"); DLOG(INFO) << "role " << role; @@ -86,7 +86,7 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); // -- Find number of samples per spreading code (1ms)------------------------- - code_length_ = round(static_cast(fs_in_) / GALILEO_E5A_CODE_CHIP_RATE_CPS * static_cast(GALILEO_E5A_CODE_LENGTH_CHIPS)); + code_length_ = static_cast(round(static_cast(fs_in_) / GALILEO_E5A_CODE_CHIP_RATE_CPS * static_cast(GALILEO_E5A_CODE_LENGTH_CHIPS))); vector_length_ = code_length_ * sampled_ms_; @@ -137,11 +137,11 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::stop_acquisition() void GalileoE5aNoncoherentIQAcquisitionCaf::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", static_cast(0.0)); if (pfa == 0.0) { - pfa = configuration_->property(role_ + ".pfa", 0.0); + pfa = configuration_->property(role_ + ".pfa", static_cast(0.0)); } if (pfa == 0.0) diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc index c67c72c38..67c07e068 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc @@ -66,7 +66,7 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition( } code_length_ = static_cast(std::floor(static_cast(acq_parameters_.resampled_fs) / (GALILEO_E5A_CODE_CHIP_RATE_CPS / GALILEO_E5A_CODE_LENGTH_CHIPS))); - vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); + vector_length_ = static_cast(std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2.0 : 1.0)); code_ = std::vector>(vector_length_); sampled_ms_ = acq_parameters_.sampled_ms; @@ -198,11 +198,7 @@ void GalileoE5aPcpsAcquisition::set_state(int state) void GalileoE5aPcpsAcquisition::connect(gr::top_block_sptr top_block __attribute__((unused))) { - if (item_type_ == "gr_complex") - { - // nothing to connect - } - else if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { // nothing to connect } @@ -215,11 +211,7 @@ void GalileoE5aPcpsAcquisition::connect(gr::top_block_sptr top_block __attribute void GalileoE5aPcpsAcquisition::disconnect(gr::top_block_sptr top_block __attribute__((unused))) { - if (item_type_ == "gr_complex") - { - // nothing to disconnect - } - else if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { // nothing to disconnect } diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc index 35dc7bf9e..195f90d75 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc @@ -42,7 +42,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga( out_streams_(out_streams) { pcpsconf_fpga_t acq_parameters; - std::string default_dump_filename = "../data/acquisition.dat"; + const std::string default_dump_filename("../data/acquisition.dat"); DLOG(INFO) << "Role " << role; @@ -166,7 +166,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga( acq_parameters.total_block_exp = configuration->property(role + ".total_block_exp", 13); acq_parameters.num_doppler_bins_step2 = configuration->property(role + ".second_nbins", 4); - acq_parameters.doppler_step2 = configuration->property(role + ".second_doppler_step", 125.0); + acq_parameters.doppler_step2 = configuration->property(role + ".second_doppler_step", static_cast(125.0)); acq_parameters.make_2_steps = configuration->property(role + ".make_two_steps", false); acq_parameters.max_num_acqs = configuration->property(role + ".max_num_acqs", 2); acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters); diff --git a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc index 1eb304381..604c76e8b 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc @@ -61,7 +61,7 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( fs_in_ = acq_parameters_.fs_in; code_length_ = static_cast(std::floor(static_cast(acq_parameters_.resampled_fs) / (GLONASS_L1_CA_CODE_RATE_CPS / GLONASS_L1_CA_CODE_LENGTH_CHIPS))); - vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); + vector_length_ = static_cast(std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2.0 : 1.0)); code_ = std::vector>(vector_length_); sampled_ms_ = acq_parameters_.sampled_ms; @@ -173,11 +173,7 @@ void GlonassL1CaPcpsAcquisition::set_state(int state) void GlonassL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_ == "gr_complex") - { - // nothing to connect - } - else if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { // nothing to connect } @@ -196,11 +192,7 @@ void GlonassL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block) void GlonassL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_ == "gr_complex") - { - // nothing to disconnect - } - else if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { // nothing to disconnect } @@ -221,11 +213,7 @@ void GlonassL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr GlonassL1CaPcpsAcquisition::get_left_block() { - if (item_type_ == "gr_complex") - { - return acquisition_; - } - if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { return acquisition_; } diff --git a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc index f5f280e64..9e3bee695 100644 --- a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc @@ -60,7 +60,7 @@ GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( fs_in_ = acq_parameters_.fs_in; code_length_ = static_cast(std::floor(static_cast(acq_parameters_.resampled_fs) / (GLONASS_L2_CA_CODE_RATE_CPS / GLONASS_L2_CA_CODE_LENGTH_CHIPS))); - vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); + vector_length_ = static_cast(std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2.0 : 1.0)); code_ = std::vector>(vector_length_); sampled_ms_ = acq_parameters_.sampled_ms; @@ -172,11 +172,7 @@ void GlonassL2CaPcpsAcquisition::set_state(int state) void GlonassL2CaPcpsAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_ == "gr_complex") - { - // nothing to connect - } - else if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { // nothing to connect } @@ -197,11 +193,7 @@ void GlonassL2CaPcpsAcquisition::connect(gr::top_block_sptr top_block) void GlonassL2CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_ == "gr_complex") - { - // nothing to disconnect - } - else if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { // nothing to disconnect } @@ -220,11 +212,7 @@ void GlonassL2CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr GlonassL2CaPcpsAcquisition::get_left_block() { - if (item_type_ == "gr_complex") - { - return acquisition_; - } - if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { return acquisition_; } 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 367f77f4b..a866dc44f 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc @@ -63,7 +63,7 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( item_size_ = acq_parameters_.it_size; code_length_ = static_cast(std::floor(static_cast(acq_parameters_.resampled_fs) / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS))); - vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); + vector_length_ = static_cast(std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2.0 : 1.0)); code_ = std::vector>(vector_length_); sampled_ms_ = acq_parameters_.sampled_ms; @@ -187,11 +187,7 @@ void GpsL1CaPcpsAcquisition::set_state(int state) void GpsL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_ == "gr_complex") - { - // nothing to connect - } - else if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { // nothing to connect } @@ -212,11 +208,7 @@ void GpsL1CaPcpsAcquisition::connect(gr::top_block_sptr top_block) void GpsL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_ == "gr_complex") - { - // nothing to disconnect - } - else if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { // nothing to disconnect } @@ -235,11 +227,7 @@ void GpsL1CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr GpsL1CaPcpsAcquisition::get_left_block() { - if (item_type_ == "gr_complex") - { - return acquisition_; - } - if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { return acquisition_; } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc index e05e83b8c..210b85522 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc @@ -38,7 +38,7 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( in_streams_(in_streams), out_streams_(out_streams) { - std::string default_item_type = "gr_complex"; + const std::string default_item_type("gr_complex"); std::string default_dump_filename = "./acquisition.mat"; DLOG(INFO) << "role " << role; @@ -67,7 +67,7 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( acq_parameters.blocking_on_standby = configuration->property(role + ".blocking_on_standby", false); // -- Find number of samples per spreading code ------------------------- - vector_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)); + vector_length_ = static_cast(round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS))); acq_parameters.samples_per_ms = vector_length_; code_ = std::vector>(vector_length_); diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc index dd8c62c1b..5325f3f35 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc @@ -141,7 +141,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( acq_parameters.total_block_exp = configuration->property(role + ".total_block_exp", 10); acq_parameters.num_doppler_bins_step2 = configuration->property(role + ".second_nbins", 4); - acq_parameters.doppler_step2 = configuration->property(role + ".second_doppler_step", 125.0); + acq_parameters.doppler_step2 = configuration->property(role + ".second_doppler_step", static_cast(125.0)); acq_parameters.make_2_steps = configuration->property(role + ".make_two_steps", false); acq_parameters.max_num_acqs = configuration->property(role + ".max_num_acqs", 2); acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters); diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc index cfd699147..9151d765d 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc @@ -37,7 +37,7 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( in_streams_(in_streams), out_streams_(out_streams) { - std::string default_item_type = "gr_complex"; + const std::string default_item_type("gr_complex"); std::string default_dump_filename = "./data/acquisition.dat"; DLOG(INFO) << "role " << role; @@ -57,7 +57,7 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); // --- Find number of samples per spreading code ------------------------- - vector_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)); + vector_length_ = static_cast(round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS))); code_.reserve(vector_length_); diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc index 987cc6308..9a66ba5a5 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc @@ -44,7 +44,7 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( out_streams_(out_streams) { configuration_ = configuration; - std::string default_item_type = "gr_complex"; + const std::string default_item_type("gr_complex"); std::string default_dump_filename = "./data/acquisition.dat"; DLOG(INFO) << "role " << role; @@ -77,7 +77,7 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( default_dump_filename); // -- Find number of samples per spreading code ------------------------- - code_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)); + code_length_ = static_cast(round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS))); vector_length_ = code_length_ * sampled_ms_; @@ -126,11 +126,11 @@ void GpsL1CaPcpsOpenClAcquisition::stop_acquisition() void GpsL1CaPcpsOpenClAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", static_cast(0.0)); if (pfa == 0.0) { - pfa = configuration_->property(role_ + ".pfa", 0.0); + pfa = configuration_->property(role_ + ".pfa", static_cast(0.0)); } if (pfa == 0.0) { diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc index 4d82acfff..65713e24c 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc @@ -45,7 +45,7 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( out_streams_(out_streams) { configuration_ = configuration; - std::string default_item_type = "gr_complex"; + const std::string default_item_type("gr_complex"); std::string default_dump_filename = "./data/acquisition.dat"; DLOG(INFO) << "role " << role; @@ -62,7 +62,7 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4); // -- Find number of samples per spreading code ------------------------- - code_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)); + code_length_ = static_cast(round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS))); /* Calculate the folding factor value based on the calculations */ auto temp = static_cast(ceil(sqrt(log2(code_length_)))); @@ -155,11 +155,11 @@ void GpsL1CaPcpsQuickSyncAcquisition::stop_acquisition() void GpsL1CaPcpsQuickSyncAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", static_cast(0.0)); if (pfa == 0.0) { - pfa = configuration_->property(role_ + ".pfa", 0.0); + pfa = configuration_->property(role_ + ".pfa", static_cast(0.0)); } if (pfa == 0.0) { diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc index 039364eb6..8cb522e9c 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc @@ -44,7 +44,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( out_streams_(out_streams) { configuration_ = configuration; - std::string default_item_type = "gr_complex"; + const std::string default_item_type("gr_complex"); std::string default_dump_filename = "./data/acquisition.dat"; DLOG(INFO) << "role " << role; @@ -68,7 +68,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); // -- Find number of samples per spreading code ------------------------- - code_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)); + code_length_ = static_cast(round(fs_in_ / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS))); vector_length_ = code_length_ * sampled_ms_; @@ -117,11 +117,11 @@ void GpsL1CaPcpsTongAcquisition::stop_acquisition() void GpsL1CaPcpsTongAcquisition::set_threshold(float threshold) { - float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); + float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", static_cast(0.0)); if (pfa == 0.0) { - pfa = configuration_->property(role_ + ".pfa", 0.0); + pfa = configuration_->property(role_ + ".pfa", static_cast(0.0)); } if (pfa == 0.0) { diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc index c2eb579c2..bde01e504 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc @@ -61,7 +61,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( fs_in_ = acq_parameters_.fs_in; code_length_ = static_cast(std::floor(static_cast(acq_parameters_.resampled_fs) / (GPS_L2_M_CODE_RATE_CPS / GPS_L2_M_CODE_LENGTH_CHIPS))); - vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); + vector_length_ = static_cast(std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2.0 : 1.0)); code_ = std::vector>(vector_length_); acquisition_ = pcps_make_acquisition(acq_parameters_); @@ -187,11 +187,7 @@ void GpsL2MPcpsAcquisition::set_state(int state) void GpsL2MPcpsAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_ == "gr_complex") - { - // nothing to connect - } - else if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { // nothing to connect } @@ -212,11 +208,7 @@ void GpsL2MPcpsAcquisition::connect(gr::top_block_sptr top_block) void GpsL2MPcpsAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_ == "gr_complex") - { - // nothing to disconnect - } - else if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { // nothing to disconnect } @@ -235,11 +227,7 @@ void GpsL2MPcpsAcquisition::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr GpsL2MPcpsAcquisition::get_left_block() { - if (item_type_ == "gr_complex") - { - return acquisition_; - } - if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { return acquisition_; } diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc index 26e9d902a..6218e652a 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc @@ -63,7 +63,7 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( } acq_parameters.doppler_max = doppler_max_; - unsigned int code_length = std::round(static_cast(fs_in_) / (GPS_L2_M_CODE_RATE_CPS / static_cast(GPS_L2_M_CODE_LENGTH_CHIPS))); + auto code_length = static_cast(std::round(static_cast(fs_in_) / (GPS_L2_M_CODE_RATE_CPS / static_cast(GPS_L2_M_CODE_LENGTH_CHIPS)))); acq_parameters.code_length = code_length; // The FPGA can only use FFT lengths that are a power of two. float nbits = ceilf(log2f(static_cast(code_length))); diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc index dd46990f5..03504b7e9 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc @@ -60,7 +60,7 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( item_size_ = acq_parameters_.it_size; code_length_ = static_cast(std::floor(static_cast(acq_parameters_.resampled_fs) / (GPS_L5I_CODE_RATE_CPS / GPS_L5I_CODE_LENGTH_CHIPS))); - vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); + vector_length_ = static_cast(std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2.0 : 1.0)); code_ = std::vector>(vector_length_); fs_in_ = acq_parameters_.fs_in; @@ -188,11 +188,7 @@ void GpsL5iPcpsAcquisition::set_state(int state) void GpsL5iPcpsAcquisition::connect(gr::top_block_sptr top_block) { - if (item_type_ == "gr_complex") - { - // nothing to connect - } - else if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { // nothing to connect } @@ -213,11 +209,7 @@ void GpsL5iPcpsAcquisition::connect(gr::top_block_sptr top_block) void GpsL5iPcpsAcquisition::disconnect(gr::top_block_sptr top_block) { - if (item_type_ == "gr_complex") - { - // nothing to disconnect - } - else if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { // nothing to disconnect } @@ -236,11 +228,7 @@ void GpsL5iPcpsAcquisition::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr GpsL5iPcpsAcquisition::get_left_block() { - if (item_type_ == "gr_complex") - { - return acquisition_; - } - if (item_type_ == "cshort") + if (item_type_ == "gr_complex" || item_type_ == "cshort") { return acquisition_; } diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc index d47b10e9c..a62d8577e 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc @@ -144,7 +144,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( acq_parameters.total_block_exp = configuration->property(role + ".total_block_exp", 13); acq_parameters.num_doppler_bins_step2 = configuration->property(role + ".second_nbins", 4); - acq_parameters.doppler_step2 = configuration->property(role + ".second_doppler_step", 125.0); + acq_parameters.doppler_step2 = configuration->property(role + ".second_doppler_step", static_cast(125.0)); acq_parameters.make_2_steps = configuration->property(role + ".make_two_steps", false); acq_parameters.max_num_acqs = configuration->property(role + ".max_num_acqs", 2); acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters); diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc index a11fbb8c6..8055ec37c 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc @@ -240,7 +240,7 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::init() for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) { int doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; - float phase_step_rad = TWO_PI * doppler / static_cast(d_fs_in); + float phase_step_rad = static_cast(TWO_PI) * doppler / static_cast(d_fs_in); std::array _phase{}; volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index].data(), -phase_step_rad, _phase.data(), d_fft_size); } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc index d6af93550..6355155bf 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -82,7 +82,7 @@ pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acqu d_state = 0; d_doppler_bias = 0; d_num_noncoherent_integrations_counter = 0U; - d_consumed_samples = d_acq_parameters.sampled_ms * d_acq_parameters.samples_per_ms * (d_acq_parameters.bit_transition_flag ? 2 : 1); + d_consumed_samples = d_acq_parameters.sampled_ms * d_acq_parameters.samples_per_ms * (d_acq_parameters.bit_transition_flag ? 2.0 : 1.0); if (d_acq_parameters.sampled_ms == d_acq_parameters.ms_per_code) { d_fft_size = d_consumed_samples; @@ -258,11 +258,11 @@ void pcps_acquisition::update_local_carrier(own::span carrier_vector float phase_step_rad; if (d_acq_parameters.use_automatic_resampler) { - phase_step_rad = TWO_PI * freq / static_cast(d_acq_parameters.resampled_fs); + phase_step_rad = static_cast(TWO_PI) * freq / static_cast(d_acq_parameters.resampled_fs); } else { - phase_step_rad = TWO_PI * freq / static_cast(d_acq_parameters.fs_in); + phase_step_rad = static_cast(TWO_PI) * freq / static_cast(d_acq_parameters.fs_in); } std::array _phase{}; volk_gnsssdr_s32f_sincos_32fc(carrier_vector.data(), -phase_step_rad, _phase.data(), carrier_vector.size()); @@ -531,8 +531,8 @@ float pcps_acquisition::max_to_input_power_statistic(uint32_t& indext, int32_t& indext = index_time; if (!d_step_two) { - int index_opp = (index_doppler + d_num_doppler_bins / 2) % d_num_doppler_bins; - d_input_power = std::accumulate(d_magnitude_grid[index_opp].data(), d_magnitude_grid[index_opp].data() + effective_fft_size, 0.0) / effective_fft_size / 2.0 / d_num_noncoherent_integrations_counter; + auto index_opp = (index_doppler + d_num_doppler_bins / 2) % d_num_doppler_bins; + d_input_power = std::accumulate(d_magnitude_grid[index_opp].data(), d_magnitude_grid[index_opp].data() + effective_fft_size, static_cast(0.0)) / static_cast(effective_fft_size / 2.0 / d_num_noncoherent_integrations_counter); doppler = -static_cast(doppler_max) + d_doppler_center + doppler_step * static_cast(index_doppler); } else @@ -891,12 +891,12 @@ void pcps_acquisition::calculate_threshold() return; } - int effective_fft_size = (d_acq_parameters.bit_transition_flag ? (d_fft_size / 2) : d_fft_size); + auto effective_fft_size = static_cast(d_acq_parameters.bit_transition_flag ? (d_fft_size / 2) : d_fft_size); int num_doppler_bins = (d_step_two ? d_num_doppler_bins_step2 : d_num_doppler_bins); int num_bins = effective_fft_size * num_doppler_bins; - d_threshold = 2.0 * boost::math::gamma_p_inv(2.0 * d_acq_parameters.max_dwells, std::pow(1.0 - pfa, 1.0 / static_cast(num_bins))); + d_threshold = static_cast(2.0 * boost::math::gamma_p_inv(2.0 * d_acq_parameters.max_dwells, std::pow(1.0 - pfa, 1.0 / static_cast(num_bins)))); } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc index 6821d8103..b62cb722e 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc @@ -175,7 +175,7 @@ void pcps_cccwsr_acquisition_cc::init() for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) { int32_t doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; - float phase_step_rad = TWO_PI * doppler / static_cast(d_fs_in); + float phase_step_rad = static_cast(TWO_PI) * doppler / static_cast(d_fs_in); std::array _phase{}; volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index].data(), -phase_step_rad, _phase.data(), d_fft_size); } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc index 3cc3f4c07..8e882cb1f 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc @@ -195,7 +195,7 @@ void pcps_quicksync_acquisition_cc::init() for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) { int32_t doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; - float phase_step_rad = TWO_PI * doppler / static_cast(d_fs_in); + float phase_step_rad = static_cast(TWO_PI) * doppler / static_cast(d_fs_in); std::array _phase{}; volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index].data(), -phase_step_rad, _phase.data(), d_samples_per_code * d_folding_factor); } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc index f46028292..869db0c16 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc @@ -182,7 +182,7 @@ void pcps_tong_acquisition_cc::init() for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) { int32_t doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; - float phase_step_rad = TWO_PI * doppler / static_cast(d_fs_in); + float phase_step_rad = static_cast(TWO_PI) * doppler / static_cast(d_fs_in); std::array _phase{}; volk_gnsssdr_s32f_sincos_32fc(d_grid_doppler_wipeoffs[doppler_index].data(), -phase_step_rad, _phase.data(), d_fft_size); } diff --git a/src/algorithms/acquisition/libs/acq_conf.cc b/src/algorithms/acquisition/libs/acq_conf.cc index 54c658a4e..c918687ab 100644 --- a/src/algorithms/acquisition/libs/acq_conf.cc +++ b/src/algorithms/acquisition/libs/acq_conf.cc @@ -148,7 +148,7 @@ void Acq_Conf::ConfigureAutomaticResampler(double opt_freq) void Acq_Conf::SetDerivedParams() { - samples_per_ms = static_cast(resampled_fs) * 0.001; + samples_per_ms = static_cast(resampled_fs) * 0.001F; samples_per_chip = static_cast(std::ceil(static_cast(resampled_fs) / chips_per_second)); samples_per_code = samples_per_ms * ms_per_code; } diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index 0429de568..3c0321857 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -79,10 +79,10 @@ Channel::Channel(const ConfigurationInterface* configuration, uint32_t channel, acq_->set_doppler_step(doppler_step); - float threshold = configuration->property("Acquisition_" + implementation_ + std::to_string(channel_) + ".threshold", 0.0); + float threshold = configuration->property("Acquisition_" + implementation_ + std::to_string(channel_) + ".threshold", static_cast(0.0)); if (threshold == 0.0) { - threshold = configuration->property("Acquisition_" + implementation_ + ".threshold", 0.0); + threshold = configuration->property("Acquisition_" + implementation_ + ".threshold", static_cast(0.0)); } acq_->set_threshold(threshold); diff --git a/src/algorithms/channel/adapters/channel.h b/src/algorithms/channel/adapters/channel.h index 6d5b386a9..9e23f4a19 100644 --- a/src/algorithms/channel/adapters/channel.h +++ b/src/algorithms/channel/adapters/channel.h @@ -78,9 +78,9 @@ public: void assist_acquisition_doppler(double Carrier_Doppler_hz) override; - inline std::shared_ptr acquisition() { return acq_; } - inline std::shared_ptr tracking() { return trk_; } - inline std::shared_ptr telemetry() { return nav_; } + inline std::shared_ptr acquisition() const { return acq_; } + inline std::shared_ptr tracking() const { return trk_; } + inline std::shared_ptr telemetry() const { return nav_; } void msg_handler_events(pmt::pmt_t msg); private: diff --git a/src/algorithms/data_type_adapter/adapters/byte_to_short.cc b/src/algorithms/data_type_adapter/adapters/byte_to_short.cc index df4775312..8b76dcfda 100644 --- a/src/algorithms/data_type_adapter/adapters/byte_to_short.cc +++ b/src/algorithms/data_type_adapter/adapters/byte_to_short.cc @@ -26,9 +26,9 @@ ByteToShort::ByteToShort(const ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams) { - std::string default_input_item_type = "byte"; - std::string default_output_item_type = "short"; - std::string default_dump_filename = "../data/input_filter.dat"; + const std::string default_input_item_type("byte"); + const std::string default_output_item_type("short"); + const std::string default_dump_filename("../data/input_filter.dat"); DLOG(INFO) << "role " << role_; diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.cc b/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.cc index 2dbb8f638..082c87370 100644 --- a/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.cc +++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.cc @@ -27,9 +27,9 @@ IbyteToCbyte::IbyteToCbyte(const ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { - std::string default_input_item_type = "byte"; - std::string default_output_item_type = "lv_8sc_t"; - std::string default_dump_filename = "../data/input_filter.dat"; + const std::string default_input_item_type("byte"); + const std::string default_output_item_type("lv_8sc_t"); + const std::string default_dump_filename("../data/input_filter.dat"); DLOG(INFO) << "role " << role_; diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.cc b/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.cc index 871f20995..8c23ad5d4 100644 --- a/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.cc +++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.cc @@ -25,9 +25,9 @@ IbyteToComplex::IbyteToComplex(const ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { - std::string default_input_item_type = "byte"; - std::string default_output_item_type = "gr_complex"; - std::string default_dump_filename = "../data/input_filter.dat"; + const std::string default_input_item_type("byte"); + const std::string default_output_item_type("gr_complex"); + const std::string default_dump_filename("../data/input_filter.dat"); DLOG(INFO) << "role " << role_; diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.cc b/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.cc index 8fd267237..57e8ed345 100644 --- a/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.cc +++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.cc @@ -27,9 +27,9 @@ IbyteToCshort::IbyteToCshort(const ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { - std::string default_input_item_type = "byte"; - std::string default_output_item_type = "cshort"; - std::string default_dump_filename = "../data/input_filter.dat"; + const std::string default_input_item_type("byte"); + const std::string default_output_item_type("cshort"); + const std::string default_dump_filename("../data/input_filter.dat"); DLOG(INFO) << "role " << role_; diff --git a/src/algorithms/data_type_adapter/adapters/ishort_to_complex.cc b/src/algorithms/data_type_adapter/adapters/ishort_to_complex.cc index 053512839..c73b0509c 100644 --- a/src/algorithms/data_type_adapter/adapters/ishort_to_complex.cc +++ b/src/algorithms/data_type_adapter/adapters/ishort_to_complex.cc @@ -25,9 +25,9 @@ IshortToComplex::IshortToComplex(const ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { - std::string default_input_item_type = "short"; - std::string default_output_item_type = "gr_complex"; - std::string default_dump_filename = "../data/input_filter.dat"; + const std::string default_input_item_type("short"); + const std::string default_output_item_type("gr_complex"); + const std::string default_dump_filename("../data/input_filter.dat"); DLOG(INFO) << "role " << role_; diff --git a/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.cc b/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.cc index 67ce39bb3..f78731be8 100644 --- a/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.cc +++ b/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.cc @@ -27,9 +27,9 @@ IshortToCshort::IshortToCshort(const ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { - std::string default_input_item_type = "short"; - std::string default_output_item_type = "cshort"; - std::string default_dump_filename = "../data/input_filter.dat"; + const std::string default_input_item_type("short"); + const std::string default_output_item_type("cshort"); + const std::string default_dump_filename("../data/input_filter.dat"); DLOG(INFO) << "role " << role_; diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.cc b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.cc index 05e2b5ea2..59d0afb5e 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.cc +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.cc @@ -35,7 +35,7 @@ interleaved_byte_to_complex_byte::interleaved_byte_to_complex_byte() : sync_deci gr::io_signature::make(1, 1, sizeof(lv_8sc_t)), // lv_8sc_t is a Volk's typedef for std::complex 2) { - const int alignment_multiple = volk_get_alignment() / sizeof(lv_8sc_t); + const auto alignment_multiple = static_cast(volk_get_alignment() / sizeof(lv_8sc_t)); set_alignment(std::max(1, alignment_multiple)); } diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.cc b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.cc index e6b4649c7..76c982760 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.cc +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.cc @@ -35,7 +35,7 @@ interleaved_byte_to_complex_short::interleaved_byte_to_complex_short() : sync_de gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), // lv_16sc_t is a Volk's typedef for std::complex 2) { - const int alignment_multiple = volk_get_alignment() / sizeof(lv_16sc_t); + const auto alignment_multiple = static_cast(volk_get_alignment() / sizeof(lv_16sc_t)); set_alignment(std::max(1, alignment_multiple)); } diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.cc b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.cc index af528ff91..29a8a0285 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.cc +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.cc @@ -35,7 +35,7 @@ interleaved_short_to_complex_short::interleaved_short_to_complex_short() : sync_ gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), // lv_16sc_t is a Volk's typedef for std::complex 2) { - const int alignment_multiple = volk_get_alignment() / sizeof(lv_16sc_t); + const auto alignment_multiple = static_cast(volk_get_alignment() / sizeof(lv_16sc_t)); set_alignment(std::max(1, alignment_multiple)); } diff --git a/src/algorithms/input_filter/adapters/beamformer_filter.cc b/src/algorithms/input_filter/adapters/beamformer_filter.cc index ac0f127c6..7e436c016 100644 --- a/src/algorithms/input_filter/adapters/beamformer_filter.cc +++ b/src/algorithms/input_filter/adapters/beamformer_filter.cc @@ -28,8 +28,8 @@ BeamformerFilter::BeamformerFilter( const ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, unsigned int out_stream) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { - std::string default_item_type = "gr_complex"; - std::string default_dump_file = "./data/input_filter.dat"; + const std::string default_item_type("gr_complex"); + const std::string default_dump_file("./data/input_filter.dat"); item_type_ = configuration->property(role + ".item_type", default_item_type); dump_ = configuration->property(role + ".dump", false); DLOG(INFO) << "dump_ is " << dump_; diff --git a/src/algorithms/input_filter/adapters/fir_filter.cc b/src/algorithms/input_filter/adapters/fir_filter.cc index 8c0566bed..118402859 100644 --- a/src/algorithms/input_filter/adapters/fir_filter.cc +++ b/src/algorithms/input_filter/adapters/fir_filter.cc @@ -132,17 +132,17 @@ FirFilter::FirFilter(const ConfigurationInterface* configuration, std::string ro void FirFilter::init() { - std::string default_input_item_type = "gr_complex"; - std::string default_output_item_type = "gr_complex"; - std::string default_taps_item_type = "float"; - std::string default_dump_filename = "../data/input_filter.dat"; - int default_number_of_taps = 6; - unsigned int default_number_of_bands = 2; - std::vector default_bands = {0.0, 0.4, 0.6, 1.0}; - std::vector default_ampl = {1.0, 1.0, 0.0, 0.0}; - std::vector default_error_w = {1.0, 1.0}; - std::string default_filter_type = "bandpass"; - int default_grid_density = 16; + const std::string default_input_item_type("gr_complex"); + const std::string default_output_item_type("gr_complex"); + const std::string default_taps_item_type("float"); + const std::string default_dump_filename("../data/input_filter.dat"); + const int default_number_of_taps = 6; + const unsigned int default_number_of_bands = 2; + const std::vector default_bands = {0.0, 0.4, 0.6, 1.0}; + const std::vector default_ampl = {1.0, 1.0, 0.0, 0.0}; + const std::vector default_error_w = {1.0, 1.0}; + const std::string default_filter_type("bandpass"); + const int default_grid_density = 16; DLOG(INFO) << "role " << role_; diff --git a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc index 8e5d34cf1..7f015f78d 100644 --- a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc +++ b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc @@ -31,20 +31,20 @@ FreqXlatingFirFilter::FreqXlatingFirFilter(const ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams) { - std::string default_input_item_type = "gr_complex"; - std::string default_output_item_type = "gr_complex"; - std::string default_taps_item_type = "float"; - std::string default_dump_filename = "../data/input_filter.dat"; - double default_intermediate_freq = 0.0; - double default_sampling_freq = 4000000.0; - int default_number_of_taps = 6; - unsigned int default_number_of_bands = 2; - std::vector default_bands = {0.0, 0.4, 0.6, 1.0}; - std::vector default_ampl = {1.0, 1.0, 0.0, 0.0}; - std::vector default_error_w = {1.0, 1.0}; - std::string default_filter_type = "bandpass"; - int default_grid_density = 16; - int default_decimation_factor = 1; + const std::string default_input_item_type("gr_complex"); + const std::string default_output_item_type("gr_complex"); + const std::string default_taps_item_type("float"); + const std::string default_dump_filename("../data/input_filter.dat"); + const double default_intermediate_freq = 0.0; + const double default_sampling_freq = 4000000.0; + const int default_number_of_taps = 6; + const unsigned int default_number_of_bands = 2; + const std::vector default_bands = {0.0, 0.4, 0.6, 1.0}; + const std::vector default_ampl = {1.0, 1.0, 0.0, 0.0}; + const std::vector default_error_w = {1.0, 1.0}; + const std::string default_filter_type("bandpass"); + const int default_grid_density = 16; + const int default_decimation_factor = 1; DLOG(INFO) << "role " << role_; diff --git a/src/algorithms/input_filter/adapters/notch_filter.cc b/src/algorithms/input_filter/adapters/notch_filter.cc index 7e275cf96..11df6f345 100644 --- a/src/algorithms/input_filter/adapters/notch_filter.cc +++ b/src/algorithms/input_filter/adapters/notch_filter.cc @@ -28,27 +28,22 @@ NotchFilter::NotchFilter(const ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { - float pfa; - float default_pfa = 0.001; - float p_c_factor; - float default_p_c_factor = 0.9; - int length_; - int default_length_ = 32; - int n_segments_est; - int default_n_segments_est = 12500; - int n_segments_reset; - int default_n_segments_reset = 5000000; - std::string default_item_type = "gr_complex"; - std::string default_dump_file = "./data/input_filter.dat"; + const float default_pfa = 0.001; + const float default_p_c_factor = 0.9; + const int default_length_ = 32; + const int default_n_segments_est = 12500; + const int default_n_segments_reset = 5000000; + const std::string default_item_type("gr_complex"); + const std::string default_dump_file("./data/input_filter.dat"); item_type_ = configuration->property(role + ".item_type", default_item_type); dump_ = configuration->property(role + ".dump", false); DLOG(INFO) << "dump_ is " << dump_; dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file); - pfa = configuration->property(role + ".pfa", default_pfa); - p_c_factor = configuration->property(role + ".p_c_factor", default_p_c_factor); - length_ = configuration->property(role + ".length", default_length_); - n_segments_est = configuration->property(role + ".segments_est", default_n_segments_est); - n_segments_reset = configuration->property(role + ".segments_reset", default_n_segments_reset); + float pfa = configuration->property(role + ".pfa", default_pfa); + float p_c_factor = configuration->property(role + ".p_c_factor", default_p_c_factor); + int length_ = configuration->property(role + ".length", default_length_); + int n_segments_est = configuration->property(role + ".segments_est", default_n_segments_est); + int n_segments_reset = configuration->property(role + ".segments_reset", default_n_segments_reset); if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); diff --git a/src/algorithms/input_filter/adapters/notch_filter_lite.cc b/src/algorithms/input_filter/adapters/notch_filter_lite.cc index da06cf275..73e13a6ae 100644 --- a/src/algorithms/input_filter/adapters/notch_filter_lite.cc +++ b/src/algorithms/input_filter/adapters/notch_filter_lite.cc @@ -29,32 +29,26 @@ NotchFilterLite::NotchFilterLite(const ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { - float p_c_factor; - float default_p_c_factor = 0.9; - float pfa; - float default_pfa = 0.001; - int length_; - int default_length_ = 32; - int n_segments_est; - int default_n_segments_est = 12500; - int n_segments_reset; - int default_n_segments_reset = 5000000; - float default_samp_freq = 4000000; + const float default_p_c_factor = 0.9; + const float default_pfa = 0.001; + const int default_length_ = 32; + const int default_n_segments_est = 12500; + const int default_n_segments_reset = 5000000; + const float default_samp_freq = 4000000; + const std::string default_item_type("gr_complex"); + const std::string default_dump_file("./data/input_filter.dat"); float samp_freq = configuration->property("SignalSource.sampling_frequency", default_samp_freq); - float default_coeff_rate = samp_freq * 0.1; - float coeff_rate; - std::string default_item_type = "gr_complex"; - std::string default_dump_file = "./data/input_filter.dat"; + float default_coeff_rate = samp_freq * 0.1F; item_type_ = configuration->property(role + ".item_type", default_item_type); dump_ = configuration->property(role + ".dump", false); DLOG(INFO) << "dump_ is " << dump_; dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file); - p_c_factor = configuration->property(role + ".p_c_factor", default_p_c_factor); - pfa = configuration->property(role + ".pfa", default_pfa); - coeff_rate = configuration->property(role + ".coeff_rate", default_coeff_rate); - length_ = configuration->property(role + ".length", default_length_); - n_segments_est = configuration->property(role + ".segments_est", default_n_segments_est); - n_segments_reset = configuration->property(role + ".segments_reset", default_n_segments_reset); + float p_c_factor = configuration->property(role + ".p_c_factor", default_p_c_factor); + float pfa = configuration->property(role + ".pfa", default_pfa); + float coeff_rate = configuration->property(role + ".coeff_rate", default_coeff_rate); + int length_ = configuration->property(role + ".length", default_length_); + int n_segments_est = configuration->property(role + ".segments_est", default_n_segments_est); + int n_segments_reset = configuration->property(role + ".segments_reset", default_n_segments_reset); int n_segments_coeff = static_cast((samp_freq / coeff_rate) / static_cast(length_)); n_segments_coeff = std::max(1, n_segments_coeff); if (item_type_ == "gr_complex") diff --git a/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc b/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc index 482531f04..97eac2b0c 100644 --- a/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc +++ b/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc @@ -32,9 +32,9 @@ PulseBlankingFilter::PulseBlankingFilter(const ConfigurationInterface* configura { size_t item_size; xlat_ = false; - std::string default_input_item_type = "gr_complex"; - std::string default_output_item_type = "gr_complex"; - std::string default_dump_filename = "../data/input_filter.dat"; + const std::string default_input_item_type("gr_complex"); + const std::string default_output_item_type("gr_complex"); + const std::string default_dump_filename("../data/input_filter.dat"); DLOG(INFO) << "role " << role_; @@ -42,13 +42,13 @@ PulseBlankingFilter::PulseBlankingFilter(const ConfigurationInterface* configura output_item_type_ = configuration->property(role_ + ".output_item_type", default_output_item_type); dump_ = configuration->property(role_ + ".dump", false); dump_filename_ = configuration->property(role_ + ".dump_filename", default_dump_filename); - float default_pfa_ = 0.04; + const float default_pfa_ = 0.04; float pfa = configuration->property(role_ + ".pfa", default_pfa_); - int default_length_ = 32; + const int default_length_ = 32; int length_ = configuration->property(role_ + ".length", default_length_); - int default_n_segments_est = 12500; + const int default_n_segments_est = 12500; int n_segments_est = configuration->property(role_ + ".segments_est", default_n_segments_est); - int default_n_segments_reset = 5000000; + const int default_n_segments_reset = 5000000; int n_segments_reset = configuration->property(role_ + ".segments_reset", default_n_segments_reset); if (input_item_type_ == "gr_complex") { @@ -62,17 +62,17 @@ PulseBlankingFilter::PulseBlankingFilter(const ConfigurationInterface* configura item_size = sizeof(gr_complex); // avoids uninitialization input_size_ = sizeof(gr_complex); // avoids uninitialization } - double default_if = 0.0; + const double default_if = 0.0; double if_aux = configuration->property(role_ + ".if", default_if); double if_ = configuration->property(role_ + ".IF", if_aux); if (std::abs(if_) > 1.0) { xlat_ = true; - double default_sampling_freq = 4000000.0; + const double default_sampling_freq = 4000000.0; double sampling_freq_ = configuration->property(role_ + ".sampling_frequency", default_sampling_freq); - double default_bw = 2000000.0; + const double default_bw = 2000000.0; double bw_ = configuration->property(role_ + ".bw", default_bw); - double default_tw = bw_ / 10.0; + const double default_tw = bw_ / 10.0; double tw_ = configuration->property(role_ + ".tw", default_tw); const std::vector taps = gr::filter::firdes::low_pass(1.0, sampling_freq_, bw_, tw_); freq_xlating_ = gr::filter::freq_xlating_fir_filter_ccf::make(1, taps, if_, sampling_freq_); diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc index 0e14da02d..8cea79651 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -91,7 +92,7 @@ int Notch::general_work(int noutput_items, gr_vector_int &ninput_items __attribu d_fft->execute(); volk_32fc_s32f_power_spectrum_32f(power_spect.data(), d_fft->get_outbuf(), 1.0, length_); volk_32f_s32f_calc_spectral_noise_floor_32f(&sig2dB, power_spect.data(), 15.0, length_); - sig2lin = std::pow(10.0, (sig2dB / 10.0)) / (static_cast(n_deg_fred)); + sig2lin = std::pow(10.0F, (sig2dB / 10.0F)) / (static_cast(n_deg_fred)); noise_pow_est = (static_cast(n_segments) * noise_pow_est + sig2lin) / (static_cast(n_segments + 1)); memcpy(out, in, sizeof(gr_complex) * length_); } @@ -103,13 +104,13 @@ int Notch::general_work(int noutput_items, gr_vector_int &ninput_items __attribu if (filter_state_ == false) { filter_state_ = true; - last_out = gr_complex(0, 0); + last_out = gr_complex(0.0, 0.0); } volk_32fc_x2_multiply_conjugate_32fc(c_samples.data(), in, (in - 1), length_); volk_32fc_s32f_atan2_32f(angle_.data(), c_samples.data(), static_cast(1.0), length_); for (int32_t aux = 0; aux < length_; aux++) { - z_0 = std::exp(gr_complex(0, 1) * (*(angle_.data() + aux))); + z_0 = std::exp(gr_complex(0.0, 1.0) * (*(angle_.data() + aux))); *(out + aux) = *(in + aux) - z_0 * (*(in + aux - 1)) + p_c_factor * z_0 * last_out; last_out = *(out + aux); } diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc index 3f2ee6ee6..b41f1a1a1 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -96,7 +97,7 @@ int NotchLite::general_work(int noutput_items, gr_vector_int &ninput_items __att d_fft->execute(); volk_32fc_s32f_power_spectrum_32f(power_spect.data(), d_fft->get_outbuf(), 1.0, length_); volk_32f_s32f_calc_spectral_noise_floor_32f(&sig2dB, power_spect.data(), 15.0, length_); - sig2lin = std::pow(10.0, (sig2dB / 10.0)) / static_cast(n_deg_fred); + sig2lin = std::pow(10.0F, (sig2dB / 10.0F)) / static_cast(n_deg_fred); noise_pow_est = (static_cast(n_segments) * noise_pow_est + sig2lin) / static_cast(n_segments + 1); memcpy(out, in, sizeof(gr_complex) * length_); } @@ -117,7 +118,7 @@ int NotchLite::general_work(int noutput_items, gr_vector_int &ninput_items __att volk_32fc_s32f_atan2_32f(&angle1, &c_samples1, static_cast(1.0), 1); volk_32fc_x2_multiply_conjugate_32fc(&c_samples2, (in + length_ - 1), (in + length_ - 2), 1); volk_32fc_s32f_atan2_32f(&angle2, &c_samples2, static_cast(1.0), 1); - float angle_ = (angle1 + angle2) / 2.0; + float angle_ = (angle1 + angle2) / 2.0F; z_0 = std::exp(gr_complex(0, 1) * angle_); } for (int32_t aux = 0; aux < length_; aux++) diff --git a/src/algorithms/libs/cshort_to_float_x2.cc b/src/algorithms/libs/cshort_to_float_x2.cc index 485fe192c..82e493397 100644 --- a/src/algorithms/libs/cshort_to_float_x2.cc +++ b/src/algorithms/libs/cshort_to_float_x2.cc @@ -34,7 +34,7 @@ cshort_to_float_x2::cshort_to_float_x2() : sync_block("cshort_to_float_x2", gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), // lv_8sc_t is a Volk's typedef for std::complex gr::io_signature::make(2, 2, sizeof(float))) { - const int alignment_multiple = volk_get_alignment() / sizeof(lv_16sc_t); + const auto alignment_multiple = static_cast(volk_get_alignment() / sizeof(lv_16sc_t)); set_alignment(std::max(1, alignment_multiple)); } diff --git a/src/algorithms/libs/pass_through.cc b/src/algorithms/libs/pass_through.cc index cd1f549c9..20cd85349 100644 --- a/src/algorithms/libs/pass_through.cc +++ b/src/algorithms/libs/pass_through.cc @@ -34,7 +34,7 @@ Pass_Through::Pass_Through(const ConfigurationInterface* configuration, const st in_streams_(in_streams), out_streams_(out_streams) { - std::string default_item_type = "gr_complex"; + const std::string default_item_type("gr_complex"); std::string input_type = configuration->property(role + ".input_item_type", default_item_type); std::string output_type = configuration->property(role + ".output_item_type", default_item_type); if (input_type != output_type) diff --git a/src/algorithms/libs/rtklib/rtklib_conversions.cc b/src/algorithms/libs/rtklib/rtklib_conversions.cc index 7b111e023..cc0f0eaf2 100644 --- a/src/algorithms/libs/rtklib/rtklib_conversions.cc +++ b/src/algorithms/libs/rtklib/rtklib_conversions.cc @@ -128,7 +128,7 @@ obsd_t insert_obs_to_rtklib(obsd_t& rtklib_obs, const Gnss_Synchro& gnss_synchro geph_t eph_to_rtklib(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const Glonass_Gnav_Utc_Model& gnav_clock_model) { - double week; + int week; double sec; int adj_week; geph_t rtklib_sat = {0, 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, 0.0, 0.0, 0.0}; diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc index 0a906dc81..c25247f39 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc @@ -555,17 +555,11 @@ void hybrid_observables_gs::smooth_pseudoranges(std::vector &data) switch (d_mapStringValues[it->Signal]) { case evGPS_1C: - wavelength_m = SPEED_OF_LIGHT_M_S / FREQ1; - break; - case evGPS_L5: - wavelength_m = SPEED_OF_LIGHT_M_S / FREQ5; - break; case evSBAS_1C: - wavelength_m = SPEED_OF_LIGHT_M_S / FREQ1; - break; case evGAL_1B: wavelength_m = SPEED_OF_LIGHT_M_S / FREQ1; break; + case evGPS_L5: case evGAL_5X: wavelength_m = SPEED_OF_LIGHT_M_S / FREQ5; break; @@ -626,7 +620,7 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused) { d_Rx_clock_buffer.push_back(in[d_nchannels_in - 1][0].Tracking_sample_counter); // Consume one item from the clock channel (last of the input channels) - consume(d_nchannels_in - 1, 1); + consume(static_cast(d_nchannels_in) - 1, 1); } // Push the tracking observables into buffers to allow the observable interpolation at the desired Rx clock diff --git a/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc b/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc index cb850ada0..a45308915 100644 --- a/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc +++ b/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc @@ -35,12 +35,10 @@ DirectResamplerConditioner::DirectResamplerConditioner( const ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, unsigned int out_stream) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { - std::string default_item_type = "short"; - std::string default_dump_file = "./data/signal_conditioner.dat"; - double fs_in_deprecated; - double fs_in; - fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000.0); - fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + const std::string default_item_type("short"); + const std::string default_dump_file("./data/signal_conditioner.dat"); + double fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000.0); + double fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); sample_freq_in_ = configuration->property(role_ + ".sample_freq_in", 4000000.0); sample_freq_out_ = configuration->property(role_ + ".sample_freq_out", fs_in); if (std::fabs(fs_in - sample_freq_out_) > std::numeric_limits::epsilon()) diff --git a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc index 5d29cb9c7..318fcb4e6 100644 --- a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc +++ b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc @@ -30,12 +30,10 @@ MmseResamplerConditioner::MmseResamplerConditioner( const ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, unsigned int out_stream) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { - std::string default_item_type = "gr_complex"; - std::string default_dump_file = "./data/signal_conditioner.dat"; - double fs_in_deprecated; - double fs_in; - fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000.0); - fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + const std::string default_item_type("gr_complex"); + const std::string default_dump_file("./data/signal_conditioner.dat"); + double fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000.0); + double fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); sample_freq_in_ = configuration->property(role_ + ".sample_freq_in", 4000000.0); sample_freq_out_ = configuration->property(role_ + ".sample_freq_out", fs_in); if (std::fabs(fs_in - sample_freq_out_) > std::numeric_limits::epsilon()) @@ -63,9 +61,9 @@ MmseResamplerConditioner::MmseResamplerConditioner( fir_filter_ccf_ = gr::filter::fir_filter_ccf::make(1, taps); #ifdef GR_GREATER_38 - resampler_ = gr::filter::mmse_resampler_cc::make(0.0, sample_freq_in_ / sample_freq_out_); + resampler_ = gr::filter::mmse_resampler_cc::make(0.0, static_cast(sample_freq_in_ / sample_freq_out_)); #else - resampler_ = gr::filter::fractional_resampler_cc::make(0.0, sample_freq_in_ / sample_freq_out_); + resampler_ = gr::filter::fractional_resampler_cc::make(0.0, static_cast(sample_freq_in_ / sample_freq_out_)); #endif DLOG(INFO) << "sample_freq_in " << sample_freq_in_; DLOG(INFO) << "sample_freq_out" << sample_freq_out_; diff --git a/src/algorithms/signal_generator/adapters/signal_generator.cc b/src/algorithms/signal_generator/adapters/signal_generator.cc index 258939a75..86d05f666 100644 --- a/src/algorithms/signal_generator/adapters/signal_generator.cc +++ b/src/algorithms/signal_generator/adapters/signal_generator.cc @@ -36,7 +36,7 @@ SignalGenerator::SignalGenerator(const ConfigurationInterface* configuration, unsigned int out_stream, Concurrent_Queue* queue __attribute__((unused))) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { - std::string default_item_type = "gr_complex"; + const std::string default_item_type("gr_complex"); std::string default_dump_file = "./data/gen_source.dat"; std::string default_system = "G"; std::string default_signal = "1C"; diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc index f21812ed9..0c41eb84c 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc @@ -75,8 +75,8 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(const ConfigurationInterface *con { filter_source_ = configuration->property(role + ".filter_source", std::string("Off")); } - Fpass_ = configuration->property(role + ".Fpass", 0.0); - Fstop_ = configuration->property(role + ".Fstop", 0.0); + Fpass_ = configuration->property(role + ".Fpass", static_cast(0.0)); + Fstop_ = configuration->property(role + ".Fstop", static_cast(0.0)); enable_dds_lo_ = configuration->property(role + ".enable_dds_lo", false); freq_dds_tx_hz_ = configuration->property(role + ".freq_dds_tx_hz", static_cast(10000)); freq_rf_tx_hz_ = configuration->property(role + ".freq_rf_tx_hz", static_cast(GPS_L1_FREQ_HZ - GPS_L5_FREQ_HZ - freq_dds_tx_hz_)); diff --git a/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc b/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc index 42ddd1c3a..b0549f9d3 100644 --- a/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc +++ b/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc @@ -32,16 +32,15 @@ CustomUDPSignalSource::CustomUDPSignalSource(const ConfigurationInterface* confi Concurrent_Queue* queue __attribute__((unused))) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { // DUMP PARAMETERS - std::string empty = ""; - std::string default_dump_file = "./data/signal_source.dat"; - std::string default_item_type = "gr_complex"; + const std::string default_dump_file("./data/signal_source.dat"); + const std::string default_item_type("gr_complex"); dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file); // network PARAMETERS - std::string default_capture_device = "eth0"; - std::string default_address = "127.0.0.1"; - int default_port = 1234; + const std::string default_capture_device("eth0"); + const std::string default_address("127.0.0.1"); + const int default_port = 1234; std::string address = configuration->property(role + ".origin_address", default_address); std::string capture_device = configuration->property(role + ".capture_device", default_capture_device); int port = configuration->property(role + ".port", default_port); @@ -51,7 +50,7 @@ CustomUDPSignalSource::CustomUDPSignalSource(const ConfigurationInterface* confi channels_in_udp_ = configuration->property(role + ".channels_in_udp", 1); IQ_swap_ = configuration->property(role + ".IQ_swap", false); - std::string default_sample_type = "cbyte"; + const std::string default_sample_type("cbyte"); std::string sample_type = configuration->property(role + ".sample_type", default_sample_type); item_type_ = configuration->property(role + ".item_type", default_item_type); // output item size is always gr_complex diff --git a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc index c2ffb9e06..6a8ae6abf 100644 --- a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc +++ b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc @@ -37,8 +37,8 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(const ConfigurationInterface *configu const std::string &role, unsigned int in_stream, unsigned int out_stream, Concurrent_Queue *queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { - std::string default_item_type = "gr_complex"; - std::string default_dump_file = "./data/signal_source.dat"; + const std::string default_item_type("gr_complex"); + const std::string default_dump_file("./data/signal_source.dat"); std::string default_gain_mode("slow_attack"); double default_tx_attenuation_db = -10.0; uri_ = configuration->property(role + ".device_address", std::string("192.168.2.1")); diff --git a/src/algorithms/signal_source/adapters/labsat_signal_source.cc b/src/algorithms/signal_source/adapters/labsat_signal_source.cc index e27b98857..0c34bdc49 100644 --- a/src/algorithms/signal_source/adapters/labsat_signal_source.cc +++ b/src/algorithms/signal_source/adapters/labsat_signal_source.cc @@ -28,7 +28,7 @@ LabsatSignalSource::LabsatSignalSource(const ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, unsigned int out_stream, Concurrent_Queue* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { - std::string default_item_type = "gr_complex"; + const std::string default_item_type("gr_complex"); std::string default_dump_file = "./labsat_output.dat"; item_type_ = configuration->property(role + ".item_type", default_item_type); dump_ = configuration->property(role + ".dump", false); diff --git a/src/algorithms/signal_source/adapters/multichannel_file_signal_source.cc b/src/algorithms/signal_source/adapters/multichannel_file_signal_source.cc index f8507a673..28bad9a42 100644 --- a/src/algorithms/signal_source/adapters/multichannel_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/multichannel_file_signal_source.cc @@ -44,7 +44,7 @@ MultichannelFileSignalSource::MultichannelFileSignalSource(const ConfigurationIn sampling_frequency_ = configuration->property(role + ".sampling_frequency", static_cast(0)); n_channels_ = configuration->property(role + ".total_channels", 1); - for (unsigned int n = 0; n < n_channels_; n++) + for (int32_t n = 0; n < n_channels_; n++) { filename_vec_.push_back(configuration->property(role + ".filename" + std::to_string(n), default_filename)); } @@ -93,7 +93,7 @@ MultichannelFileSignalSource::MultichannelFileSignalSource(const ConfigurationIn } try { - for (unsigned int n = 0; n < n_channels_; n++) + for (int32_t n = 0; n < n_channels_; n++) { file_source_vec_.push_back(gr::blocks::file_source::make(item_size_, filename_vec_.at(n).c_str(), repeat_)); @@ -210,13 +210,13 @@ MultichannelFileSignalSource::MultichannelFileSignalSource(const ConfigurationIn if (enable_throttle_control_) { - for (unsigned int n = 0; n < n_channels_; n++) + for (int32_t n = 0; n < n_channels_; n++) { throttle_vec_.push_back(gr::blocks::throttle::make(item_size_, sampling_frequency_)); } } - for (unsigned int n = 0; n < n_channels_; n++) + for (int32_t n = 0; n < n_channels_; n++) { LOG(INFO) << "Multichanne File source filename #" << n << filename_vec_.at(n); } @@ -242,7 +242,7 @@ void MultichannelFileSignalSource::connect(gr::top_block_sptr top_block) { if (enable_throttle_control_ == true) { - for (unsigned int n = 0; n < n_channels_; n++) + for (int32_t n = 0; n < n_channels_; n++) { top_block->connect(file_source_vec_.at(n), 0, throttle_vec_.at(n), 0); DLOG(INFO) << "connected file_source #" << n << " to throttle"; @@ -252,7 +252,7 @@ void MultichannelFileSignalSource::connect(gr::top_block_sptr top_block) } else { - for (unsigned int n = 0; n < n_channels_; n++) + for (int32_t n = 0; n < n_channels_; n++) { top_block->connect(file_source_vec_.at(n), 0, valve_, n); DLOG(INFO) << "connected file_source #" << n << " to valve_"; @@ -265,7 +265,7 @@ void MultichannelFileSignalSource::disconnect(gr::top_block_sptr top_block) { if (enable_throttle_control_ == true) { - for (unsigned int n = 0; n < n_channels_; n++) + for (int32_t n = 0; n < n_channels_; n++) { top_block->disconnect(file_source_vec_.at(n), 0, throttle_vec_.at(n), 0); DLOG(INFO) << "disconnected file_source #" << n << " to throttle"; @@ -275,7 +275,7 @@ void MultichannelFileSignalSource::disconnect(gr::top_block_sptr top_block) } else { - for (unsigned int n = 0; n < n_channels_; n++) + for (int32_t n = 0; n < n_channels_; n++) { top_block->disconnect(file_source_vec_.at(n), 0, valve_, n); DLOG(INFO) << "disconnected file_source #" << n << " to valve_"; diff --git a/src/algorithms/signal_source/adapters/multichannel_file_signal_source.h b/src/algorithms/signal_source/adapters/multichannel_file_signal_source.h index a84a1b078..8b2651093 100644 --- a/src/algorithms/signal_source/adapters/multichannel_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/multichannel_file_signal_source.h @@ -118,7 +118,7 @@ private: uint64_t samples_; int64_t sampling_frequency_; size_t item_size_; - uint32_t n_channels_; + int32_t n_channels_; uint32_t in_streams_; uint32_t out_streams_; bool repeat_; diff --git a/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc b/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc index fcaca5abe..9392a9f04 100644 --- a/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc +++ b/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc @@ -34,9 +34,9 @@ OsmosdrSignalSource::OsmosdrSignalSource(const ConfigurationInterface* configura Concurrent_Queue* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { // DUMP PARAMETERS - std::string empty = ""; - std::string default_dump_file = "./data/signal_source.dat"; - std::string default_item_type = "gr_complex"; + std::string empty; + const std::string default_dump_file("./data/signal_source.dat"); + const std::string default_item_type("gr_complex"); samples_ = configuration->property(role + ".samples", static_cast(0)); dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", diff --git a/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc b/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc index 2bfe668ce..7b550a3a7 100644 --- a/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc +++ b/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc @@ -31,8 +31,8 @@ PlutosdrSignalSource::PlutosdrSignalSource(const ConfigurationInterface* configu const std::string& role, unsigned int in_stream, unsigned int out_stream, Concurrent_Queue* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { - std::string default_item_type = "gr_complex"; - std::string default_dump_file = "./data/signal_source.dat"; + const std::string default_item_type("gr_complex"); + const std::string default_dump_file("./data/signal_source.dat"); std::string default_gain_mode("slow_attack"); uri_ = configuration->property(role + ".device_address", std::string("192.168.2.1")); freq_ = configuration->property(role + ".freq", static_cast(GPS_L1_FREQ_HZ)); diff --git a/src/algorithms/signal_source/adapters/raw_array_signal_source.cc b/src/algorithms/signal_source/adapters/raw_array_signal_source.cc index 1bd3ac1f9..547b276a4 100644 --- a/src/algorithms/signal_source/adapters/raw_array_signal_source.cc +++ b/src/algorithms/signal_source/adapters/raw_array_signal_source.cc @@ -29,7 +29,7 @@ RawArraySignalSource::RawArraySignalSource(const ConfigurationInterface* configuration, std::string role, unsigned int in_stream, unsigned int out_stream, Concurrent_Queue* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { - std::string default_item_type = "gr_complex"; + const std::string default_item_type("gr_complex"); std::string default_dump_file = "./data/raw_array_source.dat"; item_type_ = configuration->property(role + ".item_type", default_item_type); diff --git a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc index 7411e2f23..e7a558872 100644 --- a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc +++ b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc @@ -39,23 +39,22 @@ RtlTcpSignalSource::RtlTcpSignalSource(const ConfigurationInterface* configurati out_stream_(out_stream) { // DUMP PARAMETERS - std::string empty = ""; - std::string default_dump_file = "./data/signal_source.dat"; - std::string default_item_type = "gr_complex"; + const std::string default_dump_file("./data/signal_source.dat"); + const std::string default_item_type("gr_complex"); samples_ = configuration->property(role + ".samples", static_cast(0)); dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file); // rtl_tcp PARAMETERS - std::string default_address = "127.0.0.1"; - int16_t default_port = 1234; + const std::string default_address("127.0.0.1"); + const int16_t default_port = 1234; AGC_enabled_ = configuration->property(role + ".AGC_enabled", true); - freq_ = configuration->property(role + ".freq", GPS_L1_FREQ_HZ); - gain_ = configuration->property(role + ".gain", 40.0); + freq_ = configuration->property(role + ".freq", static_cast(GPS_L1_FREQ_HZ)); + gain_ = configuration->property(role + ".gain", 40); rf_gain_ = configuration->property(role + ".rf_gain", 40.0); - if_gain_ = configuration->property(role + ".if_gain", 40.0); - sample_rate_ = configuration->property(role + ".sampling_frequency", 2.0e6); + if_gain_ = configuration->property(role + ".if_gain", 40); + sample_rate_ = configuration->property(role + ".sampling_frequency", 2000000); item_type_ = configuration->property(role + ".item_type", default_item_type); address_ = configuration->property(role + ".address", default_address); port_ = configuration->property(role + ".port", default_port); diff --git a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h index 5b145663b..ba5fc7d2b 100644 --- a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h +++ b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h @@ -98,10 +98,10 @@ private: std::string address_; size_t item_size_; uint64_t samples_; - double sample_rate_; - double freq_; - double gain_; - double if_gain_; + int sample_rate_; + int freq_; + int gain_; + int if_gain_; double rf_gain_; unsigned int in_stream_; unsigned int out_stream_; diff --git a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc index 29fd1e73e..84fd76fd3 100644 --- a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc @@ -56,7 +56,7 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(const ConfigurationInte } if (n_channels_ > 1) { - for (uint32_t i = 0; i < n_channels_; i++) + for (int32_t i = 0; i < n_channels_; i++) { null_sinks_.push_back(gr::blocks::null_sink::make(sizeof(gr_complex))); unpack_spir_vec_.push_back(make_unpack_spir_gss6450_samples(adc_bits_)); @@ -135,7 +135,7 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(const ConfigurationInte LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]"; std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]\n"; - for (uint32_t i = 0; i < (n_channels_); i++) + for (int32_t i = 0; i < n_channels_; i++) { valve_vec_.emplace_back(gnss_sdr_make_valve(sizeof(gr_complex), samples_, queue)); if (dump_) @@ -187,7 +187,7 @@ void SpirGSS6450FileSignalSource::connect(gr::top_block_sptr top_block) if (n_channels_ > 1) { uint32_t aux = 0; - for (uint32_t i = 0; i < n_channels_; i++) + for (int32_t i = 0; i < n_channels_; i++) { if (i != (sel_ch_ - 1)) { @@ -205,7 +205,7 @@ void SpirGSS6450FileSignalSource::connect(gr::top_block_sptr top_block) } } } - for (uint32_t i = 0; i < n_channels_; i++) + for (int32_t i = 0; i < n_channels_; i++) { if (enable_throttle_control_) { @@ -248,7 +248,7 @@ void SpirGSS6450FileSignalSource::disconnect(gr::top_block_sptr top_block) if (n_channels_ > 1) { uint32_t aux = 0; - for (uint32_t i = 0; i < n_channels_; i++) + for (int32_t i = 0; i < n_channels_; i++) { if (i != (sel_ch_ - 1)) { @@ -267,7 +267,7 @@ void SpirGSS6450FileSignalSource::disconnect(gr::top_block_sptr top_block) } } - for (uint32_t i = 0; i < (n_channels_); i++) + for (int32_t i = 0; i < (n_channels_); i++) { if (enable_throttle_control_) { diff --git a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h index 663bbb20f..54a5d88e2 100644 --- a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h @@ -125,8 +125,8 @@ private: uint32_t in_streams_; uint32_t out_streams_; uint32_t adc_bits_; - uint32_t n_channels_; - uint32_t sel_ch_; + int32_t n_channels_; + int32_t sel_ch_; bool repeat_; bool dump_; // Enables dumping the gr_complex sample output bool enable_throttle_control_; diff --git a/src/algorithms/signal_source/adapters/uhd_signal_source.cc b/src/algorithms/signal_source/adapters/uhd_signal_source.cc index f0bf2257a..f2c3e5c9b 100644 --- a/src/algorithms/signal_source/adapters/uhd_signal_source.cc +++ b/src/algorithms/signal_source/adapters/uhd_signal_source.cc @@ -34,8 +34,8 @@ UhdSignalSource::UhdSignalSource(const ConfigurationInterface* configuration, Concurrent_Queue* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream) { // DUMP PARAMETERS - std::string empty = ""; - std::string default_dump_file = "./data/signal_source.dat"; + std::string empty; + const std::string default_dump_file("./data/signal_source.dat"); std::string default_item_type = "cshort"; // UHD COMMON PARAMETERS diff --git a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc index 8a7689311..7234ebb98 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc @@ -406,16 +406,6 @@ int Gr_Complex_Ip_Packet_Source::work(int noutput_items, switch (d_wire_sample_type) { case 1: // complex byte samples - bytes_requested = noutput_items * d_bytes_per_sample; - if (bytes_requested < fifo_items) - { - num_samples_readed = noutput_items; // read all - } - else - { - num_samples_readed = fifo_items / d_bytes_per_sample; // read what we have - } - break; case 2: // complex 4 bits samples bytes_requested = noutput_items * d_bytes_per_sample; if (bytes_requested < fifo_items) diff --git a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc index 35cb14c39..377d572d2 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc @@ -418,7 +418,7 @@ int labsat23_source::general_work(int noutput_items, { std::vector memblock(n_int16_to_read); binary_input_file.read(reinterpret_cast(memblock.data()), n_int16_to_read * 2); - n_int16_to_read = binary_input_file.gcount() / 2; // from bytes to int16 + n_int16_to_read = static_cast(binary_input_file.gcount()) / 2; // from bytes to int16 if (n_int16_to_read > 0) { int output_pointer = 0; @@ -476,7 +476,7 @@ int labsat23_source::general_work(int noutput_items, { std::vector memblock(n_int16_to_read); binary_input_file.read(reinterpret_cast(memblock.data()), n_int16_to_read * 2); - n_int16_to_read = binary_input_file.gcount() / 2; // from bytes to int16 + n_int16_to_read = static_cast(binary_input_file.gcount()) / 2; // from bytes to int16 if (n_int16_to_read > 0) { int output_pointer = 0; diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc index b4b21fbb9..4b49e7900 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc @@ -235,12 +235,12 @@ void rtl_tcp_signal_source_c::set_if_gain(int gain) {3, 15, 3}}; std::map gains; - for (int i = 0; i < static_cast(ranges.size()); i++) + for (size_t i = 0; i < ranges.size(); i++) { gains[i + 1] = ranges[i].start; } - for (int i = ranges.size() - 1; i >= 0; i--) + for (size_t i = ranges.size() - 1; i > 0; i--) { const range &r = ranges[i]; double error = gain; @@ -248,7 +248,7 @@ void rtl_tcp_signal_source_c::set_if_gain(int gain) while (g < r.stop) { double sum = 0; - for (int j = 0; j < static_cast(gains.size()); j++) + for (size_t j = 0; j < gains.size(); j++) { if (i == j) { diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc index abad46c6c..960001128 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.cc @@ -23,15 +23,15 @@ #include #include -unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples(unsigned int adc_nbit_) +unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples(int adc_nbit_) { return unpack_spir_gss6450_samples_sptr(new unpack_spir_gss6450_samples(adc_nbit_)); } -unpack_spir_gss6450_samples::unpack_spir_gss6450_samples(unsigned int adc_nbit) : gr::sync_interpolator("unpack_spir_gss6450_samples", - gr::io_signature::make(1, 1, sizeof(int32_t)), - gr::io_signature::make(1, 1, sizeof(gr_complex)), 16 / adc_nbit) +unpack_spir_gss6450_samples::unpack_spir_gss6450_samples(int adc_nbit) : gr::sync_interpolator("unpack_spir_gss6450_samples", + gr::io_signature::make(1, 1, sizeof(int32_t)), + gr::io_signature::make(1, 1, sizeof(gr_complex)), 16 / adc_nbit) { adc_bits = adc_nbit; samples_per_int = 16 / adc_bits; @@ -53,21 +53,21 @@ void unpack_spir_gss6450_samples::decode_4bits_word(uint32_t input_uint32, gr_co if (tmp_char >= 2) { - I = (tmp_char - 4); + I = static_cast(tmp_char - 4); } else { - I = tmp_char; + I = static_cast(tmp_char); } input_uint32 = input_uint32 >> 2; tmp_char = input_uint32 & 3; if (tmp_char >= 2) { - Q = (tmp_char - 4); + Q = static_cast(tmp_char - 4); } else { - Q = tmp_char; + Q = static_cast(tmp_char); } input_uint32 = input_uint32 >> 2; @@ -82,21 +82,21 @@ void unpack_spir_gss6450_samples::decode_4bits_word(uint32_t input_uint32, gr_co if (tmp_char >= 8) { - I = (tmp_char - 16); + I = static_cast(tmp_char - 16); } else { - I = tmp_char; + I = static_cast(tmp_char); } input_uint32 = input_uint32 >> 4; tmp_char = input_uint32 & 0x0F; if (tmp_char >= 8) { - Q = (tmp_char - 16); + Q = static_cast(tmp_char - 16); } else { - Q = tmp_char; + Q = static_cast(tmp_char); } input_uint32 = input_uint32 >> 4; diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h index 6933d595a..cde681346 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h @@ -36,22 +36,22 @@ using unpack_spir_gss6450_samples_sptr = std::shared_ptr; #endif -unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples(unsigned int adc_nbit_); +unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples(int adc_nbit_); class unpack_spir_gss6450_samples : public gr::sync_interpolator { public: - explicit unpack_spir_gss6450_samples(unsigned int adc_nbit); + explicit unpack_spir_gss6450_samples(int adc_nbit); ~unpack_spir_gss6450_samples() = default; void decode_4bits_word(uint32_t input_uint32, gr_complex *out, int adc_bits_); int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); private: - friend unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples_sptr(unsigned int adc_nbit); - unsigned int adc_bits; - unsigned int samples_per_int; + friend unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples_sptr(int adc_nbit); + int adc_bits; + int samples_per_int; }; #endif // GNSS_SDR_UNPACK_SPIR_GSS6450_SAMPLES_H diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc index d93bc338e..b38638a65 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc @@ -302,7 +302,6 @@ bool gps_l1_ca_telemetry_decoder_gs::decode_subframe() case 5: // get almanac (if available) // TODO: implement almanac reader in navigation_message - break; default: break; } diff --git a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc index 3e9ef95e1..278a24609 100644 --- a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc +++ b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc @@ -40,8 +40,8 @@ Viterbi_Decoder::Viterbi_Decoder(const int g_encoder[], const int KK, const int // derived code properties d_mm = d_KK - 1; - d_states = 1U << d_mm; /* 2^mm */ - d_number_symbols = 1U << d_nn; /* 2^nn */ + d_states = static_cast(1U << d_mm); /* 2^mm */ + d_number_symbols = static_cast(1U << d_nn); /* 2^nn */ /* create appropriate transition matrices (trellis) */ d_out0.reserve(d_states); @@ -197,7 +197,7 @@ int Viterbi_Decoder::do_acs(const double sym[], int nbits) int next_state_if_1 = d_state1[state_at_t]; /* hypothesis: info bit is a zero */ - int bm_0 = d_metric_c[d_out0[state_at_t]]; + float bm_0 = d_metric_c[d_out0[state_at_t]]; metric = d_pm_t[state_at_t] + bm_0; // path metric + zerobranch metric /* store new metric if more than metric in storage */ @@ -210,7 +210,7 @@ int Viterbi_Decoder::do_acs(const double sym[], int nbits) } /* hypothesis: info bit is a one */ - int bm_1 = d_metric_c[d_out1[state_at_t]]; + float bm_1 = d_metric_c[d_out1[state_at_t]]; metric = d_pm_t[state_at_t] + bm_1; // path metric + onebranch metric /* store new metric if more than metric in storage */ @@ -280,7 +280,7 @@ int Viterbi_Decoder::do_tb_and_decode(int traceback_length, int requested_decodi VLOG(FLOW) << "do_tb_and_decode(): requested_decoding_length=" << requested_decoding_length; // decode only decode_length bits -> overstep newer bits which are too much - decoding_length_mismatch = d_trellis_paths.size() - (traceback_length + requested_decoding_length); + decoding_length_mismatch = static_cast(d_trellis_paths.size()) - (traceback_length + requested_decoding_length); VLOG(BLOCK) << "decoding_length_mismatch=" << decoding_length_mismatch; overstep_length = decoding_length_mismatch >= 0 ? decoding_length_mismatch : 0; VLOG(BLOCK) << "overstep_length=" << overstep_length; @@ -290,7 +290,7 @@ int Viterbi_Decoder::do_tb_and_decode(int traceback_length, int requested_decodi { state = it->get_anchestor_state_of_current_state(state); } - t_out = d_trellis_paths.end() - (d_trellis_paths.begin() + traceback_length + overstep_length) - 1; // requested_decoding_length-1; + t_out = static_cast(d_trellis_paths.end() - (d_trellis_paths.begin() + traceback_length + overstep_length) - 1); // requested_decoding_length-1; indicator_metric = 0; for (it = d_trellis_paths.begin() + traceback_length + overstep_length; it < d_trellis_paths.end(); ++it) { @@ -306,7 +306,7 @@ int Viterbi_Decoder::do_tb_and_decode(int traceback_length, int requested_decodi } if (n_im > 0) { - indicator_metric /= n_im; + indicator_metric /= static_cast(n_im); } VLOG(BLOCK) << "indicator metric: " << indicator_metric; @@ -348,7 +348,7 @@ float Viterbi_Decoder::gamma(const float rec_array[], int symbol, int nn) } // rm = rm > 50 ? rm : -1000; - return (rm); + return rm; } @@ -359,7 +359,7 @@ void Viterbi_Decoder::nsc_transit(int output_p[], int trans_p[], int input, cons int nextstate[1]; int state; int states; - states = (1U << (KK - 1)); /* The number of states: 2^mm */ + states = static_cast(1U << (KK - 1)); /* The number of states: 2^mm */ /* Determine the output and next state for each possible starting state */ for (state = 0; state < states; state++) @@ -432,7 +432,7 @@ int Viterbi_Decoder::parity_counter(int symbol, int length) temp_parity = temp_parity ^ (symbol & 1U); symbol = symbol >> 1U; } - return (temp_parity); + return static_cast(temp_parity); } diff --git a/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc index 75c33af1e..9ef1be39e 100644 --- a/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc @@ -41,7 +41,7 @@ BeidouB1iDllPllTracking::BeidouB1iDllPllTracking( DLOG(INFO) << "role " << role; trk_params.SetFromConfiguration(configuration, role); - int vector_length = std::round(trk_params.fs_in / (BEIDOU_B1I_CODE_RATE_CPS / BEIDOU_B1I_CODE_LENGTH_CHIPS)); + auto vector_length = static_cast(std::round(trk_params.fs_in / (BEIDOU_B1I_CODE_RATE_CPS / BEIDOU_B1I_CODE_LENGTH_CHIPS))); trk_params.vector_length = vector_length; if (trk_params.extend_correlation_symbols < 1) { diff --git a/src/algorithms/tracking/adapters/beidou_b3i_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/beidou_b3i_dll_pll_tracking.cc index 37807f4ab..543f61cbf 100644 --- a/src/algorithms/tracking/adapters/beidou_b3i_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/beidou_b3i_dll_pll_tracking.cc @@ -42,7 +42,7 @@ BeidouB3iDllPllTracking::BeidouB3iDllPllTracking( DLOG(INFO) << "role " << role; trk_params.SetFromConfiguration(configuration, role); - int vector_length = std::round(static_cast(trk_params.fs_in) / (BEIDOU_B3I_CODE_RATE_CPS / BEIDOU_B3I_CODE_LENGTH_CHIPS)); + auto vector_length = static_cast(std::round(static_cast(trk_params.fs_in) / (BEIDOU_B3I_CODE_RATE_CPS / BEIDOU_B3I_CODE_LENGTH_CHIPS))); trk_params.vector_length = vector_length; trk_params.track_pilot = configuration->property(role + ".track_pilot", false); if (trk_params.extend_correlation_symbols < 1) 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 b0ef8860f..6a368c6d8 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 @@ -54,7 +54,7 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking( { std::cout << TEXT_RED << "WARNING: Galileo E1. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n'; } - int vector_length = std::round(trk_params.fs_in / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)); + auto vector_length = static_cast(std::round(trk_params.fs_in / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS))); trk_params.vector_length = vector_length; trk_params.system = 'E'; std::array sig_{'1', 'B', '\0'}; 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 d12ecc5af..e0f9ad0c0 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 @@ -57,7 +57,7 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( std::cout << TEXT_RED << "WARNING: Galileo E1. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << '\n'; } d_track_pilot = trk_params_fpga.track_pilot; - int32_t vector_length = std::round(trk_params_fpga.fs_in / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)); + auto vector_length = static_cast(std::round(trk_params_fpga.fs_in / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS))); trk_params_fpga.vector_length = vector_length; trk_params_fpga.system = 'E'; std::array sig_{'1', 'B', '\0'}; diff --git a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc index 4e30253de..2d2345ae1 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc @@ -38,37 +38,27 @@ GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking( { DLOG(INFO) << "role " << role; // ################# CONFIGURATION PARAMETERS ######################## - int fs_in; - int vector_length; - bool dump; - std::string dump_filename; - std::string item_type; - std::string default_item_type = "gr_complex"; - float pll_bw_hz; - float dll_bw_hz; - float early_late_space_chips; - float very_early_late_space_chips; - size_t port_ch0; - item_type = configuration->property(role + ".item_type", default_item_type); + const std::string default_item_type("gr_complex"); + std::string item_type = configuration->property(role + ".item_type", default_item_type); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); - fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); - dump = configuration->property(role + ".dump", false); - pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); + int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + bool dump = configuration->property(role + ".dump", false); + float pll_bw_hz = configuration->property(role + ".pll_bw_hz", static_cast(50.0)); if (FLAGS_pll_bw_hz != 0.0) { pll_bw_hz = static_cast(FLAGS_pll_bw_hz); } - dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); + float dll_bw_hz = configuration->property(role + ".dll_bw_hz", static_cast(2.0)); if (FLAGS_dll_bw_hz != 0.0) { dll_bw_hz = static_cast(FLAGS_dll_bw_hz); } - early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.15); - very_early_late_space_chips = configuration->property(role + ".very_early_late_space_chips", 0.5); - port_ch0 = configuration->property(role + ".port_ch0", 2060); - std::string default_dump_filename = "./track_ch"; - dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); - vector_length = std::round(fs_in / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS)); + float early_late_space_chips = configuration->property(role + ".early_late_space_chips", static_cast(0.15)); + float very_early_late_space_chips = configuration->property(role + ".very_early_late_space_chips", static_cast(0.5)); + size_t port_ch0 = configuration->property(role + ".port_ch0", 2060); + const std::string default_dump_filename("./track_ch"); + std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); + auto vector_length = static_cast(std::round(fs_in / (GALILEO_E1_CODE_CHIP_RATE_CPS / GALILEO_E1_B_CODE_LENGTH_CHIPS))); // ################# MAKE TRACKING GNURadio object ################### if (item_type == "gr_complex") 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 3cfa0e797..7ce1ffcbb 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc @@ -39,7 +39,7 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( DLOG(INFO) << "role " << role; trk_params.SetFromConfiguration(configuration, role); - int vector_length = std::round(trk_params.fs_in / (GALILEO_E5A_CODE_CHIP_RATE_CPS / GALILEO_E5A_CODE_LENGTH_CHIPS)); + auto vector_length = static_cast(std::round(trk_params.fs_in / (GALILEO_E5A_CODE_CHIP_RATE_CPS / GALILEO_E5A_CODE_LENGTH_CHIPS))); trk_params.vector_length = vector_length; if (trk_params.extend_correlation_symbols < 1) { 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 f3a100f0f..777d3cd33 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 @@ -37,7 +37,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( DLOG(INFO) << "role " << role; trk_params_fpga.SetFromConfiguration(configuration, role); - int32_t vector_length = std::round(trk_params_fpga.fs_in / (GALILEO_E5A_CODE_CHIP_RATE_CPS / GALILEO_E5A_CODE_LENGTH_CHIPS)); + auto vector_length = static_cast(std::round(trk_params_fpga.fs_in / (GALILEO_E5A_CODE_CHIP_RATE_CPS / GALILEO_E5A_CODE_LENGTH_CHIPS))); trk_params_fpga.vector_length = vector_length; d_track_pilot = trk_params_fpga.track_pilot; if (trk_params_fpga.extend_correlation_symbols < 1) diff --git a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc index 1fdb27c5f..bff443447 100644 --- a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc +++ b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc @@ -39,39 +39,29 @@ GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking( { DLOG(INFO) << "role " << role; // ################# CONFIGURATION PARAMETERS ######################## - int fs_in; - int vector_length; - bool dump; - std::string dump_filename; - std::string default_item_type = "gr_complex"; - float pll_bw_hz; - float pll_bw_narrow_hz; - float dll_bw_hz; - float dll_bw_narrow_hz; - float early_late_space_chips; + const std::string default_item_type("gr_complex"); item_type_ = configuration->property(role + ".item_type", default_item_type); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); - fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); - dump = configuration->property(role + ".dump", false); - pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); + int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + bool dump = configuration->property(role + ".dump", false); + float pll_bw_hz = configuration->property(role + ".pll_bw_hz", static_cast(50.0)); if (FLAGS_pll_bw_hz != 0.0) { pll_bw_hz = static_cast(FLAGS_pll_bw_hz); } - dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); + float dll_bw_hz = configuration->property(role + ".dll_bw_hz", static_cast(2.0)); if (FLAGS_dll_bw_hz != 0.0) { dll_bw_hz = static_cast(FLAGS_dll_bw_hz); } - pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 20.0); - dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 2.0); - int extend_correlation_ms; - extend_correlation_ms = configuration->property(role + ".extend_correlation_ms", 1); + float pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", static_cast(20.0)); + float dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", static_cast(2.0)); + int extend_correlation_ms = configuration->property(role + ".extend_correlation_ms", 1); - early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); - std::string default_dump_filename = "./track_ch"; - dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); - vector_length = std::round(fs_in / (GLONASS_L1_CA_CODE_RATE_CPS / GLONASS_L1_CA_CODE_LENGTH_CHIPS)); + float early_late_space_chips = configuration->property(role + ".early_late_space_chips", static_cast(0.5)); + const std::string default_dump_filename("./track_ch"); + std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); + auto vector_length = static_cast(std::round(fs_in / (GLONASS_L1_CA_CODE_RATE_CPS / GLONASS_L1_CA_CODE_LENGTH_CHIPS))); // ################# MAKE TRACKING GNURadio object ################### if (item_type_ == "gr_complex") diff --git a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc index 09be39990..1a70c7f9d 100644 --- a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc @@ -38,33 +38,25 @@ GlonassL1CaDllPllTracking::GlonassL1CaDllPllTracking( { DLOG(INFO) << "role " << role; // ################# CONFIGURATION PARAMETERS ######################## - int fs_in; - int vector_length; - bool dump; - std::string dump_filename; - std::string item_type; - std::string default_item_type = "gr_complex"; - float pll_bw_hz; - float dll_bw_hz; - float early_late_space_chips; - item_type = configuration->property(role + ".item_type", default_item_type); + const std::string default_item_type("gr_complex"); + std::string item_type = configuration->property(role + ".item_type", default_item_type); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); - fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); - dump = configuration->property(role + ".dump", false); - pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); + int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + bool dump = configuration->property(role + ".dump", false); + float pll_bw_hz = configuration->property(role + ".pll_bw_hz", static_cast(50.0)); if (FLAGS_pll_bw_hz != 0.0) { pll_bw_hz = static_cast(FLAGS_pll_bw_hz); } - dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); + float dll_bw_hz = configuration->property(role + ".dll_bw_hz", static_cast(2.0)); if (FLAGS_dll_bw_hz != 0.0) { dll_bw_hz = static_cast(FLAGS_dll_bw_hz); } - early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); - std::string default_dump_filename = "./track_ch"; - dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); - vector_length = std::round(fs_in / (GLONASS_L1_CA_CODE_RATE_CPS / GLONASS_L1_CA_CODE_LENGTH_CHIPS)); + float early_late_space_chips = configuration->property(role + ".early_late_space_chips", static_cast(0.5)); + const std::string default_dump_filename("./track_ch"); + std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); + auto vector_length = static_cast(std::round(fs_in / (GLONASS_L1_CA_CODE_RATE_CPS / GLONASS_L1_CA_CODE_LENGTH_CHIPS))); // ################# MAKE TRACKING GNURadio object ################### if (item_type == "gr_complex") diff --git a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.cc b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.cc index 2ad8e0378..40086eb43 100644 --- a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.cc +++ b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.cc @@ -37,39 +37,29 @@ GlonassL2CaDllPllCAidTracking::GlonassL2CaDllPllCAidTracking( { DLOG(INFO) << "role " << role; // ################# CONFIGURATION PARAMETERS ######################## - int fs_in; - int vector_length; - bool dump; - std::string dump_filename; - std::string default_item_type = "gr_complex"; - float pll_bw_hz; - float pll_bw_narrow_hz; - float dll_bw_hz; - float dll_bw_narrow_hz; - float early_late_space_chips; + const std::string default_item_type("gr_complex"); item_type_ = configuration->property(role + ".item_type", default_item_type); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); - fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); - dump = configuration->property(role + ".dump", false); - pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); + int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + bool dump = configuration->property(role + ".dump", false); + float pll_bw_hz = configuration->property(role + ".pll_bw_hz", static_cast(50.0)); if (FLAGS_pll_bw_hz != 0.0) { pll_bw_hz = static_cast(FLAGS_pll_bw_hz); } - dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); + float dll_bw_hz = configuration->property(role + ".dll_bw_hz", static_cast(2.0)); if (FLAGS_dll_bw_hz != 0.0) { dll_bw_hz = static_cast(FLAGS_dll_bw_hz); } - pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 20.0); - dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 2.0); - int extend_correlation_ms; - extend_correlation_ms = configuration->property(role + ".extend_correlation_ms", 1); + float pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", static_cast(20.0)); + float dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", static_cast(2.0)); + int extend_correlation_ms = configuration->property(role + ".extend_correlation_ms", 1); - early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); - std::string default_dump_filename = "./track_ch"; - dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); - vector_length = std::round(fs_in / (GLONASS_L2_CA_CODE_RATE_CPS / GLONASS_L2_CA_CODE_LENGTH_CHIPS)); + float early_late_space_chips = configuration->property(role + ".early_late_space_chips", static_cast(0.5)); + const std::string default_dump_filename("./track_ch"); + std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); + auto vector_length = static_cast(std::round(fs_in / (GLONASS_L2_CA_CODE_RATE_CPS / GLONASS_L2_CA_CODE_LENGTH_CHIPS))); // ################# MAKE TRACKING GNURadio object ################### if (item_type_ == "gr_complex") diff --git a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.cc index 130ce2204..acf5fd556 100644 --- a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.cc @@ -36,33 +36,25 @@ GlonassL2CaDllPllTracking::GlonassL2CaDllPllTracking( { DLOG(INFO) << "role " << role; // ################# CONFIGURATION PARAMETERS ######################## - int fs_in; - int vector_length; - bool dump; - std::string dump_filename; - std::string item_type; - std::string default_item_type = "gr_complex"; - float pll_bw_hz; - float dll_bw_hz; - float early_late_space_chips; - item_type = configuration->property(role + ".item_type", default_item_type); + const std::string default_item_type("gr_complex"); + std::string item_type = configuration->property(role + ".item_type", default_item_type); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); - fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); - dump = configuration->property(role + ".dump", false); - pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); + int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + bool dump = configuration->property(role + ".dump", false); + float pll_bw_hz = configuration->property(role + ".pll_bw_hz", static_cast(50.0)); if (FLAGS_pll_bw_hz != 0.0) { pll_bw_hz = static_cast(FLAGS_pll_bw_hz); } - dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); + float dll_bw_hz = configuration->property(role + ".dll_bw_hz", static_cast(2.0)); if (FLAGS_dll_bw_hz != 0.0) { dll_bw_hz = static_cast(FLAGS_dll_bw_hz); } - early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); - std::string default_dump_filename = "./track_ch"; - dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); - vector_length = std::round(fs_in / (GLONASS_L2_CA_CODE_RATE_CPS / GLONASS_L2_CA_CODE_LENGTH_CHIPS)); + float early_late_space_chips = configuration->property(role + ".early_late_space_chips", static_cast(0.5)); + const std::string default_dump_filename("./track_ch"); + std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); + auto vector_length = static_cast(std::round(fs_in / (GLONASS_L2_CA_CODE_RATE_CPS / GLONASS_L2_CA_CODE_LENGTH_CHIPS))); // ################# MAKE TRACKING GNURadio object ################### if (item_type == "gr_complex") diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc index 5209d99df..bf347108a 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc @@ -41,7 +41,7 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking( DLOG(INFO) << "role " << role; trk_params.SetFromConfiguration(configuration, role); - int vector_length = std::round(trk_params.fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)); + auto vector_length = static_cast(std::round(trk_params.fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS))); trk_params.vector_length = vector_length; if (trk_params.extend_correlation_symbols < 1) { 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 5a33cb5cc..de2fc97a9 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 @@ -42,7 +42,7 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga( DLOG(INFO) << "role " << role; trk_params_fpga.SetFromConfiguration(configuration, role); - int32_t vector_length = std::round(trk_params_fpga.fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)); + auto vector_length = static_cast(std::round(trk_params_fpga.fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS))); trk_params_fpga.vector_length = vector_length; if (trk_params_fpga.extend_correlation_symbols < 1) { diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.cc index 9723f2d3f..1bbd2f6cd 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.cc @@ -42,7 +42,7 @@ GpsL1CaDllPllTrackingGPU::GpsL1CaDllPllTrackingGPU( bool dump; std::string dump_filename; std::string item_type; - std::string default_item_type = "gr_complex"; + const std::string default_item_type("gr_complex"); float pll_bw_hz; float dll_bw_hz; float early_late_space_chips; @@ -56,7 +56,7 @@ GpsL1CaDllPllTrackingGPU::GpsL1CaDllPllTrackingGPU( dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); - std::string default_dump_filename = "./track_ch"; + const std::string default_dump_filename("./track_ch"); dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)); diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc index e78751b2c..893dcd31c 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc @@ -40,43 +40,28 @@ GpsL1CaKfTracking::GpsL1CaKfTracking( { DLOG(INFO) << "role " << role; // ################# CONFIGURATION PARAMETERS ######################## - int order; - int fs_in; - int vector_length; - int f_if; - bool dump; - std::string dump_filename; - std::string item_type; - std::string default_item_type = "gr_complex"; - float dll_bw_hz; - float early_late_space_chips; - bool bce_run; - unsigned int bce_ptrans; - unsigned int bce_strans; - int bce_nu; - int bce_kappa; - - item_type = configuration->property(role + ".item_type", default_item_type); - order = configuration->property(role + ".order", 2); + const std::string default_item_type("gr_complex"); + std::string item_type = configuration->property(role + ".item_type", default_item_type); + int order = configuration->property(role + ".order", 2); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); - fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); - f_if = configuration->property(role + ".if", 0); - dump = configuration->property(role + ".dump", false); - dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); + int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + int f_if = configuration->property(role + ".if", 0); + bool dump = configuration->property(role + ".dump", false); + float dll_bw_hz = configuration->property(role + ".dll_bw_hz", static_cast(2.0)); if (FLAGS_dll_bw_hz != 0.0) { dll_bw_hz = static_cast(FLAGS_dll_bw_hz); } - early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); - std::string default_dump_filename = "./track_ch"; - dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); - vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)); + float early_late_space_chips = configuration->property(role + ".early_late_space_chips", static_cast(0.5)); + const std::string default_dump_filename("./track_ch"); + std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); + auto vector_length = static_cast(std::round(fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS))); - bce_run = configuration->property(role + ".bce_run", false); - bce_ptrans = configuration->property(role + ".p_transient", 0); - bce_strans = configuration->property(role + ".s_transient", 0); - bce_nu = configuration->property(role + ".bce_nu", 0); - bce_kappa = configuration->property(role + ".bce_kappa", 0); + bool bce_run = configuration->property(role + ".bce_run", false); + unsigned int bce_ptrans = configuration->property(role + ".p_transient", 0); + unsigned int bce_strans = configuration->property(role + ".s_transient", 0); + int bce_nu = configuration->property(role + ".bce_nu", 0); + int bce_kappa = configuration->property(role + ".bce_kappa", 0); // ################# MAKE TRACKING GNURadio object ################### if (item_type == "gr_complex") diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc index abf25c1ea..cd54bc27a 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc @@ -37,24 +37,17 @@ GpsL1CaTcpConnectorTracking::GpsL1CaTcpConnectorTracking( { DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## - int fs_in; - int vector_length; - bool dump; - std::string dump_filename; - std::string item_type; - std::string default_item_type = "gr_complex"; - float early_late_space_chips; - size_t port_ch0; - item_type = configuration->property(role + ".item_type", default_item_type); + const std::string default_item_type("gr_complex"); + std::string item_type = configuration->property(role + ".item_type", default_item_type); // vector_length = configuration->property(role + ".vector_length", 2048); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); - fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); - dump = configuration->property(role + ".dump", false); - early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); - port_ch0 = configuration->property(role + ".port_ch0", 2060); - std::string default_dump_filename = "./track_ch"; - dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); - vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS)); + int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); + bool dump = configuration->property(role + ".dump", false); + float early_late_space_chips = configuration->property(role + ".early_late_space_chips", static_cast(0.5)); + size_t port_ch0 = configuration->property(role + ".port_ch0", 2060); + const std::string default_dump_filename("./track_ch"); + std::string dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); + auto vector_length = static_cast(std::round(fs_in / (GPS_L1_CA_CODE_RATE_CPS / GPS_L1_CA_CODE_LENGTH_CHIPS))); // ################# MAKE TRACKING GNURadio object ################### if (item_type == "gr_complex") 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 313be4b65..311350b46 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 @@ -40,7 +40,7 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking( DLOG(INFO) << "role " << role; trk_params.SetFromConfiguration(configuration, role); - int vector_length = std::round(static_cast(trk_params.fs_in) / (static_cast(GPS_L2_M_CODE_RATE_CPS) / static_cast(GPS_L2_M_CODE_LENGTH_CHIPS))); + auto vector_length = static_cast(std::round(static_cast(trk_params.fs_in) / (static_cast(GPS_L2_M_CODE_RATE_CPS) / static_cast(GPS_L2_M_CODE_LENGTH_CHIPS)))); trk_params.vector_length = vector_length; if (trk_params.extend_correlation_symbols != 1) { 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 5de5194b5..18c08d9f2 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 @@ -47,7 +47,7 @@ GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga( DLOG(INFO) << "role " << role; trk_params_fpga.SetFromConfiguration(configuration, role); - int vector_length = std::round(static_cast(trk_params_fpga.fs_in) / (static_cast(GPS_L2_M_CODE_RATE_CPS) / static_cast(GPS_L2_M_CODE_LENGTH_CHIPS))); + auto vector_length = static_cast(std::round(static_cast(trk_params_fpga.fs_in) / (static_cast(GPS_L2_M_CODE_RATE_CPS) / static_cast(GPS_L2_M_CODE_LENGTH_CHIPS)))); trk_params_fpga.vector_length = vector_length; trk_params_fpga.extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1); if (trk_params_fpga.extend_correlation_symbols != 1) 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 c95b30d24..21bbf816f 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc @@ -40,7 +40,7 @@ GpsL5DllPllTracking::GpsL5DllPllTracking( DLOG(INFO) << "role " << role; trk_params.SetFromConfiguration(configuration, role); - int vector_length = std::round(static_cast(trk_params.fs_in) / (static_cast(GPS_L5I_CODE_RATE_CPS) / static_cast(GPS_L5I_CODE_LENGTH_CHIPS))); + auto vector_length = static_cast(std::round(static_cast(trk_params.fs_in) / (static_cast(GPS_L5I_CODE_RATE_CPS) / static_cast(GPS_L5I_CODE_LENGTH_CHIPS)))); trk_params.vector_length = vector_length; if (trk_params.extend_correlation_symbols < 1) { 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 7f9fef3b2..4649968c7 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 @@ -44,7 +44,7 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( DLOG(INFO) << "role " << role; trk_params_fpga.SetFromConfiguration(configuration, role); - int32_t vector_length = std::round(static_cast(trk_params_fpga.fs_in) / (static_cast(GPS_L5I_CODE_RATE_CPS) / static_cast(GPS_L5I_CODE_LENGTH_CHIPS))); + auto vector_length = static_cast(std::round(static_cast(trk_params_fpga.fs_in) / (static_cast(GPS_L5I_CODE_RATE_CPS) / static_cast(GPS_L5I_CODE_LENGTH_CHIPS)))); trk_params_fpga.vector_length = vector_length; if (trk_params_fpga.extend_correlation_symbols < 1) { diff --git a/src/algorithms/tracking/libs/dll_pll_conf.cc b/src/algorithms/tracking/libs/dll_pll_conf.cc index e35b7d999..054d39163 100644 --- a/src/algorithms/tracking/libs/dll_pll_conf.cc +++ b/src/algorithms/tracking/libs/dll_pll_conf.cc @@ -86,7 +86,7 @@ void Dll_Pll_Conf::SetFromConfiguration(const ConfigurationInterface *configurat item_type = "gr_complex"; } - int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", fs_in); + double fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", fs_in); fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); high_dyn = configuration->property(role + ".high_dyn", high_dyn); dump = configuration->property(role + ".dump", dump); diff --git a/src/algorithms/tracking/libs/dll_pll_conf_fpga.cc b/src/algorithms/tracking/libs/dll_pll_conf_fpga.cc index 90d0e4305..07ec2fb3b 100644 --- a/src/algorithms/tracking/libs/dll_pll_conf_fpga.cc +++ b/src/algorithms/tracking/libs/dll_pll_conf_fpga.cc @@ -90,7 +90,7 @@ Dll_Pll_Conf_Fpga::Dll_Pll_Conf_Fpga() void Dll_Pll_Conf_Fpga::SetFromConfiguration(const ConfigurationInterface *configuration, const std::string &role) { - int32_t fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", fs_in); + double fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", fs_in); fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); high_dyn = configuration->property(role + ".high_dyn", high_dyn); smoother_length = configuration->property(role + ".smoother_length", smoother_length); diff --git a/src/algorithms/tracking/libs/exponential_smoother.cc b/src/algorithms/tracking/libs/exponential_smoother.cc index b6a85a0f0..58386e238 100644 --- a/src/algorithms/tracking/libs/exponential_smoother.cc +++ b/src/algorithms/tracking/libs/exponential_smoother.cc @@ -27,7 +27,7 @@ Exponential_Smoother::Exponential_Smoother() { alpha_ = 0.001; old_value_ = 0.0; - one_minus_alpha_ = 1.0 - alpha_; + one_minus_alpha_ = 1.0F - alpha_; samples_for_initialization_ = 200; initializing_ = true; init_counter_ = 0; @@ -48,7 +48,7 @@ void Exponential_Smoother::set_alpha(float alpha) { alpha_ = 1; } - one_minus_alpha_ = 1.0 - alpha_; + one_minus_alpha_ = 1.0F - alpha_; } diff --git a/src/algorithms/tracking/libs/lock_detectors.cc b/src/algorithms/tracking/libs/lock_detectors.cc index edcff9ca2..ab789a3f5 100644 --- a/src/algorithms/tracking/libs/lock_detectors.cc +++ b/src/algorithms/tracking/libs/lock_detectors.cc @@ -69,7 +69,7 @@ float cn0_svn_estimator(const gr_complex* Prompt_buffer, int length, float coh_i Psig = Psig * Psig; Ptot /= static_cast(length); SNR = Psig / (Ptot - Psig); - SNR_dB_Hz = 10.0 * std::log10(SNR) - 10.0 * std::log10(coh_integration_time_s); + SNR_dB_Hz = 10.0F * std::log10(SNR) - 10.0F * std::log10(coh_integration_time_s); return SNR_dB_Hz; } @@ -110,7 +110,7 @@ float cn0_m2m4_estimator(const gr_complex* Prompt_buffer, int length, float coh_ Psig = Psig * Psig; m_2 /= n; m_4 /= n; - aux = std::sqrt(2.0 * m_2 * m_2 - m_4); + aux = std::sqrt(2.0F * m_2 * m_2 - m_4); if (std::isnan(aux)) { SNR_aux = Psig / (m_2 - Psig); @@ -119,7 +119,7 @@ float cn0_m2m4_estimator(const gr_complex* Prompt_buffer, int length, float coh_ { SNR_aux = aux / (m_2 - aux); } - SNR_dB_Hz = 10.0 * std::log10(SNR_aux) - 10.0 * std::log10(coh_integration_time_s); + SNR_dB_Hz = 10.0F * std::log10(SNR_aux) - 10.0F * std::log10(coh_integration_time_s); return SNR_dB_Hz; } diff --git a/src/algorithms/tracking/libs/nonlinear_tracking.cc b/src/algorithms/tracking/libs/nonlinear_tracking.cc index 515b6cd74..2ae46c06e 100644 --- a/src/algorithms/tracking/libs/nonlinear_tracking.cc +++ b/src/algorithms/tracking/libs/nonlinear_tracking.cc @@ -245,12 +245,12 @@ void UnscentedFilter::predict_sequential(const arma::vec& x_post, const arma::ma float kappa = 0.0; float beta = 2.0; - float lambda = std::pow(alpha, 2.0) * (static_cast(nx) + kappa) - static_cast(nx); + float lambda = std::pow(alpha, 2.0F) * (static_cast(nx) + kappa) - static_cast(nx); // Compute UT Weights float W0_m = lambda / (static_cast(nx) + lambda); - float W0_c = lambda / (static_cast(nx) + lambda) + (1 - std::pow(alpha, 2.0) + beta); - float Wi_m = 1.0 / (2.0 * (static_cast(nx) + lambda)); + float W0_c = lambda / (static_cast(nx) + lambda) + (1 - std::pow(alpha, 2.0F) + beta); + float Wi_m = 1.0F / (2.0F * (static_cast(nx) + lambda)); // Propagate and evaluate sigma points arma::mat Xi_fact = arma::zeros(nx, nx); @@ -300,12 +300,12 @@ void UnscentedFilter::update_sequential(const arma::vec& z_upd, const arma::vec& float kappa = 0.0; float beta = 2.0; - float lambda = std::pow(alpha, 2.0) * (static_cast(nx) + kappa) - static_cast(nx); + float lambda = std::pow(alpha, 2.0F) * (static_cast(nx) + kappa) - static_cast(nx); // Compute UT Weights float W0_m = lambda / (static_cast(nx) + lambda); - float W0_c = lambda / (static_cast(nx) + lambda) + (1.0 - std::pow(alpha, 2.0) + beta); - float Wi_m = 1.0 / (2.0 * (static_cast(nx) + lambda)); + float W0_c = lambda / (static_cast(nx) + lambda) + (1.0F - std::pow(alpha, 2.0F) + beta); + float Wi_m = 1.0F / (2.0F * (static_cast(nx) + lambda)); // Propagate and evaluate sigma points arma::mat Xi_fact = arma::zeros(nx, nx); diff --git a/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.cc b/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.cc index 109fcbbda..018bb645a 100644 --- a/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.cc +++ b/src/algorithms/tracking/libs/tracking_2nd_DLL_filter.cc @@ -30,10 +30,10 @@ void Tracking_2nd_DLL_filter::calculate_lopp_coef(float* tau1, float* tau2, float lbw, float zeta, float k) { // Solve natural frequency - float Wn = lbw * 8.0 * zeta / (4.0 * zeta * zeta + 1.0); + float Wn = lbw * 8.0F * zeta / (4.0F * zeta * zeta + 1.0F); // solve for t1 & t2 *tau1 = k / (Wn * Wn); - *tau2 = 2.0 * zeta / Wn; + *tau2 = 2.0F * zeta / Wn; } @@ -55,7 +55,7 @@ void Tracking_2nd_DLL_filter::initialize() float Tracking_2nd_DLL_filter::get_code_nco(float DLL_discriminator) { - float code_nco = d_old_code_nco + (d_tau2_code / d_tau1_code) * (DLL_discriminator - d_old_code_error) + (DLL_discriminator + d_old_code_error) * (d_pdi_code / (2.0 * d_tau1_code)); + float code_nco = d_old_code_nco + (d_tau2_code / d_tau1_code) * (DLL_discriminator - d_old_code_error) + (DLL_discriminator + d_old_code_error) * (d_pdi_code / (2.0F * d_tau1_code)); d_old_code_nco = code_nco; d_old_code_error = DLL_discriminator; // [chips] return code_nco; diff --git a/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.cc b/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.cc index b1267589b..c9be08e33 100644 --- a/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.cc +++ b/src/algorithms/tracking/libs/tracking_2nd_PLL_filter.cc @@ -29,10 +29,10 @@ void Tracking_2nd_PLL_filter::calculate_lopp_coef(float* tau1, float* tau2, float lbw, float zeta, float k) { // Solve natural frequency - float Wn = lbw * 8.0 * zeta / (4.0 * zeta * zeta + 1.0); + float Wn = lbw * 8.0F * zeta / (4.0F * zeta * zeta + 1.0F); // solve for t1 & t2 *tau1 = k / (Wn * Wn); - *tau2 = 2.0 * zeta / Wn; + *tau2 = 2.0F * zeta / Wn; } @@ -59,7 +59,7 @@ void Tracking_2nd_PLL_filter::initialize() */ float Tracking_2nd_PLL_filter::get_carrier_nco(float PLL_discriminator) { - float carr_nco = d_old_carr_nco + (d_tau2_carr / d_tau1_carr) * (PLL_discriminator - d_old_carr_error) + (PLL_discriminator + d_old_carr_error) * (d_pdi_carr / (2.0 * d_tau1_carr)); + float carr_nco = d_old_carr_nco + (d_tau2_carr / d_tau1_carr) * (PLL_discriminator - d_old_carr_error) + (PLL_discriminator + d_old_carr_error) * (d_pdi_carr / (2.0F * d_tau1_carr)); d_old_carr_nco = carr_nco; d_old_carr_error = PLL_discriminator; return carr_nco; diff --git a/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.cc b/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.cc index 5d15ebaba..e6619a7d8 100644 --- a/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.cc +++ b/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.cc @@ -53,11 +53,11 @@ void Tracking_FLL_PLL_filter::set_params(float fll_bw_hz, float pll_bw_hz, int o d_pll_b3 = 2.400; d_pll_a3 = 1.100; d_pll_a2 = 1.414; - d_pll_w0p = pll_bw_hz / 0.7845; + d_pll_w0p = pll_bw_hz / 0.7845F; d_pll_w0p2 = d_pll_w0p * d_pll_w0p; d_pll_w0p3 = d_pll_w0p2 * d_pll_w0p; - d_pll_w0f = fll_bw_hz / 0.53; + d_pll_w0f = fll_bw_hz / 0.53F; d_pll_w0f2 = d_pll_w0f * d_pll_w0f; } else @@ -66,9 +66,9 @@ void Tracking_FLL_PLL_filter::set_params(float fll_bw_hz, float pll_bw_hz, int o * 2nd order PLL with 1st order FLL assist */ d_pll_a2 = 1.414; - d_pll_w0p = pll_bw_hz / 0.53; + d_pll_w0p = pll_bw_hz / 0.53F; d_pll_w0p2 = d_pll_w0p * d_pll_w0p; - d_pll_w0f = fll_bw_hz / 0.25; + d_pll_w0f = fll_bw_hz / 0.25F; } } @@ -77,7 +77,7 @@ void Tracking_FLL_PLL_filter::initialize(float d_acq_carrier_doppler_hz) { if (d_order == 3) { - d_pll_x = 2.0 * d_acq_carrier_doppler_hz; + d_pll_x = 2.0F * d_acq_carrier_doppler_hz; d_pll_w = 0; } else @@ -97,8 +97,8 @@ float Tracking_FLL_PLL_filter::get_carrier_error(float FLL_discriminator, float * 3rd order PLL with 2nd order FLL assist */ d_pll_w = d_pll_w + correlation_time_s * (d_pll_w0p3 * PLL_discriminator + d_pll_w0f2 * FLL_discriminator); - d_pll_x = d_pll_x + correlation_time_s * (0.5 * d_pll_w + d_pll_a2 * d_pll_w0f * FLL_discriminator + d_pll_a3 * d_pll_w0p2 * PLL_discriminator); - carrier_error_hz = 0.5 * d_pll_x + d_pll_b3 * d_pll_w0p * PLL_discriminator; + d_pll_x = d_pll_x + correlation_time_s * (0.5F * d_pll_w + d_pll_a2 * d_pll_w0f * FLL_discriminator + d_pll_a3 * d_pll_w0p2 * PLL_discriminator); + carrier_error_hz = 0.5F * d_pll_x + d_pll_b3 * d_pll_w0p * PLL_discriminator; } else { @@ -107,7 +107,7 @@ float Tracking_FLL_PLL_filter::get_carrier_error(float FLL_discriminator, float */ float pll_w_new; pll_w_new = d_pll_w + PLL_discriminator * d_pll_w0p2 * correlation_time_s + FLL_discriminator * d_pll_w0f * correlation_time_s; - carrier_error_hz = 0.5 * (pll_w_new + d_pll_w) + d_pll_a2 * d_pll_w0p * PLL_discriminator; + carrier_error_hz = 0.5F * (pll_w_new + d_pll_w) + d_pll_a2 * d_pll_w0p * PLL_discriminator; d_pll_w = pll_w_new; /* std::cout << " d_pll_w = " << carrier_error_hz << ", pll_w_new = " << pll_w_new << ", PLL_discriminator=" << PLL_discriminator diff --git a/src/algorithms/tracking/libs/tracking_loop_filter.cc b/src/algorithms/tracking/libs/tracking_loop_filter.cc index 88e1522e2..acf3b42c0 100644 --- a/src/algorithms/tracking/libs/tracking_loop_filter.cc +++ b/src/algorithms/tracking/libs/tracking_loop_filter.cc @@ -106,7 +106,7 @@ void Tracking_loop_filter::update_coefficients() float wn; float T = d_update_interval; - float zeta = 1.0 / std::sqrt(2.0); + float zeta = 1.0F / std::sqrt(2.0F); // The following is based on the bilinear transform approximation of // the analog integrator. The loop format is from Kaplan & Hegarty @@ -121,7 +121,7 @@ void Tracking_loop_filter::update_coefficients() switch (d_loop_order) { case 1: - wn = d_noise_bandwidth * 4.0; + wn = d_noise_bandwidth * 4.0F; g1 = wn; if (d_include_last_integrator) { @@ -141,9 +141,9 @@ void Tracking_loop_filter::update_coefficients() } break; case 2: - wn = d_noise_bandwidth * (8.0 * zeta) / (4.0 * zeta * zeta + 1.0); + wn = d_noise_bandwidth * (8.0F * zeta) / (4.0F * zeta * zeta + 1.0F); g1 = wn * wn; - g2 = wn * 2.0 * zeta; + g2 = wn * 2.0F * zeta; if (d_include_last_integrator) { d_input_coefficients.resize(3); @@ -166,7 +166,7 @@ void Tracking_loop_filter::update_coefficients() } break; case 3: - wn = d_noise_bandwidth / 0.7845; // From Kaplan + wn = d_noise_bandwidth / 0.7845F; // From Kaplan float a3 = 1.1; float b3 = 2.4; g1 = wn * wn * wn; diff --git a/src/core/monitor/gnss_synchro_monitor.cc b/src/core/monitor/gnss_synchro_monitor.cc index 442a16b8c..d063f0810 100644 --- a/src/core/monitor/gnss_synchro_monitor.cc +++ b/src/core/monitor/gnss_synchro_monitor.cc @@ -28,7 +28,7 @@ #include -gnss_synchro_monitor_sptr gnss_synchro_make_monitor(unsigned int n_channels, +gnss_synchro_monitor_sptr gnss_synchro_make_monitor(int n_channels, int decimation_factor, int udp_port, const std::vector& udp_addresses, @@ -42,7 +42,7 @@ gnss_synchro_monitor_sptr gnss_synchro_make_monitor(unsigned int n_channels, } -gnss_synchro_monitor::gnss_synchro_monitor(unsigned int n_channels, +gnss_synchro_monitor::gnss_synchro_monitor(int n_channels, int decimation_factor, int udp_port, const std::vector& udp_addresses, @@ -68,7 +68,7 @@ int gnss_synchro_monitor::work(int noutput_items, gr_vector_const_void_star& inp count++; if (count >= d_decimation_factor) { - for (unsigned int i = 0; i < d_nchannels; i++) + for (int i = 0; i < d_nchannels; i++) { std::vector stocks; stocks.push_back(in[i][epoch]); diff --git a/src/core/monitor/gnss_synchro_monitor.h b/src/core/monitor/gnss_synchro_monitor.h index 3fd27df21..a1c6ea255 100644 --- a/src/core/monitor/gnss_synchro_monitor.h +++ b/src/core/monitor/gnss_synchro_monitor.h @@ -43,7 +43,7 @@ using gnss_synchro_monitor_sptr = std::shared_ptr; using gnss_synchro_monitor_sptr = boost::shared_ptr; #endif -gnss_synchro_monitor_sptr gnss_synchro_make_monitor(unsigned int n_channels, +gnss_synchro_monitor_sptr gnss_synchro_make_monitor(int n_channels, int decimation_factor, int udp_port, const std::vector& udp_addresses, @@ -63,19 +63,19 @@ public: gr_vector_void_star& output_items); private: - friend gnss_synchro_monitor_sptr gnss_synchro_make_monitor(unsigned int n_channels, + friend gnss_synchro_monitor_sptr gnss_synchro_make_monitor(int n_channels, int decimation_factor, int udp_port, const std::vector& udp_addresses, bool enable_protobuf); - gnss_synchro_monitor(unsigned int n_channels, + gnss_synchro_monitor(int n_channels, int decimation_factor, int udp_port, const std::vector& udp_addresses, bool enable_protobuf); - unsigned int d_nchannels; + int d_nchannels; int d_decimation_factor; std::unique_ptr udp_sink_ptr; int count; diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index 73ab37685..44fa313a9 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -346,7 +346,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1C( appendix3 = ""; } // Automatically detect input data type - std::string default_item_type = "gr_complex"; + const std::string default_item_type("gr_complex"); std::string acq_item_type = configuration->property("Acquisition_1C" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_1C" + appendix2 + ".item_type", default_item_type); if (acq_item_type != trk_item_type) @@ -407,7 +407,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2S( appendix3 = ""; } // Automatically detect input data type - std::string default_item_type = "gr_complex"; + const std::string default_item_type("gr_complex"); std::string acq_item_type = configuration->property("Acquisition_2S" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_2S" + appendix2 + ".item_type", default_item_type); if (acq_item_type != trk_item_type) @@ -471,7 +471,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1B( appendix3 = ""; } // Automatically detect input data type - std::string default_item_type = "gr_complex"; + const std::string default_item_type("gr_complex"); std::string acq_item_type = configuration->property("Acquisition_1B" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_1B" + appendix2 + ".item_type", default_item_type); if (acq_item_type != trk_item_type) @@ -535,7 +535,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_5X( appendix3 = ""; } // Automatically detect input data type - std::string default_item_type = "gr_complex"; + const std::string default_item_type("gr_complex"); std::string acq_item_type = configuration->property("Acquisition_5X" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_5X" + appendix2 + ".item_type", default_item_type); if (acq_item_type != trk_item_type) @@ -600,7 +600,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( appendix3 = ""; } // Automatically detect input data type - std::string default_item_type = "gr_complex"; + const std::string default_item_type("gr_complex"); std::string acq_item_type = configuration->property("Acquisition_1G" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_1G" + appendix2 + ".item_type", default_item_type); if (acq_item_type != trk_item_type) @@ -665,7 +665,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( appendix3 = ""; } // Automatically detect input data type - std::string default_item_type = "gr_complex"; + const std::string default_item_type("gr_complex"); std::string acq_item_type = configuration->property("Acquisition_2G" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_2G" + appendix2 + ".item_type", default_item_type); if (acq_item_type != trk_item_type) @@ -729,7 +729,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_L5( appendix3 = ""; } // Automatically detect input data type - std::string default_item_type = "gr_complex"; + const std::string default_item_type("gr_complex"); std::string acq_item_type = configuration->property("Acquisition_L5" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_L5" + appendix2 + ".item_type", default_item_type); if (acq_item_type != trk_item_type) @@ -793,7 +793,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_B1( appendix3 = ""; } // Automatically detect input data type - std::string default_item_type = "gr_complex"; + const std::string default_item_type("gr_complex"); std::string acq_item_type = configuration->property("Acquisition_B1" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_B1" + appendix2 + ".item_type", default_item_type); if (acq_item_type != trk_item_type) @@ -857,7 +857,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_B3( appendix3 = ""; } // Automatically detect input data type - std::string default_item_type = "gr_complex"; + const std::string default_item_type("gr_complex"); std::string acq_item_type = configuration->property("Acquisition_B3" + appendix1 + ".item_type", default_item_type); std::string trk_item_type = configuration->property("Tracking_B3" + appendix2 + ".item_type", default_item_type); if (acq_item_type != trk_item_type) @@ -887,7 +887,7 @@ std::unique_ptr>> GNSSBlockFacto std::string telemetry_decoder_implementation; std::string acquisition_implementation; - unsigned int channel_absolute_id = 0; + int channel_absolute_id = 0; unsigned int Channels_1C_count = configuration->property("Channels_1C.count", 0); unsigned int Channels_1B_count = configuration->property("Channels_1B.count", 0); diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index f3943fd3d..c219ec623 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -174,7 +174,7 @@ void GNSSFlowgraph::connect() } } #endif - for (unsigned int i = 0; i < channels_count_; i++) + for (int i = 0; i < channels_count_; i++) { try { @@ -301,7 +301,7 @@ void GNSSFlowgraph::connect() std::cout << "Set GNSS-SDR.internal_fs_sps in configuration file\n"; throw(std::invalid_argument("Set GNSS-SDR.internal_fs_sps in configuration")); } - int observable_interval_ms = static_cast(configuration_->property("GNSS-SDR.observable_interval_ms", 20)); + int observable_interval_ms = configuration_->property("GNSS-SDR.observable_interval_ms", 20); ch_out_sample_counter_ = gnss_sdr_make_sample_counter(fs, observable_interval_ms, sig_conditioner_.at(0)->get_right_block()->output_signature()->sizeof_stream_item(0)); top_block_->connect(sig_conditioner_.at(0)->get_right_block(), 0, ch_out_sample_counter_, 0); top_block_->connect(ch_out_sample_counter_, 0, observables_->get_left_block(), channels_count_); // extra port for the sample counter pulse @@ -326,7 +326,7 @@ void GNSSFlowgraph::connect() std::cout << "Set GNSS-SDR.internal_fs_sps in configuration file\n"; throw(std::invalid_argument("Set GNSS-SDR.internal_fs_sps in configuration")); } - int observable_interval_ms = static_cast(configuration_->property("GNSS-SDR.observable_interval_ms", 20)); + int observable_interval_ms = configuration_->property("GNSS-SDR.observable_interval_ms", 20); ch_out_fpga_sample_counter_ = gnss_sdr_make_fpga_sample_counter(fs, observable_interval_ms); top_block_->connect(ch_out_fpga_sample_counter_, 0, observables_->get_left_block(), channels_count_); // extra port for the sample counter pulse } @@ -351,7 +351,7 @@ void GNSSFlowgraph::connect() throw(std::invalid_argument("Set GNSS-SDR.internal_fs_sps in configuration")); } - int observable_interval_ms = static_cast(configuration_->property("GNSS-SDR.observable_interval_ms", 20)); + int observable_interval_ms = configuration_->property("GNSS-SDR.observable_interval_ms", 20); ch_out_sample_counter_ = gnss_sdr_make_sample_counter(fs, observable_interval_ms, sig_conditioner_.at(0)->get_right_block()->output_signature()->sizeof_stream_item(0)); top_block_->connect(sig_conditioner_.at(0)->get_right_block(), 0, ch_out_sample_counter_, 0); top_block_->connect(ch_out_sample_counter_, 0, observables_->get_left_block(), channels_count_); // extra port for the sample counter pulse @@ -371,7 +371,7 @@ void GNSSFlowgraph::connect() { signal_conditioner_connected.push_back(false); } - for (unsigned int i = 0; i < channels_count_; i++) + for (int i = 0; i < channels_count_; i++) { #ifndef ENABLE_FPGA int selected_signal_conditioner_ID = 0; @@ -417,14 +417,8 @@ void GNSSFlowgraph::connect() acq_fs = GALILEO_E5A_OPT_ACQ_FS_SPS; break; case evGLO_1G: - acq_fs = fs; - break; case evGLO_2G: - acq_fs = fs; - break; case evBDS_B1: - acq_fs = fs; - break; case evBDS_B3: acq_fs = fs; break; @@ -562,7 +556,7 @@ void GNSSFlowgraph::connect() // Put channels fixed to a given satellite at the beginning of the vector, then the rest std::vector vector_of_channels; - for (unsigned int i = 0; i < channels_count_; i++) + for (int i = 0; i < channels_count_; i++) { unsigned int sat = 0; try @@ -680,7 +674,7 @@ void GNSSFlowgraph::connect() // Connect the observables output of each channel to the PVT block try { - for (unsigned int i = 0; i < channels_count_; i++) + for (int i = 0; i < channels_count_; i++) { top_block_->connect(observables_->get_right_block(), i, pvt_->get_left_block(), i); top_block_->msg_connect(channels_.at(i)->get_right_block(), pmt::mp("telemetry"), pvt_->get_left_block(), pmt::mp("telemetry")); @@ -704,7 +698,7 @@ void GNSSFlowgraph::connect() { try { - for (unsigned int i = 0; i < channels_count_; i++) + for (int i = 0; i < channels_count_; i++) { top_block_->connect(observables_->get_right_block(), i, GnssSynchroMonitor_, i); } @@ -719,7 +713,7 @@ void GNSSFlowgraph::connect() } #ifndef ENABLE_FPGA // Activate acquisition in enabled channels - for (unsigned int i = 0; i < channels_count_; i++) + for (int i = 0; i < channels_count_; i++) { LOG(INFO) << "Channel " << i << " assigned to " << channels_.at(i)->get_signal(); if (channels_state_[i] == 1) @@ -910,7 +904,7 @@ void GNSSFlowgraph::disconnect() } #endif // Signal conditioner (selected_signal_source) >> channels (i) (dependent of their associated SignalSource_ID) - for (unsigned int i = 0; i < channels_count_; i++) + for (int i = 0; i < channels_count_; i++) { #ifndef ENABLE_FPGA int selected_signal_conditioner_ID; @@ -952,7 +946,7 @@ void GNSSFlowgraph::disconnect() try { - for (unsigned int i = 0; i < channels_count_; i++) + for (int i = 0; i < channels_count_; i++) { top_block_->disconnect(observables_->get_right_block(), i, pvt_->get_left_block(), i); if (enable_monitor_) @@ -999,7 +993,7 @@ void GNSSFlowgraph::disconnect() } } - for (unsigned int i = 0; i < channels_count_; i++) + for (int i = 0; i < channels_count_; i++) { try { @@ -1172,8 +1166,6 @@ double GNSSFlowgraph::project_doppler(const std::string& searched_signal, double switch (mapStringValues_[searched_signal]) { case evGPS_L5: - return (primary_freq_doppler_hz / FREQ1) * FREQ5; - break; case evGAL_5X: return (primary_freq_doppler_hz / FREQ1) * FREQ5; break; @@ -1189,7 +1181,7 @@ double GNSSFlowgraph::project_doppler(const std::string& searched_signal, double void GNSSFlowgraph::acquisition_manager(unsigned int who) { unsigned int current_channel; - for (unsigned int i = 0; i < channels_count_; i++) + for (int i = 0; i < channels_count_; i++) { current_channel = (i + who + 1) % channels_count_; unsigned int sat_ = 0; @@ -1459,7 +1451,7 @@ void GNSSFlowgraph::set_configuration(const std::shared_ptrGetChannels(configuration_.get(), queue_.get()); - channels_count_ = channels->size(); - for (unsigned int i = 0; i < channels_count_; i++) + channels_count_ = static_cast(channels->size()); + for (int i = 0; i < channels_count_; i++) { std::shared_ptr chan_ = std::move(channels->at(i)); channels_.push_back(std::dynamic_pointer_cast(chan_)); @@ -1995,7 +1987,7 @@ void GNSSFlowgraph::set_channels_state() LOG(WARNING) << "Channels_in_acquisition is bigger than number of channels. Variable acq_channels_count_ is set to " << channels_count_; } channels_state_.reserve(channels_count_); - for (unsigned int i = 0; i < channels_count_; i++) + for (int i = 0; i < channels_count_; i++) { if (i < max_acq_channels_) { @@ -2091,7 +2083,7 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal if (it2 != available_GPS_2S_signals_.end()) { - estimated_doppler = current_status.second->Carrier_Doppler_hz; + estimated_doppler = static_cast(current_status.second->Carrier_Doppler_hz); RX_time = current_status.second->RX_time; // 3. return the GPS L2 satellite and remove it from list result = *it2; @@ -2143,7 +2135,7 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal if (it2 != available_GPS_L5_signals_.end()) { - estimated_doppler = current_status.second->Carrier_Doppler_hz; + estimated_doppler = static_cast(current_status.second->Carrier_Doppler_hz); RX_time = current_status.second->RX_time; // std::cout << " Channel: " << it->first << " => Doppler: " << estimated_doppler << "[Hz] \n"; // 3. return the GPS L5 satellite and remove it from list @@ -2197,7 +2189,7 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal if (it2 != available_GAL_5X_signals_.end()) { - estimated_doppler = current_status.second->Carrier_Doppler_hz; + estimated_doppler = static_cast(current_status.second->Carrier_Doppler_hz); RX_time = current_status.second->RX_time; // std::cout << " Channel: " << it->first << " => Doppler: " << estimated_doppler << "[Hz] \n"; // 3. return the Gal 5X satellite and remove it from list diff --git a/src/core/receiver/gnss_flowgraph.h b/src/core/receiver/gnss_flowgraph.h index 90abaf04e..832a1345d 100644 --- a/src/core/receiver/gnss_flowgraph.h +++ b/src/core/receiver/gnss_flowgraph.h @@ -230,10 +230,9 @@ private: std::mutex signal_list_mutex_; int sources_count_; - - unsigned int channels_count_; - unsigned int acq_channels_count_; - unsigned int max_acq_channels_; + int channels_count_; + int acq_channels_count_; + int max_acq_channels_; bool connected_; bool running_; diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index d481ba0d3..e37d4e89c 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -238,9 +238,9 @@ std::string TcpCmdInterface::warmstart(const std::vector &commandLi receiver_utc_time_ = timegm(&tm); // Read latitude, longitude, and height - rx_latitude_ = std::stod(commandLine.at(3).c_str()); - rx_longitude_ = std::stod(commandLine.at(4).c_str()); - rx_altitude_ = std::stod(commandLine.at(5).c_str()); + rx_latitude_ = std::stof(commandLine.at(3).c_str()); + rx_longitude_ = std::stof(commandLine.at(4).c_str()); + rx_altitude_ = std::stof(commandLine.at(5).c_str()); if (std::isnan(rx_latitude_) || std::isnan(rx_longitude_) || std::isnan(rx_altitude_)) { diff --git a/src/core/system_parameters/CMakeLists.txt b/src/core/system_parameters/CMakeLists.txt index 392fd47f0..e78425139 100644 --- a/src/core/system_parameters/CMakeLists.txt +++ b/src/core/system_parameters/CMakeLists.txt @@ -45,6 +45,8 @@ set(SYSTEM_PARAMETERS_HEADERS galileo_ephemeris.h galileo_almanac.h galileo_almanac_helper.h + Galileo_FNAV.h + Galileo_INAV.h galileo_iono.h galileo_navigation_message.h sbas_ephemeris.h diff --git a/src/core/system_parameters/Galileo_E1.h b/src/core/system_parameters/Galileo_E1.h index 376d52010..f2674655b 100644 --- a/src/core/system_parameters/Galileo_E1.h +++ b/src/core/system_parameters/Galileo_E1.h @@ -26,8 +26,6 @@ #include "gnss_frequencies.h" #include // for size_t #include -#include // std::pair -#include // carrier and code frequencies @@ -49,233 +47,8 @@ constexpr uint32_t GALILEO_E1_OPT_ACQ_FS_SPS = 2000000; //!< Sampling frequency constexpr int32_t GALILEO_E1_HISTORY_DEEP = 100; //!< Observable history length for interpotalion -// Galileo INAV Telemetry structure -constexpr int32_t GALILEO_INAV_PREAMBLE_LENGTH_BITS = 10; -constexpr double GALILEO_INAV_PAGE_PART_WITH_PREABLE_SECONDS = 2.0 + (static_cast(GALILEO_INAV_PREAMBLE_LENGTH_BITS) * GALILEO_E1_CODE_PERIOD_S); -constexpr int32_t GALILEO_INAV_PREAMBLE_PERIOD_SYMBOLS = 250; -constexpr int32_t GALILEO_INAV_PAGE_PART_SYMBOLS = 250; //!< Each Galileo INAV pages are composed of two parts (even and odd) each of 250 symbols, including preamble. See Galileo ICD 4.3.2 -constexpr int32_t GALILEO_INAV_PAGE_SYMBOLS = 500; //!< The complete Galileo INAV page length -constexpr int32_t GALILEO_INAV_PAGE_PART_SECONDS = 1; // a page part last 1 sec -constexpr int32_t GALILEO_INAV_PAGE_PART_MS = 1000; // a page part last 1 sec -constexpr int32_t GALILEO_INAV_PAGE_SECONDS = 2; // a full page last 2 sec -constexpr int32_t GALILEO_INAV_INTERLEAVER_ROWS = 8; -constexpr int32_t GALILEO_INAV_INTERLEAVER_COLS = 30; -constexpr int32_t GALILEO_TELEMETRY_RATE_BITS_SECOND = 250; // bps -constexpr int32_t GALILEO_PAGE_TYPE_BITS = 6; -constexpr int32_t GALILEO_DATA_JK_BITS = 128; -constexpr int32_t GALILEO_DATA_FRAME_BITS = 196; -constexpr int32_t GALILEO_DATA_FRAME_BYTES = 25; - -constexpr char GALILEO_INAV_PREAMBLE[11] = "0101100000"; constexpr char GALILEO_E1_C_SECONDARY_CODE[26] = "0011100000001010110110010"; -const std::vector> TYPE({{1, 6}}); -const std::vector> PAGE_TYPE_BIT({{1, 6}}); - -/* Page 1 - Word type 1: Ephemeris (1/4) */ -const std::vector> IOD_NAV_1_BIT({{7, 10}}); -const std::vector> T0_E_1_BIT({{17, 14}}); -constexpr int32_t T0E_1_LSB = 60; -const std::vector> M0_1_BIT({{31, 32}}); -constexpr double M0_1_LSB = PI_TWO_N31; -const std::vector> E_1_BIT({{63, 32}}); -constexpr double E_1_LSB = TWO_N33; -const std::vector> A_1_BIT({{95, 32}}); -constexpr double A_1_LSB_GAL = TWO_N19; -// last two bits are reserved - - -/* Page 2 - Word type 2: Ephemeris (2/4) */ -const std::vector> IOD_NAV_2_BIT({{7, 10}}); -const std::vector> OMEGA_0_2_BIT({{17, 32}}); -constexpr double OMEGA_0_2_LSB = PI_TWO_N31; -const std::vector> I_0_2_BIT({{49, 32}}); -constexpr double I_0_2_LSB = PI_TWO_N31; -const std::vector> OMEGA_2_BIT({{81, 32}}); -constexpr double OMEGA_2_LSB = PI_TWO_N31; -const std::vector> I_DOT_2_BIT({{113, 14}}); -constexpr double I_DOT_2_LSB = PI_TWO_N43; -// last two bits are reserved - - -/* Word type 3: Ephemeris (3/4) and SISA */ -const std::vector> IOD_NAV_3_BIT({{7, 10}}); -const std::vector> OMEGA_DOT_3_BIT({{17, 24}}); -constexpr double OMEGA_DOT_3_LSB = PI_TWO_N43; -const std::vector> DELTA_N_3_BIT({{41, 16}}); -constexpr double DELTA_N_3_LSB = PI_TWO_N43; -const std::vector> C_UC_3_BIT({{57, 16}}); -constexpr double C_UC_3_LSB = TWO_N29; -const std::vector> C_US_3_BIT({{73, 16}}); -constexpr double C_US_3_LSB = TWO_N29; -const std::vector> C_RC_3_BIT({{89, 16}}); -constexpr double C_RC_3_LSB = TWO_N5; -const std::vector> C_RS_3_BIT({{105, 16}}); -constexpr double C_RS_3_LSB = TWO_N5; -const std::vector> SISA_3_BIT({{121, 8}}); - - -/* Word type 4: Ephemeris (4/4) and Clock correction parameters */ -const std::vector> IOD_NAV_4_BIT({{7, 10}}); -const std::vector> SV_ID_PRN_4_BIT({{17, 6}}); -const std::vector> C_IC_4_BIT({{23, 16}}); -constexpr double C_IC_4_LSB = TWO_N29; -const std::vector> C_IS_4_BIT({{39, 16}}); -constexpr double C_IS_4_LSB = TWO_N29; -const std::vector> T0C_4_BIT({{55, 14}}); // -constexpr int32_t T0C_4_LSB = 60; -const std::vector> AF0_4_BIT({{69, 31}}); // -constexpr double AF0_4_LSB = TWO_N34; -const std::vector> AF1_4_BIT({{100, 21}}); // -constexpr double AF1_4_LSB = TWO_N46; -const std::vector> AF2_4_BIT({{121, 6}}); -constexpr double AF2_4_LSB = TWO_N59; -const std::vector> SPARE_4_BIT({{127, 2}}); -// last two bits are reserved - - -/* Word type 5: Ionospheric correction, BGD, signal health and data validity status and GST */ -/* Ionospheric correction */ -/* Az */ -const std::vector> AI0_5_BIT({{7, 11}}); // -constexpr double AI0_5_LSB = TWO_N2; -const std::vector> AI1_5_BIT({{18, 11}}); // -constexpr double AI1_5_LSB = TWO_N8; -const std::vector> AI2_5_BIT({{29, 14}}); // -constexpr double AI2_5_LSB = TWO_N15; -/* Ionospheric disturbance flag */ -const std::vector> REGION1_5_BIT({{43, 1}}); // -const std::vector> REGION2_5_BIT({{44, 1}}); // -const std::vector> REGION3_5_BIT({{45, 1}}); // -const std::vector> REGION4_5_BIT({{46, 1}}); // -const std::vector> REGION5_5_BIT({{47, 1}}); // -const std::vector> BGD_E1_E5A_5_BIT({{48, 10}}); // -constexpr double BGD_E1_E5A_5_LSB = TWO_N32; -const std::vector> BGD_E1_E5B_5_BIT({{58, 10}}); // -constexpr double BGD_E1_E5B_5_LSB = TWO_N32; -const std::vector> E5B_HS_5_BIT({{68, 2}}); // -const std::vector> E1_B_HS_5_BIT({{70, 2}}); // -const std::vector> E5B_DVS_5_BIT({{72, 1}}); // -const std::vector> E1_B_DVS_5_BIT({{73, 1}}); // -/* GST */ -const std::vector> WN_5_BIT({{74, 12}}); -const std::vector> TOW_5_BIT({{86, 20}}); -const std::vector> SPARE_5_BIT({{106, 23}}); - - -/* Page 6 */ -const std::vector> A0_6_BIT({{7, 32}}); -constexpr double A0_6_LSB = TWO_N30; -const std::vector> A1_6_BIT({{39, 24}}); -constexpr double A1_6_LSB = TWO_N50; -const std::vector> DELTA_T_LS_6_BIT({{63, 8}}); -const std::vector> T0T_6_BIT({{71, 8}}); -constexpr int32_t T0T_6_LSB = 3600; -const std::vector> W_NOT_6_BIT({{79, 8}}); -const std::vector> WN_LSF_6_BIT({{87, 8}}); -const std::vector> DN_6_BIT({{95, 3}}); -const std::vector> DELTA_T_LSF_6_BIT({{98, 8}}); -const std::vector> TOW_6_BIT({{106, 20}}); - - -/* Page 7 */ -const std::vector> IOD_A_7_BIT({{7, 4}}); -const std::vector> WN_A_7_BIT({{11, 2}}); -const std::vector> T0A_7_BIT({{13, 10}}); -constexpr int32_t T0A_7_LSB = 600; -const std::vector> SVI_D1_7_BIT({{23, 6}}); -const std::vector> DELTA_A_7_BIT({{29, 13}}); -constexpr double DELTA_A_7_LSB = TWO_N9; -const std::vector> E_7_BIT({{42, 11}}); -constexpr double E_7_LSB = TWO_N16; -const std::vector> OMEGA_7_BIT({{53, 16}}); -constexpr double OMEGA_7_LSB = TWO_N15; -const std::vector> DELTA_I_7_BIT({{69, 11}}); -constexpr double DELTA_I_7_LSB = TWO_N14; -const std::vector> OMEGA0_7_BIT({{80, 16}}); -constexpr double OMEGA0_7_LSB = TWO_N15; -const std::vector> OMEGA_DOT_7_BIT({{96, 11}}); -constexpr double OMEGA_DOT_7_LSB = TWO_N33; -const std::vector> M0_7_BIT({{107, 16}}); -constexpr double M0_7_LSB = TWO_N15; - - -/* Page 8 */ -const std::vector> IOD_A_8_BIT({{7, 4}}); -const std::vector> AF0_8_BIT({{11, 16}}); -constexpr double AF0_8_LSB = TWO_N19; -const std::vector> AF1_8_BIT({{27, 13}}); -constexpr double AF1_8_LSB = TWO_N38; -const std::vector> E5B_HS_8_BIT({{40, 2}}); -const std::vector> E1_B_HS_8_BIT({{42, 2}}); -const std::vector> SVI_D2_8_BIT({{44, 6}}); -const std::vector> DELTA_A_8_BIT({{50, 13}}); -constexpr double DELTA_A_8_LSB = TWO_N9; -const std::vector> E_8_BIT({{63, 11}}); -constexpr double E_8_LSB = TWO_N16; -const std::vector> OMEGA_8_BIT({{74, 16}}); -constexpr double OMEGA_8_LSB = TWO_N15; -const std::vector> DELTA_I_8_BIT({{90, 11}}); -constexpr double DELTA_I_8_LSB = TWO_N14; -const std::vector> OMEGA0_8_BIT({{101, 16}}); -constexpr double OMEGA0_8_LSB = TWO_N15; -const std::vector> OMEGA_DOT_8_BIT({{117, 11}}); -constexpr double OMEGA_DOT_8_LSB = TWO_N33; - - -/* Page 9 */ -const std::vector> IOD_A_9_BIT({{7, 4}}); -const std::vector> WN_A_9_BIT({{11, 2}}); -const std::vector> T0A_9_BIT({{13, 10}}); -constexpr int32_t T0A_9_LSB = 600; -const std::vector> M0_9_BIT({{23, 16}}); -constexpr double M0_9_LSB = TWO_N15; -const std::vector> AF0_9_BIT({{39, 16}}); -constexpr double AF0_9_LSB = TWO_N19; -const std::vector> AF1_9_BIT({{55, 13}}); -constexpr double AF1_9_LSB = TWO_N38; -const std::vector> E5B_HS_9_BIT({{68, 2}}); -const std::vector> E1_B_HS_9_BIT({{70, 2}}); -const std::vector> SVI_D3_9_BIT({{72, 6}}); -const std::vector> DELTA_A_9_BIT({{78, 13}}); -constexpr double DELTA_A_9_LSB = TWO_N9; -const std::vector> E_9_BIT({{91, 11}}); -constexpr double E_9_LSB = TWO_N16; -const std::vector> OMEGA_9_BIT({{102, 16}}); -constexpr double OMEGA_9_LSB = TWO_N15; -const std::vector> DELTA_I_9_BIT({{118, 11}}); -constexpr double DELTA_I_9_LSB = TWO_N14; - - -/* Page 10 */ -const std::vector> IOD_A_10_BIT({{7, 4}}); -const std::vector> OMEGA0_10_BIT({{11, 16}}); -constexpr double OMEGA0_10_LSB = TWO_N15; -const std::vector> OMEGA_DOT_10_BIT({{27, 11}}); -constexpr double OMEGA_DOT_10_LSB = TWO_N33; -const std::vector> M0_10_BIT({{38, 16}}); -constexpr double M0_10_LSB = TWO_N15; -const std::vector> AF0_10_BIT({{54, 16}}); -constexpr double AF0_10_LSB = TWO_N19; -const std::vector> AF1_10_BIT({{70, 13}}); -constexpr double AF1_10_LSB = TWO_N38; -const std::vector> E5B_HS_10_BIT({{83, 2}}); -const std::vector> E1_B_HS_10_BIT({{85, 2}}); -const std::vector> A_0_G_10_BIT({{87, 16}}); -constexpr double A_0G_10_LSB = TWO_N35; -const std::vector> A_1_G_10_BIT({{103, 12}}); -constexpr double A_1G_10_LSB = TWO_N51; -const std::vector> T_0_G_10_BIT({{115, 8}}); -constexpr int32_t T_0_G_10_LSB = 3600; -const std::vector> WN_0_G_10_BIT({{123, 6}}); - - -/* Page 0 */ -const std::vector> TIME_0_BIT({{7, 2}}); -const std::vector> WN_0_BIT({{97, 12}}); -const std::vector> TOW_0_BIT({{109, 20}}); - - // Galileo E1 primary codes constexpr size_t GALILEO_E1_B_PRIMARY_CODE_STR_LENGTH = 1023; constexpr char GALILEO_E1_B_PRIMARY_CODE[GALILEO_E1_NUMBER_OF_CODES][1024] = { diff --git a/src/core/system_parameters/Galileo_E5a.h b/src/core/system_parameters/Galileo_E5a.h index 0a6fa32ed..413212d8b 100644 --- a/src/core/system_parameters/Galileo_E5a.h +++ b/src/core/system_parameters/Galileo_E5a.h @@ -24,8 +24,6 @@ #include "gnss_frequencies.h" #include // for size_t #include -#include // std::pair -#include // Carrier and code frequencies @@ -67,154 +65,6 @@ constexpr int32_t GALILEO_FNAV_DATA_FRAME_BYTES = 27; constexpr char GALILEO_FNAV_PREAMBLE[13] = "101101110000"; -const std::vector> FNAV_PAGE_TYPE_BIT({{1, 6}}); - -/* WORD 1 iono corrections. FNAV (Galileo E5a message)*/ -const std::vector> FNAV_SV_ID_PRN_1_BIT({{7, 6}}); -const std::vector> FNAV_IO_DNAV_1_BIT({{13, 10}}); -const std::vector> FNAV_T0C_1_BIT({{23, 14}}); -constexpr int32_t FNAV_T0C_1_LSB = 60; -const std::vector> FNAV_AF0_1_BIT({{37, 31}}); -constexpr double FNAV_AF0_1_LSB = TWO_N34; -const std::vector> FNAV_AF1_1_BIT({{68, 21}}); -constexpr double FNAV_AF1_1_LSB = TWO_N46; -const std::vector> FNAV_AF2_1_BIT({{89, 6}}); -constexpr double FNAV_AF2_1_LSB = TWO_N59; -const std::vector> FNAV_SISA_1_BIT({{95, 8}}); -const std::vector> FNAV_AI0_1_BIT({{103, 11}}); -constexpr double FNAV_AI0_1_LSB = TWO_N2; -const std::vector> FNAV_AI1_1_BIT({{114, 11}}); -constexpr double FNAV_AI1_1_LSB = TWO_N8; -const std::vector> FNAV_AI2_1_BIT({{125, 14}}); -constexpr double FNAV_AI2_1_LSB = TWO_N15; -const std::vector> FNAV_REGION1_1_BIT({{139, 1}}); -const std::vector> FNAV_REGION2_1_BIT({{140, 1}}); -const std::vector> FNAV_REGION3_1_BIT({{141, 1}}); -const std::vector> FNAV_REGION4_1_BIT({{142, 1}}); -const std::vector> FNAV_REGION5_1_BIT({{143, 1}}); -const std::vector> FNAV_BGD_1_BIT({{144, 10}}); -constexpr double FNAV_BGD_1_LSB = TWO_N32; -const std::vector> FNAV_E5AHS_1_BIT({{154, 2}}); -const std::vector> FNAV_WN_1_BIT({{156, 12}}); -const std::vector> FNAV_TOW_1_BIT({{168, 20}}); -const std::vector> FNAV_E5ADVS_1_BIT({{188, 1}}); - -// WORD 2 Ephemeris (1/3) -const std::vector> FNAV_IO_DNAV_2_BIT({{7, 10}}); -const std::vector> FNAV_M0_2_BIT({{17, 32}}); -constexpr double FNAV_M0_2_LSB = PI_TWO_N31; -const std::vector> FNAV_OMEGADOT_2_BIT({{49, 24}}); -constexpr double FNAV_OMEGADOT_2_LSB = PI_TWO_N43; -const std::vector> FNAV_E_2_BIT({{73, 32}}); -constexpr double FNAV_E_2_LSB = TWO_N33; -const std::vector> FNAV_A12_2_BIT({{105, 32}}); -constexpr double FNAV_A12_2_LSB = TWO_N19; -const std::vector> FNAV_OMEGA0_2_BIT({{137, 32}}); -constexpr double FNAV_OMEGA0_2_LSB = PI_TWO_N31; -const std::vector> FNAV_IDOT_2_BIT({{169, 14}}); -constexpr double FNAV_IDOT_2_LSB = PI_TWO_N43; -const std::vector> FNAV_WN_2_BIT({{183, 12}}); -const std::vector> FNAV_TOW_2_BIT({{195, 20}}); - -// WORD 3 Ephemeris (2/3) -const std::vector> FNAV_IO_DNAV_3_BIT({{7, 10}}); -const std::vector> FNAV_I0_3_BIT({{17, 32}}); -constexpr double FNAV_I0_3_LSB = PI_TWO_N31; -const std::vector> FNAV_W_3_BIT({{49, 32}}); -constexpr double FNAV_W_3_LSB = PI_TWO_N31; -const std::vector> FNAV_DELTAN_3_BIT({{81, 16}}); -constexpr double FNAV_DELTAN_3_LSB = PI_TWO_N43; -const std::vector> FNAV_CUC_3_BIT({{97, 16}}); -constexpr double FNAV_CUC_3_LSB = TWO_N29; -const std::vector> FNAV_CUS_3_BIT({{113, 16}}); -constexpr double FNAV_CUS_3_LSB = TWO_N29; -const std::vector> FNAV_CRC_3_BIT({{129, 16}}); -constexpr double FNAV_CRC_3_LSB = TWO_N5; -const std::vector> FNAV_CRS_3_BIT({{145, 16}}); -constexpr double FNAV_CRS_3_LSB = TWO_N5; -const std::vector> FNAV_T0E_3_BIT({{161, 14}}); -constexpr int32_t FNAV_T0E_3_LSB = 60; -const std::vector> FNAV_WN_3_BIT({{175, 12}}); -const std::vector> FNAV_TOW_3_BIT({{187, 20}}); - -// WORD 4 Ephemeris (3/3) -const std::vector> FNAV_IO_DNAV_4_BIT({{7, 10}}); -const std::vector> FNAV_CIC_4_BIT({{17, 16}}); -constexpr double FNAV_CIC_4_LSB = TWO_N29; -const std::vector> FNAV_CIS_4_BIT({{33, 16}}); -constexpr double FNAV_CIS_4_LSB = TWO_N29; -const std::vector> FNAV_A0_4_BIT({{49, 32}}); -constexpr double FNAV_A0_4_LSB = TWO_N30; -const std::vector> FNAV_A1_4_BIT({{81, 24}}); -constexpr double FNAV_A1_4_LSB = TWO_N50; -const std::vector> FNAV_DELTATLS_4_BIT({{105, 8}}); -const std::vector> FNAV_T0T_4_BIT({{113, 8}}); -constexpr int32_t FNAV_T0T_4_LSB = 3600; -const std::vector> FNAV_W_NOT_4_BIT({{121, 8}}); -const std::vector> FNAV_W_NLSF_4_BIT({{129, 8}}); -const std::vector> FNAV_DN_4_BIT({{137, 3}}); -const std::vector> FNAV_DELTATLSF_4_BIT({{140, 8}}); -const std::vector> FNAV_T0G_4_BIT({{148, 8}}); -constexpr int32_t FNAV_T0G_4_LSB = 3600; -const std::vector> FNAV_A0G_4_BIT({{156, 16}}); -constexpr double FNAV_A0G_4_LSB = TWO_N35; -const std::vector> FNAV_A1G_4_BIT({{172, 12}}); -constexpr double FNAV_A1G_4_LSB = TWO_N51; -const std::vector> FNAV_W_N0G_4_BIT({{184, 6}}); -const std::vector> FNAV_TOW_4_BIT({{190, 20}}); - -// WORD 5 Almanac SVID1 SVID2(1/2) -const std::vector> FNAV_IO_DA_5_BIT({{7, 4}}); -const std::vector> FNAV_W_NA_5_BIT({{11, 2}}); -const std::vector> FNAV_T0A_5_BIT({{13, 10}}); -constexpr int32_t FNAV_T0A_5_LSB = 600; -const std::vector> FNAV_SVI_D1_5_BIT({{23, 6}}); -const std::vector> FNAV_DELTAA12_1_5_BIT({{29, 13}}); -constexpr double FNAV_DELTAA12_5_LSB = TWO_N9; -const std::vector> FNAV_E_1_5_BIT({{42, 11}}); -constexpr double FNAV_E_5_LSB = TWO_N16; -const std::vector> FNAV_W_1_5_BIT({{53, 16}}); -constexpr double FNAV_W_5_LSB = TWO_N15; -const std::vector> FNAV_DELTAI_1_5_BIT({{69, 11}}); -constexpr double FNAV_DELTAI_5_LSB = TWO_N14; -const std::vector> FNAV_OMEGA0_1_5_BIT({{80, 16}}); -constexpr double FNAV_OMEGA0_5_LSB = TWO_N15; -const std::vector> FNAV_OMEGADOT_1_5_BIT({{96, 11}}); -constexpr double FNAV_OMEGADOT_5_LSB = TWO_N33; -const std::vector> FNAV_M0_1_5_BIT({{107, 16}}); -constexpr double FNAV_M0_5_LSB = TWO_N15; -const std::vector> FNAV_AF0_1_5_BIT({{123, 16}}); -constexpr double FNAV_AF0_5_LSB = TWO_N19; -const std::vector> FNAV_AF1_1_5_BIT({{139, 13}}); -constexpr double FNAV_AF1_5_LSB = TWO_N38; -const std::vector> FNAV_E5AHS_1_5_BIT({{152, 2}}); -const std::vector> FNAV_SVI_D2_5_BIT({{154, 6}}); -const std::vector> FNAV_DELTAA12_2_5_BIT({{160, 13}}); -const std::vector> FNAV_E_2_5_BIT({{173, 11}}); -const std::vector> FNAV_W_2_5_BIT({{184, 16}}); -const std::vector> FNAV_DELTAI_2_5_BIT({{200, 11}}); -// const std::vector> FNAV_Omega012_2_5_bit({{210,4}}); - -// WORD 6 Almanac SVID2(1/2) SVID3 -const std::vector> FNAV_IO_DA_6_BIT({{7, 4}}); -// const std::vector> FNAV_Omega022_2_6_bit({{10,12}}); -const std::vector> FNAV_OMEGADOT_2_6_BIT({{23, 11}}); -const std::vector> FNAV_M0_2_6_BIT({{34, 16}}); -const std::vector> FNAV_AF0_2_6_BIT({{50, 16}}); -const std::vector> FNAV_AF1_2_6_BIT({{66, 13}}); -const std::vector> FNAV_E5AHS_2_6_BIT({{79, 2}}); -const std::vector> FNAV_SVI_D3_6_BIT({{81, 6}}); -const std::vector> FNAV_DELTAA12_3_6_BIT({{87, 13}}); -const std::vector> FNAV_E_3_6_BIT({{100, 11}}); -const std::vector> FNAV_W_3_6_BIT({{111, 16}}); -const std::vector> FNAV_DELTAI_3_6_BIT({{127, 11}}); -const std::vector> FNAV_OMEGA0_3_6_BIT({{138, 16}}); -const std::vector> FNAV_OMEGADOT_3_6_BIT({{154, 11}}); -const std::vector> FNAV_M0_3_6_BIT({{165, 16}}); -const std::vector> FNAV_AF0_3_6_BIT({{181, 16}}); -const std::vector> FNAV_AF1_3_6_BIT({{197, 13}}); -const std::vector> FNAV_E5AHS_3_6_BIT({{210, 2}}); - // Galileo E5a-I primary codes constexpr size_t GALILEO_E5A_I_PRIMARY_CODE_STR_LENGTH = 2558; constexpr char GALILEO_E5A_I_PRIMARY_CODE[GALILEO_E5A_NUMBER_OF_CODES][2559] = { diff --git a/src/core/system_parameters/Galileo_E5b.h b/src/core/system_parameters/Galileo_E5b.h index 9c84bff94..ef77050ab 100644 --- a/src/core/system_parameters/Galileo_E5b.h +++ b/src/core/system_parameters/Galileo_E5b.h @@ -25,8 +25,6 @@ #include "gnss_frequencies.h" #include #include -#include -#include // Carrier and code frequencies @@ -47,239 +45,9 @@ constexpr int32_t GALILEO_E5B_HISTORY_DEEP = 100; // optimum parameters constexpr uint32_t GALILEO_E5B_OPT_ACQ_FS_SPS = 10000000; //!< Sampling frequency that maximizes the acquisition SNR while using a non-multiple of chip rate -// Galileo I/NAV message structure -constexpr double GALILEO_INAV_PAGE_PART_WITH_PREABLE_SECONDS = 2.04; //!< Page Duration + (Galileo I/NAV Preamble bits)*(Galileo E5b-I tiered Code Period(seconds)) -constexpr int32_t GALILEO_INAV_PREAMBLE_LENGTH_BITS = 10; -constexpr int32_t GALILEO_INAV_PREAMBLE_PERIOD_SYMBOLS = 250; -constexpr int32_t GALILEO_INAV_PAGE_PART_SYMBOLS = 250; //!< Each Galileo INAV pages are composed of two parts (even and odd) each of 250 symbols, including preamble. See Galileo ICD 4.3.2 -constexpr int32_t GALILEO_INAV_PAGE_SYMBOLS = 500; //!< The complete Galileo INAV page length -constexpr int32_t GALILEO_INAV_PAGE_PART_SECONDS = 1; // a page part last 1 sec -constexpr int32_t GALILEO_INAV_PAGE_PART_MS = 1000; // a page part last 1 sec -constexpr int32_t GALILEO_INAV_PAGE_SECONDS = 2; // a full page last 2 sec -constexpr int32_t GALILEO_INAV_INTERLEAVER_ROWS = 8; -constexpr int32_t GALILEO_INAV_INTERLEAVER_COLS = 30; -constexpr int32_t GALILEO_TELEMETRY_RATE_BITS_SECOND = 250; // bps -constexpr int32_t GALILEO_PAGE_TYPE_BITS = 6; -constexpr int32_t GALILEO_DATA_JK_BITS = 128; -constexpr int32_t GALILEO_DATA_FRAME_BITS = 196; -constexpr int32_t GALILEO_DATA_FRAME_BYTES = 25; -constexpr char GALILEO_INAV_PREAMBLE[11] = "0101100000"; - // Galileo E5b-I secondary code constexpr char GALILEO_E5B_I_SECONDARY_CODE[5] = "1110"; - -const std::vector> TYPE({{1, 6}}); -const std::vector> PAGE_TYPE_BIT({{1, 6}}); - -/* Page 0 */ -const std::vector> TIME_0_BIT({{7, 2}}); -const std::vector> WN_0_BIT({{97, 12}}); -const std::vector> TOW_0_BIT({{109, 20}}); - - -/* Page 1 - Word type 1: Ephemeris (1/4) */ -const std::vector> IOD_NAV_1_BIT({{7, 10}}); -const std::vector> T0_E_1_BIT({{17, 14}}); -constexpr int32_t T0E_1_LSB = 60; -const std::vector> M0_1_BIT({{31, 32}}); -constexpr double M0_1_LSB = PI_TWO_N31; -const std::vector> E_1_BIT({{63, 32}}); -constexpr double E_1_LSB = TWO_N33; -const std::vector> A_1_BIT({{95, 32}}); -constexpr double A_1_LSB_GAL = TWO_N19; -// last two bits are reserved - - -/* Page 2 - Word type 2: Ephemeris (2/4) */ -const std::vector> IOD_NAV_2_BIT({{7, 10}}); -const std::vector> OMEGA_0_2_BIT({{17, 32}}); -constexpr double OMEGA_0_2_LSB = PI_TWO_N31; -const std::vector> I_0_2_BIT({{49, 32}}); -constexpr double I_0_2_LSB = PI_TWO_N31; -const std::vector> OMEGA_2_BIT({{81, 32}}); -constexpr double OMEGA_2_LSB = PI_TWO_N31; -const std::vector> I_DOT_2_BIT({{113, 14}}); -constexpr double I_DOT_2_LSB = PI_TWO_N43; -// last two bits are reserved - - -/* Word type 3: Ephemeris (3/4) and SISA */ -const std::vector> IOD_NAV_3_BIT({{7, 10}}); -const std::vector> OMEGA_DOT_3_BIT({{17, 24}}); -constexpr double OMEGA_DOT_3_LSB = PI_TWO_N43; -const std::vector> DELTA_N_3_BIT({{41, 16}}); -constexpr double DELTA_N_3_LSB = PI_TWO_N43; -const std::vector> C_UC_3_BIT({{57, 16}}); -constexpr double C_UC_3_LSB = TWO_N29; -const std::vector> C_US_3_BIT({{73, 16}}); -constexpr double C_US_3_LSB = TWO_N29; -const std::vector> C_RC_3_BIT({{89, 16}}); -constexpr double C_RC_3_LSB = TWO_N5; -const std::vector> C_RS_3_BIT({{105, 16}}); -constexpr double C_RS_3_LSB = TWO_N5; -const std::vector> SISA_3_BIT({{121, 8}}); - - -/* Word type 4: Ephemeris (4/4) and Clock correction parameters */ -const std::vector> IOD_NAV_4_BIT({{7, 10}}); -const std::vector> SV_ID_PRN_4_BIT({{17, 6}}); -const std::vector> C_IC_4_BIT({{23, 16}}); -constexpr double C_IC_4_LSB = TWO_N29; -const std::vector> C_IS_4_BIT({{39, 16}}); -constexpr double C_IS_4_LSB = TWO_N29; -const std::vector> T0C_4_BIT({{55, 14}}); // -constexpr int32_t T0C_4_LSB = 60; -const std::vector> AF0_4_BIT({{69, 31}}); // -constexpr double AF0_4_LSB = TWO_N34; -const std::vector> AF1_4_BIT({{100, 21}}); // -constexpr double AF1_4_LSB = TWO_N46; -const std::vector> AF2_4_BIT({{121, 6}}); -constexpr double AF2_4_LSB = TWO_N59; -const std::vector> SPARE_4_BIT({{127, 2}}); -// last two bits are reserved - - -/* Word type 5: Ionospheric correction, BGD, signal health and data validity status and GST */ -/* Ionospheric correction */ -/* Az */ -const std::vector> AI0_5_BIT({{7, 11}}); // -constexpr double AI0_5_LSB = TWO_N2; -const std::vector> AI1_5_BIT({{18, 11}}); // -constexpr double AI1_5_LSB = TWO_N8; -const std::vector> AI2_5_BIT({{29, 14}}); // -constexpr double AI2_5_LSB = TWO_N15; - - -/* Ionospheric disturbance flag */ -const std::vector> REGION1_5_BIT({{43, 1}}); // -const std::vector> REGION2_5_BIT({{44, 1}}); // -const std::vector> REGION3_5_BIT({{45, 1}}); // -const std::vector> REGION4_5_BIT({{46, 1}}); // -const std::vector> REGION5_5_BIT({{47, 1}}); // -const std::vector> BGD_E1_E5A_5_BIT({{48, 10}}); // -constexpr double BGD_E1_E5A_5_LSB = TWO_N32; -const std::vector> BGD_E1_E5B_5_BIT({{58, 10}}); // -constexpr double BGD_E1_E5B_5_LSB = TWO_N32; -const std::vector> E5B_HS_5_BIT({{68, 2}}); // -const std::vector> E1_B_HS_5_BIT({{70, 2}}); // -const std::vector> E5B_DVS_5_BIT({{72, 1}}); // -const std::vector> E1_B_DVS_5_BIT({{73, 1}}); // - - -/* GST */ -const std::vector> WN_5_BIT({{74, 12}}); -const std::vector> TOW_5_BIT({{86, 20}}); -const std::vector> SPARE_5_BIT({{106, 23}}); - - -/* Page 6 */ -const std::vector> A0_6_BIT({{7, 32}}); -constexpr double A0_6_LSB = TWO_N30; -const std::vector> A1_6_BIT({{39, 24}}); -constexpr double A1_6_LSB = TWO_N50; -const std::vector> DELTA_T_LS_6_BIT({{63, 8}}); -const std::vector> T0T_6_BIT({{71, 8}}); -constexpr int32_t T0T_6_LSB = 3600; -const std::vector> W_NOT_6_BIT({{79, 8}}); -const std::vector> WN_LSF_6_BIT({{87, 8}}); -const std::vector> DN_6_BIT({{95, 3}}); -const std::vector> DELTA_T_LSF_6_BIT({{98, 8}}); -const std::vector> TOW_6_BIT({{106, 20}}); - - -/* Page 7 */ -const std::vector> IOD_A_7_BIT({{7, 4}}); -const std::vector> WN_A_7_BIT({{11, 2}}); -const std::vector> T0A_7_BIT({{13, 10}}); -constexpr int32_t T0A_7_LSB = 600; -const std::vector> SVI_D1_7_BIT({{23, 6}}); -const std::vector> DELTA_A_7_BIT({{29, 13}}); -constexpr double DELTA_A_7_LSB = TWO_N9; -const std::vector> E_7_BIT({{42, 11}}); -constexpr double E_7_LSB = TWO_N16; -const std::vector> OMEGA_7_BIT({{53, 16}}); -constexpr double OMEGA_7_LSB = TWO_N15; -const std::vector> DELTA_I_7_BIT({{69, 11}}); -constexpr double DELTA_I_7_LSB = TWO_N14; -const std::vector> OMEGA0_7_BIT({{80, 16}}); -constexpr double OMEGA0_7_LSB = TWO_N15; -const std::vector> OMEGA_DOT_7_BIT({{96, 11}}); -constexpr double OMEGA_DOT_7_LSB = TWO_N33; -const std::vector> M0_7_BIT({{107, 16}}); -constexpr double M0_7_LSB = TWO_N15; - - -/* Page 8 */ -const std::vector> IOD_A_8_BIT({{7, 4}}); -const std::vector> AF0_8_BIT({{11, 16}}); -constexpr double AF0_8_LSB = TWO_N19; -const std::vector> AF1_8_BIT({{27, 13}}); -constexpr double AF1_8_LSB = TWO_N38; -const std::vector> E5B_HS_8_BIT({{40, 2}}); -const std::vector> E1_B_HS_8_BIT({{42, 2}}); -const std::vector> SVI_D2_8_BIT({{44, 6}}); -const std::vector> DELTA_A_8_BIT({{50, 13}}); -constexpr double DELTA_A_8_LSB = TWO_N9; -const std::vector> E_8_BIT({{63, 11}}); -constexpr double E_8_LSB = TWO_N16; -const std::vector> OMEGA_8_BIT({{74, 16}}); -constexpr double OMEGA_8_LSB = TWO_N15; -const std::vector> DELTA_I_8_BIT({{90, 11}}); -constexpr double DELTA_I_8_LSB = TWO_N14; -const std::vector> OMEGA0_8_BIT({{101, 16}}); -constexpr double OMEGA0_8_LSB = TWO_N15; -const std::vector> OMEGA_DOT_8_BIT({{117, 11}}); -constexpr double OMEGA_DOT_8_LSB = TWO_N33; - - -/* Page 9 */ -const std::vector> IOD_A_9_BIT({{7, 4}}); -const std::vector> WN_A_9_BIT({{11, 2}}); -const std::vector> T0A_9_BIT({{13, 10}}); -constexpr int32_t T0A_9_LSB = 600; -const std::vector> M0_9_BIT({{23, 16}}); -constexpr double M0_9_LSB = TWO_N15; -const std::vector> AF0_9_BIT({{39, 16}}); -constexpr double AF0_9_LSB = TWO_N19; -const std::vector> AF1_9_BIT({{55, 13}}); -constexpr double AF1_9_LSB = TWO_N38; -const std::vector> E5B_HS_9_BIT({{68, 2}}); -const std::vector> E1_B_HS_9_BIT({{70, 2}}); -const std::vector> SVI_D3_9_BIT({{72, 6}}); -const std::vector> DELTA_A_9_BIT({{78, 13}}); -constexpr double DELTA_A_9_LSB = TWO_N9; -const std::vector> E_9_BIT({{91, 11}}); -constexpr double E_9_LSB = TWO_N16; -const std::vector> OMEGA_9_BIT({{102, 16}}); -constexpr double OMEGA_9_LSB = TWO_N15; -const std::vector> DELTA_I_9_BIT({{118, 11}}); -constexpr double DELTA_I_9_LSB = TWO_N14; - - -/* Page 10 */ -const std::vector> IOD_A_10_BIT({{7, 4}}); -const std::vector> OMEGA0_10_BIT({{11, 16}}); -constexpr double OMEGA0_10_LSB = TWO_N15; -const std::vector> OMEGA_DOT_10_BIT({{27, 11}}); -constexpr double OMEGA_DOT_10_LSB = TWO_N33; -const std::vector> M0_10_BIT({{38, 16}}); -constexpr double M0_10_LSB = TWO_N15; -const std::vector> AF0_10_BIT({{54, 16}}); -constexpr double AF0_10_LSB = TWO_N19; -const std::vector> AF1_10_BIT({{70, 13}}); -constexpr double AF1_10_LSB = TWO_N38; -const std::vector> E5B_HS_10_BIT({{83, 2}}); -const std::vector> E1_B_HS_10_BIT({{85, 2}}); -const std::vector> A_0_G_10_BIT({{87, 16}}); -constexpr double A_0G_10_LSB = TWO_N35; -const std::vector> A_1_G_10_BIT({{103, 12}}); -constexpr double A_1G_10_LSB = TWO_N51; -const std::vector> T_0_G_10_BIT({{115, 8}}); -constexpr int32_t T_0_G_10_LSB = 3600; -const std::vector> WN_0_G_10_BIT({{123, 6}}); - - // Galileo E5b-I primary codes constexpr size_t GALILEO_E5B_I_PRIMARY_CODE_STR_LENGTH = 2558; constexpr char GALILEO_E5B_I_PRIMARY_CODE[GALILEO_E5B_NUMBER_OF_CODES][2559] = { diff --git a/src/core/system_parameters/Galileo_FNAV.h b/src/core/system_parameters/Galileo_FNAV.h new file mode 100644 index 000000000..a954dd99b --- /dev/null +++ b/src/core/system_parameters/Galileo_FNAV.h @@ -0,0 +1,177 @@ +/*! + * \file Galileo_FNAV.h + * \brief Galileo FNAV mesage constants + * \author Carles Fernandez, 2020. cfernandez(at)cttc.es + * + * + * ----------------------------------------------------------------------------- + * + * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + * ----------------------------------------------------------------------------- + */ + +#ifndef GNSS_SDR_GALILEO_FNAV_H +#define GNSS_SDR_GALILEO_FNAV_H + +#include "MATH_CONSTANTS.h" +#include +#include +#include + +const std::vector> FNAV_PAGE_TYPE_BIT({{1, 6}}); + +/* WORD 1 iono corrections. FNAV (Galileo E5a message)*/ +const std::vector> FNAV_SV_ID_PRN_1_BIT({{7, 6}}); +const std::vector> FNAV_IO_DNAV_1_BIT({{13, 10}}); +const std::vector> FNAV_T0C_1_BIT({{23, 14}}); +constexpr int32_t FNAV_T0C_1_LSB = 60; +const std::vector> FNAV_AF0_1_BIT({{37, 31}}); +constexpr double FNAV_AF0_1_LSB = TWO_N34; +const std::vector> FNAV_AF1_1_BIT({{68, 21}}); +constexpr double FNAV_AF1_1_LSB = TWO_N46; +const std::vector> FNAV_AF2_1_BIT({{89, 6}}); +constexpr double FNAV_AF2_1_LSB = TWO_N59; +const std::vector> FNAV_SISA_1_BIT({{95, 8}}); +const std::vector> FNAV_AI0_1_BIT({{103, 11}}); +constexpr double FNAV_AI0_1_LSB = TWO_N2; +const std::vector> FNAV_AI1_1_BIT({{114, 11}}); +constexpr double FNAV_AI1_1_LSB = TWO_N8; +const std::vector> FNAV_AI2_1_BIT({{125, 14}}); +constexpr double FNAV_AI2_1_LSB = TWO_N15; +const std::vector> FNAV_REGION1_1_BIT({{139, 1}}); +const std::vector> FNAV_REGION2_1_BIT({{140, 1}}); +const std::vector> FNAV_REGION3_1_BIT({{141, 1}}); +const std::vector> FNAV_REGION4_1_BIT({{142, 1}}); +const std::vector> FNAV_REGION5_1_BIT({{143, 1}}); +const std::vector> FNAV_BGD_1_BIT({{144, 10}}); +constexpr double FNAV_BGD_1_LSB = TWO_N32; +const std::vector> FNAV_E5AHS_1_BIT({{154, 2}}); +const std::vector> FNAV_WN_1_BIT({{156, 12}}); +const std::vector> FNAV_TOW_1_BIT({{168, 20}}); +const std::vector> FNAV_E5ADVS_1_BIT({{188, 1}}); + +// WORD 2 Ephemeris (1/3) +const std::vector> FNAV_IO_DNAV_2_BIT({{7, 10}}); +const std::vector> FNAV_M0_2_BIT({{17, 32}}); +constexpr double FNAV_M0_2_LSB = PI_TWO_N31; +const std::vector> FNAV_OMEGADOT_2_BIT({{49, 24}}); +constexpr double FNAV_OMEGADOT_2_LSB = PI_TWO_N43; +const std::vector> FNAV_E_2_BIT({{73, 32}}); +constexpr double FNAV_E_2_LSB = TWO_N33; +const std::vector> FNAV_A12_2_BIT({{105, 32}}); +constexpr double FNAV_A12_2_LSB = TWO_N19; +const std::vector> FNAV_OMEGA0_2_BIT({{137, 32}}); +constexpr double FNAV_OMEGA0_2_LSB = PI_TWO_N31; +const std::vector> FNAV_IDOT_2_BIT({{169, 14}}); +constexpr double FNAV_IDOT_2_LSB = PI_TWO_N43; +const std::vector> FNAV_WN_2_BIT({{183, 12}}); +const std::vector> FNAV_TOW_2_BIT({{195, 20}}); + +// WORD 3 Ephemeris (2/3) +const std::vector> FNAV_IO_DNAV_3_BIT({{7, 10}}); +const std::vector> FNAV_I0_3_BIT({{17, 32}}); +constexpr double FNAV_I0_3_LSB = PI_TWO_N31; +const std::vector> FNAV_W_3_BIT({{49, 32}}); +constexpr double FNAV_W_3_LSB = PI_TWO_N31; +const std::vector> FNAV_DELTAN_3_BIT({{81, 16}}); +constexpr double FNAV_DELTAN_3_LSB = PI_TWO_N43; +const std::vector> FNAV_CUC_3_BIT({{97, 16}}); +constexpr double FNAV_CUC_3_LSB = TWO_N29; +const std::vector> FNAV_CUS_3_BIT({{113, 16}}); +constexpr double FNAV_CUS_3_LSB = TWO_N29; +const std::vector> FNAV_CRC_3_BIT({{129, 16}}); +constexpr double FNAV_CRC_3_LSB = TWO_N5; +const std::vector> FNAV_CRS_3_BIT({{145, 16}}); +constexpr double FNAV_CRS_3_LSB = TWO_N5; +const std::vector> FNAV_T0E_3_BIT({{161, 14}}); +constexpr int32_t FNAV_T0E_3_LSB = 60; +const std::vector> FNAV_WN_3_BIT({{175, 12}}); +const std::vector> FNAV_TOW_3_BIT({{187, 20}}); + +// WORD 4 Ephemeris (3/3) +const std::vector> FNAV_IO_DNAV_4_BIT({{7, 10}}); +const std::vector> FNAV_CIC_4_BIT({{17, 16}}); +constexpr double FNAV_CIC_4_LSB = TWO_N29; +const std::vector> FNAV_CIS_4_BIT({{33, 16}}); +constexpr double FNAV_CIS_4_LSB = TWO_N29; +const std::vector> FNAV_A0_4_BIT({{49, 32}}); +constexpr double FNAV_A0_4_LSB = TWO_N30; +const std::vector> FNAV_A1_4_BIT({{81, 24}}); +constexpr double FNAV_A1_4_LSB = TWO_N50; +const std::vector> FNAV_DELTATLS_4_BIT({{105, 8}}); +const std::vector> FNAV_T0T_4_BIT({{113, 8}}); +constexpr int32_t FNAV_T0T_4_LSB = 3600; +const std::vector> FNAV_W_NOT_4_BIT({{121, 8}}); +const std::vector> FNAV_W_NLSF_4_BIT({{129, 8}}); +const std::vector> FNAV_DN_4_BIT({{137, 3}}); +const std::vector> FNAV_DELTATLSF_4_BIT({{140, 8}}); +const std::vector> FNAV_T0G_4_BIT({{148, 8}}); +constexpr int32_t FNAV_T0G_4_LSB = 3600; +const std::vector> FNAV_A0G_4_BIT({{156, 16}}); +constexpr double FNAV_A0G_4_LSB = TWO_N35; +const std::vector> FNAV_A1G_4_BIT({{172, 12}}); +constexpr double FNAV_A1G_4_LSB = TWO_N51; +const std::vector> FNAV_W_N0G_4_BIT({{184, 6}}); +const std::vector> FNAV_TOW_4_BIT({{190, 20}}); + +// WORD 5 Almanac SVID1 SVID2(1/2) +const std::vector> FNAV_IO_DA_5_BIT({{7, 4}}); +const std::vector> FNAV_W_NA_5_BIT({{11, 2}}); +const std::vector> FNAV_T0A_5_BIT({{13, 10}}); +constexpr int32_t FNAV_T0A_5_LSB = 600; +const std::vector> FNAV_SVI_D1_5_BIT({{23, 6}}); +const std::vector> FNAV_DELTAA12_1_5_BIT({{29, 13}}); +constexpr double FNAV_DELTAA12_5_LSB = TWO_N9; +const std::vector> FNAV_E_1_5_BIT({{42, 11}}); +constexpr double FNAV_E_5_LSB = TWO_N16; +const std::vector> FNAV_W_1_5_BIT({{53, 16}}); +constexpr double FNAV_W_5_LSB = TWO_N15; +const std::vector> FNAV_DELTAI_1_5_BIT({{69, 11}}); +constexpr double FNAV_DELTAI_5_LSB = TWO_N14; +const std::vector> FNAV_OMEGA0_1_5_BIT({{80, 16}}); +constexpr double FNAV_OMEGA0_5_LSB = TWO_N15; +const std::vector> FNAV_OMEGADOT_1_5_BIT({{96, 11}}); +constexpr double FNAV_OMEGADOT_5_LSB = TWO_N33; +const std::vector> FNAV_M0_1_5_BIT({{107, 16}}); +constexpr double FNAV_M0_5_LSB = TWO_N15; +const std::vector> FNAV_AF0_1_5_BIT({{123, 16}}); +constexpr double FNAV_AF0_5_LSB = TWO_N19; +const std::vector> FNAV_AF1_1_5_BIT({{139, 13}}); +constexpr double FNAV_AF1_5_LSB = TWO_N38; +const std::vector> FNAV_E5AHS_1_5_BIT({{152, 2}}); +const std::vector> FNAV_SVI_D2_5_BIT({{154, 6}}); +const std::vector> FNAV_DELTAA12_2_5_BIT({{160, 13}}); +const std::vector> FNAV_E_2_5_BIT({{173, 11}}); +const std::vector> FNAV_W_2_5_BIT({{184, 16}}); +const std::vector> FNAV_DELTAI_2_5_BIT({{200, 11}}); +// const std::vector> FNAV_Omega012_2_5_bit({{210,4}}); + +// WORD 6 Almanac SVID2(1/2) SVID3 +const std::vector> FNAV_IO_DA_6_BIT({{7, 4}}); +// const std::vector> FNAV_Omega022_2_6_bit({{10,12}}); +const std::vector> FNAV_OMEGADOT_2_6_BIT({{23, 11}}); +const std::vector> FNAV_M0_2_6_BIT({{34, 16}}); +const std::vector> FNAV_AF0_2_6_BIT({{50, 16}}); +const std::vector> FNAV_AF1_2_6_BIT({{66, 13}}); +const std::vector> FNAV_E5AHS_2_6_BIT({{79, 2}}); +const std::vector> FNAV_SVI_D3_6_BIT({{81, 6}}); +const std::vector> FNAV_DELTAA12_3_6_BIT({{87, 13}}); +const std::vector> FNAV_E_3_6_BIT({{100, 11}}); +const std::vector> FNAV_W_3_6_BIT({{111, 16}}); +const std::vector> FNAV_DELTAI_3_6_BIT({{127, 11}}); +const std::vector> FNAV_OMEGA0_3_6_BIT({{138, 16}}); +const std::vector> FNAV_OMEGADOT_3_6_BIT({{154, 11}}); +const std::vector> FNAV_M0_3_6_BIT({{165, 16}}); +const std::vector> FNAV_AF0_3_6_BIT({{181, 16}}); +const std::vector> FNAV_AF1_3_6_BIT({{197, 13}}); +const std::vector> FNAV_E5AHS_3_6_BIT({{210, 2}}); + +#endif // GNSS_SDR_GALILEO_FNAV_H diff --git a/src/core/system_parameters/Galileo_INAV.h b/src/core/system_parameters/Galileo_INAV.h new file mode 100644 index 000000000..28992d26d --- /dev/null +++ b/src/core/system_parameters/Galileo_INAV.h @@ -0,0 +1,252 @@ +/*! + * \file Galileo_INAV.h + * \brief Galileo INAV mesage constants + * \author Carles Fernandez, 2020. cfernandez(at)cttc.es + * + * + * ----------------------------------------------------------------------------- + * + * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + * ----------------------------------------------------------------------------- + */ + +#ifndef GNSS_SDR_GALILEO_INAV_H +#define GNSS_SDR_GALILEO_INAV_H + +#include "MATH_CONSTANTS.h" +#include +#include +#include + + +// Galileo INAV message structure +constexpr int32_t GALILEO_INAV_PREAMBLE_LENGTH_BITS = 10; +constexpr double GALILEO_INAV_PAGE_PART_WITH_PREABLE_SECONDS = 2.04; //!< Page Duration + (Galileo I/NAV Preamble bits)*(Galileo E5b-I tiered Code Period(seconds)) +constexpr int32_t GALILEO_INAV_PREAMBLE_PERIOD_SYMBOLS = 250; +constexpr int32_t GALILEO_INAV_PAGE_PART_SYMBOLS = 250; //!< Each Galileo INAV pages are composed of two parts (even and odd) each of 250 symbols, including preamble. See Galileo ICD 4.3.2 +constexpr int32_t GALILEO_INAV_PAGE_SYMBOLS = 500; //!< The complete Galileo INAV page length +constexpr int32_t GALILEO_INAV_PAGE_PART_SECONDS = 1; // a page part last 1 sec +constexpr int32_t GALILEO_INAV_PAGE_PART_MS = 1000; // a page part last 1 sec +constexpr int32_t GALILEO_INAV_PAGE_SECONDS = 2; // a full page last 2 sec +constexpr int32_t GALILEO_INAV_INTERLEAVER_ROWS = 8; +constexpr int32_t GALILEO_INAV_INTERLEAVER_COLS = 30; +constexpr int32_t GALILEO_TELEMETRY_RATE_BITS_SECOND = 250; // bps +constexpr int32_t GALILEO_PAGE_TYPE_BITS = 6; +constexpr int32_t GALILEO_DATA_JK_BITS = 128; +constexpr int32_t GALILEO_DATA_FRAME_BITS = 196; +constexpr int32_t GALILEO_DATA_FRAME_BYTES = 25; +constexpr char GALILEO_INAV_PREAMBLE[11] = "0101100000"; + +const std::vector> TYPE({{1, 6}}); +const std::vector> PAGE_TYPE_BIT({{1, 6}}); + +/* Page 1 - Word type 1: Ephemeris (1/4) */ +const std::vector> IOD_NAV_1_BIT({{7, 10}}); +const std::vector> T0_E_1_BIT({{17, 14}}); +constexpr int32_t T0E_1_LSB = 60; +const std::vector> M0_1_BIT({{31, 32}}); +constexpr double M0_1_LSB = PI_TWO_N31; +const std::vector> E_1_BIT({{63, 32}}); +constexpr double E_1_LSB = TWO_N33; +const std::vector> A_1_BIT({{95, 32}}); +constexpr double A_1_LSB_GAL = TWO_N19; +// last two bits are reserved + + +/* Page 2 - Word type 2: Ephemeris (2/4) */ +const std::vector> IOD_NAV_2_BIT({{7, 10}}); +const std::vector> OMEGA_0_2_BIT({{17, 32}}); +constexpr double OMEGA_0_2_LSB = PI_TWO_N31; +const std::vector> I_0_2_BIT({{49, 32}}); +constexpr double I_0_2_LSB = PI_TWO_N31; +const std::vector> OMEGA_2_BIT({{81, 32}}); +constexpr double OMEGA_2_LSB = PI_TWO_N31; +const std::vector> I_DOT_2_BIT({{113, 14}}); +constexpr double I_DOT_2_LSB = PI_TWO_N43; +// last two bits are reserved + +/* Word type 3: Ephemeris (3/4) and SISA */ +const std::vector> IOD_NAV_3_BIT({{7, 10}}); +const std::vector> OMEGA_DOT_3_BIT({{17, 24}}); +constexpr double OMEGA_DOT_3_LSB = PI_TWO_N43; +const std::vector> DELTA_N_3_BIT({{41, 16}}); +constexpr double DELTA_N_3_LSB = PI_TWO_N43; +const std::vector> C_UC_3_BIT({{57, 16}}); +constexpr double C_UC_3_LSB = TWO_N29; +const std::vector> C_US_3_BIT({{73, 16}}); +constexpr double C_US_3_LSB = TWO_N29; +const std::vector> C_RC_3_BIT({{89, 16}}); +constexpr double C_RC_3_LSB = TWO_N5; +const std::vector> C_RS_3_BIT({{105, 16}}); +constexpr double C_RS_3_LSB = TWO_N5; +const std::vector> SISA_3_BIT({{121, 8}}); + + +/* Word type 4: Ephemeris (4/4) and Clock correction parameters */ +const std::vector> IOD_NAV_4_BIT({{7, 10}}); +const std::vector> SV_ID_PRN_4_BIT({{17, 6}}); +const std::vector> C_IC_4_BIT({{23, 16}}); +constexpr double C_IC_4_LSB = TWO_N29; +const std::vector> C_IS_4_BIT({{39, 16}}); +constexpr double C_IS_4_LSB = TWO_N29; +const std::vector> T0C_4_BIT({{55, 14}}); // +constexpr int32_t T0C_4_LSB = 60; +const std::vector> AF0_4_BIT({{69, 31}}); // +constexpr double AF0_4_LSB = TWO_N34; +const std::vector> AF1_4_BIT({{100, 21}}); // +constexpr double AF1_4_LSB = TWO_N46; +const std::vector> AF2_4_BIT({{121, 6}}); +constexpr double AF2_4_LSB = TWO_N59; +const std::vector> SPARE_4_BIT({{127, 2}}); +// last two bits are reserved + +/* Word type 5: Ionospheric correction, BGD, signal health and data validity status and GST */ +/* Ionospheric correction */ +/* Az */ +const std::vector> AI0_5_BIT({{7, 11}}); // +constexpr double AI0_5_LSB = TWO_N2; +const std::vector> AI1_5_BIT({{18, 11}}); // +constexpr double AI1_5_LSB = TWO_N8; +const std::vector> AI2_5_BIT({{29, 14}}); // +constexpr double AI2_5_LSB = TWO_N15; +/* Ionospheric disturbance flag */ +const std::vector> REGION1_5_BIT({{43, 1}}); // +const std::vector> REGION2_5_BIT({{44, 1}}); // +const std::vector> REGION3_5_BIT({{45, 1}}); // +const std::vector> REGION4_5_BIT({{46, 1}}); // +const std::vector> REGION5_5_BIT({{47, 1}}); // +const std::vector> BGD_E1_E5A_5_BIT({{48, 10}}); // +constexpr double BGD_E1_E5A_5_LSB = TWO_N32; +const std::vector> BGD_E1_E5B_5_BIT({{58, 10}}); // +constexpr double BGD_E1_E5B_5_LSB = TWO_N32; +const std::vector> E5B_HS_5_BIT({{68, 2}}); // +const std::vector> E1_B_HS_5_BIT({{70, 2}}); // +const std::vector> E5B_DVS_5_BIT({{72, 1}}); // +const std::vector> E1_B_DVS_5_BIT({{73, 1}}); // +/* GST */ +const std::vector> WN_5_BIT({{74, 12}}); +const std::vector> TOW_5_BIT({{86, 20}}); +const std::vector> SPARE_5_BIT({{106, 23}}); + + +/* Page 6 */ +const std::vector> A0_6_BIT({{7, 32}}); +constexpr double A0_6_LSB = TWO_N30; +const std::vector> A1_6_BIT({{39, 24}}); +constexpr double A1_6_LSB = TWO_N50; +const std::vector> DELTA_T_LS_6_BIT({{63, 8}}); +const std::vector> T0T_6_BIT({{71, 8}}); +constexpr int32_t T0T_6_LSB = 3600; +const std::vector> W_NOT_6_BIT({{79, 8}}); +const std::vector> WN_LSF_6_BIT({{87, 8}}); +const std::vector> DN_6_BIT({{95, 3}}); +const std::vector> DELTA_T_LSF_6_BIT({{98, 8}}); +const std::vector> TOW_6_BIT({{106, 20}}); + + +/* Page 7 */ +const std::vector> IOD_A_7_BIT({{7, 4}}); +const std::vector> WN_A_7_BIT({{11, 2}}); +const std::vector> T0A_7_BIT({{13, 10}}); +constexpr int32_t T0A_7_LSB = 600; +const std::vector> SVI_D1_7_BIT({{23, 6}}); +const std::vector> DELTA_A_7_BIT({{29, 13}}); +constexpr double DELTA_A_7_LSB = TWO_N9; +const std::vector> E_7_BIT({{42, 11}}); +constexpr double E_7_LSB = TWO_N16; +const std::vector> OMEGA_7_BIT({{53, 16}}); +constexpr double OMEGA_7_LSB = TWO_N15; +const std::vector> DELTA_I_7_BIT({{69, 11}}); +constexpr double DELTA_I_7_LSB = TWO_N14; +const std::vector> OMEGA0_7_BIT({{80, 16}}); +constexpr double OMEGA0_7_LSB = TWO_N15; +const std::vector> OMEGA_DOT_7_BIT({{96, 11}}); +constexpr double OMEGA_DOT_7_LSB = TWO_N33; +const std::vector> M0_7_BIT({{107, 16}}); +constexpr double M0_7_LSB = TWO_N15; + + +/* Page 8 */ +const std::vector> IOD_A_8_BIT({{7, 4}}); +const std::vector> AF0_8_BIT({{11, 16}}); +constexpr double AF0_8_LSB = TWO_N19; +const std::vector> AF1_8_BIT({{27, 13}}); +constexpr double AF1_8_LSB = TWO_N38; +const std::vector> E5B_HS_8_BIT({{40, 2}}); +const std::vector> E1_B_HS_8_BIT({{42, 2}}); +const std::vector> SVI_D2_8_BIT({{44, 6}}); +const std::vector> DELTA_A_8_BIT({{50, 13}}); +constexpr double DELTA_A_8_LSB = TWO_N9; +const std::vector> E_8_BIT({{63, 11}}); +constexpr double E_8_LSB = TWO_N16; +const std::vector> OMEGA_8_BIT({{74, 16}}); +constexpr double OMEGA_8_LSB = TWO_N15; +const std::vector> DELTA_I_8_BIT({{90, 11}}); +constexpr double DELTA_I_8_LSB = TWO_N14; +const std::vector> OMEGA0_8_BIT({{101, 16}}); +constexpr double OMEGA0_8_LSB = TWO_N15; +const std::vector> OMEGA_DOT_8_BIT({{117, 11}}); +constexpr double OMEGA_DOT_8_LSB = TWO_N33; + + +/* Page 9 */ +const std::vector> IOD_A_9_BIT({{7, 4}}); +const std::vector> WN_A_9_BIT({{11, 2}}); +const std::vector> T0A_9_BIT({{13, 10}}); +constexpr int32_t T0A_9_LSB = 600; +const std::vector> M0_9_BIT({{23, 16}}); +constexpr double M0_9_LSB = TWO_N15; +const std::vector> AF0_9_BIT({{39, 16}}); +constexpr double AF0_9_LSB = TWO_N19; +const std::vector> AF1_9_BIT({{55, 13}}); +constexpr double AF1_9_LSB = TWO_N38; +const std::vector> E5B_HS_9_BIT({{68, 2}}); +const std::vector> E1_B_HS_9_BIT({{70, 2}}); +const std::vector> SVI_D3_9_BIT({{72, 6}}); +const std::vector> DELTA_A_9_BIT({{78, 13}}); +constexpr double DELTA_A_9_LSB = TWO_N9; +const std::vector> E_9_BIT({{91, 11}}); +constexpr double E_9_LSB = TWO_N16; +const std::vector> OMEGA_9_BIT({{102, 16}}); +constexpr double OMEGA_9_LSB = TWO_N15; +const std::vector> DELTA_I_9_BIT({{118, 11}}); +constexpr double DELTA_I_9_LSB = TWO_N14; + + +/* Page 10 */ +const std::vector> IOD_A_10_BIT({{7, 4}}); +const std::vector> OMEGA0_10_BIT({{11, 16}}); +constexpr double OMEGA0_10_LSB = TWO_N15; +const std::vector> OMEGA_DOT_10_BIT({{27, 11}}); +constexpr double OMEGA_DOT_10_LSB = TWO_N33; +const std::vector> M0_10_BIT({{38, 16}}); +constexpr double M0_10_LSB = TWO_N15; +const std::vector> AF0_10_BIT({{54, 16}}); +constexpr double AF0_10_LSB = TWO_N19; +const std::vector> AF1_10_BIT({{70, 13}}); +constexpr double AF1_10_LSB = TWO_N38; +const std::vector> E5B_HS_10_BIT({{83, 2}}); +const std::vector> E1_B_HS_10_BIT({{85, 2}}); +const std::vector> A_0_G_10_BIT({{87, 16}}); +constexpr double A_0G_10_LSB = TWO_N35; +const std::vector> A_1_G_10_BIT({{103, 12}}); +constexpr double A_1G_10_LSB = TWO_N51; +const std::vector> T_0_G_10_BIT({{115, 8}}); +constexpr int32_t T_0_G_10_LSB = 3600; +const std::vector> WN_0_G_10_BIT({{123, 6}}); + + +/* Page 0 */ +const std::vector> TIME_0_BIT({{7, 2}}); +const std::vector> WN_0_BIT({{97, 12}}); +const std::vector> TOW_0_BIT({{109, 20}}); + +#endif // GNSS_SDR_GALILEO_INAV_H diff --git a/src/core/system_parameters/beidou_dnav_navigation_message.cc b/src/core/system_parameters/beidou_dnav_navigation_message.cc index e3c0b50cc..9979f4877 100644 --- a/src/core/system_parameters/beidou_dnav_navigation_message.cc +++ b/src/core/system_parameters/beidou_dnav_navigation_message.cc @@ -511,7 +511,7 @@ int32_t Beidou_Dnav_Navigation_Message::d1_subframe_decoder(std::string const& s } if (SV_page_5 == 10) { - d_DeltaT_LS = static_cast(read_navigation_signed(subframe_bits, D1_DELTA_T_LS)); + i_DeltaT_LS = static_cast(read_navigation_signed(subframe_bits, D1_DELTA_T_LS)); d_DeltaT_LSF = static_cast(read_navigation_signed(subframe_bits, D1_DELTA_T_LSF)); i_WN_LSF = static_cast(read_navigation_signed(subframe_bits, D1_WN_LSF)); d_A0UTC = static_cast(read_navigation_signed(subframe_bits, D1_A0UTC)); @@ -730,7 +730,7 @@ double Beidou_Dnav_Navigation_Message::utc_time(const double beidoutime_correcte { double t_utc; double t_utc_daytime; - double Delta_t_UTC = d_DeltaT_LS + d_A0UTC + d_A1UTC * (beidoutime_corrected); + double Delta_t_UTC = i_DeltaT_LS + d_A0UTC + d_A1UTC * (beidoutime_corrected); // Determine if the effectivity time of the leap second event is in the past int32_t weeksToLeapSecondEvent = i_WN_LSF - i_BEIDOU_week; @@ -754,7 +754,7 @@ double Beidou_Dnav_Navigation_Message::utc_time(const double beidoutime_correcte if ((beidoutime_corrected - secondOfLeapSecondEvent) < (static_cast(5) / static_cast(4)) * 24 * 60 * 60) { int32_t W = fmod(beidoutime_corrected - Delta_t_UTC - 43200, 86400) + 43200; - t_utc_daytime = fmod(W, 86400 + d_DeltaT_LSF - d_DeltaT_LS); + t_utc_daytime = fmod(W, 86400 + d_DeltaT_LSF - i_DeltaT_LS); } else { @@ -896,7 +896,7 @@ Beidou_Dnav_Utc_Model Beidou_Dnav_Navigation_Message::get_utc_model() // UTC parameters utc_model.d_A1_UTC = d_A1UTC; utc_model.d_A0_UTC = d_A0UTC; - utc_model.d_DeltaT_LS = d_DeltaT_LS; + utc_model.i_DeltaT_LS = i_DeltaT_LS; utc_model.i_WN_LSF = i_WN_LSF; utc_model.i_DN = i_DN; utc_model.d_DeltaT_LSF = d_DeltaT_LSF; diff --git a/src/core/system_parameters/beidou_dnav_navigation_message.h b/src/core/system_parameters/beidou_dnav_navigation_message.h index 99b100774..0b1dd07aa 100644 --- a/src/core/system_parameters/beidou_dnav_navigation_message.h +++ b/src/core/system_parameters/beidou_dnav_navigation_message.h @@ -267,7 +267,7 @@ private: // UTC parameters double d_A1UTC{}; // 1st order term of a model that relates GPS and UTC time [s/s] double d_A0UTC{}; // Constant of a model that relates GPS and UTC time [s] - double d_DeltaT_LS{}; // delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. + int32_t i_DeltaT_LS{}; // delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. int32_t i_WN_LSF{}; // Week number at the end of which the leap second becomes effective [weeks] int32_t i_DN{}; // Day number (DN) at the end of which the leap second becomes effective [days] double d_DeltaT_LSF{}; // Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] diff --git a/src/core/system_parameters/beidou_dnav_utc_model.h b/src/core/system_parameters/beidou_dnav_utc_model.h index 01e96ed6c..28329fe48 100644 --- a/src/core/system_parameters/beidou_dnav_utc_model.h +++ b/src/core/system_parameters/beidou_dnav_utc_model.h @@ -38,7 +38,7 @@ public: // BeiDou UTC parameters double d_A0_UTC{}; //!< BDT clock bias relative to UTC [s] double d_A1_UTC{}; //!< BDT clock rate relative to UTC [s/s] - double d_DeltaT_LS{}; //!< Delta time due to leap seconds before the new leap second effective + int i_DeltaT_LS{}; //!< Delta time due to leap seconds before the new leap second effective int i_WN_LSF{}; //!< Week number of the new leap second int i_DN{}; //!< Day number of week of the new leap second double d_DeltaT_LSF{}; //!< Delta time due to leap seconds after the new leap second effective [s] @@ -69,7 +69,7 @@ public: }; archive& make_nvp("d_A1", d_A1_UTC); archive& make_nvp("d_A0", d_A0_UTC); - archive& make_nvp("d_DeltaT_LS", d_DeltaT_LS); + archive& make_nvp("i_DeltaT_LS", i_DeltaT_LS); archive& make_nvp("i_WN_LSF", i_WN_LSF); archive& make_nvp("i_DN", i_DN); archive& make_nvp("d_DeltaT_LSF", d_DeltaT_LSF); diff --git a/src/core/system_parameters/galileo_fnav_message.h b/src/core/system_parameters/galileo_fnav_message.h index b506bc521..652d13105 100644 --- a/src/core/system_parameters/galileo_fnav_message.h +++ b/src/core/system_parameters/galileo_fnav_message.h @@ -28,6 +28,7 @@ #include "Galileo_E5a.h" +#include "Galileo_FNAV.h" #include "galileo_almanac_helper.h" #include "galileo_ephemeris.h" #include "galileo_iono.h" diff --git a/src/core/system_parameters/galileo_navigation_message.h b/src/core/system_parameters/galileo_navigation_message.h index 3a93c655c..7115fa28e 100644 --- a/src/core/system_parameters/galileo_navigation_message.h +++ b/src/core/system_parameters/galileo_navigation_message.h @@ -23,6 +23,7 @@ #define GNSS_SDR_GALILEO_NAVIGATION_MESSAGE_H #include "Galileo_E1.h" +#include "Galileo_INAV.h" #include "galileo_almanac_helper.h" #include "galileo_ephemeris.h" #include "galileo_iono.h" diff --git a/src/core/system_parameters/glonass_gnav_ephemeris.cc b/src/core/system_parameters/glonass_gnav_ephemeris.cc index d69601f39..ee92c4c1f 100644 --- a/src/core/system_parameters/glonass_gnav_ephemeris.cc +++ b/src/core/system_parameters/glonass_gnav_ephemeris.cc @@ -53,7 +53,7 @@ boost::posix_time::ptime Glonass_Gnav_Ephemeris::glot_to_utc(const double offset } -void Glonass_Gnav_Ephemeris::glot_to_gpst(double tod_offset, double glot2utc_corr, double glot2gpst_corr, double* wn, double* tow) const +void Glonass_Gnav_Ephemeris::glot_to_gpst(double tod_offset, double glot2utc_corr, double glot2gpst_corr, int32_t* wn, double* tow) const { double tod = 0.0; double glot2utc = 3 * 3600; diff --git a/src/core/system_parameters/glonass_gnav_ephemeris.h b/src/core/system_parameters/glonass_gnav_ephemeris.h index ebb03022a..cf85e4351 100644 --- a/src/core/system_parameters/glonass_gnav_ephemeris.h +++ b/src/core/system_parameters/glonass_gnav_ephemeris.h @@ -81,7 +81,7 @@ public: double d_iode{}; //!< Issue of data, ephemeris (Bit 0-6 of tb) double d_tau_c{}; //!< GLONASST 2 UTC correction (todo) may be eliminated double d_TOW{}; //!< GLONASST IN GPST seconds of week - double d_WN{}; //!< GLONASST IN GPST week number of the start of frame + int32_t d_WN{}; //!< GLONASST IN GPST week number of the start of frame double d_tod{}; //!< Time of Day since ephemeris where decoded /*! @@ -114,7 +114,7 @@ public: * \param[out] WN Week Number, not in mod(1024) format * \param[out] TOW Time of Week in seconds of week */ - void glot_to_gpst(double tod_offset, double glot2utc_corr, double glot2gpst_corr, double* WN, double* TOW) const; + void glot_to_gpst(double tod_offset, double glot2utc_corr, double glot2gpst_corr, int32_t* WN, double* TOW) const; template diff --git a/src/core/system_parameters/gnss_satellite.cc b/src/core/system_parameters/gnss_satellite.cc index 074e422a5..6d6445852 100644 --- a/src/core/system_parameters/gnss_satellite.cc +++ b/src/core/system_parameters/gnss_satellite.cc @@ -191,30 +191,15 @@ void Gnss_Satellite::set_PRN(uint32_t PRN_) } else if (system == "SBAS") { - if (PRN_ == 120) + if ((PRN_ == 120) // EGNOS Test Platform.Inmarsat 3-F2 (Atlantic Ocean Region-East) + || (PRN_ == 123) // EGNOS Operational Platform. Astra 5B + || (PRN_ == 131) // WAAS Eutelsat 117 West B + || (PRN_ == 135) // WAAS Galaxy 15 + || (PRN_ == 136) // EGNOS Operational Platform. SES-5 (a.k.a. Sirius 5 or Astra 4B) + || (PRN_ == 138)) // WAAS Anik F1R { PRN = PRN_; - } // EGNOS Test Platform.Inmarsat 3-F2 (Atlantic Ocean Region-East) - else if (PRN_ == 123) - { - PRN = PRN_; - } // EGNOS Operational Platform. Astra 5B - else if (PRN_ == 131) - { - PRN = PRN_; - } // WAAS Eutelsat 117 West B - else if (PRN_ == 135) - { - PRN = PRN_; - } // WAAS Galaxy 15 - else if (PRN_ == 136) - { - PRN = PRN_; - } // EGNOS Operational Platform. SES-5 (a.k.a. Sirius 5 or Astra 4B) - else if (PRN_ == 138) - { - PRN = PRN_; - } // WAAS Anik F1R + } else { DLOG(INFO) << "This PRN is not defined"; diff --git a/src/tests/benchmarks/CMakeLists.txt b/src/tests/benchmarks/CMakeLists.txt index bb460983f..236fc1e1c 100644 --- a/src/tests/benchmarks/CMakeLists.txt +++ b/src/tests/benchmarks/CMakeLists.txt @@ -115,3 +115,5 @@ endif() if(has_transform_reduce_with_execution_policy) target_compile_definitions(benchmark_detector PRIVATE -DCOMPILER_HAS_STD_TRANSFORM_REDUCE_WITH_POLICY=1) endif() + +add_benchmark(benchmark_sign) diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_test.cc index 16322cc41..c8219a466 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_test.cc @@ -18,7 +18,8 @@ * ------------------------------------------------------------------------- */ -#include "Galileo_E1.h" + +#include "Galileo_INAV.h" #include "rtcm.h" #include #include diff --git a/src/tests/unit-tests/system-parameters/glonass_gnav_ephemeris_test.cc b/src/tests/unit-tests/system-parameters/glonass_gnav_ephemeris_test.cc index ab56f4caf..aae70cf81 100644 --- a/src/tests/unit-tests/system-parameters/glonass_gnav_ephemeris_test.cc +++ b/src/tests/unit-tests/system-parameters/glonass_gnav_ephemeris_test.cc @@ -63,7 +63,7 @@ TEST(GlonassGnavEphemerisTest, ConvertGlonassT2GpsT1) double glo2utc = 3600 * 3; double tod = 48600; - double week = 0.0; + int week = 0.0; double tow = 0.0; double true_leap_sec = 13; double true_week = 1307; @@ -89,7 +89,7 @@ TEST(GlonassGnavEphemerisTest, ConvertGlonassT2GpsT2) double glo2utc = 3600 * 3; double tod = 7560; - double week = 0.0; + int week = 0.0; double tow = 0.0; double true_leap_sec = 17; double true_week = 1915; @@ -115,7 +115,7 @@ TEST(GlonassGnavEphemerisTest, ConvertGlonassT2GpsT3) double glo2utc = 3600 * 3; double tod = 7560; - double week = 0.0; + int week = 0.0; double tow = 0.0; double true_leap_sec = 17; double true_week = 1886;