diff --git a/.clang-format b/.clang-format index f0d042c27..7ab3cb079 100644 --- a/.clang-format +++ b/.clang-format @@ -47,13 +47,20 @@ DerivePointerAlignment: true DisableFormat: false ExperimentalAutoDetectBinPacking: false ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] +IncludeBlocks: Merge IncludeCategories: - - Regex: '^<.*\.h>' + - Regex: '^.*.h"' Priority: 1 - - Regex: '^<.*' + - Regex: '^.*(boost|gflags|glog|gnsssdr|gpstk|gtest|gnuradio|pmt|uhd|volk)/' + Priority: 2 + - Regex: '^.*(armadillo|matio|pugixml)' Priority: 2 - Regex: '.*' Priority: 3 + - Regex: '^<.*\.h>' + Priority: 4 + - Regex: '^<.*' + Priority: 5 IndentCaseLabels: false IndentWidth: 4 IndentWrappedFunctionNames: false @@ -73,7 +80,7 @@ PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 200 PointerAlignment: Left ReflowComments: true -SortIncludes: false +SortIncludes: true SpaceAfterCStyleCast: false SpaceBeforeAssignmentOperators: true SpaceBeforeParens: ControlStatements diff --git a/.clang-tidy b/.clang-tidy index 5eb3cab9e..50fa566d0 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,3 +1,3 @@ --- -Checks: '-*,boost-use-to-string,cert-dcl21-cpp,cert-dcl58-cpp,cert-env33-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,clang-analyzer-cplusplus*,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-build-namespaces,google-runtime-int,google-runtime-references,llvm-header-guard,misc-misplaced-const,misc-new-delete-overloads,misc-non-copyable-objects,misc-static-assert,misc-throw-by-value-catch-by-reference,misc-uniqueptr-reset-release,modernize-deprecated-headers,modernize-loop-convert,modernize-pass-by-value,modernize-raw-string-literal,modernize-use-auto,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-using,performance-faster-string-find,performance-move-const-arg,readability-named-parameter,readability-string-compare' +Checks: '-*,boost-use-to-string,cert-dcl21-cpp,cert-dcl58-cpp,cert-env33-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,clang-analyzer-cplusplus*,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-build-namespaces,google-runtime-int,google-runtime-references,llvm-header-guard,misc-misplaced-const,misc-new-delete-overloads,misc-non-copyable-objects,misc-static-assert,misc-throw-by-value-catch-by-reference,misc-uniqueptr-reset-release,modernize-deprecated-headers,modernize-loop-convert,modernize-pass-by-value,modernize-raw-string-literal,modernize-use-auto,modernize-use-bool-literals,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-using,performance-faster-string-find,performance-inefficient-algorithm,performance-move-const-arg,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,readability-container-size-empty,readability-named-parameter,readability-non-const-parameter,readability-string-compare' HeaderFilterRegex: '.*' diff --git a/docs/xml-schemas/gal_almanac_map.xsd b/docs/xml-schemas/gal_almanac_map.xsd index 390609c58..8512bfc64 100644 --- a/docs/xml-schemas/gal_almanac_map.xsd +++ b/docs/xml-schemas/gal_almanac_map.xsd @@ -12,10 +12,10 @@ - + - + diff --git a/docs/xml-schemas/gal_ephemeris_map.xsd b/docs/xml-schemas/gal_ephemeris_map.xsd index bf6c5ea20..bf2166b48 100644 --- a/docs/xml-schemas/gal_ephemeris_map.xsd +++ b/docs/xml-schemas/gal_ephemeris_map.xsd @@ -1,4 +1,4 @@ -< + diff --git a/docs/xml-schemas/gal_utc_model.xsd b/docs/xml-schemas/gal_utc_model.xsd index a589f94fb..2e1e22eed 100644 --- a/docs/xml-schemas/gal_utc_model.xsd +++ b/docs/xml-schemas/gal_utc_model.xsd @@ -10,8 +10,8 @@ - - + + diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index 5bc2b473f..cd9ecbd26 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -30,11 +30,11 @@ #include "rtklib_pvt.h" -#include "pvt_conf.h" #include "configuration_interface.h" #include "gnss_sdr_flags.h" -#include +#include "pvt_conf.h" #include +#include #include #include #if OLD_BOOST @@ -214,6 +214,7 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 31; if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 32; // L1+E1+L5+E5a + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 33; // L1+E1+E5a // RTKLIB PVT solver options // Settings 1 diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 87ea980b1..1cb94cb94 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -34,8 +34,8 @@ #include "galileo_almanac_helper.h" #include "gnss_sdr_create_directory.h" #include "pvt_conf.h" -#include #include +#include #include #include #include @@ -43,9 +43,9 @@ #include #include #include +#include #include #include -#include #if OLD_BOOST #include namespace bc = boost::math; @@ -1410,6 +1410,16 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item b_rinex_header_written = true; // do not write header anymore } break; + case 33: // L1+E1+E5a + if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and + (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) + { + std::string gal_signal("1B 5X"); + rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal); + rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); + b_rinex_header_written = true; // do not write header anymore + } + break; default: break; } @@ -1490,6 +1500,9 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 32: // L1+E1+L5+E5a rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_ephemeris_map, d_pvt_solver->galileo_ephemeris_map); break; + case 33: // L1+E1+E5a + rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_ephemeris_map, d_pvt_solver->galileo_ephemeris_map); + break; default: break; } @@ -1784,6 +1797,20 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item b_rinex_header_updated = true; // do not write header anymore } break; + case 33: // L1+E1+E5a + if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_pvt_solver->galileo_ephemeris_map.cend())) + { + rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map); + } + if (!b_rinex_header_updated and (d_pvt_solver->gps_utc_model.d_A0 != 0) and (d_pvt_solver->galileo_utc_model.A0_6 != 0)) + { + rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model); + rp->update_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, d_pvt_solver->galileo_iono, d_pvt_solver->galileo_utc_model); + b_rinex_header_updated = true; // do not write header anymore + } + break; + default: + break; } } } @@ -2441,7 +2468,25 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (d_rtcm_MSM_rate_ms != 0) { + std::map::const_iterator gnss_observables_iter; std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + int gal_channel = 0; + for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) + { + std::string system(&gnss_observables_iter->second.System, 1); + if (gal_channel == 0) + { + if (system == "E") + { + gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) + { + gal_channel = 1; + } + } + } + } + if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) { d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h index 558bc74f0..3aec0b868 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h @@ -31,26 +31,26 @@ #ifndef GNSS_SDR_RTKLIB_PVT_CC_H #define GNSS_SDR_RTKLIB_PVT_CC_H -#include "gps_ephemeris.h" -#include "nmea_printer.h" -#include "kml_printer.h" -#include "gpx_printer.h" #include "geojson_printer.h" +#include "gps_ephemeris.h" +#include "gpx_printer.h" +#include "kml_printer.h" +#include "nmea_printer.h" +#include "pvt_conf.h" #include "rinex_printer.h" #include "rtcm_printer.h" -#include "pvt_conf.h" #include "rtklib_solver.h" -#include #include +#include #include -#include -#include -#include #include #include #include -#include #include +#include +#include +#include +#include class rtklib_pvt_cc; diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc index 007552187..d927786a2 100644 --- a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc +++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc @@ -30,12 +30,12 @@ */ #include "hybrid_ls_pvt.h" -#include "Galileo_E1.h" #include "GPS_L1_CA.h" #include "GPS_L2C.h" +#include "Galileo_E1.h" #include -#include #include +#include using google::LogMessage; diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.h b/src/algorithms/PVT/libs/hybrid_ls_pvt.h index 2fe5fd9f3..8a9c2b590 100644 --- a/src/algorithms/PVT/libs/hybrid_ls_pvt.h +++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.h @@ -32,12 +32,12 @@ #ifndef GNSS_SDR_HYBRID_LS_PVT_H_ #define GNSS_SDR_HYBRID_LS_PVT_H_ -#include "ls_pvt.h" -#include "galileo_navigation_message.h" -#include "gps_navigation_message.h" -#include "gps_cnav_navigation_message.h" #include "galileo_almanac.h" +#include "galileo_navigation_message.h" #include "gnss_synchro.h" +#include "gps_cnav_navigation_message.h" +#include "gps_navigation_message.h" +#include "ls_pvt.h" #include "rtklib_rtkcmn.h" #include #include diff --git a/src/algorithms/PVT/libs/pvt_conf.h b/src/algorithms/PVT/libs/pvt_conf.h index 1719863e1..f5e9af10e 100644 --- a/src/algorithms/PVT/libs/pvt_conf.h +++ b/src/algorithms/PVT/libs/pvt_conf.h @@ -33,8 +33,8 @@ #include #include -#include #include +#include class Pvt_Conf { diff --git a/src/algorithms/PVT/libs/pvt_solution.h b/src/algorithms/PVT/libs/pvt_solution.h index bfdc217b7..116cd771e 100644 --- a/src/algorithms/PVT/libs/pvt_solution.h +++ b/src/algorithms/PVT/libs/pvt_solution.h @@ -33,9 +33,9 @@ #define GNSS_SDR_PVT_SOLUTION_H_ +#include #include #include -#include const unsigned int PVT_MAX_CHANNELS = 90; const unsigned int PVT_MAX_PRN = 127; // 126 is SBAS diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index fdd6ec9ab..cb7065e97 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -29,21 +29,21 @@ */ #include "rinex_printer.h" -#include #include #include #include +#include #include // for create_directories, exists #include // for path, operator<< #include // for filesystem #include -#include // for getlogin_r() #include // for min and max #include // for floor #include // for getenv() #include #include #include +#include // for getlogin_r() #include #include @@ -7057,7 +7057,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri double int_sec = 0; // Avoid compiler warning - if (glonass_band.size()) + if (!glonass_band.empty()) { } diff --git a/src/algorithms/PVT/libs/rinex_printer.h b/src/algorithms/PVT/libs/rinex_printer.h index 00c8497db..331b35946 100644 --- a/src/algorithms/PVT/libs/rinex_printer.h +++ b/src/algorithms/PVT/libs/rinex_printer.h @@ -51,21 +51,21 @@ #ifndef GNSS_SDR_RINEX_PRINTER_H_ #define GNSS_SDR_RINEX_PRINTER_H_ -#include "gps_navigation_message.h" -#include "gps_cnav_navigation_message.h" -#include "galileo_navigation_message.h" -#include "glonass_gnav_navigation_message.h" +#include "GLONASS_L1_L2_CA.h" #include "GPS_L1_CA.h" #include "Galileo_E1.h" -#include "GLONASS_L1_L2_CA.h" +#include "galileo_navigation_message.h" +#include "glonass_gnav_navigation_message.h" #include "gnss_synchro.h" +#include "gps_cnav_navigation_message.h" +#include "gps_navigation_message.h" #include #include -#include #include -#include // for stringstream #include // for setprecision #include +#include // for stringstream +#include class Sbas_Raw_Msg; diff --git a/src/algorithms/PVT/libs/rtcm_printer.cc b/src/algorithms/PVT/libs/rtcm_printer.cc index 3cfe7faaa..da32c0e9b 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.cc +++ b/src/algorithms/PVT/libs/rtcm_printer.cc @@ -38,10 +38,10 @@ #include // for filesystem #include #include +#include // for O_RDWR #include -#include -#include // for O_RDWR #include // for tcgetattr +#include using google::LogMessage; diff --git a/src/algorithms/PVT/libs/rtcm_printer.h b/src/algorithms/PVT/libs/rtcm_printer.h index 883826800..aca7197bb 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.h +++ b/src/algorithms/PVT/libs/rtcm_printer.h @@ -148,7 +148,7 @@ private: std::string rtcm_devname; uint16_t port; uint16_t station_id; - int32_t rtcm_dev_descriptor; // RTCM serial device descriptor (i.e. COM port) + int32_t rtcm_dev_descriptor; // RTCM serial device descriptor (i.e. COM port) int32_t init_serial(const std::string& serial_device); //serial port control void close_serial(); std::shared_ptr rtcm; diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 86719aa5d..1125e704a 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -52,13 +52,13 @@ * -----------------------------------------------------------------------*/ #include "rtklib_solver.h" -#include "rtklib_conversions.h" -#include "rtklib_solution.h" +#include "GLONASS_L1_L2_CA.h" #include "GPS_L1_CA.h" #include "Galileo_E1.h" -#include "GLONASS_L1_L2_CA.h" -#include +#include "rtklib_conversions.h" +#include "rtklib_solution.h" #include +#include #include @@ -820,7 +820,7 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ } } - if (index_aux > 0) dops(index_aux, azel.data(), 0.0, dop_); + if (index_aux > 0) dops(index_aux, azel.data(), 0.0, dop_.data()); this->set_valid_position(true); arma::vec rx_position_and_time(4); rx_position_and_time(0) = pvt_sol.rr[0]; // [m] diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h index 8651432ca..73a96166d 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.h +++ b/src/algorithms/PVT/libs/rtklib_solver.h @@ -55,14 +55,15 @@ #define GNSS_SDR_RTKLIB_SOLVER_H_ -#include "rtklib_rtkpos.h" -#include "galileo_navigation_message.h" -#include "gps_navigation_message.h" -#include "gps_cnav_navigation_message.h" -#include "glonass_gnav_navigation_message.h" #include "galileo_almanac.h" +#include "galileo_navigation_message.h" +#include "glonass_gnav_navigation_message.h" #include "gnss_synchro.h" +#include "gps_cnav_navigation_message.h" +#include "gps_navigation_message.h" #include "pvt_solution.h" +#include "rtklib_rtkpos.h" +#include #include #include #include @@ -82,7 +83,7 @@ private: bool d_flag_dump_enabled; bool d_flag_dump_mat_enabled; int d_nchannels; // Number of available channels for positioning - double dop_[4]; + std::array dop_; public: sol_t pvt_sol; @@ -99,7 +100,7 @@ public: std::map galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris std::map gps_ephemeris_map; //!< Map storing new GPS_Ephemeris std::map gps_cnav_ephemeris_map; //!< Map storing new GPS_CNAV_Ephemeris - std::map glonass_gnav_ephemeris_map; //!< Map storing new GLONASS GNAV Ephmeris + std::map glonass_gnav_ephemeris_map; //!< Map storing new GLONASS GNAV Ephemeris Galileo_Utc_Model galileo_utc_model; Galileo_Iono galileo_iono; 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 26c3e42fb..7af5d228f 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 @@ -30,12 +30,12 @@ */ #include "galileo_e1_pcps_8ms_ambiguous_acquisition.h" -#include -#include -#include "galileo_e1_signal_processing.h" #include "Galileo_E1.h" #include "configuration_interface.h" +#include "galileo_e1_signal_processing.h" #include "gnss_sdr_flags.h" +#include +#include using google::LogMessage; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h index 59cd5c649..ce9cd440b 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.h @@ -32,9 +32,9 @@ #ifndef GNSS_SDR_GALILEO_E1_PCPS_8MS_AMBIGUOUS_ACQUISITION_H_ #define GNSS_SDR_GALILEO_E1_PCPS_8MS_AMBIGUOUS_ACQUISITION_H_ -#include "gnss_synchro.h" #include "acquisition_interface.h" #include "galileo_pcps_8ms_acquisition_cc.h" +#include "gnss_synchro.h" #include #include @@ -131,6 +131,9 @@ public: void set_state(int state __attribute__((unused))) override{}; + void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{}; + + private: ConfigurationInterface* configuration_; galileo_pcps_8ms_acquisition_cc_sptr acquisition_cc_; 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 0384ce949..79e25061c 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc @@ -30,11 +30,11 @@ */ #include "galileo_e1_pcps_ambiguous_acquisition.h" +#include "Galileo_E1.h" +#include "acq_conf.h" #include "configuration_interface.h" #include "galileo_e1_signal_processing.h" -#include "Galileo_E1.h" #include "gnss_sdr_flags.h" -#include "acq_conf.h" #include #include @@ -50,7 +50,6 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( in_streams_(in_streams), out_streams_(out_streams) { - Acq_Conf acq_parameters; configuration_ = configuration; std::string default_item_type = "gr_complex"; std::string default_dump_filename = "./acquisition.mat"; @@ -61,41 +60,67 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); - acq_parameters.fs_in = fs_in_; - acq_parameters.samples_per_chip = static_cast(ceil((1.0 / Galileo_E1_CODE_CHIP_RATE_HZ) * static_cast(acq_parameters.fs_in))); + acq_parameters_.fs_in = fs_in_; doppler_max_ = configuration_->property(role + ".doppler_max", 5000); if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; - acq_parameters.doppler_max = doppler_max_; - acq_parameters.ms_per_code = 4; - sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", acq_parameters.ms_per_code); - acq_parameters.sampled_ms = sampled_ms_; - if ((acq_parameters.sampled_ms % acq_parameters.ms_per_code) != 0) + acq_parameters_.doppler_max = doppler_max_; + acq_parameters_.ms_per_code = 4; + sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", acq_parameters_.ms_per_code); + acq_parameters_.sampled_ms = sampled_ms_; + if ((acq_parameters_.sampled_ms % acq_parameters_.ms_per_code) != 0) { LOG(WARNING) << "Parameter coherent_integration_time_ms should be a multiple of 4. Setting it to 4"; - acq_parameters.sampled_ms = acq_parameters.ms_per_code; + acq_parameters_.sampled_ms = acq_parameters_.ms_per_code; } bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); - acq_parameters.bit_transition_flag = bit_transition_flag_; + acq_parameters_.bit_transition_flag = bit_transition_flag_; use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions - acq_parameters.use_CFAR_algorithm_flag = use_CFAR_algorithm_flag_; + acq_parameters_.use_CFAR_algorithm_flag = use_CFAR_algorithm_flag_; acquire_pilot_ = configuration_->property(role + ".acquire_pilot", false); //will be true in future versions max_dwells_ = configuration_->property(role + ".max_dwells", 1); - acq_parameters.max_dwells = max_dwells_; + acq_parameters_.max_dwells = max_dwells_; dump_ = configuration_->property(role + ".dump", false); - acq_parameters.dump = dump_; - acq_parameters.dump_channel = configuration_->property(role + ".dump_channel", 0); + acq_parameters_.dump = dump_; + acq_parameters_.dump_channel = configuration_->property(role + ".dump_channel", 0); blocking_ = configuration_->property(role + ".blocking", true); - acq_parameters.blocking = blocking_; + acq_parameters_.blocking = blocking_; dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); - acq_parameters.dump_filename = dump_filename_; - //--- Find number of samples per spreading code (4 ms) ----------------- - code_length_ = static_cast(std::floor(static_cast(fs_in_) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); + acq_parameters_.dump_filename = dump_filename_; - float samples_per_ms = static_cast(fs_in_) * 0.001; - acq_parameters.samples_per_ms = samples_per_ms; - acq_parameters.samples_per_code = acq_parameters.samples_per_ms * static_cast(Galileo_E1_CODE_PERIOD_MS); - vector_length_ = sampled_ms_ * samples_per_ms; + acq_parameters_.use_automatic_resampler = configuration_->property("GNSS-SDR.use_acquisition_resampler", false); + if (acq_parameters_.use_automatic_resampler == true and item_type_ != "gr_complex") + { + LOG(WARNING) << "Galileo E1 acqisition disabled the automatic resampler feature because its item_type is not set to gr_complex"; + acq_parameters_.use_automatic_resampler = false; + } + if (acq_parameters_.use_automatic_resampler) + { + if (acq_parameters_.fs_in > Galileo_E1_OPT_ACQ_FS_HZ) + { + acq_parameters_.resampler_ratio = floor(static_cast(acq_parameters_.fs_in) / Galileo_E1_OPT_ACQ_FS_HZ); + uint32_t decimation = acq_parameters_.fs_in / Galileo_E1_OPT_ACQ_FS_HZ; + while (acq_parameters_.fs_in % decimation > 0) + { + decimation--; + }; + acq_parameters_.resampler_ratio = decimation; + acq_parameters_.resampled_fs = acq_parameters_.fs_in / static_cast(acq_parameters_.resampler_ratio); + } + //--- Find number of samples per spreading code (4 ms) ----------------- + code_length_ = static_cast(std::floor(static_cast(acq_parameters_.resampled_fs) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); + acq_parameters_.samples_per_ms = static_cast(acq_parameters_.resampled_fs) * 0.001; + acq_parameters_.samples_per_chip = static_cast(ceil((1.0 / Galileo_E1_CODE_CHIP_RATE_HZ) * static_cast(acq_parameters_.resampled_fs))); + } + else + { + //--- Find number of samples per spreading code (4 ms) ----------------- + code_length_ = static_cast(std::floor(static_cast(fs_in_) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); + acq_parameters_.samples_per_ms = static_cast(fs_in_) * 0.001; + acq_parameters_.samples_per_chip = static_cast(ceil((1.0 / Galileo_E1_CODE_CHIP_RATE_HZ) * static_cast(acq_parameters_.fs_in))); + } + acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast(Galileo_E1_CODE_PERIOD_MS); + vector_length_ = sampled_ms_ * acq_parameters_.samples_per_ms; if (bit_transition_flag_) { vector_length_ *= 2; @@ -111,12 +136,12 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( { item_size_ = sizeof(gr_complex); } - acq_parameters.it_size = item_size_; - 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.make_2_steps = configuration_->property(role + ".make_two_steps", false); - acq_parameters.blocking_on_standby = configuration_->property(role + ".blocking_on_standby", false); - acquisition_ = pcps_make_acquisition(acq_parameters); + acq_parameters_.it_size = item_size_; + 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_.make_2_steps = configuration_->property(role + ".make_two_steps", false); + acq_parameters_.blocking_on_standby = configuration_->property(role + ".blocking_on_standby", false); + acquisition_ = pcps_make_acquisition(acq_parameters_); DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; if (item_type_ == "cbyte") @@ -227,13 +252,29 @@ void GalileoE1PcpsAmbiguousAcquisition::set_local_code() { //set local signal generator to Galileo E1 pilot component (1C) char pilot_signal[3] = "1C"; - galileo_e1_code_gen_complex_sampled(code, pilot_signal, - cboc, gnss_synchro_->PRN, fs_in_, 0, false); + if (acq_parameters_.use_automatic_resampler) + { + galileo_e1_code_gen_complex_sampled(code, pilot_signal, + cboc, gnss_synchro_->PRN, acq_parameters_.resampled_fs, 0, false); + } + else + { + galileo_e1_code_gen_complex_sampled(code, pilot_signal, + cboc, gnss_synchro_->PRN, fs_in_, 0, false); + } } else { - galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal, - cboc, gnss_synchro_->PRN, fs_in_, 0, false); + if (acq_parameters_.use_automatic_resampler) + { + galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal, + cboc, gnss_synchro_->PRN, acq_parameters_.resampled_fs, 0, false); + } + else + { + galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal, + cboc, gnss_synchro_->PRN, fs_in_, 0, false); + } } @@ -352,3 +393,8 @@ gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisition::get_right_block() { return acquisition_; } + +void GalileoE1PcpsAmbiguousAcquisition::set_resampler_latency(uint32_t latency_samples) +{ + acquisition_->set_resampler_latency(latency_samples); +} diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h index 4f4a3c657..ee4538022 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.h @@ -32,10 +32,11 @@ #ifndef GNSS_SDR_GALILEO_E1_PCPS_AMBIGUOUS_ACQUISITION_H_ #define GNSS_SDR_GALILEO_E1_PCPS_AMBIGUOUS_ACQUISITION_H_ +#include "acq_conf.h" #include "acquisition_interface.h" +#include "complex_byte_to_float_x2.h" #include "gnss_synchro.h" #include "pcps_acquisition.h" -#include "complex_byte_to_float_x2.h" #include #include #include @@ -137,8 +138,16 @@ public: */ void stop_acquisition() override; + /*! + * \brief Sets the resampler latency to account it in the acquisition code delay estimation + */ + + void set_resampler_latency(uint32_t latency_samples) override; + + private: ConfigurationInterface* configuration_; + Acq_Conf acq_parameters_; pcps_acquisition_sptr acquisition_; gr::blocks::float_to_complex::sptr float_to_complex_; complex_byte_to_float_x2_sptr cbyte_to_float_x2_; 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 90fd0f911..6097ce61d 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 @@ -30,9 +30,9 @@ */ #include "galileo_e1_pcps_ambiguous_acquisition_fpga.h" +#include "Galileo_E1.h" #include "configuration_interface.h" #include "galileo_e1_signal_processing.h" -#include "Galileo_E1.h" #include "gnss_sdr_flags.h" #include #include @@ -89,7 +89,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( // dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); // acq_parameters.dump_filename = dump_filename_; //--- Find number of samples per spreading code (4 ms) ----------------- - unsigned int code_length = static_cast(std::round(static_cast(fs_in) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); + auto code_length = static_cast(std::round(static_cast(fs_in) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); //acq_parameters.samples_per_code = code_length_; //int samples_per_ms = static_cast(std::round(static_cast(fs_in_) * 0.001)); //acq_parameters.samples_per_ms = samples_per_ms; @@ -120,9 +120,9 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( // compute all the GALILEO E1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time // a channel is assigned) - gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(nsamples_total, true); // Direct FFT - std::complex* code = new std::complex[nsamples_total]; // buffer for the local code - gr_complex* fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + auto* fft_if = new gr::fft::fft_complex(nsamples_total, true); // Direct FFT + auto* code = new std::complex[nsamples_total]; // buffer for the local code + auto* fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); d_all_fft_codes_ = new lv_16sc_t[nsamples_total * Galileo_E1_NUMBER_OF_CODES]; // memory containing all the possible fft codes for PRN 0 to 32 float max; // temporary maxima search @@ -174,7 +174,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( // // fill in zero padding for (int s = code_length; s < nsamples_total; s++) { - code[s] = std::complex(static_cast(0, 0)); + code[s] = std::complex(0.0, 0.0); //code[s] = 0; } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h index 8ea13f0e4..09391ddb8 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.h @@ -33,11 +33,11 @@ #define GNSS_SDR_GALILEO_E1_PCPS_AMBIGUOUS_ACQUISITION_FPGA_H_ #include "acquisition_interface.h" +#include "complex_byte_to_float_x2.h" #include "gnss_synchro.h" #include "pcps_acquisition_fpga.h" -#include "complex_byte_to_float_x2.h" -#include #include +#include #include #include @@ -142,6 +142,8 @@ public: */ void stop_acquisition() override; + void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{}; + private: ConfigurationInterface* configuration_; //pcps_acquisition_sptr acquisition_; 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 d0e16de1f..76869f266 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 @@ -30,12 +30,12 @@ */ #include "galileo_e1_pcps_cccwsr_ambiguous_acquisition.h" -#include -#include -#include "galileo_e1_signal_processing.h" #include "Galileo_E1.h" #include "configuration_interface.h" +#include "galileo_e1_signal_processing.h" #include "gnss_sdr_flags.h" +#include +#include using google::LogMessage; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h index 9fde5d723..4e472c112 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.h @@ -32,8 +32,8 @@ #ifndef GNSS_SDR_GALILEO_E1_PCPS_CCCWSR_AMBIGUOUS_ACQUISITION_H_ #define GNSS_SDR_GALILEO_E1_PCPS_CCCWSR_AMBIGUOUS_ACQUISITION_H_ -#include "gnss_synchro.h" #include "acquisition_interface.h" +#include "gnss_synchro.h" #include "pcps_cccwsr_acquisition_cc.h" #include #include @@ -131,6 +131,8 @@ public: */ void stop_acquisition() override; + void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{}; + private: ConfigurationInterface* configuration_; pcps_cccwsr_acquisition_cc_sptr acquisition_cc_; 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 ecc243de0..b409eee0b 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 @@ -30,12 +30,12 @@ */ #include "galileo_e1_pcps_quicksync_ambiguous_acquisition.h" -#include -#include -#include "galileo_e1_signal_processing.h" #include "Galileo_E1.h" #include "configuration_interface.h" +#include "galileo_e1_signal_processing.h" #include "gnss_sdr_flags.h" +#include +#include using google::LogMessage; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h index 844856260..981cf46a6 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.h @@ -32,8 +32,8 @@ #ifndef GNSS_SDR_GALILEO_E1_PCPS_QUICKSYNC_AMBIGUOUS_ACQUISITION_H_ #define GNSS_SDR_GALILEO_E1_PCPS_QUICKSYNC_AMBIGUOUS_ACQUISITION_H_ -#include "gnss_synchro.h" #include "acquisition_interface.h" +#include "gnss_synchro.h" #include "pcps_quicksync_acquisition_cc.h" #include #include @@ -135,6 +135,8 @@ public: */ void stop_acquisition() override; + void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{}; + private: ConfigurationInterface* configuration_; pcps_quicksync_acquisition_cc_sptr acquisition_cc_; 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 db77547a5..20418f7ef 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 @@ -30,12 +30,12 @@ */ #include "galileo_e1_pcps_tong_ambiguous_acquisition.h" -#include -#include -#include "galileo_e1_signal_processing.h" #include "Galileo_E1.h" #include "configuration_interface.h" +#include "galileo_e1_signal_processing.h" #include "gnss_sdr_flags.h" +#include +#include using google::LogMessage; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h index 8e56c4044..95fbaee0b 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.h @@ -32,8 +32,8 @@ #ifndef GNSS_SDR_GALILEO_E1_PCPS_TONG_AMBIGUOUS_ACQUISITION_H_ #define GNSS_SDR_GALILEO_E1_PCPS_TONG_AMBIGUOUS_ACQUISITION_H_ -#include "gnss_synchro.h" #include "acquisition_interface.h" +#include "gnss_synchro.h" #include "pcps_tong_acquisition_cc.h" #include #include @@ -134,6 +134,8 @@ public: */ void stop_acquisition() override; + void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{}; + private: ConfigurationInterface* configuration_; pcps_tong_acquisition_cc_sptr acquisition_cc_; 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 d9fe2ac69..c6c4f663d 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 @@ -36,12 +36,12 @@ */ #include "galileo_e5a_noncoherent_iq_acquisition_caf.h" -#include -#include -#include "galileo_e5_signal_processing.h" #include "Galileo_E5a.h" #include "configuration_interface.h" +#include "galileo_e5_signal_processing.h" #include "gnss_sdr_flags.h" +#include +#include using google::LogMessage; diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h index 4175a0741..3e4d936aa 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.h @@ -38,9 +38,9 @@ #ifndef GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_H_ #define GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_H_ -#include "gnss_synchro.h" #include "acquisition_interface.h" #include "galileo_e5a_noncoherent_iq_acquisition_caf_cc.h" +#include "gnss_synchro.h" #include class ConfigurationInterface; @@ -137,6 +137,8 @@ public: */ void stop_acquisition() override; + void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{}; + private: ConfigurationInterface* configuration_; galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr acquisition_cc_; diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc index e18e2e0a3..4b7abfc8f 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc @@ -29,11 +29,11 @@ */ #include "galileo_e5a_pcps_acquisition.h" +#include "Galileo_E5a.h" +#include "acq_conf.h" #include "configuration_interface.h" #include "galileo_e5_signal_processing.h" -#include "Galileo_E5a.h" #include "gnss_sdr_flags.h" -#include "acq_conf.h" #include #include #include @@ -49,7 +49,6 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con in_streams_(in_streams), out_streams_(out_streams) { - Acq_Conf acq_parameters = Acq_Conf(); configuration_ = configuration; std::string default_item_type = "gr_complex"; std::string default_dump_filename = "./acquisition.mat"; @@ -60,8 +59,7 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); - acq_parameters.fs_in = fs_in_; - acq_parameters.samples_per_chip = static_cast(ceil((1.0 / Galileo_E5a_CODE_CHIP_RATE_HZ) * static_cast(acq_parameters.fs_in))); + acq_parameters_.fs_in = fs_in_; acq_pilot_ = configuration_->property(role + ".acquire_pilot", false); acq_iq_ = configuration_->property(role + ".acquire_iq", false); if (acq_iq_) @@ -69,22 +67,58 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con acq_pilot_ = false; } dump_ = configuration_->property(role + ".dump", false); - acq_parameters.dump = dump_; - acq_parameters.dump_channel = configuration_->property(role + ".dump_channel", 0); + acq_parameters_.dump = dump_; + acq_parameters_.dump_channel = configuration_->property(role + ".dump_channel", 0); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; - acq_parameters.doppler_max = doppler_max_; + acq_parameters_.doppler_max = doppler_max_; sampled_ms_ = 1; max_dwells_ = configuration_->property(role + ".max_dwells", 1); - acq_parameters.max_dwells = max_dwells_; + acq_parameters_.max_dwells = max_dwells_; dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); - acq_parameters.dump_filename = dump_filename_; + acq_parameters_.dump_filename = dump_filename_; bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); - acq_parameters.bit_transition_flag = bit_transition_flag_; + acq_parameters_.bit_transition_flag = bit_transition_flag_; use_CFAR_ = configuration_->property(role + ".use_CFAR_algorithm", false); - acq_parameters.use_CFAR_algorithm_flag = use_CFAR_; + acq_parameters_.use_CFAR_algorithm_flag = use_CFAR_; blocking_ = configuration_->property(role + ".blocking", true); - acq_parameters.blocking = blocking_; + acq_parameters_.blocking = blocking_; + + + acq_parameters_.use_automatic_resampler = configuration_->property("GNSS-SDR.use_acquisition_resampler", false); + if (acq_parameters_.use_automatic_resampler == true and item_type_ != "gr_complex") + { + LOG(WARNING) << "Galileo E5a acquisition disabled the automatic resampler feature because its item_type is not set to gr_complex"; + acq_parameters_.use_automatic_resampler = false; + } + if (acq_parameters_.use_automatic_resampler) + { + if (acq_parameters_.fs_in > Galileo_E5a_OPT_ACQ_FS_HZ) + { + acq_parameters_.resampler_ratio = floor(static_cast(acq_parameters_.fs_in) / Galileo_E5a_OPT_ACQ_FS_HZ); + uint32_t decimation = acq_parameters_.fs_in / Galileo_E5a_OPT_ACQ_FS_HZ; + while (acq_parameters_.fs_in % decimation > 0) + { + decimation--; + }; + acq_parameters_.resampler_ratio = decimation; + acq_parameters_.resampled_fs = acq_parameters_.fs_in / static_cast(acq_parameters_.resampler_ratio); + } + + //--- Find number of samples per spreading code ------------------------- + code_length_ = static_cast(std::floor(static_cast(acq_parameters_.resampled_fs) / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS))); + acq_parameters_.samples_per_ms = static_cast(acq_parameters_.resampled_fs) * 0.001; + acq_parameters_.samples_per_chip = static_cast(ceil((1.0 / Galileo_E5a_CODE_CHIP_RATE_HZ) * static_cast(acq_parameters_.resampled_fs))); + } + else + { + acq_parameters_.resampled_fs = fs_in_; + //--- Find number of samples per spreading code ------------------------- + code_length_ = static_cast(std::floor(static_cast(fs_in_) / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS))); + acq_parameters_.samples_per_ms = static_cast(fs_in_) * 0.001; + acq_parameters_.samples_per_chip = static_cast(ceil((1.0 / Galileo_E5a_CODE_CHIP_RATE_HZ) * static_cast(acq_parameters_.fs_in))); + } + //--- Find number of samples per spreading code (1ms)------------------------- code_length_ = static_cast(std::round(static_cast(fs_in_) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast(Galileo_E5a_CODE_LENGTH_CHIPS))); vector_length_ = code_length_ * sampled_ms_; @@ -104,16 +138,15 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con item_size_ = sizeof(gr_complex); LOG(WARNING) << item_type_ << " unknown acquisition item type"; } - acq_parameters.it_size = item_size_; - acq_parameters.samples_per_ms = static_cast(fs_in_) * 0.001; - acq_parameters.sampled_ms = sampled_ms_; - acq_parameters.ms_per_code = 1; - acq_parameters.samples_per_code = acq_parameters.samples_per_ms * static_cast(GALILEO_E5a_CODE_PERIOD_MS); - 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.make_2_steps = configuration_->property(role + ".make_two_steps", false); - acq_parameters.blocking_on_standby = configuration_->property(role + ".blocking_on_standby", false); - acquisition_ = pcps_make_acquisition(acq_parameters); + acq_parameters_.it_size = item_size_; + acq_parameters_.sampled_ms = sampled_ms_; + acq_parameters_.ms_per_code = 1; + acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast(GALILEO_E5a_CODE_PERIOD_MS); + 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_.make_2_steps = configuration_->property(role + ".make_two_steps", false); + acq_parameters_.blocking_on_standby = configuration_->property(role + ".blocking_on_standby", false); + acquisition_ = pcps_make_acquisition(acq_parameters_); channel_ = 0; threshold_ = 0.0; @@ -224,7 +257,14 @@ void GalileoE5aPcpsAcquisition::set_local_code() strcpy(signal_, "5I"); } - galileo_e5_a_code_gen_complex_sampled(code, signal_, gnss_synchro_->PRN, fs_in_, 0); + if (acq_parameters_.use_automatic_resampler) + { + galileo_e5_a_code_gen_complex_sampled(code, signal_, gnss_synchro_->PRN, acq_parameters_.resampled_fs, 0); + } + else + { + galileo_e5_a_code_gen_complex_sampled(code, signal_, gnss_synchro_->PRN, fs_in_, 0); + } for (unsigned int i = 0; i < sampled_ms_; i++) { @@ -311,3 +351,8 @@ gr::basic_block_sptr GalileoE5aPcpsAcquisition::get_right_block() { return acquisition_; } + +void GalileoE5aPcpsAcquisition::set_resampler_latency(uint32_t latency_samples) +{ + acquisition_->set_resampler_latency(latency_samples); +} diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h index 063c79ff2..5a4d71fc1 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.h @@ -128,13 +128,19 @@ public: */ void stop_acquisition() override; + /*! + * \brief Sets the resampler latency to account it in the acquisition code delay estimation + */ + + void set_resampler_latency(uint32_t latency_samples) override; + private: float calculate_threshold(float pfa); ConfigurationInterface* configuration_; pcps_acquisition_sptr acquisition_; - + Acq_Conf acq_parameters_; size_t item_size_; std::string item_type_; 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 ef99a0fe7..0559ddc7e 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc @@ -29,9 +29,9 @@ */ #include "galileo_e5a_pcps_acquisition_fpga.h" +#include "Galileo_E5a.h" #include "configuration_interface.h" #include "galileo_e5_signal_processing.h" -#include "Galileo_E5a.h" #include "gnss_sdr_flags.h" #include #include @@ -89,7 +89,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf acq_pilot_ = false; } - unsigned int code_length = static_cast(std::round(static_cast(fs_in) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast(Galileo_E5a_CODE_LENGTH_CHIPS))); + auto code_length = static_cast(std::round(static_cast(fs_in) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast(Galileo_E5a_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((float)code_length)); @@ -108,9 +108,9 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf // compute all the GALILEO E5 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time // a channel is assigned) - gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(nsamples_total, true); // Direct FFT - std::complex* code = new std::complex[nsamples_total]; // buffer for the local code - gr_complex* fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + auto* fft_if = new gr::fft::fft_complex(nsamples_total, true); // Direct FFT + auto* code = new std::complex[nsamples_total]; // buffer for the local code + auto* fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); d_all_fft_codes_ = new lv_16sc_t[nsamples_total * Galileo_E5a_NUMBER_OF_CODES]; // memory containing all the possible fft codes for PRN 0 to 32 float max; // temporary maxima search @@ -141,7 +141,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf // fill in zero padding for (int s = code_length; s < nsamples_total; s++) { - code[s] = std::complex(static_cast(0, 0)); + code[s] = std::complex(0.0, 0.0); //code[s] = 0; } diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h index 91788c733..79f0d2836 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.h @@ -130,6 +130,8 @@ public: */ void stop_acquisition() override; + void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{}; + private: //float calculate_threshold(float pfa); 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 0bb8cc9e4..050190ee7 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc @@ -32,11 +32,11 @@ */ #include "glonass_l1_ca_pcps_acquisition.h" +#include "GLONASS_L1_L2_CA.h" +#include "acq_conf.h" #include "configuration_interface.h" #include "glonass_l1_signal_processing.h" #include "gnss_sdr_flags.h" -#include "acq_conf.h" -#include "GLONASS_L1_L2_CA.h" #include #include diff --git a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h index 3c0c14ab1..17affc67c 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.h @@ -35,9 +35,9 @@ #define GNSS_SDR_GLONASS_L1_CA_PCPS_ACQUISITION_H_ #include "acquisition_interface.h" +#include "complex_byte_to_float_x2.h" #include "gnss_synchro.h" #include "pcps_acquisition.h" -#include "complex_byte_to_float_x2.h" #include #include @@ -137,6 +137,8 @@ public: */ void stop_acquisition() override; + void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{}; + private: ConfigurationInterface* configuration_; pcps_acquisition_sptr 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 4c9fd6440..93aa9736d 100644 --- a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc @@ -31,11 +31,11 @@ */ #include "glonass_l2_ca_pcps_acquisition.h" +#include "GLONASS_L1_L2_CA.h" +#include "acq_conf.h" #include "configuration_interface.h" #include "glonass_l2_signal_processing.h" -#include "GLONASS_L1_L2_CA.h" #include "gnss_sdr_flags.h" -#include "acq_conf.h" #include #include diff --git a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h index 3c093c5cd..ad99d9d5a 100644 --- a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.h @@ -34,9 +34,9 @@ #define GNSS_SDR_GLONASS_L2_CA_PCPS_ACQUISITION_H_ #include "acquisition_interface.h" +#include "complex_byte_to_float_x2.h" #include "gnss_synchro.h" #include "pcps_acquisition.h" -#include "complex_byte_to_float_x2.h" #include #include @@ -136,6 +136,8 @@ public: */ void stop_acquisition() override; + void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{}; + private: ConfigurationInterface* configuration_; pcps_acquisition_sptr 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 e631d17eb..ce0ea4065 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc @@ -34,11 +34,11 @@ */ #include "gps_l1_ca_pcps_acquisition.h" -#include "configuration_interface.h" -#include "gps_sdr_signal_processing.h" #include "GPS_L1_CA.h" -#include "gnss_sdr_flags.h" #include "acq_conf.h" +#include "configuration_interface.h" +#include "gnss_sdr_flags.h" +#include "gps_sdr_signal_processing.h" #include #include @@ -54,7 +54,6 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( in_streams_(in_streams), out_streams_(out_streams) { - Acq_Conf acq_parameters = Acq_Conf(); configuration_ = configuration; std::string default_item_type = "gr_complex"; std::string default_dump_filename = "./acquisition.mat"; @@ -64,36 +63,64 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( item_type_ = configuration_->property(role + ".item_type", default_item_type); int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); - acq_parameters.fs_in = fs_in_; - acq_parameters.samples_per_chip = static_cast(ceil(GPS_L1_CA_CHIP_PERIOD * static_cast(acq_parameters.fs_in))); + acq_parameters_.fs_in = fs_in_; dump_ = configuration_->property(role + ".dump", false); - acq_parameters.dump = dump_; - acq_parameters.dump_channel = configuration_->property(role + ".dump_channel", 0); + acq_parameters_.dump = dump_; + acq_parameters_.dump_channel = configuration_->property(role + ".dump_channel", 0); blocking_ = configuration_->property(role + ".blocking", true); - acq_parameters.blocking = blocking_; + acq_parameters_.blocking = blocking_; doppler_max_ = configuration_->property(role + ".doppler_max", 5000); if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; - acq_parameters.doppler_max = doppler_max_; + acq_parameters_.doppler_max = doppler_max_; sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); - acq_parameters.sampled_ms = sampled_ms_; - acq_parameters.ms_per_code = 1; + acq_parameters_.sampled_ms = sampled_ms_; + acq_parameters_.ms_per_code = 1; bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); - acq_parameters.bit_transition_flag = bit_transition_flag_; + acq_parameters_.bit_transition_flag = bit_transition_flag_; use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions - acq_parameters.use_CFAR_algorithm_flag = use_CFAR_algorithm_flag_; + acq_parameters_.use_CFAR_algorithm_flag = use_CFAR_algorithm_flag_; max_dwells_ = configuration_->property(role + ".max_dwells", 1); - acq_parameters.max_dwells = max_dwells_; + acq_parameters_.max_dwells = max_dwells_; dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); - acq_parameters.dump_filename = dump_filename_; - 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.make_2_steps = configuration_->property(role + ".make_two_steps", false); - //--- Find number of samples per spreading code ------------------------- - code_length_ = static_cast(std::floor(static_cast(fs_in_) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); - acq_parameters.samples_per_ms = static_cast(fs_in_) * 0.001; - acq_parameters.samples_per_code = acq_parameters.samples_per_ms * static_cast(GPS_L1_CA_CODE_PERIOD * 1000.0); + acq_parameters_.dump_filename = dump_filename_; + 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_.make_2_steps = configuration_->property(role + ".make_two_steps", false); + acq_parameters_.use_automatic_resampler = configuration_->property("GNSS-SDR.use_acquisition_resampler", false); + if (acq_parameters_.use_automatic_resampler == true and item_type_ != "gr_complex") + { + LOG(WARNING) << "GPS L1 CA acquisition disabled the automatic resampler feature because its item_type is not set to gr_complex"; + acq_parameters_.use_automatic_resampler = false; + } + if (acq_parameters_.use_automatic_resampler) + { + if (acq_parameters_.fs_in > GPS_L1_CA_OPT_ACQ_FS_HZ) + { + acq_parameters_.resampler_ratio = floor(static_cast(acq_parameters_.fs_in) / GPS_L1_CA_OPT_ACQ_FS_HZ); + uint32_t decimation = acq_parameters_.fs_in / GPS_L1_CA_OPT_ACQ_FS_HZ; + while (acq_parameters_.fs_in % decimation > 0) + { + decimation--; + }; + acq_parameters_.resampler_ratio = decimation; + acq_parameters_.resampled_fs = acq_parameters_.fs_in / static_cast(acq_parameters_.resampler_ratio); + } + //--- Find number of samples per spreading code ------------------------- + code_length_ = static_cast(std::floor(static_cast(acq_parameters_.resampled_fs) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); + acq_parameters_.samples_per_ms = static_cast(acq_parameters_.resampled_fs) * 0.001; + acq_parameters_.samples_per_chip = static_cast(ceil(GPS_L1_CA_CHIP_PERIOD * static_cast(acq_parameters_.resampled_fs))); + } + else + { + acq_parameters_.resampled_fs = fs_in_; + //--- Find number of samples per spreading code ------------------------- + code_length_ = static_cast(std::floor(static_cast(fs_in_) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); + acq_parameters_.samples_per_ms = static_cast(fs_in_) * 0.001; + acq_parameters_.samples_per_chip = static_cast(ceil(GPS_L1_CA_CHIP_PERIOD * static_cast(acq_parameters_.fs_in))); + } - vector_length_ = std::floor(acq_parameters.sampled_ms * acq_parameters.samples_per_ms) * (acq_parameters.bit_transition_flag ? 2 : 1); + acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast(GPS_L1_CA_CODE_PERIOD * 1000.0); + vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); code_ = new gr_complex[vector_length_]; if (item_type_ == "cshort") @@ -105,9 +132,9 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( item_size_ = sizeof(gr_complex); } - acq_parameters.it_size = item_size_; - acq_parameters.blocking_on_standby = configuration_->property(role + ".blocking_on_standby", false); - acquisition_ = pcps_make_acquisition(acq_parameters); + acq_parameters_.it_size = item_size_; + acq_parameters_.blocking_on_standby = configuration_->property(role + ".blocking_on_standby", false); + acquisition_ = pcps_make_acquisition(acq_parameters_); DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; if (item_type_ == "cbyte") @@ -208,8 +235,14 @@ void GpsL1CaPcpsAcquisition::set_local_code() { auto* code = new std::complex[code_length_]; - gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); - + if (acq_parameters_.use_automatic_resampler) + { + gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, acq_parameters_.resampled_fs, 0); + } + else + { + gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); + } for (unsigned int i = 0; i < sampled_ms_; i++) { memcpy(&(code_[i * code_length_]), code, @@ -325,3 +358,8 @@ gr::basic_block_sptr GpsL1CaPcpsAcquisition::get_right_block() { return acquisition_; } + +void GpsL1CaPcpsAcquisition::set_resampler_latency(uint32_t latency_samples) +{ + acquisition_->set_resampler_latency(latency_samples); +} diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h index 5aee6bc7a..efca26bdd 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.h @@ -36,10 +36,11 @@ #ifndef GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_H_ #define GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_H_ +#include "acq_conf.h" #include "acquisition_interface.h" +#include "complex_byte_to_float_x2.h" #include "gnss_synchro.h" #include "pcps_acquisition.h" -#include "complex_byte_to_float_x2.h" #include #include #include @@ -141,9 +142,17 @@ public: */ void stop_acquisition() override; + /*! + * \brief Sets the resampler latency to account it in the acquisition code delay estimation + */ + + void set_resampler_latency(uint32_t latency_samples) override; + + private: ConfigurationInterface* configuration_; pcps_acquisition_sptr acquisition_; + Acq_Conf acq_parameters_; gr::blocks::float_to_complex::sptr float_to_complex_; complex_byte_to_float_x2_sptr cbyte_to_float_x2_; size_t item_size_; 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 eacd4b6a6..4e16b54ec 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 @@ -33,11 +33,11 @@ */ #include "gps_l1_ca_pcps_acquisition_fine_doppler.h" -#include "gps_sdr_signal_processing.h" #include "GPS_L1_CA.h" +#include "acq_conf.h" #include "configuration_interface.h" #include "gnss_sdr_flags.h" -#include "acq_conf.h" +#include "gps_sdr_signal_processing.h" #include using google::LogMessage; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h index 4a4bb9a19..b1b64d6eb 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.h @@ -34,8 +34,8 @@ #ifndef GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FINE_DOPPLER_H_ #define GNSS_SDR_GPS_L1_CA_PCPS_ACQUISITION_FINE_DOPPLER_H_ -#include "gnss_synchro.h" #include "acquisition_interface.h" +#include "gnss_synchro.h" #include "pcps_acquisition_fine_doppler_cc.h" #include @@ -132,6 +132,8 @@ public: */ void stop_acquisition() override; + void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{}; + private: pcps_acquisition_fine_doppler_cc_sptr acquisition_cc_; size_t item_size_; 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 f46b7c305..6ddfa4616 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 @@ -34,13 +34,13 @@ * ------------------------------------------------------------------------- */ +#include "gps_l1_ca_pcps_acquisition_fpga.h" +#include "GPS_L1_CA.h" #include "configuration_interface.h" #include "gnss_sdr_flags.h" -#include "gps_l1_ca_pcps_acquisition_fpga.h" #include "gps_sdr_signal_processing.h" -#include "GPS_L1_CA.h" -#include #include +#include #include @@ -74,7 +74,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( acq_parameters.doppler_max = doppler_max_; unsigned int sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 1); acq_parameters.sampled_ms = sampled_ms; - unsigned int code_length = static_cast(std::round(static_cast(fs_in) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); + auto code_length = static_cast(std::round(static_cast(fs_in) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_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((float)code_length)); @@ -90,10 +90,10 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( // compute all the GPS L1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time // a channel is assigned) - gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(vector_length, true); // Direct FFT + auto* fft_if = new gr::fft::fft_complex(vector_length, true); // Direct FFT // allocate memory to compute all the PRNs and compute all the possible codes - std::complex* code = new std::complex[nsamples_total]; // buffer for the local code - gr_complex* fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + auto* code = new std::complex[nsamples_total]; // buffer for the local code + auto* fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); d_all_fft_codes_ = new lv_16sc_t[nsamples_total * NUM_PRNs]; // memory containing all the possible fft codes for PRN 0 to 32 float max; // temporary maxima search for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) @@ -102,7 +102,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( // fill in zero padding for (int s = code_length; s < nsamples_total; s++) { - code[s] = std::complex(static_cast(0, 0)); + code[s] = std::complex(0.0, 0.0); //code[s] = 0; } int offset = 0; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h index 4d0d7339f..015de1d39 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.h @@ -140,6 +140,8 @@ public: */ void stop_acquisition() override; + void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{}; + private: ConfigurationInterface* configuration_; pcps_acquisition_fpga_sptr acquisition_fpga_; 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 993c77e36..fb7a140b7 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 @@ -33,11 +33,11 @@ */ #include "gps_l1_ca_pcps_assisted_acquisition.h" -#include -#include "gps_sdr_signal_processing.h" #include "GPS_L1_CA.h" #include "configuration_interface.h" #include "gnss_sdr_flags.h" +#include "gps_sdr_signal_processing.h" +#include using google::LogMessage; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h index 1f6094b6d..04b653440 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.h @@ -34,8 +34,8 @@ #ifndef GNSS_SDR_GPS_L1_CA_PCPS_ASSISTED_ACQUISITION_H_ #define GNSS_SDR_GPS_L1_CA_PCPS_ASSISTED_ACQUISITION_H_ -#include "gnss_synchro.h" #include "acquisition_interface.h" +#include "gnss_synchro.h" #include "pcps_assisted_acquisition_cc.h" #include @@ -128,6 +128,8 @@ public: */ void stop_acquisition() override; + void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{}; + private: pcps_assisted_acquisition_cc_sptr acquisition_cc_; size_t item_size_; 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 494f8d543..1fd9b109f 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 @@ -30,12 +30,12 @@ */ #include "gps_l1_ca_pcps_opencl_acquisition.h" -#include -#include -#include "gps_sdr_signal_processing.h" #include "GPS_L1_CA.h" #include "configuration_interface.h" #include "gnss_sdr_flags.h" +#include "gps_sdr_signal_processing.h" +#include +#include using google::LogMessage; @@ -220,7 +220,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_local_code() { if (item_type_ == "gr_complex") { - std::complex* code = new std::complex[code_length_]; + auto* code = new std::complex[code_length_]; gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); @@ -261,9 +261,9 @@ float GpsL1CaPcpsOpenClAcquisition::calculate_threshold(float pfa) unsigned int ncells = vector_length_ * frequency_bins; double exponent = 1 / static_cast(ncells); double val = pow(1.0 - pfa, exponent); - double lambda = double(vector_length_); + auto lambda = double(vector_length_); boost::math::exponential_distribution mydist(lambda); - float threshold = static_cast(quantile(mydist, val)); + auto threshold = static_cast(quantile(mydist, val)); return threshold; } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h index 60c78b2e0..a7dbe1bc9 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.h @@ -32,8 +32,8 @@ #ifndef GNSS_SDR_GPS_L1_CA_PCPS_OPENCL_ACQUISITION_H_ #define GNSS_SDR_GPS_L1_CA_PCPS_OPENCL_ACQUISITION_H_ -#include "gnss_synchro.h" #include "acquisition_interface.h" +#include "gnss_synchro.h" #include "pcps_opencl_acquisition_cc.h" #include #include @@ -130,6 +130,8 @@ public: */ void stop_acquisition() override; + void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{}; + private: ConfigurationInterface* configuration_; pcps_opencl_acquisition_cc_sptr acquisition_cc_; 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 8a4774f7b..a3d896ccc 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 @@ -31,12 +31,12 @@ */ #include "gps_l1_ca_pcps_quicksync_acquisition.h" -#include -#include -#include "gps_sdr_signal_processing.h" #include "GPS_L1_CA.h" #include "configuration_interface.h" #include "gnss_sdr_flags.h" +#include "gps_sdr_signal_processing.h" +#include +#include using google::LogMessage; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h index e18fb1704..482db0f44 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.h @@ -33,10 +33,10 @@ #ifndef GNSS_SDR_GPS_L1_CA_PCPS_QUICKSYNC_ACQUISITION_H_ #define GNSS_SDR_GPS_L1_CA_PCPS_QUICKSYNC_ACQUISITION_H_ -#include "gnss_synchro.h" #include "acquisition_interface.h" -#include "pcps_quicksync_acquisition_cc.h" #include "configuration_interface.h" +#include "gnss_synchro.h" +#include "pcps_quicksync_acquisition_cc.h" #include #include @@ -136,6 +136,8 @@ public: */ void stop_acquisition() override; + void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{}; + private: ConfigurationInterface* configuration_; pcps_quicksync_acquisition_cc_sptr acquisition_cc_; 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 7663d76ca..0b3a627ba 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 @@ -30,12 +30,12 @@ */ #include "gps_l1_ca_pcps_tong_acquisition.h" -#include -#include -#include "gps_sdr_signal_processing.h" #include "GPS_L1_CA.h" #include "configuration_interface.h" #include "gnss_sdr_flags.h" +#include "gps_sdr_signal_processing.h" +#include +#include using google::LogMessage; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h index 76cf2b8e0..63e89b8a5 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.h @@ -32,10 +32,10 @@ #ifndef GNSS_SDR_GPS_L1_CA_TONG_ACQUISITION_H_ #define GNSS_SDR_GPS_L1_CA_TONG_ACQUISITION_H_ -#include "gnss_synchro.h" #include "acquisition_interface.h" -#include "pcps_tong_acquisition_cc.h" #include "configuration_interface.h" +#include "gnss_synchro.h" +#include "pcps_tong_acquisition_cc.h" #include #include @@ -135,6 +135,8 @@ public: */ void stop_acquisition() override; + void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{}; + private: ConfigurationInterface* configuration_; pcps_tong_acquisition_cc_sptr acquisition_cc_; 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 bc293524a..dcf663121 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc @@ -32,11 +32,11 @@ */ #include "gps_l2_m_pcps_acquisition.h" -#include "configuration_interface.h" -#include "gps_l2c_signal.h" #include "GPS_L2C.h" -#include "gnss_sdr_flags.h" #include "acq_conf.h" +#include "configuration_interface.h" +#include "gnss_sdr_flags.h" +#include "gps_l2c_signal.h" #include #include @@ -52,7 +52,6 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( in_streams_(in_streams), out_streams_(out_streams) { - Acq_Conf acq_parameters = Acq_Conf(); configuration_ = configuration; std::string default_item_type = "gr_complex"; std::string default_dump_filename = "./acquisition.mat"; @@ -60,42 +59,73 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( LOG(INFO) << "role " << role; item_type_ = configuration_->property(role + ".item_type", default_item_type); - //float pfa = configuration_->property(role + ".pfa", 0.0); - int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); - acq_parameters.fs_in = fs_in_; - acq_parameters.samples_per_chip = static_cast(ceil((1.0 / GPS_L2_M_CODE_RATE_HZ) * static_cast(acq_parameters.fs_in))); + acq_parameters_.fs_in = fs_in_; dump_ = configuration_->property(role + ".dump", false); - acq_parameters.dump = dump_; - acq_parameters.dump_channel = configuration_->property(role + ".dump_channel", 0); + acq_parameters_.dump = dump_; + acq_parameters_.dump_channel = configuration_->property(role + ".dump_channel", 0); blocking_ = configuration_->property(role + ".blocking", true); - acq_parameters.blocking = blocking_; + acq_parameters_.blocking = blocking_; doppler_max_ = configuration->property(role + ".doppler_max", 5000); if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; - acq_parameters.doppler_max = doppler_max_; + acq_parameters_.doppler_max = doppler_max_; bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); - acq_parameters.bit_transition_flag = bit_transition_flag_; + acq_parameters_.bit_transition_flag = bit_transition_flag_; use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions - acq_parameters.use_CFAR_algorithm_flag = use_CFAR_algorithm_flag_; + acq_parameters_.use_CFAR_algorithm_flag = use_CFAR_algorithm_flag_; max_dwells_ = configuration_->property(role + ".max_dwells", 1); - acq_parameters.max_dwells = max_dwells_; + acq_parameters_.max_dwells = max_dwells_; dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); - acq_parameters.dump_filename = dump_filename_; - //--- Find number of samples per spreading code ------------------------- - acq_parameters.samples_per_ms = static_cast(fs_in_) * 0.001; - acq_parameters.ms_per_code = 20; - acq_parameters.sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", acq_parameters.ms_per_code); - if ((acq_parameters.sampled_ms % acq_parameters.ms_per_code) != 0) + acq_parameters_.dump_filename = dump_filename_; + acq_parameters_.ms_per_code = 20; + acq_parameters_.sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", acq_parameters_.ms_per_code); + if ((acq_parameters_.sampled_ms % acq_parameters_.ms_per_code) != 0) { LOG(WARNING) << "Parameter coherent_integration_time_ms should be a multiple of 20. Setting it to 20"; - acq_parameters.sampled_ms = acq_parameters.ms_per_code; + acq_parameters_.sampled_ms = acq_parameters_.ms_per_code; } - code_length_ = acq_parameters.ms_per_code * acq_parameters.samples_per_ms; + 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_.make_2_steps = configuration_->property(role + ".make_two_steps", false); + acq_parameters_.blocking_on_standby = configuration_->property(role + ".blocking_on_standby", false); + acq_parameters_.use_automatic_resampler = configuration_->property("GNSS-SDR.use_acquisition_resampler", false); + if (acq_parameters_.use_automatic_resampler == true and item_type_ != "gr_complex") + { + LOG(WARNING) << "GPS L2CM acquisition disabled the automatic resampler feature because its item_type is not set to gr_complex"; + acq_parameters_.use_automatic_resampler = false; + } + if (acq_parameters_.use_automatic_resampler) + { + if (acq_parameters_.fs_in > GPS_L2C_OPT_ACQ_FS_HZ) + { + acq_parameters_.resampler_ratio = floor(static_cast(acq_parameters_.fs_in) / GPS_L2C_OPT_ACQ_FS_HZ); + uint32_t decimation = acq_parameters_.fs_in / GPS_L2C_OPT_ACQ_FS_HZ; + while (acq_parameters_.fs_in % decimation > 0) + { + decimation--; + }; + acq_parameters_.resampler_ratio = decimation; + acq_parameters_.resampled_fs = acq_parameters_.fs_in / static_cast(acq_parameters_.resampler_ratio); + } - vector_length_ = acq_parameters.sampled_ms * acq_parameters.samples_per_ms * (acq_parameters.bit_transition_flag ? 2 : 1); + //--- Find number of samples per spreading code ------------------------- + code_length_ = static_cast(std::floor(static_cast(acq_parameters_.resampled_fs) / (GPS_L2_M_CODE_RATE_HZ / GPS_L2_M_CODE_LENGTH_CHIPS))); + acq_parameters_.samples_per_ms = static_cast(acq_parameters_.resampled_fs) * 0.001; + acq_parameters_.samples_per_chip = static_cast(ceil((1.0 / GPS_L2_M_CODE_RATE_HZ) * static_cast(acq_parameters_.resampled_fs))); + } + else + { + acq_parameters_.resampled_fs = fs_in_; + //--- Find number of samples per spreading code ------------------------- + code_length_ = static_cast(std::floor(static_cast(fs_in_) / (GPS_L2_M_CODE_RATE_HZ / GPS_L2_M_CODE_LENGTH_CHIPS))); + acq_parameters_.samples_per_ms = static_cast(fs_in_) * 0.001; + acq_parameters_.samples_per_chip = static_cast(ceil((1.0 / GPS_L2_M_CODE_RATE_HZ) * static_cast(acq_parameters_.fs_in))); + } + acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast(GPS_L2_M_PERIOD * 1000.0); + vector_length_ = acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms * (acq_parameters_.bit_transition_flag ? 2 : 1); code_ = new gr_complex[vector_length_]; if (item_type_ == "cshort") @@ -107,14 +137,8 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( item_size_ = sizeof(gr_complex); } - acq_parameters.samples_per_code = acq_parameters.samples_per_ms * static_cast(GPS_L2_M_PERIOD * 1000.0); - acq_parameters.it_size = item_size_; - - 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.make_2_steps = configuration_->property(role + ".make_two_steps", false); - acq_parameters.blocking_on_standby = configuration_->property(role + ".blocking_on_standby", false); - acquisition_ = pcps_make_acquisition(acq_parameters); + acq_parameters_.it_size = item_size_; + acquisition_ = pcps_make_acquisition(acq_parameters_); DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; if (item_type_ == "cbyte") @@ -127,7 +151,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( threshold_ = 0.0; doppler_step_ = 0; gnss_synchro_ = nullptr; - num_codes_ = acq_parameters.sampled_ms / acq_parameters.ms_per_code; + num_codes_ = acq_parameters_.sampled_ms / acq_parameters_.ms_per_code; if (in_streams_ > 1) { LOG(ERROR) << "This implementation only supports one input stream"; @@ -223,7 +247,16 @@ void GpsL2MPcpsAcquisition::set_local_code() { auto* code = new std::complex[code_length_]; - gps_l2c_m_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_); + + if (acq_parameters_.use_automatic_resampler) + { + gps_l2c_m_code_gen_complex_sampled(code, gnss_synchro_->PRN, acq_parameters_.resampled_fs); + } + else + { + gps_l2c_m_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_); + } + for (unsigned int i = 0; i < num_codes_; i++) { @@ -339,3 +372,7 @@ gr::basic_block_sptr GpsL2MPcpsAcquisition::get_right_block() { return acquisition_; } +void GpsL2MPcpsAcquisition::set_resampler_latency(uint32_t latency_samples) +{ + acquisition_->set_resampler_latency(latency_samples); +} diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h index 4a0c96c60..da1c7ef6e 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.h @@ -35,9 +35,9 @@ #define GNSS_SDR_GPS_L2_M_PCPS_ACQUISITION_H_ #include "acquisition_interface.h" +#include "complex_byte_to_float_x2.h" #include "gnss_synchro.h" #include "pcps_acquisition.h" -#include "complex_byte_to_float_x2.h" #include #include #include @@ -139,9 +139,17 @@ public: */ void stop_acquisition() override; + /*! + * \brief Sets the resampler latency to account it in the acquisition code delay estimation + */ + + void set_resampler_latency(uint32_t latency_samples) override; + + private: ConfigurationInterface* configuration_; pcps_acquisition_sptr acquisition_; + Acq_Conf acq_parameters_; gr::blocks::float_to_complex::sptr float_to_complex_; complex_byte_to_float_x2_sptr cbyte_to_float_x2_; size_t item_size_; 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 1b1315d2a..c3cd96275 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 @@ -32,10 +32,10 @@ */ #include "gps_l2_m_pcps_acquisition_fpga.h" -#include "configuration_interface.h" -#include "gps_l2c_signal.h" #include "GPS_L2C.h" +#include "configuration_interface.h" #include "gnss_sdr_flags.h" +#include "gps_l2c_signal.h" #include #include @@ -104,10 +104,10 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( // compute all the GPS L1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time // a channel is assigned) - gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(vector_length, true); // Direct FFT + auto* fft_if = new gr::fft::fft_complex(vector_length, true); // Direct FFT // allocate memory to compute all the PRNs and compute all the possible codes - std::complex* code = new std::complex[nsamples_total]; // buffer for the local code - gr_complex* fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + auto* code = new std::complex[nsamples_total]; // buffer for the local code + auto* fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); d_all_fft_codes_ = new lv_16sc_t[nsamples_total * NUM_PRNs]; // memory containing all the possible fft codes for PRN 0 to 32 float max; // temporary maxima search for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) @@ -116,7 +116,7 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( // fill in zero padding for (int s = code_length; s < nsamples_total; s++) { - code[s] = std::complex(static_cast(0, 0)); + code[s] = std::complex(0.0, 0.0); //code[s] = 0; } memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h index 7effb0cf6..102911d3d 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.h @@ -35,11 +35,11 @@ #define GNSS_SDR_GPS_L2_M_PCPS_ACQUISITION_FPGA_H_ #include "acquisition_interface.h" +#include "complex_byte_to_float_x2.h" #include "gnss_synchro.h" #include "pcps_acquisition_fpga.h" -#include "complex_byte_to_float_x2.h" -#include #include +#include #include #include @@ -140,6 +140,8 @@ public: */ void stop_acquisition() override; + void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{}; + private: ConfigurationInterface* configuration_; //pcps_acquisition_sptr acquisition_; diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc index f3f8cf2a9..f436da1d4 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc @@ -32,11 +32,11 @@ */ #include "gps_l5i_pcps_acquisition.h" -#include "configuration_interface.h" -#include "gps_l5_signal.h" #include "GPS_L5.h" -#include "gnss_sdr_flags.h" #include "acq_conf.h" +#include "configuration_interface.h" +#include "gnss_sdr_flags.h" +#include "gps_l5_signal.h" #include #include @@ -52,7 +52,6 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( in_streams_(in_streams), out_streams_(out_streams) { - Acq_Conf acq_parameters = Acq_Conf(); configuration_ = configuration; std::string default_item_type = "gr_complex"; std::string default_dump_filename = "./acquisition.mat"; @@ -63,32 +62,24 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( int64_t fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000); fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); - acq_parameters.fs_in = fs_in_; - acq_parameters.samples_per_chip = static_cast(ceil((1.0 / GPS_L5i_CODE_RATE_HZ) * static_cast(acq_parameters.fs_in))); + acq_parameters_.fs_in = fs_in_; dump_ = configuration_->property(role + ".dump", false); - acq_parameters.dump = dump_; - acq_parameters.dump_channel = configuration_->property(role + ".dump_channel", 0); + acq_parameters_.dump = dump_; + acq_parameters_.dump_channel = configuration_->property(role + ".dump_channel", 0); blocking_ = configuration_->property(role + ".blocking", true); - acq_parameters.blocking = blocking_; + acq_parameters_.blocking = blocking_; doppler_max_ = configuration->property(role + ".doppler_max", 5000); if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; - acq_parameters.doppler_max = doppler_max_; + acq_parameters_.doppler_max = doppler_max_; bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); - acq_parameters.bit_transition_flag = bit_transition_flag_; + acq_parameters_.bit_transition_flag = bit_transition_flag_; use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions - acq_parameters.use_CFAR_algorithm_flag = use_CFAR_algorithm_flag_; + acq_parameters_.use_CFAR_algorithm_flag = use_CFAR_algorithm_flag_; max_dwells_ = configuration_->property(role + ".max_dwells", 1); - acq_parameters.max_dwells = max_dwells_; + acq_parameters_.max_dwells = max_dwells_; dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); - acq_parameters.dump_filename = dump_filename_; - acq_parameters.sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 1); - //--- Find number of samples per spreading code ------------------------- - code_length_ = static_cast(std::floor(static_cast(fs_in_) / (GPS_L5i_CODE_RATE_HZ / GPS_L5i_CODE_LENGTH_CHIPS))); - acq_parameters.samples_per_ms = static_cast(fs_in_) * 0.001; - acq_parameters.samples_per_code = acq_parameters.samples_per_ms * static_cast(GPS_L5i_PERIOD * 1000.0); - - vector_length_ = std::floor(acq_parameters.sampled_ms * acq_parameters.samples_per_ms) * (acq_parameters.bit_transition_flag ? 2 : 1); - code_ = new gr_complex[vector_length_]; + acq_parameters_.dump_filename = dump_filename_; + acq_parameters_.sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 1); if (item_type_ == "cshort") { @@ -99,14 +90,51 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( item_size_ = sizeof(gr_complex); } - acq_parameters.ms_per_code = 1; - acq_parameters.it_size = item_size_; - num_codes_ = acq_parameters.sampled_ms; - 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.make_2_steps = configuration_->property(role + ".make_two_steps", false); - acq_parameters.blocking_on_standby = configuration_->property(role + ".blocking_on_standby", false); - acquisition_ = pcps_make_acquisition(acq_parameters); + acq_parameters_.ms_per_code = 1; + acq_parameters_.it_size = item_size_; + num_codes_ = acq_parameters_.sampled_ms; + 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_.make_2_steps = configuration_->property(role + ".make_two_steps", false); + acq_parameters_.blocking_on_standby = configuration_->property(role + ".blocking_on_standby", false); + acq_parameters_.use_automatic_resampler = configuration_->property("GNSS-SDR.use_acquisition_resampler", false); + if (acq_parameters_.use_automatic_resampler == true and item_type_ != "gr_complex") + { + LOG(WARNING) << "GPS L5 acquisition disabled the automatic resampler feature because its item_type is not set to gr_complex"; + acq_parameters_.use_automatic_resampler = false; + } + if (acq_parameters_.use_automatic_resampler) + { + if (acq_parameters_.fs_in > GPS_L5_OPT_ACQ_FS_HZ) + { + acq_parameters_.resampler_ratio = floor(static_cast(acq_parameters_.fs_in) / GPS_L5_OPT_ACQ_FS_HZ); + uint32_t decimation = acq_parameters_.fs_in / GPS_L5_OPT_ACQ_FS_HZ; + while (acq_parameters_.fs_in % decimation > 0) + { + decimation--; + }; + acq_parameters_.resampler_ratio = decimation; + acq_parameters_.resampled_fs = acq_parameters_.fs_in / static_cast(acq_parameters_.resampler_ratio); + } + + //--- Find number of samples per spreading code ------------------------- + code_length_ = static_cast(std::floor(static_cast(acq_parameters_.resampled_fs) / (GPS_L5i_CODE_RATE_HZ / GPS_L5i_CODE_LENGTH_CHIPS))); + acq_parameters_.samples_per_ms = static_cast(acq_parameters_.resampled_fs) * 0.001; + acq_parameters_.samples_per_chip = static_cast(ceil((1.0 / GPS_L5i_CODE_RATE_HZ) * static_cast(acq_parameters_.resampled_fs))); + } + else + { + acq_parameters_.resampled_fs = fs_in_; + //--- Find number of samples per spreading code ------------------------- + code_length_ = static_cast(std::floor(static_cast(fs_in_) / (GPS_L5i_CODE_RATE_HZ / GPS_L5i_CODE_LENGTH_CHIPS))); + acq_parameters_.samples_per_ms = static_cast(fs_in_) * 0.001; + acq_parameters_.samples_per_chip = static_cast(ceil((1.0 / GPS_L5i_CODE_RATE_HZ) * static_cast(acq_parameters_.fs_in))); + } + + acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast(GPS_L5i_PERIOD * 1000.0); + vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); + code_ = new gr_complex[vector_length_]; + acquisition_ = pcps_make_acquisition(acq_parameters_); DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")"; if (item_type_ == "cbyte") @@ -114,6 +142,7 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); float_to_complex_ = gr::blocks::float_to_complex::make(); } + channel_ = 0; threshold_ = 0.0; doppler_step_ = 0; @@ -211,7 +240,15 @@ void GpsL5iPcpsAcquisition::set_local_code() { auto* code = new std::complex[code_length_]; - gps_l5i_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_); + + if (acq_parameters_.use_automatic_resampler) + { + gps_l5i_code_gen_complex_sampled(code, gnss_synchro_->PRN, acq_parameters_.resampled_fs); + } + else + { + gps_l5i_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_); + } for (unsigned int i = 0; i < num_codes_; i++) { @@ -327,3 +364,8 @@ gr::basic_block_sptr GpsL5iPcpsAcquisition::get_right_block() { return acquisition_; } + +void GpsL5iPcpsAcquisition::set_resampler_latency(uint32_t latency_samples) +{ + acquisition_->set_resampler_latency(latency_samples); +} diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h index c9f1cd95d..af8cabb81 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.h @@ -35,9 +35,9 @@ #define GNSS_SDR_GPS_L5i_PCPS_ACQUISITION_H_ #include "acquisition_interface.h" +#include "complex_byte_to_float_x2.h" #include "gnss_synchro.h" #include "pcps_acquisition.h" -#include "complex_byte_to_float_x2.h" #include #include #include @@ -139,9 +139,16 @@ public: */ void stop_acquisition() override; + /*! + * \brief Sets the resampler latency to account it in the acquisition code delay estimation + */ + + void set_resampler_latency(uint32_t latency_samples) override; + private: ConfigurationInterface* configuration_; pcps_acquisition_sptr acquisition_; + Acq_Conf acq_parameters_; gr::blocks::float_to_complex::sptr float_to_complex_; complex_byte_to_float_x2_sptr cbyte_to_float_x2_; size_t item_size_; 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 8e6930ebc..f90c77040 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc @@ -32,10 +32,10 @@ */ #include "gps_l5i_pcps_acquisition_fpga.h" -#include "configuration_interface.h" -#include "gps_l5_signal.h" #include "GPS_L5.h" +#include "configuration_interface.h" #include "gnss_sdr_flags.h" +#include "gps_l5_signal.h" #include #include @@ -89,7 +89,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( //dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); //acq_parameters.dump_filename = dump_filename_; //--- Find number of samples per spreading code ------------------------- - unsigned int code_length = static_cast(std::round(static_cast(fs_in) / (GPS_L5i_CODE_RATE_HZ / static_cast(GPS_L5i_CODE_LENGTH_CHIPS)))); + auto code_length = static_cast(std::round(static_cast(fs_in) / (GPS_L5i_CODE_RATE_HZ / static_cast(GPS_L5i_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((float)code_length)); @@ -105,11 +105,11 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( //printf("L5 ACQ CLASS MID 01\n"); // compute all the GPS L5 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time // a channel is assigned) - gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(vector_length, true); // Direct FFT + auto* fft_if = new gr::fft::fft_complex(vector_length, true); // Direct FFT //printf("L5 ACQ CLASS MID 02\n"); - std::complex* code = new gr_complex[vector_length]; + auto* code = new gr_complex[vector_length]; //printf("L5 ACQ CLASS MID 03\n"); - gr_complex* fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + auto* fft_codes_padded = static_cast(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); //printf("L5 ACQ CLASS MID 04\n"); d_all_fft_codes_ = new lv_16sc_t[nsamples_total * NUM_PRNs]; // memory containing all the possible fft codes for PRN 0 to 32 @@ -124,7 +124,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( // fill in zero padding for (int s = code_length; s < nsamples_total; s++) { - code[s] = std::complex(static_cast(0, 0)); + code[s] = std::complex(0.0, 0.0); //code[s] = 0; } memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total); // copy to FFT buffer diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h index 571f01193..bc0a04c4c 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.h @@ -35,11 +35,11 @@ #define GNSS_SDR_GPS_L5i_PCPS_ACQUISITION_FPGA_H_ #include "acquisition_interface.h" +#include "complex_byte_to_float_x2.h" #include "gnss_synchro.h" #include "pcps_acquisition_fpga.h" -#include "complex_byte_to_float_x2.h" -#include #include +#include #include #include @@ -140,6 +140,8 @@ public: */ void stop_acquisition() override; + void set_resampler_latency(uint32_t latency_samples __attribute__((unused))) override{}; + private: ConfigurationInterface* configuration_; //pcps_acquisition_sptr acquisition_; diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h index 2ebe9a8e5..352dc938c 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h @@ -38,12 +38,12 @@ #ifndef GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_CC_H_ #define GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_CC_H_ +#include "gnss_synchro.h" +#include +#include +#include #include #include -#include -#include -#include -#include "gnss_synchro.h" class galileo_e5a_noncoherentIQ_acquisition_caf_cc; diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc index 879746959..275b8aad0 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc @@ -30,13 +30,13 @@ */ #include "galileo_pcps_8ms_acquisition_cc.h" -#include -#include +#include "control_message_factory.h" #include #include #include #include -#include "control_message_factory.h" +#include +#include using google::LogMessage; diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h index 11f6eadca..d9f794d1e 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h @@ -32,12 +32,12 @@ #ifndef GNSS_SDR_PCPS_8MS_ACQUISITION_CC_H_ #define GNSS_SDR_PCPS_8MS_ACQUISITION_CC_H_ +#include "gnss_synchro.h" +#include +#include +#include #include #include -#include -#include -#include -#include "gnss_synchro.h" class galileo_pcps_8ms_acquisition_cc; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc index 5510c4d7f..d95bb24cb 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -221,6 +221,12 @@ pcps_acquisition::~pcps_acquisition() } +void pcps_acquisition::set_resampler_latency(uint32_t latency_samples) +{ + gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler + acq_parameters.resampler_latency_samples = latency_samples; +} + void pcps_acquisition::set_local_code(std::complex* code) { // reset the intermediate frequency @@ -280,7 +286,15 @@ bool pcps_acquisition::is_fdma() void pcps_acquisition::update_local_carrier(gr_complex* carrier_vector, int32_t correlator_length_samples, float freq) { - float phase_step_rad = GPS_TWO_PI * freq / static_cast(acq_parameters.fs_in); + float phase_step_rad; + if (acq_parameters.use_automatic_resampler) + { + phase_step_rad = GPS_TWO_PI * freq / static_cast(acq_parameters.resampled_fs); + } + else + { + phase_step_rad = GPS_TWO_PI * freq / static_cast(acq_parameters.fs_in); + } float _phase[1]; _phase[0] = 0.0; volk_gnsssdr_s32f_sincos_32fc(carrier_vector, -phase_step_rad, _phase, correlator_length_samples); @@ -716,9 +730,20 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count) { d_test_statistics = first_vs_second_peak_statistic(indext, doppler, d_num_doppler_bins, acq_parameters.doppler_max, d_doppler_step); } - d_gnss_synchro->Acq_delay_samples = static_cast(std::fmod(static_cast(indext), acq_parameters.samples_per_code)); - d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); - d_gnss_synchro->Acq_samplestamp_samples = samp_count; + if (acq_parameters.use_automatic_resampler) + { + //take into account the acquisition resampler ratio + d_gnss_synchro->Acq_delay_samples = static_cast(std::fmod(static_cast(indext), acq_parameters.samples_per_code)) * acq_parameters.resampler_ratio; + d_gnss_synchro->Acq_delay_samples -= static_cast(acq_parameters.resampler_latency_samples); //account the resampler filter latency + d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); + d_gnss_synchro->Acq_samplestamp_samples = rint(static_cast(samp_count) * acq_parameters.resampler_ratio); + } + else + { + d_gnss_synchro->Acq_delay_samples = static_cast(std::fmod(static_cast(indext), acq_parameters.samples_per_code)); + d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); + d_gnss_synchro->Acq_samplestamp_samples = samp_count; + } } else { @@ -762,10 +787,23 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count) { d_test_statistics = first_vs_second_peak_statistic(indext, doppler, d_num_doppler_bins_step2, static_cast(d_doppler_center_step_two - (static_cast(d_num_doppler_bins_step2) / 2.0) * acq_parameters.doppler_step2), acq_parameters.doppler_step2); } - d_gnss_synchro->Acq_delay_samples = static_cast(std::fmod(static_cast(indext), acq_parameters.samples_per_code)); - d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); - d_gnss_synchro->Acq_samplestamp_samples = samp_count; - d_gnss_synchro->Acq_doppler_step = acq_parameters.doppler_step2; + + if (acq_parameters.use_automatic_resampler) + { + //take into account the acquisition resampler ratio + d_gnss_synchro->Acq_delay_samples = static_cast(std::fmod(static_cast(indext), acq_parameters.samples_per_code)) * acq_parameters.resampler_ratio; + d_gnss_synchro->Acq_delay_samples -= static_cast(acq_parameters.resampler_latency_samples); //account the resampler filter latency + d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); + d_gnss_synchro->Acq_samplestamp_samples = rint(static_cast(samp_count) * acq_parameters.resampler_ratio); + d_gnss_synchro->Acq_doppler_step = acq_parameters.doppler_step2; + } + else + { + d_gnss_synchro->Acq_delay_samples = static_cast(std::fmod(static_cast(indext), acq_parameters.samples_per_code)); + d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); + d_gnss_synchro->Acq_samplestamp_samples = samp_count; + d_gnss_synchro->Acq_doppler_step = acq_parameters.doppler_step2; + } } lk.lock(); @@ -865,6 +903,12 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count) } } +// Called by gnuradio to enable drivers, etc for i/o devices. +bool pcps_acquisition::start() +{ + d_sample_counter = 0ULL; + return true; +} int pcps_acquisition::general_work(int noutput_items __attribute__((unused)), gr_vector_int& ninput_items, gr_vector_const_void_star& input_items, diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h index 4e46d049b..c403b7d50 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h @@ -52,8 +52,8 @@ #ifndef GNSS_SDR_PCPS_ACQUISITION_H_ #define GNSS_SDR_PCPS_ACQUISITION_H_ -#include "gnss_synchro.h" #include "acq_conf.h" +#include "gnss_synchro.h" #include #include #include @@ -98,6 +98,9 @@ private: float first_vs_second_peak_statistic(uint32_t& indext, int32_t& doppler, uint32_t num_doppler_bins, int32_t doppler_max, int32_t doppler_step); float max_to_input_power_statistic(uint32_t& indext, int32_t& doppler, float input_power, uint32_t num_doppler_bins, int32_t doppler_max, int32_t doppler_step); + bool start(); + + Acq_Conf acq_parameters; bool d_active; bool d_worker_active; @@ -233,6 +236,9 @@ public: d_doppler_step = doppler_step; } + + void set_resampler_latency(uint32_t latency_samples); + /*! * \brief Parallel Code Phase Search Acquisition signal processing. */ diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc index 3e19bee55..51b821e36 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc @@ -31,18 +31,18 @@ */ #include "pcps_acquisition_fine_doppler_cc.h" -#include "gps_sdr_signal_processing.h" -#include "control_message_factory.h" #include "GPS_L1_CA.h" +#include "control_message_factory.h" #include "gnss_sdr_create_directory.h" +#include "gps_sdr_signal_processing.h" #include #include #include +#include #include #include #include // std::rotate, std::fill_n #include -#include using google::LogMessage; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h index 6c34ad565..d92ed1db7 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h @@ -49,12 +49,12 @@ #ifndef GNSS_SDR_PCPS_ACQUISITION_FINE_DOPPLER_CC_H_ #define GNSS_SDR_PCPS_ACQUISITION_FINE_DOPPLER_CC_H_ -#include "gnss_synchro.h" #include "acq_conf.h" +#include "gnss_synchro.h" #include #include -#include #include +#include #include #include diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc index 5e97a8ed5..ffb4d2452 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc @@ -39,9 +39,10 @@ */ +#include "pcps_acquisition_fpga.h" #include #include -#include "pcps_acquisition_fpga.h" +#include #define AQ_DOWNSAMPLING_DELAY 40 // delay due to the downsampling filter in the acquisition @@ -50,7 +51,7 @@ using google::LogMessage; pcps_acquisition_fpga_sptr pcps_make_acquisition_fpga(pcpsconf_fpga_t conf_) { - return pcps_acquisition_fpga_sptr(new pcps_acquisition_fpga(conf_)); + return pcps_acquisition_fpga_sptr(new pcps_acquisition_fpga(std::move(conf_))); } @@ -61,7 +62,7 @@ pcps_acquisition_fpga::pcps_acquisition_fpga(pcpsconf_fpga_t conf_) : gr::block( // printf("acq constructor start\n"); this->message_port_register_out(pmt::mp("events")); - acq_parameters = conf_; + acq_parameters = std::move(conf_); d_sample_counter = 0ULL; // SAMPLE COUNTER d_active = false; d_state = 0; @@ -74,7 +75,7 @@ pcps_acquisition_fpga::pcps_acquisition_fpga(pcpsconf_fpga_t conf_) : gr::block( d_doppler_step = 0U; d_test_statistics = 0.0; d_channel = 0U; - d_gnss_synchro = 0; + d_gnss_synchro = nullptr; //printf("zzzz acq_parameters.code_length = %d\n", acq_parameters.code_length); //printf("zzzz acq_parameters.samples_per_ms = %d\n", acq_parameters.samples_per_ms); @@ -256,7 +257,7 @@ void pcps_acquisition_fpga::set_active(bool active) d_gnss_synchro->Acq_doppler_hz = static_cast(doppler); d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter; - d_test_statistics = (d_mag / d_input_power); //* correction_factor; + d_test_statistics = (d_mag / d_input_power); // correction_factor; } // In the case of the FPGA the option of dumping the results of the acquisition to a file is not available diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc index 5ce6fb232..b01652ec3 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc @@ -31,16 +31,16 @@ */ #include "pcps_assisted_acquisition_cc.h" -#include -#include +#include "GPS_L1_CA.h" +#include "concurrent_map.h" +#include "control_message_factory.h" +#include "gps_acq_assist.h" #include #include #include #include -#include "concurrent_map.h" -#include "control_message_factory.h" -#include "gps_acq_assist.h" -#include "GPS_L1_CA.h" +#include +#include extern concurrent_map global_gps_acq_assist_map; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h index e8d093061..d582821c6 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h @@ -48,12 +48,12 @@ #ifndef GNSS_SDR_PCPS_ASSISTED_ACQUISITION_CC_H_ #define GNSS_SDR_PCPS_ASSISTED_ACQUISITION_CC_H_ +#include "gnss_synchro.h" +#include +#include +#include #include #include -#include -#include -#include -#include "gnss_synchro.h" class pcps_assisted_acquisition_cc; 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 f9ae9b104..99841b5b6 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc @@ -35,8 +35,8 @@ */ #include "pcps_cccwsr_acquisition_cc.h" -#include "control_message_factory.h" #include "GPS_L1_CA.h" // GPS_TWO_PI +#include "control_message_factory.h" #include #include #include diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h index 072eb1b83..85050cc21 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h @@ -37,12 +37,12 @@ #ifndef GNSS_SDR_PCPS_CCCWSR_ACQUISITION_CC_H_ #define GNSS_SDR_PCPS_CCCWSR_ACQUISITION_CC_H_ +#include "gnss_synchro.h" +#include +#include +#include #include #include -#include -#include -#include -#include "gnss_synchro.h" class pcps_cccwsr_acquisition_cc; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc index aa8bceffb..0944b9ed8 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc @@ -49,10 +49,10 @@ */ #include "pcps_opencl_acquisition_cc.h" +#include "GPS_L1_CA.h" //GPS_TWO_PI #include "control_message_factory.h" #include "opencl/fft_base_kernels.h" #include "opencl/fft_internal.h" -#include "GPS_L1_CA.h" //GPS_TWO_PI #include #include #include @@ -61,13 +61,14 @@ #include #include #include +#include using google::LogMessage; pcps_opencl_acquisition_cc_sptr pcps_make_opencl_acquisition_cc( - unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long fs_in, + uint32_t sampled_ms, uint32_t max_dwells, + uint32_t doppler_max, int64_t fs_in, int samples_per_ms, int samples_per_code, bool bit_transition_flag, bool dump, @@ -75,15 +76,15 @@ pcps_opencl_acquisition_cc_sptr pcps_make_opencl_acquisition_cc( { return pcps_opencl_acquisition_cc_sptr( new pcps_opencl_acquisition_cc(sampled_ms, max_dwells, doppler_max, fs_in, samples_per_ms, - samples_per_code, bit_transition_flag, dump, dump_filename)); + samples_per_code, bit_transition_flag, dump, std::move(dump_filename))); } pcps_opencl_acquisition_cc::pcps_opencl_acquisition_cc( - unsigned int sampled_ms, - unsigned int max_dwells, - unsigned int doppler_max, - long fs_in, + uint32_t sampled_ms, + uint32_t max_dwells, + uint32_t doppler_max, + int64_t fs_in, int samples_per_ms, int samples_per_code, bool bit_transition_flag, @@ -114,7 +115,7 @@ pcps_opencl_acquisition_cc::pcps_opencl_acquisition_cc( d_cl_fft_batch_size = 1; d_in_buffer = new gr_complex *[d_max_dwells]; - for (unsigned int i = 0; i < d_max_dwells; i++) + for (uint32_t i = 0; i < d_max_dwells; i++) { d_in_buffer[i] = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); } @@ -122,7 +123,7 @@ pcps_opencl_acquisition_cc::pcps_opencl_acquisition_cc( d_fft_codes = static_cast(volk_gnsssdr_malloc(d_fft_size_pow2 * sizeof(gr_complex), volk_gnsssdr_get_alignment())); d_zero_vector = static_cast(volk_gnsssdr_malloc((d_fft_size_pow2 - d_fft_size) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); - for (unsigned int i = 0; i < (d_fft_size_pow2 - d_fft_size); i++) + for (uint32_t i = 0; i < (d_fft_size_pow2 - d_fft_size); i++) { d_zero_vector[i] = gr_complex(0.0, 0.0); } @@ -140,7 +141,7 @@ pcps_opencl_acquisition_cc::pcps_opencl_acquisition_cc( // For dumping samples into a file d_dump = dump; - d_dump_filename = dump_filename; + d_dump_filename = std::move(dump_filename); } @@ -148,14 +149,14 @@ pcps_opencl_acquisition_cc::~pcps_opencl_acquisition_cc() { if (d_num_doppler_bins > 0) { - for (unsigned int i = 0; i < d_num_doppler_bins; i++) + for (uint32_t i = 0; i < d_num_doppler_bins; i++) { volk_gnsssdr_free(d_grid_doppler_wipeoffs[i]); } delete[] d_grid_doppler_wipeoffs; } - for (unsigned int i = 0; i < d_max_dwells; i++) + for (uint32_t i = 0; i < d_max_dwells; i++) { volk_gnsssdr_free(d_in_buffer[i]); } @@ -193,7 +194,7 @@ pcps_opencl_acquisition_cc::~pcps_opencl_acquisition_cc() } -int pcps_opencl_acquisition_cc::init_opencl_environment(std::string kernel_filename) +int pcps_opencl_acquisition_cc::init_opencl_environment(const std::string &kernel_filename) { //get all platforms (drivers) std::vector all_platforms; @@ -313,7 +314,7 @@ void pcps_opencl_acquisition_cc::init() d_cl_buffer_grid_doppler_wipeoffs = new cl::Buffer *[d_num_doppler_bins]; } - for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) + for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) { d_grid_doppler_wipeoffs[doppler_index] = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); @@ -359,7 +360,7 @@ void pcps_opencl_acquisition_cc::set_local_code(std::complex *code) clFFT_ExecuteInterleaved((*d_cl_queue)(), d_cl_fft_plan, d_cl_fft_batch_size, clFFT_Forward, (*d_cl_buffer_2)(), (*d_cl_buffer_2)(), - 0, NULL, NULL); + 0, nullptr, nullptr); //Conjucate the local code cl::Kernel kernel = cl::Kernel(d_cl_program, "conj_vector"); @@ -406,7 +407,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_volk() d_input_power /= static_cast(d_fft_size); // 2- Doppler frequency search loop - for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) + for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) { // doppler search steps doppler = -static_cast(d_doppler_max) + d_doppler_step * doppler_index; @@ -542,7 +543,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl() cl::Kernel kernel; // 2- Doppler frequency search loop - for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) + for (uint32_t doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) { // doppler search steps @@ -562,7 +563,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl() clFFT_ExecuteInterleaved((*d_cl_queue)(), d_cl_fft_plan, d_cl_fft_batch_size, clFFT_Forward, (*d_cl_buffer_1)(), (*d_cl_buffer_2)(), - 0, NULL, NULL); + 0, nullptr, nullptr); // Multiply carrier wiped--off, Fourier transformed incoming signal // with the local FFT'd code reference @@ -576,7 +577,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl() // compute the inverse FFT clFFT_ExecuteInterleaved((*d_cl_queue)(), d_cl_fft_plan, d_cl_fft_batch_size, clFFT_Inverse, (*d_cl_buffer_2)(), (*d_cl_buffer_2)(), - 0, NULL, NULL); + 0, nullptr, nullptr); // Compute magnitude kernel = cl::Kernel(d_cl_program, "magnitude_squared"); @@ -735,8 +736,8 @@ int pcps_opencl_acquisition_cc::general_work(int noutput_items, // Fill internal buffer with d_max_dwells signal blocks. This step ensures that // consecutive signal blocks will be processed in multi-dwell operation. This is // essential when d_bit_transition_flag = true. - unsigned int num_dwells = std::min(static_cast(d_max_dwells - d_in_dwell_count), ninput_items[0]); - for (unsigned int i = 0; i < num_dwells; i++) + uint32_t num_dwells = std::min(static_cast(d_max_dwells - d_in_dwell_count), ninput_items[0]); + for (uint32_t i = 0; i < num_dwells; i++) { memcpy(d_in_buffer[d_in_dwell_count++], static_cast(input_items[i]), sizeof(gr_complex) * d_fft_size); diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h index df6947f47..20b53d082 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.h @@ -54,8 +54,9 @@ #include "gnss_synchro.h" #include "opencl/fft_internal.h" #include -#include #include +#include +#include #include #include #include @@ -71,8 +72,8 @@ class pcps_opencl_acquisition_cc; typedef boost::shared_ptr pcps_opencl_acquisition_cc_sptr; pcps_opencl_acquisition_cc_sptr -pcps_make_opencl_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long fs_in, +pcps_make_opencl_acquisition_cc(uint32_t sampled_ms, uint32_t max_dwells, + uint32_t doppler_max, int64_t fs_in, int samples_per_ms, int samples_per_code, bool bit_transition_flag, bool dump, @@ -88,15 +89,15 @@ class pcps_opencl_acquisition_cc : public gr::block { private: friend pcps_opencl_acquisition_cc_sptr - pcps_make_opencl_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long fs_in, + pcps_make_opencl_acquisition_cc(uint32_t sampled_ms, uint32_t max_dwells, + uint32_t doppler_max, int64_t fs_in, int samples_per_ms, int samples_per_code, bool bit_transition_flag, bool dump, std::string dump_filename); - pcps_opencl_acquisition_cc(unsigned int sampled_ms, unsigned int max_dwells, - unsigned int doppler_max, long fs_in, + pcps_opencl_acquisition_cc(uint32_t sampled_ms, uint32_t max_dwells, + uint32_t doppler_max, int64_t fs_in, int samples_per_ms, int samples_per_code, bool bit_transition_flag, bool dump, @@ -105,30 +106,30 @@ private: void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift, int doppler_offset); - int init_opencl_environment(std::string kernel_filename); + int init_opencl_environment(const std::string& kernel_filename); - long d_fs_in; + int64_t d_fs_in; int d_samples_per_ms; int d_samples_per_code; - unsigned int d_doppler_resolution; + uint32_t d_doppler_resolution; float d_threshold; std::string d_satellite_str; - unsigned int d_doppler_max; - unsigned int d_doppler_step; - unsigned int d_sampled_ms; - unsigned int d_max_dwells; - unsigned int d_well_count; - unsigned int d_fft_size; - unsigned int d_fft_size_pow2; + uint32_t d_doppler_max; + uint32_t d_doppler_step; + uint32_t d_sampled_ms; + uint32_t d_max_dwells; + uint32_t d_well_count; + uint32_t d_fft_size; + uint32_t d_fft_size_pow2; int* d_max_doppler_indexs; uint64_t d_sample_counter; gr_complex** d_grid_doppler_wipeoffs; - unsigned int d_num_doppler_bins; + uint32_t d_num_doppler_bins; gr_complex* d_fft_codes; gr::fft::fft_complex* d_fft_if; gr::fft::fft_complex* d_ifft; Gnss_Synchro* d_gnss_synchro; - unsigned int d_code_phase; + uint32_t d_code_phase; float d_doppler_freq; float d_mag; float* d_magnitude; @@ -140,12 +141,12 @@ private: int d_state; bool d_core_working; bool d_dump; - unsigned int d_channel; + uint32_t d_channel; std::string d_dump_filename; gr_complex* d_zero_vector; gr_complex** d_in_buffer; std::vector d_sample_counter_buffer; - unsigned int d_in_dwell_count; + uint32_t d_in_dwell_count; cl::Platform d_cl_platform; cl::Device d_cl_device; @@ -182,7 +183,7 @@ public: /*! * \brief Returns the maximum peak of grid search. */ - inline unsigned int mag() const + inline uint32_t mag() const { return d_mag; } @@ -219,7 +220,7 @@ public: * \brief Set acquisition channel unique ID * \param channel - receiver channel. */ - inline void set_channel(unsigned int channel) + inline void set_channel(uint32_t channel) { d_channel = channel; } @@ -238,7 +239,7 @@ public: * \brief Set maximum Doppler grid search * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. */ - inline void set_doppler_max(unsigned int doppler_max) + inline void set_doppler_max(uint32_t doppler_max) { d_doppler_max = doppler_max; } @@ -247,7 +248,7 @@ public: * \brief Set Doppler steps for the grid search * \param doppler_step - Frequency bin of the search grid [Hz]. */ - inline void set_doppler_step(unsigned int doppler_step) + inline void set_doppler_step(uint32_t doppler_step) { d_doppler_step = doppler_step; } 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 010285c1f..11c13a979 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc @@ -29,10 +29,10 @@ */ #include "pcps_quicksync_acquisition_cc.h" -#include "control_message_factory.h" #include "GPS_L1_CA.h" -#include +#include "control_message_factory.h" #include +#include #include #include #include @@ -247,7 +247,7 @@ void pcps_quicksync_acquisition_cc::set_state(int32_t state) d_mag = 0.0; d_input_power = 0.0; d_test_statistics = 0.0; - d_active = 1; + d_active = true; } else if (d_state == 0) { diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h index e933d1a7a..1e8e07a05 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h @@ -53,13 +53,13 @@ #include "gnss_synchro.h" #include -#include #include -#include -#include +#include #include -#include #include +#include +#include +#include class pcps_quicksync_acquisition_cc; @@ -90,17 +90,17 @@ class pcps_quicksync_acquisition_cc : public gr::block { private: friend pcps_quicksync_acquisition_cc_sptr - pcps_quicksync_make_acquisition_cc(uint32_t folding_factor, - uint32_t sampled_ms, uint32_t max_dwells, - uint32_t doppler_max, int64_t fs_in, + pcps_quicksync_make_acquisition_cc(uint32_t folding_factor, + uint32_t sampled_ms, uint32_t max_dwells, + uint32_t doppler_max, int64_t fs_in, int32_t samples_per_ms, int32_t samples_per_code, bool bit_transition_flag, bool dump, std::string dump_filename); - pcps_quicksync_acquisition_cc(uint32_t folding_factor, - uint32_t sampled_ms, uint32_t max_dwells, - uint32_t doppler_max, int64_t fs_in, + pcps_quicksync_acquisition_cc(uint32_t folding_factor, + uint32_t sampled_ms, uint32_t max_dwells, + uint32_t doppler_max, int64_t fs_in, int32_t samples_per_ms, int32_t samples_per_code, bool bit_transition_flag, bool dump, @@ -110,36 +110,36 @@ private: int32_t doppler_offset); gr_complex* d_code; - uint32_t d_folding_factor; // also referred in the paper as 'p' + uint32_t d_folding_factor; // also referred in the paper as 'p' float* d_corr_acumulator; - uint32_t * d_possible_delay; + uint32_t* d_possible_delay; float* d_corr_output_f; float* d_magnitude_folded; gr_complex* d_signal_folded; gr_complex* d_code_folded; float d_noise_floor_power; - int64_t d_fs_in; + int64_t d_fs_in; int32_t d_samples_per_ms; int32_t d_samples_per_code; - uint32_t d_doppler_resolution; + uint32_t d_doppler_resolution; float d_threshold; std::string d_satellite_str; - uint32_t d_doppler_max; - uint32_t d_doppler_step; - uint32_t d_sampled_ms; - uint32_t d_max_dwells; - uint32_t d_well_count; - uint32_t d_fft_size; + uint32_t d_doppler_max; + uint32_t d_doppler_step; + uint32_t d_sampled_ms; + uint32_t d_max_dwells; + uint32_t d_well_count; + uint32_t d_fft_size; uint64_t d_sample_counter; gr_complex** d_grid_doppler_wipeoffs; - uint32_t d_num_doppler_bins; + uint32_t d_num_doppler_bins; gr_complex* d_fft_codes; gr::fft::fft_complex* d_fft_if; gr::fft::fft_complex* d_fft_if2; gr::fft::fft_complex* d_ifft; Gnss_Synchro* d_gnss_synchro; - uint32_t d_code_phase; + uint32_t d_code_phase; float d_doppler_freq; float d_mag; float* d_magnitude; @@ -150,7 +150,7 @@ private: bool d_active; int32_t d_state; bool d_dump; - uint32_t d_channel; + uint32_t d_channel; std::string d_dump_filename; public: @@ -172,7 +172,7 @@ public: /*! * \brief Returns the maximum peak of grid search. */ - inline uint32_t mag() const + inline uint32_t mag() const { return d_mag; } @@ -209,7 +209,7 @@ public: * \brief Set acquisition channel unique ID * \param channel - receiver channel. */ - inline void set_channel(uint32_t channel) + inline void set_channel(uint32_t channel) { d_channel = channel; } @@ -228,7 +228,7 @@ public: * \brief Set maximum Doppler grid search * \param doppler_max - Maximum Doppler shift considered in the grid search [Hz]. */ - inline void set_doppler_max(uint32_t doppler_max) + inline void set_doppler_max(uint32_t doppler_max) { d_doppler_max = doppler_max; } @@ -237,7 +237,7 @@ public: * \brief Set Doppler steps for the grid search * \param doppler_step - Frequency bin of the search grid [Hz]. */ - inline void set_doppler_step(uint32_t doppler_step) + inline void set_doppler_step(uint32_t doppler_step) { d_doppler_step = doppler_step; } 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 6d1b4917c..dced14810 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc @@ -49,8 +49,8 @@ */ #include "pcps_tong_acquisition_cc.h" -#include "control_message_factory.h" #include "GPS_L1_CA.h" // for GPS_TWO_PI +#include "control_message_factory.h" #include #include #include diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h index af538ebf1..f4cb31068 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h @@ -53,8 +53,8 @@ #include "gnss_synchro.h" #include -#include #include +#include #include #include diff --git a/src/algorithms/acquisition/libs/acq_conf.cc b/src/algorithms/acquisition/libs/acq_conf.cc index e98bf3bdf..8e8d48d5e 100644 --- a/src/algorithms/acquisition/libs/acq_conf.cc +++ b/src/algorithms/acquisition/libs/acq_conf.cc @@ -53,4 +53,8 @@ Acq_Conf::Acq_Conf() dump_channel = 0U; it_size = sizeof(char); blocking_on_standby = false; + use_automatic_resampler = false; + resampler_ratio = 1.0; + resampled_fs = 0LL; + resampler_latency_samples = 0U; } diff --git a/src/algorithms/acquisition/libs/acq_conf.h b/src/algorithms/acquisition/libs/acq_conf.h index 445fab878..af81d8806 100644 --- a/src/algorithms/acquisition/libs/acq_conf.h +++ b/src/algorithms/acquisition/libs/acq_conf.h @@ -56,6 +56,10 @@ public: bool blocking; bool blocking_on_standby; // enable it only for unit testing to avoid sample consume on idle status bool make_2_steps; + bool use_automatic_resampler; + float resampler_ratio; + int64_t resampled_fs; + uint32_t resampler_latency_samples; std::string dump_filename; uint32_t dump_channel; size_t it_size; diff --git a/src/algorithms/acquisition/libs/fpga_acquisition.cc b/src/algorithms/acquisition/libs/fpga_acquisition.cc index 57e2a6ba2..5618d072b 100644 --- a/src/algorithms/acquisition/libs/fpga_acquisition.cc +++ b/src/algorithms/acquisition/libs/fpga_acquisition.cc @@ -37,9 +37,10 @@ #include "GPS_L1_CA.h" #include "gps_sdr_signal_processing.h" #include +#include // libraries used by the GIPO #include -#include // libraries used by the GIPO #include // libraries used by the GIPO +#include #define PAGE_SIZE 0x10000 // default page size for the multicorrelator memory map @@ -102,7 +103,7 @@ fpga_acquisition::fpga_acquisition(std::string device_name, //printf("AAA- vector_length = %d\n ", vector_length); // initial values - d_device_name = device_name; + d_device_name = std::move(device_name); //d_freq = freq; d_fs_in = fs_in; d_vector_length = vector_length; @@ -121,7 +122,7 @@ fpga_acquisition::fpga_acquisition(std::string device_name, LOG(WARNING) << "Cannot open deviceio" << d_device_name; std::cout << "Acq: cannot open deviceio" << d_device_name << std::endl; } - d_map_base = reinterpret_cast(mmap(NULL, PAGE_SIZE, + d_map_base = reinterpret_cast(mmap(nullptr, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, d_fd, 0)); if (d_map_base == reinterpret_cast(-1)) @@ -234,7 +235,7 @@ void fpga_acquisition::set_doppler_sweep(uint32_t num_sweeps) float phase_step_rad_int_temp; int32_t phase_step_rad_int; //int32_t doppler = static_cast(-d_doppler_max) + d_doppler_step * doppler_index; - int32_t doppler = static_cast(-d_doppler_max); + auto doppler = static_cast(-d_doppler_max); //float phase_step_rad = GPS_TWO_PI * (d_freq + doppler) / static_cast(d_fs_in); float phase_step_rad = GPS_TWO_PI * (doppler) / static_cast(d_fs_in); // The doppler step can never be outside the range -pi to +pi, otherwise there would be aliasing @@ -408,7 +409,7 @@ void fpga_acquisition::unblock_samples() void fpga_acquisition::close_device() { - uint32_t *aux = const_cast(d_map_base); + auto *aux = const_cast(d_map_base); if (munmap(static_cast(aux), PAGE_SIZE) == -1) { printf("Failed to unmap memory uio\n"); diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index a3d6c9bf3..946f17a65 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -38,12 +38,10 @@ using google::LogMessage; // Constructor -Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, - std::shared_ptr pass_through, std::shared_ptr acq, +Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, std::shared_ptr acq, std::shared_ptr trk, std::shared_ptr nav, std::string role, std::string implementation, gr::msg_queue::sptr queue) { - pass_through_ = std::move(pass_through); acq_ = std::move(acq); trk_ = std::move(trk); nav_ = std::move(nav); @@ -112,32 +110,15 @@ Channel::~Channel() = default; void Channel::connect(gr::top_block_sptr top_block) { - if (connected_) - { - LOG(WARNING) << "channel already connected internally"; - return; - } - if (flag_enable_fpga == false) - { - pass_through_->connect(top_block); - } acq_->connect(top_block); trk_->connect(top_block); nav_->connect(top_block); //Synchronous ports - if (flag_enable_fpga == false) - { - top_block->connect(pass_through_->get_right_block(), 0, acq_->get_left_block(), 0); - DLOG(INFO) << "pass_through_ -> acquisition"; - top_block->connect(pass_through_->get_right_block(), 0, trk_->get_left_block(), 0); - DLOG(INFO) << "pass_through_ -> tracking"; - } top_block->connect(trk_->get_right_block(), 0, nav_->get_left_block(), 0); DLOG(INFO) << "tracking -> telemetry_decoder"; // Message ports - top_block->msg_connect(acq_->get_right_block(), pmt::mp("events"), channel_msg_rx, pmt::mp("events")); top_block->msg_connect(trk_->get_right_block(), pmt::mp("events"), channel_msg_rx, pmt::mp("events")); @@ -153,17 +134,8 @@ void Channel::disconnect(gr::top_block_sptr top_block) return; } - if (flag_enable_fpga == false) - { - top_block->disconnect(pass_through_->get_right_block(), 0, acq_->get_left_block(), 0); - top_block->disconnect(pass_through_->get_right_block(), 0, trk_->get_left_block(), 0); - } top_block->disconnect(trk_->get_right_block(), 0, nav_->get_left_block(), 0); - if (flag_enable_fpga == false) - { - pass_through_->disconnect(top_block); - } acq_->disconnect(top_block); trk_->disconnect(top_block); nav_->disconnect(top_block); @@ -173,9 +145,19 @@ void Channel::disconnect(gr::top_block_sptr top_block) gr::basic_block_sptr Channel::get_left_block() { - return pass_through_->get_left_block(); + LOG(ERROR) << "Deprecated call to get_left_block() in channel interface"; + return nullptr; } +gr::basic_block_sptr Channel::get_left_block_trk() +{ + return trk_->get_left_block(); +} + +gr::basic_block_sptr Channel::get_left_block_acq() +{ + return acq_->get_left_block(); +} gr::basic_block_sptr Channel::get_right_block() { diff --git a/src/algorithms/channel/adapters/channel.h b/src/algorithms/channel/adapters/channel.h index 3802ff107..9eda9e474 100644 --- a/src/algorithms/channel/adapters/channel.h +++ b/src/algorithms/channel/adapters/channel.h @@ -35,15 +35,15 @@ #ifndef GNSS_SDR_CHANNEL_H_ #define GNSS_SDR_CHANNEL_H_ -#include "channel_interface.h" #include "channel_fsm.h" -#include "gnss_synchro.h" +#include "channel_interface.h" #include "channel_msg_receiver_cc.h" -#include +#include "gnss_synchro.h" #include +#include #include -#include #include +#include class ConfigurationInterface; class AcquisitionInterface; @@ -60,16 +60,17 @@ class Channel : public ChannelInterface { public: //! Constructor - Channel(ConfigurationInterface* configuration, uint32_t channel, - std::shared_ptr pass_through, std::shared_ptr acq, + Channel(ConfigurationInterface* configuration, uint32_t channel, std::shared_ptr acq, std::shared_ptr trk, std::shared_ptr nav, std::string role, std::string implementation, gr::msg_queue::sptr queue); //! Virtual destructor virtual ~Channel(); - void connect(gr::top_block_sptr top_block) override; + void connect(gr::top_block_sptr top_block) override; //!< connects the tracking block to the top_block and to the telemetry void disconnect(gr::top_block_sptr top_block) override; - gr::basic_block_sptr get_left_block() override; + gr::basic_block_sptr get_left_block() override; //!< gets the gnuradio tracking block pointer + gr::basic_block_sptr get_left_block_trk() override; //!< gets the gnuradio tracking block pointer + gr::basic_block_sptr get_left_block_acq() override; //!< gets the gnuradio tracking block pointer gr::basic_block_sptr get_right_block() override; inline std::string role() override { return role_; } @@ -88,7 +89,6 @@ public: private: channel_msg_receiver_cc_sptr channel_msg_rx; - std::shared_ptr pass_through_; std::shared_ptr acq_; std::shared_ptr trk_; std::shared_ptr nav_; diff --git a/src/algorithms/channel/libs/channel_fsm.h b/src/algorithms/channel/libs/channel_fsm.h index c2ee6c728..2ecc6eb20 100644 --- a/src/algorithms/channel/libs/channel_fsm.h +++ b/src/algorithms/channel/libs/channel_fsm.h @@ -33,8 +33,8 @@ #define GNSS_SDR_CHANNEL_FSM_H #include "acquisition_interface.h" -#include "tracking_interface.h" #include "telemetry_decoder_interface.h" +#include "tracking_interface.h" #include #include #include diff --git a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc index d1f967445..82333e6a7 100644 --- a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc +++ b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc @@ -30,9 +30,9 @@ #include "channel_msg_receiver_cc.h" +#include #include #include -#include #include using google::LogMessage; diff --git a/src/algorithms/conditioner/adapters/array_signal_conditioner.cc b/src/algorithms/conditioner/adapters/array_signal_conditioner.cc index f664c1de1..55970c4d7 100644 --- a/src/algorithms/conditioner/adapters/array_signal_conditioner.cc +++ b/src/algorithms/conditioner/adapters/array_signal_conditioner.cc @@ -31,7 +31,6 @@ #include "array_signal_conditioner.h" #include - #include diff --git a/src/algorithms/conditioner/adapters/array_signal_conditioner.h b/src/algorithms/conditioner/adapters/array_signal_conditioner.h index d3f1c9382..76809be53 100644 --- a/src/algorithms/conditioner/adapters/array_signal_conditioner.h +++ b/src/algorithms/conditioner/adapters/array_signal_conditioner.h @@ -33,9 +33,9 @@ #define GNSS_SDR_ARRAY_SIGNAL_CONDITIONER_H_ -#include -#include #include "gnss_block_interface.h" +#include +#include class ConfigurationInterface; diff --git a/src/algorithms/conditioner/adapters/signal_conditioner.cc b/src/algorithms/conditioner/adapters/signal_conditioner.cc index 0a7518e16..e55ba9e1a 100644 --- a/src/algorithms/conditioner/adapters/signal_conditioner.cc +++ b/src/algorithms/conditioner/adapters/signal_conditioner.cc @@ -31,7 +31,6 @@ #include "signal_conditioner.h" #include - #include diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.h b/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.h index 677ba11e8..9271689bc 100644 --- a/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.h +++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.h @@ -34,8 +34,8 @@ #include "conjugate_cc.h" #include "gnss_block_interface.h" #include "gnss_synchro.h" -#include #include +#include #include class ConfigurationInterface; diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.h b/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.h index 73e64da0d..9e7c5b74b 100644 --- a/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.h +++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.h @@ -32,8 +32,8 @@ #define GNSS_SDR_IBYTE_TO_CSHORT_H_ #include "conjugate_sc.h" -#include "interleaved_byte_to_complex_short.h" #include "gnss_block_interface.h" +#include "interleaved_byte_to_complex_short.h" #include #include diff --git a/src/algorithms/data_type_adapter/adapters/ishort_to_complex.h b/src/algorithms/data_type_adapter/adapters/ishort_to_complex.h index 7359cfae1..73d1133a8 100644 --- a/src/algorithms/data_type_adapter/adapters/ishort_to_complex.h +++ b/src/algorithms/data_type_adapter/adapters/ishort_to_complex.h @@ -33,8 +33,8 @@ #include "conjugate_cc.h" #include "gnss_block_interface.h" -#include #include +#include #include class ConfigurationInterface; diff --git a/src/algorithms/input_filter/adapters/fir_filter.cc b/src/algorithms/input_filter/adapters/fir_filter.cc index 27659019f..b436b1407 100644 --- a/src/algorithms/input_filter/adapters/fir_filter.cc +++ b/src/algorithms/input_filter/adapters/fir_filter.cc @@ -31,10 +31,10 @@ #include "fir_filter.h" #include "configuration_interface.h" -#include -#include #include +#include #include +#include using google::LogMessage; diff --git a/src/algorithms/input_filter/adapters/fir_filter.h b/src/algorithms/input_filter/adapters/fir_filter.h index 207d8e174..85626f2cc 100644 --- a/src/algorithms/input_filter/adapters/fir_filter.h +++ b/src/algorithms/input_filter/adapters/fir_filter.h @@ -33,16 +33,16 @@ #ifndef GNSS_SDR_FIR_FILTER_H_ #define GNSS_SDR_FIR_FILTER_H_ -#include "gnss_block_interface.h" -#include "complex_byte_to_float_x2.h" #include "byte_x2_to_complex_byte.h" -#include "short_x2_to_cshort.h" +#include "complex_byte_to_float_x2.h" #include "cshort_to_float_x2.h" -#include +#include "gnss_block_interface.h" +#include "short_x2_to_cshort.h" #include #include #include #include +#include #ifdef GR_GREATER_38 #include #else 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 9d5901b38..9e904d2e8 100644 --- a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc +++ b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc @@ -31,12 +31,12 @@ #include "freq_xlating_fir_filter.h" #include "configuration_interface.h" -#include -#include -#include -#include #include +#include +#include +#include #include +#include using google::LogMessage; diff --git a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.h b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.h index 8f69efc97..fad4f89cd 100644 --- a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.h +++ b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.h @@ -33,9 +33,9 @@ #ifndef GNSS_SDR_FREQ_XLATING_FIR_FILTER_H_ #define GNSS_SDR_FREQ_XLATING_FIR_FILTER_H_ +#include "complex_float_to_complex_byte.h" #include "gnss_block_interface.h" #include "short_x2_to_cshort.h" -#include "complex_float_to_complex_byte.h" #ifdef GR_GREATER_38 #include #else @@ -43,9 +43,9 @@ #include #include #endif -#include -#include #include +#include +#include #include #include #include diff --git a/src/algorithms/input_filter/adapters/notch_filter.h b/src/algorithms/input_filter/adapters/notch_filter.h index bf7e4f2db..c0e1f9510 100644 --- a/src/algorithms/input_filter/adapters/notch_filter.h +++ b/src/algorithms/input_filter/adapters/notch_filter.h @@ -33,8 +33,8 @@ #ifndef GNSS_SDR_NOTCH_FILTER_H_ #define GNSS_SDR_NOTCH_FILTER_H_ -#include "notch_cc.h" #include "gnss_block_interface.h" +#include "notch_cc.h" #include #include #include diff --git a/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc b/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc index ccf6704cc..fffdefe9f 100644 --- a/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc +++ b/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc @@ -33,9 +33,9 @@ #include #include #include +#include #include #include -#include using google::LogMessage; diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc index a969a7a36..3a3c9f8a3 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc @@ -33,8 +33,8 @@ #include #include #include -#include #include +#include using google::LogMessage; @@ -86,7 +86,7 @@ Notch::~Notch() void Notch::forecast(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items_required) { - for (int & aux : ninput_items_required) + for (int &aux : ninput_items_required) { aux = length_; } 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 b379fc664..03a3639db 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc @@ -33,8 +33,8 @@ #include #include #include -#include #include +#include using google::LogMessage; @@ -89,7 +89,7 @@ NotchLite::~NotchLite() void NotchLite::forecast(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items_required) { - for (int & aux : ninput_items_required) + for (int &aux : ninput_items_required) { aux = length_; } diff --git a/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc b/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc index f7e51f650..02c98fb5c 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc @@ -79,7 +79,7 @@ pulse_blanking_cc::~pulse_blanking_cc() void pulse_blanking_cc::forecast(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items_required) { - for (int & aux : ninput_items_required) + for (int &aux : ninput_items_required) { aux = length_; } diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index 9ef2da55c..0907ba030 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -86,11 +86,6 @@ if(OPENCL_FOUND) opencl/fft_setup.cc # Needs OpenCL opencl/fft_kernelstring.cc # Needs OpenCL ) - set(GNSS_SPLIBS_HEADERS ${GNSS_SPLIBS_HEADERS} - opencl/fft_execute.h # Needs OpenCL - opencl/fft_setup.h # Needs OpenCL - opencl/fft_kernelstring.h # Needs OpenCL - ) endif() include_directories( diff --git a/src/algorithms/libs/galileo_e1_signal_processing.cc b/src/algorithms/libs/galileo_e1_signal_processing.cc index 14dfab908..23a8d9a94 100644 --- a/src/algorithms/libs/galileo_e1_signal_processing.cc +++ b/src/algorithms/libs/galileo_e1_signal_processing.cc @@ -68,7 +68,7 @@ void galileo_e1_code_gen_int(int* _dest, char _Signal[3], int32_t _prn) } -void galileo_e1_sinboc_11_gen_int(int* _dest, int* _prn, uint32_t _length_out) +void galileo_e1_sinboc_11_gen_int(int* _dest, const int* _prn, uint32_t _length_out) { const uint32_t _length_in = Galileo_E1_B_CODE_LENGTH_CHIPS; auto _period = static_cast(_length_out / _length_in); @@ -86,7 +86,7 @@ void galileo_e1_sinboc_11_gen_int(int* _dest, int* _prn, uint32_t _length_out) } -void galileo_e1_sinboc_61_gen_int(int* _dest, int* _prn, uint32_t _length_out) +void galileo_e1_sinboc_61_gen_int(int* _dest, const int* _prn, uint32_t _length_out) { const uint32_t _length_in = Galileo_E1_B_CODE_LENGTH_CHIPS; auto _period = static_cast(_length_out / _length_in); @@ -236,7 +236,7 @@ void galileo_e1_code_gen_complex_sampled(std::complex* _dest, char _Signa std::string _galileo_signal = _Signal; const int32_t _codeFreqBasis = Galileo_E1_CODE_CHIP_RATE_HZ; // Hz auto _samplesPerCode = static_cast(static_cast(_fs) / - (static_cast(_codeFreqBasis) / static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS))); + (static_cast(_codeFreqBasis) / static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS))); if (_galileo_signal.rfind("1C") != std::string::npos && _galileo_signal.length() >= 2 && _secondary_flag) { diff --git a/src/algorithms/libs/galileo_e5_signal_processing.cc b/src/algorithms/libs/galileo_e5_signal_processing.cc index 400aed192..baa91706f 100644 --- a/src/algorithms/libs/galileo_e5_signal_processing.cc +++ b/src/algorithms/libs/galileo_e5_signal_processing.cc @@ -37,7 +37,7 @@ #include -void galileo_e5_a_code_gen_complex_primary(std::complex* _dest, int32_t _prn, char _Signal[3]) +void galileo_e5_a_code_gen_complex_primary(std::complex* _dest, int32_t _prn, const char _Signal[3]) { uint32_t prn = _prn - 1; uint32_t index = 0; diff --git a/src/algorithms/libs/galileo_e5_signal_processing.h b/src/algorithms/libs/galileo_e5_signal_processing.h index 46deaae24..7a7dfc8cc 100644 --- a/src/algorithms/libs/galileo_e5_signal_processing.h +++ b/src/algorithms/libs/galileo_e5_signal_processing.h @@ -42,7 +42,7 @@ * \brief Generates Galileo E5a code at 1 sample/chip * bool _pilot generates E5aQ code if true and E5aI (data signal) if false. */ -void galileo_e5_a_code_gen_complex_primary(std::complex* _dest, int32_t _prn, char _Signal[3]); +void galileo_e5_a_code_gen_complex_primary(std::complex* _dest, int32_t _prn, const char _Signal[3]); void galileo_e5_a_code_gen_tiered(std::complex* _dest, std::complex* _primary, uint32_t _prn, char _Signal[3]); diff --git a/src/algorithms/libs/glonass_l1_signal_processing.cc b/src/algorithms/libs/glonass_l1_signal_processing.cc index 045b53626..8707985b4 100644 --- a/src/algorithms/libs/glonass_l1_signal_processing.cc +++ b/src/algorithms/libs/glonass_l1_signal_processing.cc @@ -46,7 +46,7 @@ void glonass_l1_ca_code_gen_complex(std::complex* _dest, /* int32_t _prn for (lcv = 0; lcv < 9; lcv++) { - G1_register[lcv] = 1; + G1_register[lcv] = true; } /* Generate G1 Register */ diff --git a/src/algorithms/libs/glonass_l2_signal_processing.cc b/src/algorithms/libs/glonass_l2_signal_processing.cc index f486429e1..491b0e735 100644 --- a/src/algorithms/libs/glonass_l2_signal_processing.cc +++ b/src/algorithms/libs/glonass_l2_signal_processing.cc @@ -46,7 +46,7 @@ void glonass_l2_ca_code_gen_complex(std::complex* _dest, /* int32_t _prn, for (lcv = 0; lcv < 9; lcv++) { - G1_register[lcv] = 1; + G1_register[lcv] = true; } /* Generate G1 Register */ diff --git a/src/algorithms/libs/gnss_circular_deque.h b/src/algorithms/libs/gnss_circular_deque.h index 030044f91..23d89752b 100644 --- a/src/algorithms/libs/gnss_circular_deque.h +++ b/src/algorithms/libs/gnss_circular_deque.h @@ -33,8 +33,9 @@ #ifndef GNSS_SDR_CIRCULAR_DEQUE_H_ #define GNSS_SDR_CIRCULAR_DEQUE_H_ -#include + #include +#include template class Gnss_circular_deque diff --git a/src/algorithms/libs/gnss_sdr_fpga_sample_counter.cc b/src/algorithms/libs/gnss_sdr_fpga_sample_counter.cc index 727de7521..94eb8e294 100644 --- a/src/algorithms/libs/gnss_sdr_fpga_sample_counter.cc +++ b/src/algorithms/libs/gnss_sdr_fpga_sample_counter.cc @@ -31,22 +31,23 @@ #include "gnss_sdr_fpga_sample_counter.h" #include "gnss_synchro.h" +#include #include +#include #include +#include // libraries used by the GIPO #include #include -#include -#include // libraries used by the GIPO #include // libraries used by the GIPO -#include +#define PAGE_SIZE 0x10000 // default page size for the multicorrelator memory map +#define TEST_REG_SANITY_CHECK 0x55AA // value to check the presence of the test register (to detect the hw) -#define PAGE_SIZE 0x10000 // default page size for the multicorrelator memory map -#define TEST_REG_SANITY_CHECK 0x55AA // value to check the presence of the test register (to detect the hw) - -gnss_sdr_fpga_sample_counter::gnss_sdr_fpga_sample_counter(double _fs, int32_t _interval_ms) : gr::block("fpga_fpga_sample_counter", - gr::io_signature::make(0, 0, 0), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) +gnss_sdr_fpga_sample_counter::gnss_sdr_fpga_sample_counter( + double _fs, + int32_t _interval_ms) : gr::block("fpga_fpga_sample_counter", + gr::io_signature::make(0, 0, 0), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { message_port_register_out(pmt::mp("fpga_sample_counter")); set_max_noutput_items(1); @@ -88,10 +89,10 @@ bool gnss_sdr_fpga_sample_counter::start() { //todo: place here the RE-INITIALIZATION routines. This function will be called by GNURadio at every start of the flowgraph. - // configure the number of samples per output in the FPGA and enable the interrupts + // configure the number of samples per output in the FPGA and enable the interrupts configure_samples_per_output(samples_per_output); - // return true if everything is ok. + // return true if everything is ok. return true; } @@ -101,7 +102,7 @@ bool gnss_sdr_fpga_sample_counter::stop() { //todo: place here the routines to stop the associated hardware (if needed).This function will be called by GNURadio at every stop of the flowgraph. // return true if everything is ok. - close_device(); + close_device(); return true; } @@ -119,16 +120,16 @@ int gnss_sdr_fpga_sample_counter::general_work(int noutput_items __attribute__(( // Possible problem: what happen if the PS is overloaded and gnuradio does not call this function // with the sufficient rate to catch all the interrupts in the counter. To be evaluated later. - uint32_t counter = wait_for_interrupt_and_read_counter(); - uint64_t samples_passed = 2*static_cast(samples_per_output) - static_cast(counter); // ellapsed samples - //printf("============================================ interrupter : samples_passed = %" PRIu64 "\n", samples_passed); - // Note: at this moment the sample counter is implemented as a sample counter that decreases to zero and then it is automatically - // reloaded again and keeps counter. It is done in this way to minimize the logic in the FPGA and maximize the FPGA clock performance - // (it takes less resources and latency in the FPGA to compare a number against a fixed value like zero than to compare it to a programmable - // variable number). + uint32_t counter = wait_for_interrupt_and_read_counter(); + uint64_t samples_passed = 2 * static_cast(samples_per_output) - static_cast(counter); // ellapsed samples + //printf("============================================ interrupter : samples_passed = %" PRIu64 "\n", samples_passed); + // Note: at this moment the sample counter is implemented as a sample counter that decreases to zero and then it is automatically + // reloaded again and keeps counter. It is done in this way to minimize the logic in the FPGA and maximize the FPGA clock performance + // (it takes less resources and latency in the FPGA to compare a number against a fixed value like zero than to compare it to a programmable + // variable number). - sample_counter = sample_counter + samples_passed; //samples_per_output; - Gnss_Synchro *out = reinterpret_cast(output_items[0]); + sample_counter = sample_counter + samples_passed; //samples_per_output; + auto *out = reinterpret_cast(output_items[0]); out[0] = Gnss_Synchro(); out[0].Flag_valid_symbol_output = false; out[0].Flag_valid_word = false; @@ -136,11 +137,11 @@ int gnss_sdr_fpga_sample_counter::general_work(int noutput_items __attribute__(( out[0].fs = fs; if ((current_T_rx_ms % report_interval_ms) == 0) { - //printf("time to print sample_counter = %" PRIu64 "\n", sample_counter); - //printf("time to print current Tx ms : %" PRIu64 "\n", current_T_rx_ms); - //printf("time to print report_interval_ms : %" PRIu32 "\n", report_interval_ms); - //printf("time to print %f\n", (current_T_rx_ms % report_interval_ms)); - current_s++; + //printf("time to print sample_counter = %" PRIu64 "\n", sample_counter); + //printf("time to print current Tx ms : %" PRIu64 "\n", current_T_rx_ms); + //printf("time to print report_interval_ms : %" PRIu32 "\n", report_interval_ms); + //printf("time to print %f\n", (current_T_rx_ms % report_interval_ms)); + current_s++; if ((current_s % 60) == 0) { current_s = 0; @@ -198,7 +199,7 @@ int gnss_sdr_fpga_sample_counter::general_work(int noutput_items __attribute__(( } out[0].Tracking_sample_counter = sample_counter; //current_T_rx_ms = (sample_counter * 1000) / samples_per_output; - current_T_rx_ms = interval_ms*(sample_counter) / samples_per_output; + current_T_rx_ms = interval_ms * (sample_counter) / samples_per_output; return 1; } @@ -215,16 +216,16 @@ uint32_t gnss_sdr_fpga_sample_counter::test_register(uint32_t writeval) void gnss_sdr_fpga_sample_counter::configure_samples_per_output(uint32_t interval) { - // note : the counter is a 48-bit value in the HW. - //printf("============================================ total counter - interrupted interval : %" PRIu32 "\n", interval); - //uint64_t temp_interval; - //temp_interval = (interval & static_cast(0xFFFFFFFF)); - //printf("LSW counter - interrupted interval : %" PRIu32 "\n", static_cast(temp_interval)); - //map_base[0] = static_cast(temp_interval); - map_base[0] = interval - 1; - //temp_interval = (interval >> 32) & static_cast(0xFFFFFFFF); - //printf("MSbits counter - interrupted interval : %" PRIu32 "\n", static_cast(temp_interval)); - //map_base[1] = static_cast(temp_interval); // writing the most significant bits also enables the interrupts + // note : the counter is a 48-bit value in the HW. + //printf("============================================ total counter - interrupted interval : %" PRIu32 "\n", interval); + //uint64_t temp_interval; + //temp_interval = (interval & static_cast(0xFFFFFFFF)); + //printf("LSW counter - interrupted interval : %" PRIu32 "\n", static_cast(temp_interval)); + //map_base[0] = static_cast(temp_interval); + map_base[0] = interval - 1; + //temp_interval = (interval >> 32) & static_cast(0xFFFFFFFF); + //printf("MSbits counter - interrupted interval : %" PRIu32 "\n", static_cast(temp_interval)); + //map_base[1] = static_cast(temp_interval); // writing the most significant bits also enables the interrupts } void gnss_sdr_fpga_sample_counter::open_device() @@ -235,7 +236,7 @@ void gnss_sdr_fpga_sample_counter::open_device() LOG(WARNING) << "Cannot open deviceio" << device_name; std::cout << "Counter-Intr: cannot open deviceio" << device_name << std::endl; } - map_base = reinterpret_cast(mmap(NULL, PAGE_SIZE, + map_base = reinterpret_cast(mmap(nullptr, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)); if (map_base == reinterpret_cast(-1)) @@ -261,10 +262,10 @@ void gnss_sdr_fpga_sample_counter::open_device() void gnss_sdr_fpga_sample_counter::close_device() { - //printf("=========================================== NOW closing device ...\n"); - map_base[2] = 0; // disable the generation of the interrupt in the device + //printf("=========================================== NOW closing device ...\n"); + map_base[2] = 0; // disable the generation of the interrupt in the device - uint32_t *aux = const_cast(map_base); + auto *aux = const_cast(map_base); if (munmap(static_cast(aux), PAGE_SIZE) == -1) { printf("Failed to unmap memory uio\n"); @@ -294,12 +295,9 @@ uint32_t gnss_sdr_fpga_sample_counter::wait_for_interrupt_and_read_counter() } // acknowledge the interrupt - map_base[1] = 0; // writing anything to reg 1 acknowledges the interrupt + map_base[1] = 0; // writing anything to reg 1 acknowledges the interrupt // add number of passed samples or read the current counter value for more accuracy - counter = samples_per_output; //map_base[0]; + counter = samples_per_output; //map_base[0]; return counter; - } - - diff --git a/src/algorithms/libs/gnss_sdr_fpga_sample_counter.h b/src/algorithms/libs/gnss_sdr_fpga_sample_counter.h index e02320afc..75b924e72 100644 --- a/src/algorithms/libs/gnss_sdr_fpga_sample_counter.h +++ b/src/algorithms/libs/gnss_sdr_fpga_sample_counter.h @@ -31,8 +31,8 @@ #ifndef GNSS_SDR_FPGA_sample_counter_H_ #define GNSS_SDR_FPGA_sample_counter_H_ -#include #include +#include #include class gnss_sdr_fpga_sample_counter; @@ -57,18 +57,18 @@ private: uint64_t sample_counter; uint32_t interval_ms; uint64_t current_T_rx_ms; // Receiver time in ms since the beginning of the run - uint32_t current_s; // Receiver time in seconds, modulo 60 - bool flag_m; // True if the receiver has been running for at least 1 minute - uint32_t current_m; // Receiver time in minutes, modulo 60 - bool flag_h; // True if the receiver has been running for at least 1 hour - uint32_t current_h; // Receiver time in hours, modulo 24 - bool flag_days; // True if the receiver has been running for at least 1 day - uint32_t current_days; // Receiver time in days since the beginning of the run + uint32_t current_s; // Receiver time in seconds, modulo 60 + bool flag_m; // True if the receiver has been running for at least 1 minute + uint32_t current_m; // Receiver time in minutes, modulo 60 + bool flag_h; // True if the receiver has been running for at least 1 hour + uint32_t current_h; // Receiver time in hours, modulo 24 + bool flag_days; // True if the receiver has been running for at least 1 day + uint32_t current_days; // Receiver time in days since the beginning of the run int32_t report_interval_ms; bool flag_enable_send_msg; - int32_t fd; // driver descriptor - volatile uint32_t *map_base; // driver memory map - std::string device_name = "/dev/uio26"; // HW device name + int32_t fd; // driver descriptor + volatile uint32_t *map_base; // driver memory map + std::string device_name = "/dev/uio26"; // HW device name public: friend gnss_sdr_fpga_sample_counter_sptr gnss_sdr_make_fpga_sample_counter(double _fs, int32_t _interval_ms); diff --git a/src/algorithms/libs/gnss_sdr_sample_counter.cc b/src/algorithms/libs/gnss_sdr_sample_counter.cc index c3382e19e..e7d939582 100644 --- a/src/algorithms/libs/gnss_sdr_sample_counter.cc +++ b/src/algorithms/libs/gnss_sdr_sample_counter.cc @@ -36,10 +36,13 @@ #include #include -gnss_sdr_sample_counter::gnss_sdr_sample_counter(double _fs, int32_t _interval_ms, size_t _size) : gr::sync_decimator("sample_counter", - gr::io_signature::make(1, 1, _size), - gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), - static_cast(std::round(_fs * static_cast(_interval_ms) / 1e3))) +gnss_sdr_sample_counter::gnss_sdr_sample_counter( + double _fs, + int32_t _interval_ms, + size_t _size) : gr::sync_decimator("sample_counter", + gr::io_signature::make(1, 1, _size), + gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), + static_cast(std::round(_fs * static_cast(_interval_ms) / 1e3))) { message_port_register_out(pmt::mp("sample_counter")); set_max_noutput_items(1); diff --git a/src/algorithms/libs/gnss_sdr_sample_counter.h b/src/algorithms/libs/gnss_sdr_sample_counter.h index 90c05cb28..8a645d9f3 100644 --- a/src/algorithms/libs/gnss_sdr_sample_counter.h +++ b/src/algorithms/libs/gnss_sdr_sample_counter.h @@ -31,8 +31,8 @@ #ifndef GNSS_SDR_SAMPLE_COUNTER_H_ #define GNSS_SDR_SAMPLE_COUNTER_H_ -#include #include +#include #include @@ -40,7 +40,10 @@ class gnss_sdr_sample_counter; typedef boost::shared_ptr gnss_sdr_sample_counter_sptr; -gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter(double _fs, int32_t _interval_ms, size_t _size); +gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter( + double _fs, + int32_t _interval_ms, + size_t _size); class gnss_sdr_sample_counter : public gr::sync_decimator { diff --git a/src/algorithms/libs/gnss_sdr_time_counter.cc b/src/algorithms/libs/gnss_sdr_time_counter.cc index a4874ac4b..0cd06517b 100644 --- a/src/algorithms/libs/gnss_sdr_time_counter.cc +++ b/src/algorithms/libs/gnss_sdr_time_counter.cc @@ -61,10 +61,10 @@ gnss_sdr_time_counter_sptr gnss_sdr_make_time_counter() int gnss_sdr_time_counter::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), - gr_vector_const_void_star &input_items __attribute__((unused)), gr_vector_void_star &output_items) + gr_vector_const_void_star &input_items __attribute__((unused)), gr_vector_void_star &output_items) { - Gnss_Synchro *out = reinterpret_cast(output_items[0]); - const Gnss_Synchro *in = reinterpret_cast(input_items[0]); + auto *out = reinterpret_cast(output_items[0]); + const auto *in = reinterpret_cast(input_items[0]); out[0] = in[0]; if ((current_T_rx_ms % report_interval_ms) == 0) { diff --git a/src/algorithms/libs/gnss_sdr_time_counter.h b/src/algorithms/libs/gnss_sdr_time_counter.h index 12cc8094b..870f6717c 100644 --- a/src/algorithms/libs/gnss_sdr_time_counter.h +++ b/src/algorithms/libs/gnss_sdr_time_counter.h @@ -31,8 +31,8 @@ #ifndef GNSS_SDR_TIME_COUNTER_H_ #define GNSS_SDR_TIME_COUNTER_H_ -#include #include +#include #include class gnss_sdr_time_counter; diff --git a/src/algorithms/libs/gnss_sdr_valve.h b/src/algorithms/libs/gnss_sdr_valve.h index a166ad44e..19c104b99 100644 --- a/src/algorithms/libs/gnss_sdr_valve.h +++ b/src/algorithms/libs/gnss_sdr_valve.h @@ -34,9 +34,9 @@ #ifndef GNSS_SDR_GNSS_SDR_VALVE_H_ #define GNSS_SDR_GNSS_SDR_VALVE_H_ -#include -#include #include +#include +#include #include boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, diff --git a/src/algorithms/libs/gps_l5_signal.cc b/src/algorithms/libs/gps_l5_signal.cc index 2c1336a21..198aa27af 100644 --- a/src/algorithms/libs/gps_l5_signal.cc +++ b/src/algorithms/libs/gps_l5_signal.cc @@ -40,9 +40,9 @@ std::deque l5i_xa_shift(std::deque xa) { - if (xa == std::deque{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}) + if (xa == std::deque{true, true, true, true, true, true, true, true, true, true, true, false, true}) { - return std::deque{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; + return std::deque{true, true, true, true, true, true, true, true, true, true, true, true, true}; } std::deque out(xa.begin(), xa.end() - 1); out.push_front(xa[12] xor xa[11] xor xa[9] xor xa[8]); @@ -52,9 +52,9 @@ std::deque l5i_xa_shift(std::deque xa) std::deque l5q_xa_shift(std::deque xa) { - if (xa == std::deque{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}) + if (xa == std::deque{true, true, true, true, true, true, true, true, true, true, true, false, true}) { - return std::deque{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; + return std::deque{true, true, true, true, true, true, true, true, true, true, true, true, true}; } std::deque out(xa.begin(), xa.end() - 1); out.push_front(xa[12] xor xa[11] xor xa[9] xor xa[8]); @@ -80,8 +80,8 @@ std::deque l5q_xb_shift(std::deque xb) std::deque make_l5i_xa() { - std::deque xa = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - std::deque y(GPS_L5i_CODE_LENGTH_CHIPS, 0); + std::deque xa = {true, true, true, true, true, true, true, true, true, true, true, true, true}; + std::deque y(GPS_L5i_CODE_LENGTH_CHIPS, false); for (int32_t i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++) { @@ -94,8 +94,8 @@ std::deque make_l5i_xa() std::deque make_l5i_xb() { - std::deque xb = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - std::deque y(GPS_L5i_CODE_LENGTH_CHIPS, 0); + std::deque xb = {true, true, true, true, true, true, true, true, true, true, true, true, true}; + std::deque y(GPS_L5i_CODE_LENGTH_CHIPS, false); for (int32_t i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++) { @@ -108,8 +108,8 @@ std::deque make_l5i_xb() std::deque make_l5q_xa() { - std::deque xa = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - std::deque y(GPS_L5q_CODE_LENGTH_CHIPS, 0); + std::deque xa = {true, true, true, true, true, true, true, true, true, true, true, true, true}; + std::deque y(GPS_L5q_CODE_LENGTH_CHIPS, false); for (int32_t i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++) { @@ -122,8 +122,8 @@ std::deque make_l5q_xa() std::deque make_l5q_xb() { - std::deque xb = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - std::deque y(GPS_L5q_CODE_LENGTH_CHIPS, 0); + std::deque xb = {true, true, true, true, true, true, true, true, true, true, true, true, true}; + std::deque y(GPS_L5q_CODE_LENGTH_CHIPS, false); for (int32_t i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++) { @@ -140,13 +140,13 @@ void make_l5i(int32_t* _dest, int32_t prn) std::deque xb = make_l5i_xb(); std::deque xa = make_l5i_xa(); - std::deque xb_shift(GPS_L5i_CODE_LENGTH_CHIPS, 0); + std::deque xb_shift(GPS_L5i_CODE_LENGTH_CHIPS, false); for (int32_t n = 0; n < GPS_L5i_CODE_LENGTH_CHIPS; n++) { xb_shift[n] = xb[(xb_offset + n) % GPS_L5i_CODE_LENGTH_CHIPS]; } - std::deque out_code(GPS_L5i_CODE_LENGTH_CHIPS, 0); + std::deque out_code(GPS_L5i_CODE_LENGTH_CHIPS, false); for (int32_t n = 0; n < GPS_L5i_CODE_LENGTH_CHIPS; n++) { _dest[n] = xa[n] xor xb_shift[n]; @@ -160,13 +160,13 @@ void make_l5q(int32_t* _dest, int32_t prn) std::deque xb = make_l5q_xb(); std::deque xa = make_l5q_xa(); - std::deque xb_shift(GPS_L5q_CODE_LENGTH_CHIPS, 0); + std::deque xb_shift(GPS_L5q_CODE_LENGTH_CHIPS, false); for (int32_t n = 0; n < GPS_L5q_CODE_LENGTH_CHIPS; n++) { xb_shift[n] = xb[(xb_offset + n) % GPS_L5q_CODE_LENGTH_CHIPS]; } - std::deque out_code(GPS_L5q_CODE_LENGTH_CHIPS, 0); + std::deque out_code(GPS_L5q_CODE_LENGTH_CHIPS, false); for (int32_t n = 0; n < GPS_L5q_CODE_LENGTH_CHIPS; n++) { _dest[n] = xa[n] xor xb_shift[n]; diff --git a/src/algorithms/libs/gps_sdr_signal_processing.cc b/src/algorithms/libs/gps_sdr_signal_processing.cc index db3c33eff..e87593f6e 100644 --- a/src/algorithms/libs/gps_sdr_signal_processing.cc +++ b/src/algorithms/libs/gps_sdr_signal_processing.cc @@ -68,8 +68,8 @@ void gps_l1_ca_code_gen_int(int32_t* _dest, int32_t _prn, uint32_t _chip_shift) for (lcv = 0; lcv < 10; lcv++) { - G1_register[lcv] = 1; - G2_register[lcv] = 1; + G1_register[lcv] = true; + G2_register[lcv] = true; } /* Generate G1 & G2 Register */ diff --git a/src/algorithms/libs/opencl/cl.hpp b/src/algorithms/libs/opencl/cl.hpp index 62ba50cfc..b10828523 100644 --- a/src/algorithms/libs/opencl/cl.hpp +++ b/src/algorithms/libs/opencl/cl.hpp @@ -23,15 +23,15 @@ /*! \file * - * \brief C++ bindings for OpenCL 1.0 (rev 48), OpenCL 1.1 (rev 33) and - * OpenCL 1.2 (rev 15) + * \brief C++ bindings for OpenCL 1.0 (rev 48), OpenCL 1.1 (rev 33) and + * OpenCL 1.2 (rev 15) * \author Benedict R. Gaster, Laurent Morichetti and Lee Howes - * + * * Additions and fixes from: - * Brian Cole, March 3rd 2010 and April 2012 + * Brian Cole, March 3rd 2010 and April 2012 * Matt Gruenke, April 2012. * Bruce Merry, February 2013. - * + * * \version 1.2.5 * \date June 2013 * @@ -71,7 +71,7 @@ * * \code * #define __CL_ENABLE_EXCEPTIONS - * + * * #if defined(__APPLE__) || defined(__MACOSX) * #include * #else @@ -80,13 +80,13 @@ * #include * #include * #include - * + * * const char * helloStr = "__kernel void " * "hello(void) " * "{ " * " " * "} "; - * + * * int * main(void) * { @@ -100,33 +100,33 @@ * return -1; * } * - * cl_context_properties properties[] = + * cl_context_properties properties[] = * { CL_CONTEXT_PLATFORM, (cl_context_properties)(platforms[0])(), 0}; - * cl::Context context(CL_DEVICE_TYPE_CPU, properties); - * + * cl::Context context(CL_DEVICE_TYPE_CPU, properties); + * * std::vector devices = context.getInfo(); - * + * * cl::Program::Sources source(1, * std::make_pair(helloStr,strlen(helloStr))); * cl::Program program_ = cl::Program(context, source); * program_.build(devices); - * + * * cl::Kernel kernel(program_, "hello", &err); - * + * * cl::Event event; * cl::CommandQueue queue(context, devices[0], 0, &err); * queue.enqueueNDRangeKernel( - * kernel, - * cl::NullRange, + * kernel, + * cl::NullRange, * cl::NDRange(4,4), * cl::NullRange, * NULL, - * &event); - * + * &event); + * * event.wait(); * } * catch (cl::Error err) { - * std::cerr + * std::cerr * << "ERROR: " * << err.what() * << "(" @@ -134,10 +134,10 @@ * << ")" * << std::endl; * } - * + * * return EXIT_SUCCESS; * } - * + * * \endcode * */ @@ -146,10 +146,10 @@ #ifdef _WIN32 -#include -#include -#include #include +#include +#include +#include #if defined(__CL_ENABLE_EXCEPTIONS) #include @@ -169,12 +169,12 @@ #endif #if defined(__APPLE__) || defined(__MACOSX) -#include #include +#include #include #else -#include #include +#include #endif // !__APPLE__ // To avoid accidentally taking ownership of core OpenCL types @@ -199,8 +199,8 @@ #define CL_CALLBACK #endif //CL_CALLBACK -#include #include +#include #if !defined(__NO_STD_VECTOR) #include @@ -212,7 +212,6 @@ #if defined(linux) || defined(__APPLE__) || defined(__MACOSX) #include - #include #include #endif // linux @@ -264,8 +263,8 @@ class Memory; class Buffer; #if defined(__CL_ENABLE_EXCEPTIONS) -/*! \brief Exception class - * +/*! \brief Exception class + * * This may be thrown by API functions when __CL_ENABLE_EXCEPTIONS is defined. */ class Error : public std::exception @@ -277,7 +276,7 @@ private: public: /*! \brief Create a new CL error exception for a given error code * and corresponding message. - * + * * \param err error code value. * * \param errStr a descriptive string that must remain in scope until @@ -476,7 +475,7 @@ typedef std::string STRING_CLASS; /*! \class string * \brief Simple string class, that provides a limited subset of std::string * functionality but avoids many of the issues that come with that class. - + * \note Deprecated. Please use std::string as default or * re-define the string class to match the std::string * interface by defining STRING_CLASS @@ -495,10 +494,10 @@ public: /*! \brief Constructs a string populated from an arbitrary value of * specified size. - * + * * An extra '\0' is added, in case none was contained in str. * - * \param str the initial value of the string instance. Note that '\0' + * \param str the initial value of the string instance. Note that '\0' * characters receive no special treatment. If NULL, * the string is left empty, with a size of 0. * @@ -678,7 +677,7 @@ typedef cl::string STRING_CLASS; #endif /*! \class vector - * \brief Fixed sized vector implementation that mirroring + * \brief Fixed sized vector implementation that mirroring * * \note Deprecated. Please use std::vector as default or * re-define the vector class to match the std::vector @@ -738,7 +737,7 @@ public: } /*! \brief Appends an element after the last valid element. - * Calling this on a vector that has reached capacity will throw an + * Calling this on a vector that has reached capacity will throw an * exception if exceptions are enabled. */ void push_back(const T& x) @@ -921,7 +920,7 @@ public: /** * Internal iterator constructor to capture reference - * to the vector it iterates over rather than taking + * to the vector it iterates over rather than taking * the vector by copy. */ iterator(const vector& vec, int index) : vec_(&vec) @@ -1617,7 +1616,7 @@ struct ReferenceHandler /** * Retain the device. * \param device A valid device created using createSubDevices - * \return + * \return * CL_SUCCESS if the function executed successfully. * CL_INVALID_DEVICE if device was not a valid subdevice * CL_OUT_OF_RESOURCES @@ -1630,7 +1629,7 @@ struct ReferenceHandler /** * Retain the device. * \param device A valid device created using createSubDevices - * \return + * \return * CL_SUCCESS if the function executed successfully. * CL_INVALID_DEVICE if device was not a valid subdevice * CL_OUT_OF_RESOURCES @@ -2055,13 +2054,13 @@ public: Device() : detail::Wrapper() {} /*! \brief Copy constructor. - * + * * This simply copies the device ID value, which is an inexpensive operation. */ Device(const Device& device) : detail::Wrapper(device) {} /*! \brief Constructor from cl_device_id. - * + * * This simply copies the device ID value, which is an inexpensive operation. */ Device(const cl_device_id& device) : detail::Wrapper(device) {} @@ -2073,7 +2072,7 @@ public: static Device getDefault(cl_int* err = NULL); /*! \brief Assignment operator from Device. - * + * * This simply copies the device ID value, which is an inexpensive operation. */ Device& operator=(const Device& rhs) @@ -2086,7 +2085,7 @@ public: } /*! \brief Assignment operator from cl_device_id. - * + * * This simply copies the device ID value, which is an inexpensive operation. */ Device& operator=(const cl_device_id& rhs) @@ -2201,19 +2200,19 @@ public: Platform() : detail::Wrapper() {} /*! \brief Copy constructor. - * + * * This simply copies the platform ID value, which is an inexpensive operation. */ Platform(const Platform& platform) : detail::Wrapper(platform) {} /*! \brief Constructor from cl_platform_id. - * + * * This simply copies the platform ID value, which is an inexpensive operation. */ Platform(const cl_platform_id& platform) : detail::Wrapper(platform) {} /*! \brief Assignment operator from Platform. - * + * * This simply copies the platform ID value, which is an inexpensive operation. */ Platform& operator=(const Platform& rhs) @@ -2226,7 +2225,7 @@ public: } /*! \brief Assignment operator from cl_platform_id. - * + * * This simply copies the platform ID value, which is an inexpensive operation. */ Platform& operator=(const cl_platform_id& rhs) @@ -2259,7 +2258,7 @@ public: } /*! \brief Gets a list of devices for this platform. - * + * * Wraps clGetDeviceIDs(). */ cl_int getDevices( @@ -2369,7 +2368,7 @@ public: #endif /*! \brief Gets a list of available platforms. - * + * * Wraps clGetPlatformIDs(). */ static cl_int get( @@ -2401,7 +2400,7 @@ public: } /*! \brief Gets the first available platform. - * + * * Wraps clGetPlatformIDs(), returning the first result. */ static cl_int get( @@ -2433,7 +2432,7 @@ public: } /*! \brief Gets the first available platform, returning it by value. - * + * * Wraps clGetPlatformIDs(), returning the first result. */ static Platform get( @@ -2694,20 +2693,20 @@ public: Context() : detail::Wrapper() {} /*! \brief Copy constructor. - * + * * This calls clRetainContext() on the parameter's cl_context. */ Context(const Context& context) : detail::Wrapper(context) {} /*! \brief Constructor from cl_context - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_context * into the new Context object. */ __CL_EXPLICIT_CONSTRUCTORS Context(const cl_context& context) : detail::Wrapper(context) {} /*! \brief Assignment operator from Context. - * + * * This calls clRetainContext() on the parameter and clReleaseContext() on * the previous value held by this instance. */ @@ -2721,7 +2720,7 @@ public: } /*! \brief Assignment operator from cl_context - takes ownership. - * + * * This effectively transfers ownership of a refcount on the rhs and calls * clReleaseContext() on the value previously held by this instance. */ @@ -2756,7 +2755,7 @@ public: } /*! \brief Gets a list of supported image formats. - * + * * Wraps clGetSupportedImageFormats(). */ cl_int getSupportedImageFormats( @@ -2855,13 +2854,13 @@ public: Event() : detail::Wrapper() {} /*! \brief Copy constructor. - * + * * This calls clRetainEvent() on the parameter's cl_event. */ Event(const Event& event) : detail::Wrapper(event) {} /*! \brief Constructor from cl_event - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_event * into the new Event object. */ @@ -2882,7 +2881,7 @@ public: } /*! \brief Assignment operator from cl_event. - * + * * This calls clRetainEvent() on the parameter and clReleaseEvent() on * the previous value held by this instance. */ @@ -2941,7 +2940,7 @@ public: } /*! \brief Blocks the calling thread until this event completes. - * + * * Wraps clWaitForEvents(). */ cl_int wait() const @@ -2972,7 +2971,7 @@ public: #endif /*! \brief Blocks the calling thread until every event specified is complete. - * + * * Wraps clWaitForEvents(). */ static cl_int @@ -2987,7 +2986,7 @@ public: #if defined(CL_VERSION_1_1) /*! \brief Class interface for user events (a subset of cl_event's). - * + * * See Event for details about copy semantics, etc. */ class UserEvent : public Event @@ -3043,7 +3042,7 @@ public: #endif /*! \brief Blocks the calling thread until every event specified is complete. - * + * * Wraps clWaitForEvents(). */ inline static cl_int @@ -3076,20 +3075,20 @@ public: Memory() : detail::Wrapper() {} /*! \brief Copy constructor - performs shallow copy. - * + * * This calls clRetainMemObject() on the parameter's cl_mem. */ Memory(const Memory& memory) : detail::Wrapper(memory) {} /*! \brief Constructor from cl_mem - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_mem * into the new Memory object. */ __CL_EXPLICIT_CONSTRUCTORS Memory(const cl_mem& memory) : detail::Wrapper(memory) {} /*! \brief Assignment operator from Memory. - * + * * This calls clRetainMemObject() on the parameter and clReleaseMemObject() * on the previous value held by this instance. */ @@ -3173,7 +3172,7 @@ template cl_int copy(const cl::Buffer& buffer, IteratorType startIterator, IteratorType endIterator); /*! \brief Class interface for Buffer Memory Objects. - * + * * See Memory for details about copy semantics, etc. * * \see Memory @@ -3365,7 +3364,7 @@ public: /*! \brief Class interface for creating OpenCL buffers from ID3D10Buffer's. * * This is provided to facilitate interoperability with Direct3D. - * + * * See Memory for details about copy semantics, etc. * * \see Memory @@ -3463,9 +3462,9 @@ public: /*! \brief Class interface for GL Buffer Memory Objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class BufferGL : public Buffer @@ -3548,9 +3547,9 @@ public: /*! \brief Class interface for GL Render Buffer Memory Objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class BufferRenderGL : public Buffer @@ -3633,7 +3632,7 @@ public: /*! \brief C++ base class for Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image : public Memory @@ -3707,7 +3706,7 @@ public: /*! \brief Class interface for 1D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image1D : public Image @@ -3913,7 +3912,7 @@ public: /*! \brief Class interface for 2D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image2D : public Image @@ -4033,9 +4032,9 @@ public: /*! \brief Class interface for GL 2D Image Memory objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory * \note Deprecated for OpenCL 1.2. Please use ImageGL instead. */ @@ -4182,7 +4181,7 @@ public: /*! \brief Class interface for 3D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image3D : public Image @@ -4306,9 +4305,9 @@ public: /*! \brief Class interface for GL 3D Image Memory objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image3DGL : public Image3D @@ -4446,7 +4445,7 @@ public: * to the same underlying cl_sampler as the original. For details, see * clRetainSampler() and clReleaseSampler(). * - * \see cl_sampler + * \see cl_sampler */ class Sampler : public detail::Wrapper { @@ -4487,20 +4486,20 @@ public: } /*! \brief Copy constructor - performs shallow copy. - * + * * This calls clRetainSampler() on the parameter's cl_sampler. */ Sampler(const Sampler& sampler) : detail::Wrapper(sampler) {} /*! \brief Constructor from cl_sampler - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_sampler * into the new Sampler object. */ Sampler(const cl_sampler& sampler) : detail::Wrapper(sampler) {} /*! \brief Assignment operator from Sampler. - * + * * This calls clRetainSampler() on the parameter and clReleaseSampler() * on the previous value held by this instance. */ @@ -4592,7 +4591,7 @@ public: } /*! \brief Conversion operator to const ::size_t *. - * + * * \returns a pointer to the size of the first dimension. */ operator const ::size_t*() const @@ -4680,20 +4679,20 @@ public: Kernel() {} /*! \brief Copy constructor - performs shallow copy. - * + * * This calls clRetainKernel() on the parameter's cl_kernel. */ Kernel(const Kernel& kernel) : detail::Wrapper(kernel) {} /*! \brief Constructor from cl_kernel - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_kernel * into the new Kernel object. */ __CL_EXPLICIT_CONSTRUCTORS Kernel(const cl_kernel& kernel) : detail::Wrapper(kernel) {} /*! \brief Assignment operator from Kernel. - * + * * This calls clRetainKernel() on the parameter and clReleaseKernel() * on the previous value held by this instance. */ @@ -4962,7 +4961,7 @@ public: * Set to CL_INVALID_BINARY if the binary provided is not valid for the matching device. * \param err if non-NULL will be set to CL_SUCCESS on successful operation or one of the following errors: * CL_INVALID_CONTEXT if context is not a valid context. - * CL_INVALID_VALUE if the length of devices is zero; or if the length of binaries does not match the length of devices; + * CL_INVALID_VALUE if the length of devices is zero; or if the length of binaries does not match the length of devices; * or if any entry in binaries is NULL or has length 0. * CL_INVALID_DEVICE if OpenCL devices listed in devices are not in the list of devices associated with context. * CL_INVALID_BINARY if an invalid program binary was encountered for any device. binaryStatus will return specific status for each device. @@ -5688,7 +5687,7 @@ public: /** * Enqueue a command to fill a buffer object with a pattern * of a given size. The pattern is specified a as vector. - * \tparam PatternType The datatype of the pattern field. + * \tparam PatternType The datatype of the pattern field. * The pattern type must be an accepted OpenCL data type. */ template @@ -6033,14 +6032,14 @@ public: #if defined(CL_VERSION_1_2) /** - * Enqueues a marker command which waits for either a list of events to complete, + * Enqueues a marker command which waits for either a list of events to complete, * or all previously enqueued commands to complete. * - * Enqueues a marker command which waits for either a list of events to complete, - * or if the list is empty it waits for all commands previously enqueued in command_queue - * to complete before it completes. This command returns an event which can be waited on, - * i.e. this event can be waited on to insure that all events either in the event_wait_list - * or all previously enqueued commands, queued before this command to command_queue, + * Enqueues a marker command which waits for either a list of events to complete, + * or if the list is empty it waits for all commands previously enqueued in command_queue + * to complete before it completes. This command returns an event which can be waited on, + * i.e. this event can be waited on to insure that all events either in the event_wait_list + * or all previously enqueued commands, queued before this command to command_queue, * have completed. */ cl_int enqueueMarkerWithWaitList( @@ -6065,12 +6064,12 @@ public: /** * A synchronization point that enqueues a barrier operation. * - * Enqueues a barrier command which waits for either a list of events to complete, - * or if the list is empty it waits for all commands previously enqueued in command_queue - * to complete before it completes. This command blocks command execution, that is, any - * following commands enqueued after it do not execute until it completes. This command - * returns an event which can be waited on, i.e. this event can be waited on to insure that - * all events either in the event_wait_list or all previously enqueued commands, queued + * Enqueues a barrier command which waits for either a list of events to complete, + * or if the list is empty it waits for all commands previously enqueued in command_queue + * to complete before it completes. This command blocks command execution, that is, any + * following commands enqueued after it do not execute until it completes. This command + * returns an event which can be waited on, i.e. this event can be waited on to insure that + * all events either in the event_wait_list or all previously enqueued commands, queued * before this command to command_queue, have completed. */ cl_int enqueueBarrierWithWaitList( diff --git a/src/algorithms/libs/opencl/fft_execute.cc b/src/algorithms/libs/opencl/fft_execute.cc index baf3873be..23b2d1c83 100644 --- a/src/algorithms/libs/opencl/fft_execute.cc +++ b/src/algorithms/libs/opencl/fft_execute.cc @@ -46,11 +46,11 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// -#include "fft_internal.h" #include "clFFT.h" -#include -#include -#include +#include "fft_internal.h" +#include +#include +#include #define max(a, b) (((a) > (b)) ? (a) : (b)) #define min(a, b) (((a) < (b)) ? (a) : (b)) @@ -67,7 +67,7 @@ allocateTemporaryBufferInterleaved(cl_fft_plan *plan, cl_uint batchSize) if (plan->tempmemobj) clReleaseMemObject(plan->tempmemobj); - plan->tempmemobj = clCreateBuffer(plan->context, CL_MEM_READ_WRITE, tmpLength, NULL, &err); + plan->tempmemobj = clCreateBuffer(plan->context, CL_MEM_READ_WRITE, tmpLength, nullptr, &err); } return err; } @@ -88,8 +88,8 @@ allocateTemporaryBufferPlannar(cl_fft_plan *plan, cl_uint batchSize) if (plan->tempmemobj_imag) clReleaseMemObject(plan->tempmemobj_imag); - plan->tempmemobj_real = clCreateBuffer(plan->context, CL_MEM_READ_WRITE, tmpLength, NULL, &err); - plan->tempmemobj_imag = clCreateBuffer(plan->context, CL_MEM_READ_WRITE, tmpLength, NULL, &terr); + plan->tempmemobj_real = clCreateBuffer(plan->context, CL_MEM_READ_WRITE, tmpLength, nullptr, &err); + plan->tempmemobj_imag = clCreateBuffer(plan->context, CL_MEM_READ_WRITE, tmpLength, nullptr, &terr); err |= terr; } return err; @@ -126,7 +126,7 @@ clFFT_ExecuteInterleaved(cl_command_queue queue, clFFT_Plan Plan, cl_int batchSi cl_int num_events, cl_event *event_list, cl_event *event) { int s; - cl_fft_plan *plan = (cl_fft_plan *)Plan; + auto *plan = (cl_fft_plan *)Plan; if (plan->format != clFFT_InterleavedComplexFormat) return CL_INVALID_VALUE; @@ -180,7 +180,7 @@ clFFT_ExecuteInterleaved(cl_command_queue queue, clFFT_Plan Plan, cl_int batchSi err |= clSetKernelArg(kernelInfo->kernel, 2, sizeof(cl_int), &dir); err |= clSetKernelArg(kernelInfo->kernel, 3, sizeof(cl_int), &s); - err |= clEnqueueNDRangeKernel(queue, kernelInfo->kernel, 1, NULL, &gWorkItems, &lWorkItems, 0, NULL, NULL); + err |= clEnqueueNDRangeKernel(queue, kernelInfo->kernel, 1, nullptr, &gWorkItems, &lWorkItems, 0, nullptr, nullptr); if (err) return err; @@ -203,7 +203,7 @@ clFFT_ExecuteInterleaved(cl_command_queue queue, clFFT_Plan Plan, cl_int batchSi err |= clSetKernelArg(kernelInfo->kernel, 2, sizeof(cl_int), &dir); err |= clSetKernelArg(kernelInfo->kernel, 3, sizeof(cl_int), &s); - err |= clEnqueueNDRangeKernel(queue, kernelInfo->kernel, 1, NULL, &gWorkItems, &lWorkItems, 0, NULL, NULL); + err |= clEnqueueNDRangeKernel(queue, kernelInfo->kernel, 1, nullptr, &gWorkItems, &lWorkItems, 0, nullptr, nullptr); if (err) return err; @@ -223,7 +223,7 @@ clFFT_ExecutePlannar(cl_command_queue queue, clFFT_Plan Plan, cl_int batchSize, cl_int num_events, cl_event *event_list, cl_event *event) { int s; - cl_fft_plan *plan = (cl_fft_plan *)Plan; + auto *plan = (cl_fft_plan *)Plan; if (plan->format != clFFT_SplitComplexFormat) return CL_INVALID_VALUE; @@ -285,7 +285,7 @@ clFFT_ExecutePlannar(cl_command_queue queue, clFFT_Plan Plan, cl_int batchSize, err |= clSetKernelArg(kernelInfo->kernel, 4, sizeof(cl_int), &dir); err |= clSetKernelArg(kernelInfo->kernel, 5, sizeof(cl_int), &s); - err |= clEnqueueNDRangeKernel(queue, kernelInfo->kernel, 1, NULL, &gWorkItems, &lWorkItems, 0, NULL, NULL); + err |= clEnqueueNDRangeKernel(queue, kernelInfo->kernel, 1, nullptr, &gWorkItems, &lWorkItems, 0, nullptr, nullptr); if (err) return err; @@ -309,7 +309,7 @@ clFFT_ExecutePlannar(cl_command_queue queue, clFFT_Plan Plan, cl_int batchSize, err |= clSetKernelArg(kernelInfo->kernel, 4, sizeof(cl_int), &dir); err |= clSetKernelArg(kernelInfo->kernel, 5, sizeof(cl_int), &s); - err |= clEnqueueNDRangeKernel(queue, kernelInfo->kernel, 1, NULL, &gWorkItems, &lWorkItems, 0, NULL, NULL); + err |= clEnqueueNDRangeKernel(queue, kernelInfo->kernel, 1, nullptr, &gWorkItems, &lWorkItems, 0, nullptr, nullptr); if (err) return err; @@ -327,7 +327,7 @@ cl_int clFFT_1DTwistInterleaved(clFFT_Plan Plan, cl_command_queue queue, cl_mem array, unsigned numRows, unsigned numCols, unsigned startRow, unsigned rowsToProcess, clFFT_Direction dir) { - cl_fft_plan *plan = (cl_fft_plan *)Plan; + auto *plan = (cl_fft_plan *)Plan; unsigned int N = numRows * numCols; unsigned int nCols = numCols; @@ -337,12 +337,12 @@ clFFT_1DTwistInterleaved(clFFT_Plan Plan, cl_command_queue queue, cl_mem array, int err = 0; cl_device_id device_id; - err = clGetCommandQueueInfo(queue, CL_QUEUE_DEVICE, sizeof(cl_device_id), &device_id, NULL); + err = clGetCommandQueueInfo(queue, CL_QUEUE_DEVICE, sizeof(cl_device_id), &device_id, nullptr); if (err) return err; size_t gSize; - err = clGetKernelWorkGroupInfo(plan->twist_kernel, device_id, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), &gSize, NULL); + err = clGetKernelWorkGroupInfo(plan->twist_kernel, device_id, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), &gSize, nullptr); if (err) return err; @@ -357,7 +357,7 @@ clFFT_1DTwistInterleaved(clFFT_Plan Plan, cl_command_queue queue, cl_mem array, err |= clSetKernelArg(plan->twist_kernel, 4, sizeof(unsigned int), &rToProcess); err |= clSetKernelArg(plan->twist_kernel, 5, sizeof(int), &d); - err |= clEnqueueNDRangeKernel(queue, plan->twist_kernel, 1, NULL, numGlobalThreads, numLocalThreads, 0, NULL, NULL); + err |= clEnqueueNDRangeKernel(queue, plan->twist_kernel, 1, nullptr, numGlobalThreads, numLocalThreads, 0, nullptr, nullptr); return err; } @@ -366,7 +366,7 @@ cl_int clFFT_1DTwistPlannar(clFFT_Plan Plan, cl_command_queue queue, cl_mem array_real, cl_mem array_imag, unsigned numRows, unsigned numCols, unsigned startRow, unsigned rowsToProcess, clFFT_Direction dir) { - cl_fft_plan *plan = (cl_fft_plan *)Plan; + auto *plan = (cl_fft_plan *)Plan; unsigned int N = numRows * numCols; unsigned int nCols = numCols; @@ -376,12 +376,12 @@ clFFT_1DTwistPlannar(clFFT_Plan Plan, cl_command_queue queue, cl_mem array_real, int err = 0; cl_device_id device_id; - err = clGetCommandQueueInfo(queue, CL_QUEUE_DEVICE, sizeof(cl_device_id), &device_id, NULL); + err = clGetCommandQueueInfo(queue, CL_QUEUE_DEVICE, sizeof(cl_device_id), &device_id, nullptr); if (err) return err; size_t gSize; - err = clGetKernelWorkGroupInfo(plan->twist_kernel, device_id, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), &gSize, NULL); + err = clGetKernelWorkGroupInfo(plan->twist_kernel, device_id, CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), &gSize, nullptr); if (err) return err; @@ -397,7 +397,7 @@ clFFT_1DTwistPlannar(clFFT_Plan Plan, cl_command_queue queue, cl_mem array_real, err |= clSetKernelArg(plan->twist_kernel, 5, sizeof(unsigned int), &rToProcess); err |= clSetKernelArg(plan->twist_kernel, 6, sizeof(int), &d); - err |= clEnqueueNDRangeKernel(queue, plan->twist_kernel, 1, NULL, numGlobalThreads, numLocalThreads, 0, NULL, NULL); + err |= clEnqueueNDRangeKernel(queue, plan->twist_kernel, 1, nullptr, numGlobalThreads, numLocalThreads, 0, nullptr, nullptr); return err; } diff --git a/src/algorithms/libs/opencl/fft_internal.h b/src/algorithms/libs/opencl/fft_internal.h index 5e462f455..96a41c6de 100644 --- a/src/algorithms/libs/opencl/fft_internal.h +++ b/src/algorithms/libs/opencl/fft_internal.h @@ -51,8 +51,8 @@ #include "clFFT.h" #include -#include #include +#include using namespace std; diff --git a/src/algorithms/libs/opencl/fft_kernelstring.cc b/src/algorithms/libs/opencl/fft_kernelstring.cc index 733b60f42..33b3109e8 100644 --- a/src/algorithms/libs/opencl/fft_kernelstring.cc +++ b/src/algorithms/libs/opencl/fft_kernelstring.cc @@ -46,16 +46,16 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// -#include -#include -#include +#include "clFFT.h" +#include "fft_internal.h" +#include +#include +#include +#include +#include #include #include #include -#include -#include -#include "fft_internal.h" -#include "clFFT.h" using namespace std; @@ -806,13 +806,13 @@ createLocalMemfftKernelString(cl_fft_plan *plan) kernelName = string("fft") + num2str(kCount); *kInfo = (cl_fft_kernel_info *)malloc(sizeof(cl_fft_kernel_info)); - (*kInfo)->kernel = 0; + (*kInfo)->kernel = nullptr; (*kInfo)->lmem_size = 0; (*kInfo)->num_workgroups = 0; (*kInfo)->num_workitems_per_workgroup = 0; (*kInfo)->dir = cl_fft_kernel_x; (*kInfo)->in_place_possible = 1; - (*kInfo)->next = NULL; + (*kInfo)->next = nullptr; (*kInfo)->kernel_name = (char *)malloc(sizeof(char) * (kernelName.size() + 1)); strcpy((*kInfo)->kernel_name, kernelName.c_str()); @@ -1015,7 +1015,7 @@ createGlobalFFTKernelString(cl_fft_plan *plan, int n, int BS, cl_fft_kernel_dir kernelName = string("fft") + num2str(kCount); *kInfo = (cl_fft_kernel_info *)malloc(sizeof(cl_fft_kernel_info)); - (*kInfo)->kernel = 0; + (*kInfo)->kernel = nullptr; if (R2 == 1) (*kInfo)->lmem_size = 0; else @@ -1033,7 +1033,7 @@ createGlobalFFTKernelString(cl_fft_plan *plan, int n, int BS, cl_fft_kernel_dir (*kInfo)->in_place_possible = 1; else (*kInfo)->in_place_possible = 0; - (*kInfo)->next = NULL; + (*kInfo)->next = nullptr; (*kInfo)->kernel_name = (char *)malloc(sizeof(char) * (kernelName.size() + 1)); strcpy((*kInfo)->kernel_name, kernelName.c_str()); diff --git a/src/algorithms/libs/opencl/fft_setup.cc b/src/algorithms/libs/opencl/fft_setup.cc index 1349d65f7..a56c05328 100644 --- a/src/algorithms/libs/opencl/fft_setup.cc +++ b/src/algorithms/libs/opencl/fft_setup.cc @@ -46,16 +46,16 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// -#include "fft_internal.h" #include "fft_base_kernels.h" -#include -#include -#include -#include +#include "fft_internal.h" +#include +#include #include -#include -#include #include +#include +#include +#include +#include using namespace std; @@ -128,37 +128,37 @@ destroy_plan(cl_fft_plan *Plan) kernel_info = tmp; } - Plan->kernel_info = NULL; + Plan->kernel_info = nullptr; if (Plan->kernel_string) { delete Plan->kernel_string; - Plan->kernel_string = NULL; + Plan->kernel_string = nullptr; } if (Plan->twist_kernel) { clReleaseKernel(Plan->twist_kernel); - Plan->twist_kernel = NULL; + Plan->twist_kernel = nullptr; } if (Plan->program) { clReleaseProgram(Plan->program); - Plan->program = NULL; + Plan->program = nullptr; } if (Plan->tempmemobj) { clReleaseMemObject(Plan->tempmemobj); - Plan->tempmemobj = NULL; + Plan->tempmemobj = nullptr; } if (Plan->tempmemobj_real) { clReleaseMemObject(Plan->tempmemobj_real); - Plan->tempmemobj_real = NULL; + Plan->tempmemobj_real = nullptr; } if (Plan->tempmemobj_imag) { clReleaseMemObject(Plan->tempmemobj_imag); - Plan->tempmemobj_imag = NULL; + Plan->tempmemobj_imag = nullptr; } } @@ -201,7 +201,7 @@ int getMaxKernelWorkGroupSize(cl_fft_plan *plan, unsigned int *max_wg_size, unsi cl_fft_kernel_info *kInfo = plan->kernel_info; while (kInfo) { - err = clGetKernelWorkGroupInfo(kInfo->kernel, devices[i], CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), &wg_size, NULL); + err = clGetKernelWorkGroupInfo(kInfo->kernel, devices[i], CL_KERNEL_WORK_GROUP_SIZE, sizeof(size_t), &wg_size, nullptr); if (err != CL_SUCCESS) return -1; @@ -235,7 +235,7 @@ clFFT_CreatePlan(cl_context context, clFFT_Dim3 n, clFFT_Dimension dim, clFFT_Da int i; cl_int err; int isPow2 = 1; - cl_fft_plan *plan = NULL; + cl_fft_plan *plan = nullptr; ostringstream kString; int num_devices; int gpu_found = 0; @@ -265,15 +265,15 @@ clFFT_CreatePlan(cl_context context, clFFT_Dim3 n, clFFT_Dimension dim, clFFT_Da plan->n = n; plan->dim = dim; plan->format = dataFormat; - plan->kernel_info = 0; + plan->kernel_info = nullptr; plan->num_kernels = 0; - plan->twist_kernel = 0; - plan->program = 0; + plan->twist_kernel = nullptr; + plan->program = nullptr; plan->temp_buffer_needed = 0; plan->last_batch_size = 0; - plan->tempmemobj = 0; - plan->tempmemobj_real = 0; - plan->tempmemobj_imag = 0; + plan->tempmemobj = nullptr; + plan->tempmemobj_real = nullptr; + plan->tempmemobj_imag = nullptr; plan->max_localmem_fft_size = 2048; plan->max_work_item_per_workgroup = 256; plan->max_radix = 16; @@ -289,7 +289,7 @@ patch_kernel_source: getBlockConfigAndKernelString(plan); const char *source_str = plan->kernel_string->c_str(); - plan->program = clCreateProgramWithSource(context, 1, (const char **)&source_str, NULL, &err); + plan->program = clCreateProgramWithSource(context, 1, (const char **)&source_str, nullptr, &err); ERR_MACRO(err); err = clGetContextInfo(context, CL_CONTEXT_DEVICES, sizeof(devices), devices, &ret_size); @@ -299,28 +299,28 @@ patch_kernel_source: for (i = 0; i < num_devices; i++) { - err = clGetDeviceInfo(devices[i], CL_DEVICE_TYPE, sizeof(device_type), &device_type, NULL); + err = clGetDeviceInfo(devices[i], CL_DEVICE_TYPE, sizeof(device_type), &device_type, nullptr); ERR_MACRO(err); if (device_type == CL_DEVICE_TYPE_GPU) { gpu_found = 1; - err = clBuildProgram(plan->program, 1, &devices[i], "-cl-mad-enable", NULL, NULL); + err = clBuildProgram(plan->program, 1, &devices[i], "-cl-mad-enable", nullptr, nullptr); if (err != CL_SUCCESS) { char *build_log; char devicename[200]; size_t log_size; - err = clGetProgramBuildInfo(plan->program, devices[i], CL_PROGRAM_BUILD_LOG, 0, NULL, &log_size); + err = clGetProgramBuildInfo(plan->program, devices[i], CL_PROGRAM_BUILD_LOG, 0, nullptr, &log_size); ERR_MACRO(err); build_log = (char *)malloc(log_size + 1); - err = clGetProgramBuildInfo(plan->program, devices[i], CL_PROGRAM_BUILD_LOG, log_size, build_log, NULL); + err = clGetProgramBuildInfo(plan->program, devices[i], CL_PROGRAM_BUILD_LOG, log_size, build_log, nullptr); ERR_MACRO(err); - err = clGetDeviceInfo(devices[i], CL_DEVICE_NAME, sizeof(devicename), devicename, NULL); + err = clGetDeviceInfo(devices[i], CL_DEVICE_NAME, sizeof(devicename), devicename, nullptr); ERR_MACRO(err); fprintf(stdout, "FFT program build log on device %s\n", devicename); @@ -370,7 +370,7 @@ patch_kernel_source: void clFFT_DestroyPlan(clFFT_Plan plan) { - cl_fft_plan *Plan = (cl_fft_plan *)plan; + auto *Plan = (cl_fft_plan *)plan; if (Plan) { destroy_plan(Plan); @@ -388,7 +388,7 @@ void clFFT_DumpPlan(clFFT_Plan Plan, FILE *file) else out = file; - cl_fft_plan *plan = (cl_fft_plan *)Plan; + auto *plan = (cl_fft_plan *)Plan; cl_fft_kernel_info *kInfo = plan->kernel_info; while (kInfo) diff --git a/src/algorithms/libs/pass_through.h b/src/algorithms/libs/pass_through.h index 223256ab9..7ef1838bf 100644 --- a/src/algorithms/libs/pass_through.h +++ b/src/algorithms/libs/pass_through.h @@ -34,11 +34,11 @@ #define GNSS_SDR_PASS_THROUGH_H_ #include "conjugate_cc.h" -#include "conjugate_sc.h" #include "conjugate_ic.h" +#include "conjugate_sc.h" #include "gnss_block_interface.h" -#include #include +#include #include diff --git a/src/algorithms/libs/rtklib/rtklib.h b/src/algorithms/libs/rtklib/rtklib.h index 393652143..24c1dd1e8 100644 --- a/src/algorithms/libs/rtklib/rtklib.h +++ b/src/algorithms/libs/rtklib/rtklib.h @@ -56,14 +56,14 @@ #include "MATH_CONSTANTS.h" #include "gnss_frequencies.h" #include "gnss_obs_codes.h" -#include -#include #include #include #include +#include #include #include -#include +#include +#include /* macros --------------------------------------------------------------------*/ @@ -1211,7 +1211,7 @@ typedef struct char local[1024]; /* local file path */ int topts[4]; /* time options {poff,tint,toff,tretry} (s) */ gtime_t tnext; /* next retry time (gpst) */ - pthread_t thread; /* download thread */ + pthread_t thread; /* download thread */ } ftp_t; @@ -1284,7 +1284,7 @@ typedef struct stream_t stream[8]; /* streams {rov,base,corr,sol1,sol2,logr,logb,logc} */ stream_t *moni; /* monitor stream */ unsigned int tick; /* start tick */ - pthread_t thread; /* server thread */ + pthread_t thread; /* server thread */ int cputime; /* CPU time (ms) for a processing cycle */ int prcout; /* missing observation data count */ lock_t lock; /* lock flag */ diff --git a/src/algorithms/libs/rtklib/rtklib_conversions.h b/src/algorithms/libs/rtklib/rtklib_conversions.h index dca5ec7be..0264ad9e8 100644 --- a/src/algorithms/libs/rtklib/rtklib_conversions.h +++ b/src/algorithms/libs/rtklib/rtklib_conversions.h @@ -31,15 +31,15 @@ #ifndef GNSS_SDR_RTKLIB_CONVERSIONS_H_ #define GNSS_SDR_RTKLIB_CONVERSIONS_H_ -#include "rtklib.h" -#include "gnss_synchro.h" +#include "galileo_almanac.h" #include "galileo_ephemeris.h" -#include "gps_ephemeris.h" -#include "gps_cnav_ephemeris.h" #include "glonass_gnav_ephemeris.h" #include "glonass_gnav_utc_model.h" +#include "gnss_synchro.h" #include "gps_almanac.h" -#include "galileo_almanac.h" +#include "gps_cnav_ephemeris.h" +#include "gps_ephemeris.h" +#include "rtklib.h" eph_t eph_to_rtklib(const Galileo_Ephemeris& gal_eph); eph_t eph_to_rtklib(const Gps_Ephemeris& gps_eph); diff --git a/src/algorithms/libs/rtklib/rtklib_ephemeris.cc b/src/algorithms/libs/rtklib/rtklib_ephemeris.cc index 369448817..c942c0d2c 100644 --- a/src/algorithms/libs/rtklib/rtklib_ephemeris.cc +++ b/src/algorithms/libs/rtklib/rtklib_ephemeris.cc @@ -51,9 +51,9 @@ *----------------------------------------------------------------------------*/ #include "rtklib_ephemeris.h" +#include "rtklib_preceph.h" #include "rtklib_rtkcmn.h" #include "rtklib_sbas.h" -#include "rtklib_preceph.h" /* constants ------------------------------------------------------*/ diff --git a/src/algorithms/libs/rtklib/rtklib_lambda.cc b/src/algorithms/libs/rtklib/rtklib_lambda.cc index ac200a8b9..e96efb39a 100644 --- a/src/algorithms/libs/rtklib/rtklib_lambda.cc +++ b/src/algorithms/libs/rtklib/rtklib_lambda.cc @@ -84,7 +84,7 @@ void gauss(int n, double *L, double *Z, int i, int j) { int k, mu; - if ((mu = static_castROUND_LAMBDA(L[i + j * n])) != 0) + if ((mu = static_cast ROUND_LAMBDA(L[i + j * n])) != 0) { for (k = i; k < n; k++) L[k + n * j] -= static_cast(mu) * L[k + i * n]; for (k = 0; k < n; k++) Z[k + n * j] -= static_cast(mu) * Z[k + i * n]; diff --git a/src/algorithms/libs/rtklib/rtklib_ppp.cc b/src/algorithms/libs/rtklib/rtklib_ppp.cc index 30f07161d..3589ab522 100644 --- a/src/algorithms/libs/rtklib/rtklib_ppp.cc +++ b/src/algorithms/libs/rtklib/rtklib_ppp.cc @@ -51,12 +51,12 @@ *----------------------------------------------------------------------------*/ #include "rtklib_ppp.h" -#include "rtklib_rtkcmn.h" -#include "rtklib_sbas.h" #include "rtklib_ephemeris.h" #include "rtklib_ionex.h" -#include "rtklib_tides.h" #include "rtklib_lambda.h" +#include "rtklib_rtkcmn.h" +#include "rtklib_sbas.h" +#include "rtklib_tides.h" /* wave length of LC (m) -----------------------------------------------------*/ double lam_LC(int i, int j, int k) diff --git a/src/algorithms/libs/rtklib/rtklib_preceph.cc b/src/algorithms/libs/rtklib/rtklib_preceph.cc index 3da6b8b5b..72c62fbf1 100644 --- a/src/algorithms/libs/rtklib/rtklib_preceph.cc +++ b/src/algorithms/libs/rtklib/rtklib_preceph.cc @@ -146,7 +146,7 @@ int addpeph(nav_t *nav, peph_t *peph) /* read sp3 body -------------------------------------------------------------*/ -void readsp3b(FILE *fp, char type, int *sats __attribute__((unused)), int ns, double *bfact, +void readsp3b(FILE *fp, char type, int *sats __attribute__((unused)), int ns, const double *bfact, char *tsys, int index, int opt, nav_t *nav) { peph_t peph; diff --git a/src/algorithms/libs/rtklib/rtklib_preceph.h b/src/algorithms/libs/rtklib/rtklib_preceph.h index 24b0b610c..1186b6a88 100644 --- a/src/algorithms/libs/rtklib/rtklib_preceph.h +++ b/src/algorithms/libs/rtklib/rtklib_preceph.h @@ -75,7 +75,7 @@ int code2sys(char code); int readsp3h(FILE *fp, gtime_t *time, char *type, int *sats, double *bfact, char *tsys); int addpeph(nav_t *nav, peph_t *peph); -void readsp3b(FILE *fp, char type, int *sats, int ns, double *bfact, +void readsp3b(FILE *fp, char type, int *sats, int ns, const double *bfact, char *tsys, int index, int opt, nav_t *nav); int cmppeph(const void *p1, const void *p2); void combpeph(nav_t *nav, int opt); diff --git a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc index 71e08e7fe..9eea3a0b2 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc @@ -54,10 +54,10 @@ //#include #include #include -#include #include -#include +#include #include +#include #include @@ -1471,7 +1471,9 @@ gtime_t timeget(void) { gtime_t time; double ep[6] = {}; - struct timeval tv{}; + struct timeval tv + { + }; struct tm *tt; if (!gettimeofday(&tv, nullptr) && (tt = gmtime(&tv.tv_sec))) diff --git a/src/algorithms/libs/rtklib/rtklib_rtkpos.cc b/src/algorithms/libs/rtklib/rtklib_rtkpos.cc index e33f770e6..1634b8fcb 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkpos.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtkpos.cc @@ -52,11 +52,11 @@ *----------------------------------------------------------------------------*/ #include "rtklib_rtkpos.h" -#include "rtklib_pntpos.h" #include "rtklib_ephemeris.h" +#include "rtklib_lambda.h" +#include "rtklib_pntpos.h" #include "rtklib_ppp.h" #include "rtklib_tides.h" -#include "rtklib_lambda.h" static int resamb_WLNL(rtk_t *rtk __attribute((unused)), const obsd_t *obs __attribute((unused)), const int *sat __attribute((unused)), const int *iu __attribute((unused)), const int *ir __attribute((unused)), int ns __attribute__((unused)), const nav_t *nav __attribute((unused)), @@ -541,7 +541,7 @@ void initx_rtk(rtk_t *rtk, double xi, double var, int i) /* select common satellites between rover and reference station --------------*/ -int selsat(const obsd_t *obs, double *azel, int nu, int nr, +int selsat(const obsd_t *obs, const double *azel, int nu, int nr, const prcopt_t *opt, int *sat, int *iu, int *ir) { int i, j, k = 0; @@ -1155,7 +1155,7 @@ int zdres(int base, const obsd_t *obs, int n, const double *rs, /* test valid observation data -----------------------------------------------*/ -int validobs(int i, int j, int f, int nf, double *y) +int validobs(int i, int j, int f, int nf, const double *y) { /* if no phase observable, psudorange is also unusable */ return y[f + i * nf * 2] != 0.0 && y[f + j * nf * 2] != 0.0 && @@ -1302,7 +1302,7 @@ int test_sys(int sys, int m) /* double-differenced phase/code residuals -----------------------------------*/ int ddres(rtk_t *rtk, const nav_t *nav, double dt, const double *x, - const double *P, const int *sat, double *y, double *e, + const double *P, const int *sat, double *y, const double *e, double *azel, const int *iu, const int *ir, int ns, double *v, double *H, double *R, int *vflg) { diff --git a/src/algorithms/libs/rtklib/rtklib_rtkpos.h b/src/algorithms/libs/rtklib/rtklib_rtkpos.h index 81234a634..3cac6b4d0 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkpos.h +++ b/src/algorithms/libs/rtklib/rtklib_rtkpos.h @@ -108,7 +108,7 @@ double baseline(const double *ru, const double *rb, double *dr); void initx_rtk(rtk_t *rtk, double xi, double var, int i); -int selsat(const obsd_t *obs, double *azel, int nu, int nr, +int selsat(const obsd_t *obs, const double *azel, int nu, int nr, const prcopt_t *opt, int *sat, int *iu, int *ir); void udpos(rtk_t *rtk, double tt); @@ -144,7 +144,7 @@ int zdres(int base, const obsd_t *obs, int n, const double *rs, const double *rr, const prcopt_t *opt, int index, double *y, double *e, double *azel); -int validobs(int i, int j, int f, int nf, double *y); +int validobs(int i, int j, int f, int nf, const double *y); void ddcov(const int *nb, int n, const double *Ri, const double *Rj, int nv, double *R); @@ -162,7 +162,7 @@ double gloicbcorr(int sat1, int sat2, const prcopt_t *opt, double lam1, int test_sys(int sys, int m); int ddres(rtk_t *rtk, const nav_t *nav, double dt, const double *x, - const double *P, const int *sat, double *y, double *e, + const double *P, const int *sat, double *y, const double *e, double *azel, const int *iu, const int *ir, int ns, double *v, double *H, double *R, int *vflg); diff --git a/src/algorithms/libs/rtklib/rtklib_rtksvr.cc b/src/algorithms/libs/rtklib/rtklib_rtksvr.cc index 062597f41..ac047012a 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtksvr.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtksvr.cc @@ -1,12 +1,12 @@ #include "rtklib_rtksvr.h" +#include "rtklib_preceph.h" +#include "rtklib_rtcm.h" #include "rtklib_rtkcmn.h" #include "rtklib_rtkpos.h" -#include "rtklib_solution.h" #include "rtklib_sbas.h" -#include "rtklib_preceph.h" +#include "rtklib_solution.h" #include "rtklib_stream.h" -#include "rtklib_rtcm.h" /* write solution header to output stream ------------------------------------*/ void writesolhead(stream_t *stream, const solopt_t *solopt) @@ -424,7 +424,7 @@ void decodefile(rtksvr_t *svr, int index) { /* precise clock */ /* read rinex clock */ // Disabled!! - if (1 /*readrnxc(file, &nav)<=0 */) + if (true /*readrnxc(file, &nav)<=0 */) { tracet(1, "rinex clock file read error: %s\n", file); return; @@ -730,7 +730,7 @@ void rtksvrunlock(rtksvr_t *svr) { rtk_unlock(&svr->lock); } * return : status (1:ok 0:error) *-----------------------------------------------------------------------------*/ int rtksvrstart(rtksvr_t *svr, int cycle, int buffsize, int *strs, - char **paths, int *formats, int navsel, char **cmds, + char **paths, const int *formats, int navsel, char **cmds, char **rcvopts, int nmeacycle, int nmeareq, const double *nmeapos, prcopt_t *prcopt, solopt_t *solopt, stream_t *moni) diff --git a/src/algorithms/libs/rtklib/rtklib_rtksvr.h b/src/algorithms/libs/rtklib/rtklib_rtksvr.h index 0e6eb65e7..d5edbd252 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtksvr.h +++ b/src/algorithms/libs/rtklib/rtklib_rtksvr.h @@ -116,7 +116,7 @@ void rtksvrlock(rtksvr_t *svr); void rtksvrunlock(rtksvr_t *svr); int rtksvrstart(rtksvr_t *svr, int cycle, int buffsize, int *strs, - char **paths, int *formats, int navsel, char **cmds, + char **paths, const int *formats, int navsel, char **cmds, char **rcvopts, int nmeacycle, int nmeareq, const double *nmeapos, prcopt_t *prcopt, solopt_t *solopt, stream_t *moni); diff --git a/src/algorithms/libs/rtklib/rtklib_solution.cc b/src/algorithms/libs/rtklib/rtklib_solution.cc index ddafc248b..fe1a7d533 100644 --- a/src/algorithms/libs/rtklib/rtklib_solution.cc +++ b/src/algorithms/libs/rtklib/rtklib_solution.cc @@ -51,10 +51,10 @@ * *----------------------------------------------------------------------------*/ -#include #include "rtklib_solution.h" #include "rtklib_rtkcmn.h" #include "rtklib_rtksvr.h" +#include /* constants and macros ------------------------------------------------------*/ @@ -1111,7 +1111,7 @@ void addsolstat(solstatbuf_t *statbuf, const solstat_t *stat) { statbuf->nmax = statbuf->nmax == 0 ? 8192 : statbuf->nmax * 2; if (!(statbuf_data = static_cast(realloc(statbuf->data, sizeof(solstat_t) * - statbuf->nmax)))) + statbuf->nmax)))) { trace(1, "addsolstat: memory allocation error\n"); free(statbuf->data); diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc index 85fd0ad7e..9b2a0d3e2 100644 --- a/src/algorithms/libs/rtklib/rtklib_stream.cc +++ b/src/algorithms/libs/rtklib/rtklib_stream.cc @@ -50,21 +50,21 @@ * *----------------------------------------------------------------------------*/ -#include +#include +#include +#include +#include +#include +#include #include #include -#include -#include -#include +#include +#include +#include #include #include -#include #include -#include -#include -#include -#include -#include +#include /* global options ------------------------------------------------------------*/ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc index 8c9997ef9..c211ed710 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc @@ -16,22 +16,22 @@ * along with GNSS-SDR. If not, see . */ +#include "volk_gnsssdr_profile.h" #include "kernel_tests.h" // for init_test_list #include "qa_utils.h" // for volk_gnsssdr_test_results_t #include "volk_gnsssdr/volk_gnsssdr_complex.h" // for lv_32fc_t +#include "volk_gnsssdr/volk_gnsssdr_prefs.h" // for volk_gnsssdr_get_config_path #include "volk_gnsssdr_option_helpers.h" // for option_list, option_t -#include "volk_gnsssdr_profile.h" -#include "volk_gnsssdr/volk_gnsssdr_prefs.h" // for volk_gnsssdr_get_config_path -#include // for create_directories, exists -#include // for path, operator<< -#include // for filesystem -#include // for stat -#include // for size_t -#include // for operator<<, basic_ostream -#include // IWYU pragma: keep -#include // for map, map<>::iterator -#include // for pair -#include // for vector, vector<>::const_.. +#include // for create_directories, exists +#include // for path, operator<< +#include // for filesystem +#include // for size_t +#include // IWYU pragma: keep +#include // for operator<<, basic_ostream +#include // for map, map<>::iterator +#include // for stat +#include // for pair +#include // for vector, vector<>::const_.. namespace fs = boost::filesystem; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_resamplerxnpuppet_16i.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_resamplerxnpuppet_16i.h index 440ed4ace..1be4896b2 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_resamplerxnpuppet_16i.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_resamplerxnpuppet_16i.h @@ -36,9 +36,9 @@ #define INCLUDED_volk_gnsssdr_16i_resamplerxnpuppet_16i_H #include "volk_gnsssdr/volk_gnsssdr_16i_xn_resampler_16i_xn.h" -#include -#include #include +#include +#include #include #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_xn_resampler_16i_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_xn_resampler_16i_xn.h index 5324bf725..2491813bb 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_xn_resampler_16i_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16i_xn_resampler_16i_xn.h @@ -63,12 +63,12 @@ #ifndef INCLUDED_volk_gnsssdr_16i_xn_resampler_16i_xn_H #define INCLUDED_volk_gnsssdr_16i_xn_resampler_16i_xn_H -#include -#include -#include -#include #include #include +#include +#include +#include +#include #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h index b52e032f1..c16812e00 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h @@ -69,10 +69,10 @@ #define INCLUDED_volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_H -#include -#include -#include #include +#include +#include +#include #include //#include @@ -742,9 +742,9 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_sse3(lv_16sc #ifdef LV_HAVE_AVX2 -#include -#include #include +#include +#include static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_avx2(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const int16_t** in_a, int num_a_vectors, unsigned int num_points) { @@ -896,9 +896,9 @@ static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_a_avx2(lv_16sc #endif /* LV_HAVE_AVX2 */ #ifdef LV_HAVE_AVX2 -#include -#include #include +#include +#include static inline void volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn_u_avx2(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const int16_t** in_a, int num_a_vectors, unsigned int num_points) { diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic.h index 6d6c88702..e28e01225 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic.h @@ -36,8 +36,8 @@ #define INCLUDED_volk_gnsssdr_16ic_16i_rotator_dotprodxnpuppet_16ic_H #include "volk_gnsssdr/volk_gnsssdr_16ic_16i_rotator_dot_prod_16ic_xn.h" -#include #include +#include #include #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resampler_fast_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resampler_fast_16ic.h index 29dfcd767..634f4f8c3 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resampler_fast_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resampler_fast_16ic.h @@ -61,9 +61,9 @@ #ifndef INCLUDED_volk_gnsssdr_16ic_resampler_fast_16ic_H #define INCLUDED_volk_gnsssdr_16ic_resampler_fast_16ic_H -#include #include #include +#include #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic.h index 5ecd8c641..c6e535a42 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic.h @@ -36,9 +36,9 @@ #define INCLUDED_volk_gnsssdr_16ic_resamplerfastxnpuppet_16ic_H #include "volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn.h" -#include -#include #include +#include +#include #include #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerxnpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerxnpuppet_16ic.h index b0885924a..ffac7fece 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerxnpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_resamplerxnpuppet_16ic.h @@ -36,9 +36,9 @@ #define INCLUDED_volk_gnsssdr_16ic_resamplerxnpuppet_16ic_H #include "volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_16ic_xn.h" -#include -#include #include +#include +#include #include #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_rotatorpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_rotatorpuppet_16ic.h index 8f1c1beb5..757e213d2 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_rotatorpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_rotatorpuppet_16ic.h @@ -36,8 +36,8 @@ #define INCLUDED_volk_gnsssdr_16ic_rotatorpuppet_16ic_H -#include #include "volk_gnsssdr/volk_gnsssdr_16ic_s32fc_x2_rotator_16ic.h" +#include #include diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic.h index 4834354f5..6d65f80f3 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic.h @@ -59,9 +59,9 @@ #ifndef INCLUDED_volk_gnsssdr_16ic_x2_dot_prod_16ic_H #define INCLUDED_volk_gnsssdr_16ic_x2_dot_prod_16ic_H +#include #include #include -#include #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic_xn.h index e45b885a9..9d370fb19 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic_xn.h @@ -61,10 +61,10 @@ #define INCLUDED_volk_gnsssdr_16ic_xn_dot_prod_16ic_xn_H +#include +#include #include #include -#include -#include #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic.h index abec05bb0..67bfb1a0b 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic.h @@ -36,9 +36,9 @@ #define INCLUDED_volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic_H #include "volk_gnsssdr/volk_gnsssdr_16ic_x2_dot_prod_16ic_xn.h" -#include -#include #include +#include +#include #include #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn.h index 24b2454c4..efc0feb70 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn.h @@ -69,10 +69,10 @@ #define INCLUDED_volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_H -#include -#include -#include #include +#include +#include +#include #include #ifdef LV_HAVE_GENERIC @@ -1490,8 +1490,8 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon(lv_16sc_t* #ifdef LV_HAVE_NEONV7 -#include #include +#include static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_vma(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) { @@ -1687,8 +1687,8 @@ static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_vma(lv_16s #ifdef LV_HAVE_NEONV7 -#include #include +#include static inline void volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn_neon_optvma(lv_16sc_t* result, const lv_16sc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const lv_16sc_t** in_a, int num_a_vectors, unsigned int num_points) { diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic.h index 9339b00be..51536530e 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic.h @@ -36,8 +36,8 @@ #define INCLUDED_volk_gnsssdr_16ic_x2_rotator_dotprodxnpuppet_16ic_H #include "volk_gnsssdr/volk_gnsssdr_16ic_x2_rotator_dot_prod_16ic_xn.h" -#include #include +#include #include #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_16ic_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_16ic_xn.h index 430f27962..8bf573ea1 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_16ic_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_16ic_xn.h @@ -63,10 +63,10 @@ #ifndef INCLUDED_volk_gnsssdr_16ic_xn_resampler_16ic_xn_H #define INCLUDED_volk_gnsssdr_16ic_xn_resampler_16ic_xn_H -#include -#include #include #include +#include +#include #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn.h index 2830f691d..4d3cc61c1 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn.h @@ -63,9 +63,9 @@ #ifndef INCLUDED_volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_H #define INCLUDED_volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_H -#include #include #include +#include #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_high_dynamics_resamplerxnpuppet_32f.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_high_dynamics_resamplerxnpuppet_32f.h index c6705adca..d6fbcf756 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_high_dynamics_resamplerxnpuppet_32f.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_high_dynamics_resamplerxnpuppet_32f.h @@ -37,9 +37,9 @@ #define INCLUDED_volk_gnsssdr_32f_high_dynamics_resamplerxnpuppet_32f_H #include "volk_gnsssdr/volk_gnsssdr_32f_xn_high_dynamics_resampler_32f_xn.h" -#include -#include #include +#include +#include #include diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_resamplerxnpuppet_32f.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_resamplerxnpuppet_32f.h index 106dfecdc..5f979c69e 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_resamplerxnpuppet_32f.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_resamplerxnpuppet_32f.h @@ -36,9 +36,9 @@ #define INCLUDED_volk_gnsssdr_32f_resamplerxnpuppet_32f_H #include "volk_gnsssdr/volk_gnsssdr_32f_xn_resampler_32f_xn.h" -#include -#include #include +#include +#include #include diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_sincos_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_sincos_32fc.h index 8936901b0..9c7f01227 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_sincos_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_sincos_32fc.h @@ -57,9 +57,9 @@ #ifndef INCLUDED_volk_gnsssdr_32f_sincos_32fc_H #define INCLUDED_volk_gnsssdr_32f_sincos_32fc_H -#include #include #include +#include #ifdef LV_HAVE_SSE4_1 #include diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_xn_high_dynamics_resampler_32f_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_xn_high_dynamics_resampler_32f_xn.h index 8b666908b..db878c584 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_xn_high_dynamics_resampler_32f_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_xn_high_dynamics_resampler_32f_xn.h @@ -67,13 +67,13 @@ #ifndef INCLUDED_volk_gnsssdr_32f_xn_high_dynamics_resampler_32f_xn_H #define INCLUDED_volk_gnsssdr_32f_xn_high_dynamics_resampler_32f_xn_H -#include -#include -#include /* abs */ -#include /* int64_t */ -#include #include #include +#include +#include +#include /* int64_t */ +#include +#include /* abs */ #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_xn_resampler_32f_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_xn_resampler_32f_xn.h index e841feeb2..50bdd732c 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_xn_resampler_32f_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32f_xn_resampler_32f_xn.h @@ -63,13 +63,13 @@ #ifndef INCLUDED_volk_gnsssdr_32f_xn_resampler_32f_xn_H #define INCLUDED_volk_gnsssdr_32f_xn_resampler_32f_xn_H -#include -#include -#include /* abs */ -#include /* int64_t */ -#include #include #include +#include +#include +#include /* int64_t */ +#include +#include /* abs */ #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h index e20d229e3..822742daf 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h @@ -70,10 +70,10 @@ #define INCLUDED_volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_H -#include -#include -#include #include +#include +#include +#include #include #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32fc.h index b2bc1b740..ac71ab47a 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32fc.h @@ -36,8 +36,8 @@ #define INCLUDED_volk_gnsssdr_32fc_32f_high_dynamic_rotator_dotprodxnpuppet_32fc_H #include "volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h" -#include #include +#include #include #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn.h index 08cb7a221..c08591deb 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn.h @@ -69,10 +69,10 @@ #define INCLUDED_volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_H -#include -#include -#include #include +#include +#include +#include #include //#include @@ -165,8 +165,8 @@ static inline void volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_generic_reload #endif /*LV_HAVE_GENERIC*/ #ifdef LV_HAVE_AVX -#include #include +#include static inline void volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_u_avx(lv_32fc_t* result, const lv_32fc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const float** in_a, int num_a_vectors, unsigned int num_points) { unsigned int number = 0; @@ -329,8 +329,8 @@ static inline void volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_u_avx(lv_32fc_ #ifdef LV_HAVE_AVX -#include #include +#include static inline void volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn_a_avx(lv_32fc_t* result, const lv_32fc_t* in_common, const lv_32fc_t phase_inc, lv_32fc_t* phase, const float** in_a, int num_a_vectors, unsigned int num_points) { unsigned int number = 0; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc.h index 9212c9327..0a166d97f 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc.h @@ -36,8 +36,8 @@ #define INCLUDED_volk_gnsssdr_32fc_32f_rotator_dotprodxnpuppet_32fc_H #include "volk_gnsssdr/volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn.h" -#include #include +#include #include #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_16ic.h index 85d902d7d..ecfe1fb2e 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_16ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_16ic.h @@ -56,9 +56,9 @@ #ifndef INCLUDED_volk_gnsssdr_32fc_convert_16ic_H #define INCLUDED_volk_gnsssdr_32fc_convert_16ic_H +#include "volk_gnsssdr/volk_gnsssdr_complex.h" #include #include -#include "volk_gnsssdr/volk_gnsssdr_complex.h" #ifdef LV_HAVE_SSE2 #include diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_8ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_8ic.h index ff4202ca4..634fdd60e 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_8ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_convert_8ic.h @@ -56,10 +56,10 @@ #ifndef INCLUDED_volk_gnsssdr_32fc_convert_8ic_H #define INCLUDED_volk_gnsssdr_32fc_convert_8ic_H -#include -#include -#include #include "volk_gnsssdr/volk_gnsssdr_complex.h" +#include +#include +#include #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_resamplerxnpuppet_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_resamplerxnpuppet_32fc.h index 9c595a226..c95091ac0 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_resamplerxnpuppet_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_resamplerxnpuppet_32fc.h @@ -36,9 +36,9 @@ #define INCLUDED_volk_gnsssdr_32fc_resamplerxnpuppet_32fc_H #include "volk_gnsssdr/volk_gnsssdr_32fc_xn_resampler_32fc_xn.h" -#include -#include #include +#include +#include #include diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn.h index 32c51fa55..5701ae041 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn.h @@ -69,10 +69,10 @@ #define INCLUDED_volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn_H -#include -#include -#include #include +#include +#include +#include #include diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc.h index 6786f8821..4d5efcefe 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc.h @@ -36,8 +36,8 @@ #define INCLUDED_volk_gnsssdr_32fc_x2_rotator_dotprodxnpuppet_32fc_H #include "volk_gnsssdr/volk_gnsssdr_32fc_x2_rotator_dot_prod_32fc_xn.h" -#include #include +#include #include #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_xn_resampler_32fc_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_xn_resampler_32fc_xn.h index 2a8e7ba1b..4335e0722 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_xn_resampler_32fc_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_xn_resampler_32fc_xn.h @@ -63,10 +63,10 @@ #ifndef INCLUDED_volk_gnsssdr_32fc_xn_resampler_32fc_xn_H #define INCLUDED_volk_gnsssdr_32fc_xn_resampler_32fc_xn_H -#include -#include /* abs */ #include #include +#include +#include /* abs */ #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_x2_dot_prod_8ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_x2_dot_prod_8ic.h index 47d9ccaaf..d123f6225 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_x2_dot_prod_8ic.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_8ic_x2_dot_prod_8ic.h @@ -59,9 +59,9 @@ #ifndef INCLUDED_volk_gnsssdr_8ic_x2_dot_prod_8ic_H #define INCLUDED_volk_gnsssdr_8ic_x2_dot_prod_8ic_H -#include #include #include +#include #ifdef LV_HAVE_GENERIC diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincos_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincos_32fc.h index 50ac028d0..41e59e525 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincos_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincos_32fc.h @@ -62,9 +62,9 @@ #ifndef INCLUDED_volk_gnsssdr_s32f_sincos_32fc_H #define INCLUDED_volk_gnsssdr_s32f_sincos_32fc_H -#include #include #include +#include #ifdef LV_HAVE_SSE2 diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincospuppet_32fc.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincospuppet_32fc.h index ac86c52a2..6146d443a 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincospuppet_32fc.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_s32f_sincospuppet_32fc.h @@ -36,8 +36,8 @@ #define INCLUDED_volk_gnsssdr_s32f_sincospuppet_32fc_H -#include #include "volk_gnsssdr/volk_gnsssdr_s32f_sincos_32fc.h" +#include #include diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/kernel_tests.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/kernel_tests.h index 51a96b171..86b20b5e0 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/kernel_tests.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/kernel_tests.h @@ -29,8 +29,8 @@ #include "qa_utils.h" -#include #include +#include // macros for initializing volk_gnsssdr_test_case_t. Macros are needed to generate diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc index 58db3bac1..906028e6d 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc @@ -16,9 +16,8 @@ * along with GNSS-SDR. If not, see . */ -#include "volk_gnsssdr/volk_gnsssdr.h" // for volk_gnsssdr_func_desc_t #include "qa_utils.h" - +#include "volk_gnsssdr/volk_gnsssdr.h" // for volk_gnsssdr_func_desc_t #include // for volk_gnsssdr_free, volk_gnsssdr_malloc #include // for assert #include // for system_clock, duration,... diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h index e0a265c92..2a69e5947 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h @@ -23,8 +23,8 @@ #define _DARWIN_C_SOURCE #endif -#include "volk_gnsssdr/volk_gnsssdr_complex.h" // for lv_32fc_t #include "volk_gnsssdr/volk_gnsssdr.h" // for volk_gnsssdr_func_desc_t +#include "volk_gnsssdr/volk_gnsssdr_complex.h" // for lv_32fc_t #include // for bool, false #include // for NULL #include // for map diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc index 2dc11324e..6c23220d1 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc @@ -22,8 +22,8 @@ #include "qa_utils.h" // for volk_gnsssdr_test_case_t, volk_gnsssdr_test_results_t #include "volk_gnsssdr/volk_gnsssdr_complex.h" // for lv_32fc_t #include // for bool, false, true -#include // for operator<<, basic_ostream, endl, char... #include // IWYU pragma: keep +#include // for operator<<, basic_ostream, endl, char... #include // for map, map<>::iterator, _Rb_tree_iterator #include // for stringstream #include // for string, operator<< diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_rank_archs.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_rank_archs.h index 335d4a279..06c2cd41e 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_rank_archs.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/volk_gnsssdr_rank_archs.h @@ -19,8 +19,8 @@ #ifndef GNSS_SDR_VOLK_GNSSSDR_RANK_ARCHS_H #define GNSS_SDR_VOLK_GNSSSDR_RANK_ARCHS_H -#include #include +#include #ifdef __cplusplus extern "C" diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr.tmpl.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr.tmpl.h index cfde1b241..51f8026fc 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr.tmpl.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr.tmpl.h @@ -19,14 +19,13 @@ #ifndef INCLUDED_VOLK_GNSSSDR_RUNTIME #define INCLUDED_VOLK_GNSSSDR_RUNTIME -#include -#include #include #include +#include #include - -#include +#include #include +#include __VOLK_DECL_BEGIN diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_typedefs.tmpl.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_typedefs.tmpl.h index 2d7ac6a30..d55149147 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_typedefs.tmpl.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_typedefs.tmpl.h @@ -19,8 +19,8 @@ #ifndef INCLUDED_VOLK_GNSSSDR_TYPEDEFS #define INCLUDED_VOLK_GNSSSDR_TYPEDEFS -#include #include +#include // clang-format off %for kern in kernels: diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc index c7228f2cd..cf9807ece 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc @@ -30,8 +30,8 @@ */ #include "hybrid_observables_cc.h" -#include "display.h" #include "GPS_L1_CA.h" +#include "display.h" #include "gnss_sdr_create_directory.h" #include #include diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h index 033da7a25..9f6d31e47 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h @@ -34,10 +34,10 @@ #ifndef GNSS_SDR_HYBRID_OBSERVABLES_CC_H #define GNSS_SDR_HYBRID_OBSERVABLES_CC_H -#include "gnss_synchro.h" #include "gnss_circular_deque.h" -#include +#include "gnss_synchro.h" #include +#include #include #include #include diff --git a/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc b/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc index 4c614ccba..a1e6e2e1b 100644 --- a/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc +++ b/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc @@ -30,10 +30,10 @@ */ #include "direct_resampler_conditioner.h" +#include "configuration_interface.h" +#include "direct_resampler_conditioner_cb.h" #include "direct_resampler_conditioner_cc.h" #include "direct_resampler_conditioner_cs.h" -#include "direct_resampler_conditioner_cb.h" -#include "configuration_interface.h" #include #include #include diff --git a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc index 1a0ad9abf..bc18beba5 100644 --- a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc +++ b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc @@ -69,7 +69,7 @@ MmseResamplerConditioner::MmseResamplerConditioner( std::vector taps = gr::filter::firdes::low_pass(1.0, sample_freq_in_, sample_freq_out_ / 2.1, - sample_freq_out_ / 10, + sample_freq_out_ / 5, gr::filter::firdes::win_type::WIN_HAMMING); std::cout << "Enabled fractional resampler low pass filter with " << taps.size() << " taps" << std::endl; fir_filter_ccf_ = gr::filter::fir_filter_ccf::make(1, taps); diff --git a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.h b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.h index b3cc61e03..641975e83 100644 --- a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.h +++ b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.h @@ -35,11 +35,11 @@ #include "gnss_block_interface.h" #ifdef GR_GREATER_38 -#include #include +#include #else -#include #include +#include #endif #include diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc index 704a93b92..39bf2883a 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc @@ -33,8 +33,8 @@ #include "direct_resampler_conditioner_cb.h" -#include #include +#include using google::LogMessage; diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc index 44d78782c..a288cd4da 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc @@ -33,8 +33,8 @@ #include "direct_resampler_conditioner_cc.h" -#include #include +#include using google::LogMessage; diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc index 06d8f3a22..3506879b6 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc @@ -33,8 +33,8 @@ #include "direct_resampler_conditioner_cs.h" -#include #include +#include using google::LogMessage; diff --git a/src/algorithms/signal_generator/adapters/signal_generator.cc b/src/algorithms/signal_generator/adapters/signal_generator.cc index fcde2b3a8..a5e3d3923 100644 --- a/src/algorithms/signal_generator/adapters/signal_generator.cc +++ b/src/algorithms/signal_generator/adapters/signal_generator.cc @@ -31,11 +31,11 @@ #include "signal_generator.h" -#include "configuration_interface.h" -#include "Galileo_E1.h" -#include "GPS_L1_CA.h" -#include "Galileo_E5a.h" #include "GLONASS_L1_L2_CA.h" +#include "GPS_L1_CA.h" +#include "Galileo_E1.h" +#include "Galileo_E5a.h" +#include "configuration_interface.h" #include #include #include diff --git a/src/algorithms/signal_generator/adapters/signal_generator.h b/src/algorithms/signal_generator/adapters/signal_generator.h index 7009eb853..e32c431b8 100644 --- a/src/algorithms/signal_generator/adapters/signal_generator.h +++ b/src/algorithms/signal_generator/adapters/signal_generator.h @@ -36,9 +36,9 @@ #include "gnss_block_interface.h" #include "signal_generator_c.h" #include +#include #include #include -#include #include #include diff --git a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc index 07c17ab00..84a90d555 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc +++ b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc @@ -29,14 +29,14 @@ */ #include "signal_generator_c.h" -#include "gps_sdr_signal_processing.h" -#include "glonass_l1_signal_processing.h" -#include "galileo_e1_signal_processing.h" -#include "galileo_e5_signal_processing.h" +#include "GLONASS_L1_L2_CA.h" +#include "GPS_L1_CA.h" #include "Galileo_E1.h" #include "Galileo_E5a.h" -#include "GPS_L1_CA.h" -#include "GLONASS_L1_L2_CA.h" +#include "galileo_e1_signal_processing.h" +#include "galileo_e5_signal_processing.h" +#include "glonass_l1_signal_processing.h" +#include "gps_sdr_signal_processing.h" #include #include #include diff --git a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h index d7f9e3654..d47fc558b 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h +++ b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h @@ -35,9 +35,9 @@ #include //#include #include +#include #include #include -#include class signal_generator_c; 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 e34103561..a9cade7c5 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc @@ -31,13 +31,14 @@ */ #include "ad9361_fpga_signal_source.h" -#include "configuration_interface.h" -#include "ad9361_manager.h" #include "GPS_L1_CA.h" #include "GPS_L2C.h" +#include "ad9361_manager.h" +#include "configuration_interface.h" #include #include #include // for cout, endl +#include #ifdef __APPLE__ #include @@ -46,8 +47,8 @@ #endif Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, - boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) + const std::string& role, unsigned int in_stream, unsigned int out_stream, + boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) { std::string default_item_type = "gr_complex"; std::string default_dump_file = "./data/signal_source.dat"; diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h index 89fd50449..79ebeff3e 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h @@ -32,8 +32,8 @@ #ifndef GNSS_SDR_AD9361_FPGA_SIGNAL_SOURCE_H_ #define GNSS_SDR_AD9361_FPGA_SIGNAL_SOURCE_H_ -#include "gnss_block_interface.h" #include "fpga_switch.h" +#include "gnss_block_interface.h" #include #include #include @@ -45,7 +45,7 @@ class Ad9361FpgaSignalSource : public GNSSBlockInterface { public: Ad9361FpgaSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, + const std::string& role, unsigned int in_stream, unsigned int out_stream, boost::shared_ptr queue); ~Ad9361FpgaSignalSource(); 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 440a17252..2f2e76ef3 100644 --- a/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc +++ b/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc @@ -31,19 +31,20 @@ #include "custom_udp_signal_source.h" -#include "configuration_interface.h" #include "GPS_L1_CA.h" +#include "configuration_interface.h" #include #include #include +#include using google::LogMessage; CustomUDPSignalSource::CustomUDPSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, - boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) + const std::string& role, unsigned int in_stream, unsigned int out_stream, + boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) { // DUMP PARAMETERS std::string empty = ""; @@ -112,9 +113,7 @@ CustomUDPSignalSource::CustomUDPSignalSource(ConfigurationInterface* configurati } -CustomUDPSignalSource::~CustomUDPSignalSource() -{ -} +CustomUDPSignalSource::~CustomUDPSignalSource() = default; void CustomUDPSignalSource::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/signal_source/adapters/custom_udp_signal_source.h b/src/algorithms/signal_source/adapters/custom_udp_signal_source.h index fcd42071d..bec7c3d73 100644 --- a/src/algorithms/signal_source/adapters/custom_udp_signal_source.h +++ b/src/algorithms/signal_source/adapters/custom_udp_signal_source.h @@ -36,9 +36,9 @@ #include "gnss_block_interface.h" #include "gr_complex_ip_packet_source.h" #include -#include #include #include +#include #include #include #include @@ -54,7 +54,7 @@ class CustomUDPSignalSource : public GNSSBlockInterface { public: CustomUDPSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, + const std::string& role, unsigned int in_stream, unsigned int out_stream, boost::shared_ptr queue); virtual ~CustomUDPSignalSource(); diff --git a/src/algorithms/signal_source/adapters/file_signal_source.cc b/src/algorithms/signal_source/adapters/file_signal_source.cc index 7dbea2d0e..bc4fb6329 100644 --- a/src/algorithms/signal_source/adapters/file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/file_signal_source.cc @@ -35,10 +35,10 @@ #include "gnss_sdr_flags.h" #include "gnss_sdr_valve.h" #include -#include // for std::cerr +#include #include #include -#include +#include // for std::cerr #include diff --git a/src/algorithms/signal_source/adapters/file_signal_source.h b/src/algorithms/signal_source/adapters/file_signal_source.h index 548180a31..0d4658304 100644 --- a/src/algorithms/signal_source/adapters/file_signal_source.h +++ b/src/algorithms/signal_source/adapters/file_signal_source.h @@ -36,8 +36,8 @@ #define GNSS_SDR_FILE_SIGNAL_SOURCE_H_ #include "gnss_block_interface.h" -#include #include +#include #include #include #include diff --git a/src/algorithms/signal_source/adapters/flexiband_signal_source.cc b/src/algorithms/signal_source/adapters/flexiband_signal_source.cc index 082d45973..95b3c56cd 100644 --- a/src/algorithms/signal_source/adapters/flexiband_signal_source.cc +++ b/src/algorithms/signal_source/adapters/flexiband_signal_source.cc @@ -30,9 +30,9 @@ #include "flexiband_signal_source.h" #include "configuration_interface.h" +#include #include #include -#include #include diff --git a/src/algorithms/signal_source/adapters/flexiband_signal_source.h b/src/algorithms/signal_source/adapters/flexiband_signal_source.h index dbf7e567e..54e7eeff4 100644 --- a/src/algorithms/signal_source/adapters/flexiband_signal_source.h +++ b/src/algorithms/signal_source/adapters/flexiband_signal_source.h @@ -34,11 +34,11 @@ #define FLEXIBAND_SIGNAL_SOURCE_H_ #include "gnss_block_interface.h" +#include +#include +#include #include #include -#include -#include -#include #include #include diff --git a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc index da3b39148..8f3f5fa82 100644 --- a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc +++ b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc @@ -30,21 +30,22 @@ */ #include "fmcomms2_signal_source.h" -#include "configuration_interface.h" -#include "gnss_sdr_valve.h" -#include "ad9361_manager.h" #include "GPS_L1_CA.h" #include "GPS_L2C.h" +#include "ad9361_manager.h" +#include "configuration_interface.h" +#include "gnss_sdr_valve.h" #include #include #include +#include using google::LogMessage; Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, - boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) + const std::string& role, unsigned int in_stream, unsigned int out_stream, + boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) { std::string default_item_type = "gr_complex"; std::string default_dump_file = "./data/signal_source.dat"; @@ -85,7 +86,7 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration std::cout << "LO frequency : " << freq_ << " Hz" << std::endl; std::cout << "sample rate: " << sample_rate_ << " Hz" << std::endl; - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { if (RF_channels_ == 1) { diff --git a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h index 050e50402..820ce1a14 100644 --- a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h +++ b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h @@ -35,9 +35,9 @@ #include "gnss_block_interface.h" #include -#include #include #include +#include #include class ConfigurationInterface; @@ -46,7 +46,7 @@ class Fmcomms2SignalSource : public GNSSBlockInterface { public: Fmcomms2SignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, + const std::string& role, unsigned int in_stream, unsigned int out_stream, boost::shared_ptr queue); virtual ~Fmcomms2SignalSource(); diff --git a/src/algorithms/signal_source/adapters/gen_signal_source.cc b/src/algorithms/signal_source/adapters/gen_signal_source.cc index 094541f41..69c1151c1 100644 --- a/src/algorithms/signal_source/adapters/gen_signal_source.cc +++ b/src/algorithms/signal_source/adapters/gen_signal_source.cc @@ -33,9 +33,9 @@ #include "gen_signal_source.h" #include #include +#include #include #include -#include #include #include diff --git a/src/algorithms/signal_source/adapters/gn3s_signal_source.cc b/src/algorithms/signal_source/adapters/gn3s_signal_source.cc index 8867fca8a..ebf984c18 100644 --- a/src/algorithms/signal_source/adapters/gn3s_signal_source.cc +++ b/src/algorithms/signal_source/adapters/gn3s_signal_source.cc @@ -30,9 +30,9 @@ #include "gn3s_signal_source.h" #include "configuration_interface.h" +#include #include #include -#include #include diff --git a/src/algorithms/signal_source/adapters/gn3s_signal_source.h b/src/algorithms/signal_source/adapters/gn3s_signal_source.h index 42fd6e581..8fb7637f5 100644 --- a/src/algorithms/signal_source/adapters/gn3s_signal_source.h +++ b/src/algorithms/signal_source/adapters/gn3s_signal_source.h @@ -33,9 +33,9 @@ #define GNSS_SDR_GN3S_SIGNAL_SOURCE_H_ #include "gnss_block_interface.h" +#include #include #include -#include #include diff --git a/src/algorithms/signal_source/adapters/labsat_signal_source.h b/src/algorithms/signal_source/adapters/labsat_signal_source.h index e31cd049a..8a36f8ad5 100644 --- a/src/algorithms/signal_source/adapters/labsat_signal_source.h +++ b/src/algorithms/signal_source/adapters/labsat_signal_source.h @@ -33,9 +33,9 @@ #define GNSS_SDR_LABSAT_SIGNAL_SOURCE_H_ #include "gnss_block_interface.h" +#include #include #include -#include #include class ConfigurationInterface; diff --git a/src/algorithms/signal_source/adapters/nsr_file_signal_source.h b/src/algorithms/signal_source/adapters/nsr_file_signal_source.h index d96b8645b..89bc32ac0 100644 --- a/src/algorithms/signal_source/adapters/nsr_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/nsr_file_signal_source.h @@ -37,8 +37,8 @@ #include "gnss_block_interface.h" #include "unpack_byte_2bit_samples.h" -#include #include +#include #include #include #include diff --git a/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc b/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc index 982847f1b..80f52a290 100644 --- a/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc +++ b/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc @@ -30,21 +30,22 @@ */ #include "osmosdr_signal_source.h" +#include "GPS_L1_CA.h" #include "configuration_interface.h" #include "gnss_sdr_valve.h" -#include "GPS_L1_CA.h" #include #include #include #include +#include using google::LogMessage; OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, - boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) + const std::string& role, unsigned int in_stream, unsigned int out_stream, + boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) { // DUMP PARAMETERS std::string empty = ""; @@ -66,11 +67,11 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, osmosdr_args_ = configuration->property(role + ".osmosdr_args", std::string()); antenna_ = configuration->property(role + ".antenna", empty); - if (item_type_.compare("short") == 0) + if (item_type_ == "short") { - item_size_ = sizeof(short); + item_size_ = sizeof(int16_t); } - else if (item_type_.compare("gr_complex") == 0) + else if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); // 1. Make the driver instance @@ -130,7 +131,7 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, else { LOG(WARNING) << item_type_ << " unrecognized item type. Using short."; - item_size_ = sizeof(short); + item_size_ = sizeof(int16_t); } if (samples_ != 0) @@ -157,9 +158,7 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, } -OsmosdrSignalSource::~OsmosdrSignalSource() -{ -} +OsmosdrSignalSource::~OsmosdrSignalSource() = default; void OsmosdrSignalSource::driver_instance() diff --git a/src/algorithms/signal_source/adapters/osmosdr_signal_source.h b/src/algorithms/signal_source/adapters/osmosdr_signal_source.h index ac50d53ca..15f38b2a3 100644 --- a/src/algorithms/signal_source/adapters/osmosdr_signal_source.h +++ b/src/algorithms/signal_source/adapters/osmosdr_signal_source.h @@ -35,8 +35,9 @@ #include "gnss_block_interface.h" #include -#include #include +#include +#include #include #include #include @@ -52,7 +53,7 @@ class OsmosdrSignalSource : public GNSSBlockInterface { public: OsmosdrSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, + const std::string& role, unsigned int in_stream, unsigned int out_stream, boost::shared_ptr queue); virtual ~OsmosdrSignalSource(); @@ -98,7 +99,7 @@ private: std::string item_type_; size_t item_size_; - long samples_; + int64_t samples_; bool dump_; std::string 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 748760ac6..5c4c71dd9 100644 --- a/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc +++ b/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc @@ -29,19 +29,20 @@ */ #include "plutosdr_signal_source.h" +#include "GPS_L1_CA.h" #include "configuration_interface.h" #include "gnss_sdr_valve.h" -#include "GPS_L1_CA.h" #include #include +#include using google::LogMessage; PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, - boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) + const std::string& role, unsigned int in_stream, unsigned int out_stream, + boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) { std::string default_item_type = "gr_complex"; std::string default_dump_file = "./data/signal_source.dat"; @@ -63,7 +64,7 @@ PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file); - if (item_type_.compare("gr_complex") != 0) + if (item_type_ != "gr_complex") { std::cout << "Configuration error: item_type must be gr_complex" << std::endl; LOG(FATAL) << "Configuration error: item_type must be gr_complex!"; @@ -105,9 +106,7 @@ PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration } -PlutosdrSignalSource::~PlutosdrSignalSource() -{ -} +PlutosdrSignalSource::~PlutosdrSignalSource() = default; void PlutosdrSignalSource::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/signal_source/adapters/plutosdr_signal_source.h b/src/algorithms/signal_source/adapters/plutosdr_signal_source.h index 9b27220a1..4cedb3787 100644 --- a/src/algorithms/signal_source/adapters/plutosdr_signal_source.h +++ b/src/algorithms/signal_source/adapters/plutosdr_signal_source.h @@ -34,9 +34,9 @@ #include "gnss_block_interface.h" #include -#include #include #include +#include #include @@ -48,7 +48,7 @@ class PlutosdrSignalSource : public GNSSBlockInterface { public: PlutosdrSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, + const std::string& role, unsigned int in_stream, unsigned int out_stream, boost::shared_ptr queue); virtual ~PlutosdrSignalSource(); 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 04f4c8011..b7f29a012 100644 --- a/src/algorithms/signal_source/adapters/raw_array_signal_source.cc +++ b/src/algorithms/signal_source/adapters/raw_array_signal_source.cc @@ -30,10 +30,10 @@ #include "raw_array_signal_source.h" #include "configuration_interface.h" -#include +#include #include #include -#include +#include using google::LogMessage; diff --git a/src/algorithms/signal_source/adapters/raw_array_signal_source.h b/src/algorithms/signal_source/adapters/raw_array_signal_source.h index a00be1821..9af4df30f 100644 --- a/src/algorithms/signal_source/adapters/raw_array_signal_source.h +++ b/src/algorithms/signal_source/adapters/raw_array_signal_source.h @@ -33,9 +33,9 @@ #define RAW_ARRAY_SIGNAL_SOURCE_H_ #include "gnss_block_interface.h" +#include #include #include -#include #include class ConfigurationInterface; 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 b0cbbf34b..5166840f5 100644 --- a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc +++ b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc @@ -31,9 +31,9 @@ */ #include "rtl_tcp_signal_source.h" +#include "GPS_L1_CA.h" #include "configuration_interface.h" #include "gnss_sdr_valve.h" -#include "GPS_L1_CA.h" #include #include #include 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 f50adeded..3a89bb088 100644 --- a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h +++ b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h @@ -32,13 +32,13 @@ #ifndef GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H #define GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H -#include "rtl_tcp_signal_source_c.h" #include "gnss_block_interface.h" +#include "rtl_tcp_signal_source_c.h" #include -#include -#include #include +#include #include +#include #include #include diff --git a/src/algorithms/signal_source/adapters/spir_file_signal_source.h b/src/algorithms/signal_source/adapters/spir_file_signal_source.h index 25ace35c8..659f5b19a 100644 --- a/src/algorithms/signal_source/adapters/spir_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/spir_file_signal_source.h @@ -34,8 +34,8 @@ #include "gnss_block_interface.h" #include "unpack_intspir_1bit_samples.h" -#include #include +#include #include #include #include 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 34e1229e2..71eb9c9df 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 @@ -35,12 +35,12 @@ #include "gnss_block_interface.h" #include "gnss_sdr_valve.h" #include "unpack_spir_gss6450_samples.h" -#include -#include -#include #include -#include #include +#include +#include +#include +#include #include #include #include diff --git a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h index 4de90a666..a66a87965 100644 --- a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h @@ -36,12 +36,12 @@ #include "gnss_block_interface.h" #include "unpack_byte_2bit_cpx_samples.h" -#include #include +#include +#include #include #include #include -#include #include #include diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h index 286b0e3ab..1e98d737b 100644 --- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h @@ -37,12 +37,12 @@ #include "gnss_block_interface.h" #include "unpack_2bit_samples.h" -#include #include +#include +#include #include #include #include -#include #include #include diff --git a/src/algorithms/signal_source/adapters/uhd_signal_source.cc b/src/algorithms/signal_source/adapters/uhd_signal_source.cc index 2af118173..54a353837 100644 --- a/src/algorithms/signal_source/adapters/uhd_signal_source.cc +++ b/src/algorithms/signal_source/adapters/uhd_signal_source.cc @@ -29,12 +29,12 @@ */ #include "uhd_signal_source.h" +#include "GPS_L1_CA.h" #include "configuration_interface.h" #include "gnss_sdr_valve.h" -#include "GPS_L1_CA.h" #include -#include #include +#include #include #include #include diff --git a/src/algorithms/signal_source/adapters/uhd_signal_source.h b/src/algorithms/signal_source/adapters/uhd_signal_source.h index a5a34b08b..68d6e6b76 100644 --- a/src/algorithms/signal_source/adapters/uhd_signal_source.h +++ b/src/algorithms/signal_source/adapters/uhd_signal_source.h @@ -33,10 +33,10 @@ #include "gnss_block_interface.h" #include -#include -#include #include +#include #include +#include #include #include 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 034d2b488..ba6a8ec3e 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 @@ -32,7 +32,8 @@ #include "gr_complex_ip_packet_source.h" #include - +#include +#include const int FIFO_SIZE = 1472000; @@ -76,15 +77,15 @@ typedef struct gr_udp_header gr_complex_ip_packet_source::sptr gr_complex_ip_packet_source::make(std::string src_device, - std::string origin_address, + const std::string &origin_address, int udp_port, int udp_packet_size, int n_baseband_channels, - std::string wire_sample_type, + const std::string &wire_sample_type, size_t item_size, bool IQ_swap_) { - return gnuradio::get_initial_sptr(new gr_complex_ip_packet_source(src_device, + return gnuradio::get_initial_sptr(new gr_complex_ip_packet_source(std::move(src_device), origin_address, udp_port, udp_packet_size, @@ -99,11 +100,11 @@ gr_complex_ip_packet_source::make(std::string src_device, * The private constructor */ gr_complex_ip_packet_source::gr_complex_ip_packet_source(std::string src_device, - __attribute__((unused)) std::string origin_address, + __attribute__((unused)) const std::string &origin_address, int udp_port, int udp_packet_size, int n_baseband_channels, - std::string wire_sample_type, + const std::string &wire_sample_type, size_t item_size, bool IQ_swap_) : gr::sync_block("gr_complex_ip_packet_source", @@ -113,12 +114,12 @@ gr_complex_ip_packet_source::gr_complex_ip_packet_source(std::string src_device, std::cout << "Start Ethernet packet capture\n"; d_n_baseband_channels = n_baseband_channels; - if (wire_sample_type.compare("cbyte") == 0) + if (wire_sample_type == "cbyte") { d_wire_sample_type = 1; d_bytes_per_sample = d_n_baseband_channels * 2; } - else if (wire_sample_type.compare("c4bits") == 0) + else if (wire_sample_type == "c4bits") { d_wire_sample_type = 2; d_bytes_per_sample = d_n_baseband_channels; @@ -129,7 +130,7 @@ gr_complex_ip_packet_source::gr_complex_ip_packet_source(std::string src_device, exit(0); } std::cout << "d_wire_sample_type:" << d_wire_sample_type << std::endl; - d_src_device = src_device; + d_src_device = std::move(src_device); d_udp_port = udp_port; d_udp_payload_size = udp_packet_size; d_fifo_full = false; @@ -142,8 +143,8 @@ gr_complex_ip_packet_source::gr_complex_ip_packet_source(std::string src_device, d_item_size = item_size; d_IQ_swap = IQ_swap_; d_sock_raw = 0; - d_pcap_thread = NULL; - descr = NULL; + d_pcap_thread = nullptr; + descr = nullptr; memset(reinterpret_cast(&si_me), 0, sizeof(si_me)); } @@ -171,7 +172,7 @@ bool gr_complex_ip_packet_source::start() bool gr_complex_ip_packet_source::stop() { std::cout << "gr_complex_ip_packet_source STOP\n"; - if (descr != NULL) + if (descr != nullptr) { pcap_breakloop(descr); d_pcap_thread->join(); @@ -187,7 +188,7 @@ bool gr_complex_ip_packet_source::open() boost::mutex::scoped_lock lock(d_mutex); // hold mutex for duration of this function // open device for reading descr = pcap_open_live(d_src_device.c_str(), 1500, 1, 1000, errbuf); - if (descr == NULL) + if (descr == nullptr) { std::cout << "Error opening Ethernet device " << d_src_device << std::endl; std::cout << "Fatal Error in pcap_open_live(): " << std::string(errbuf) << std::endl; @@ -220,7 +221,7 @@ bool gr_complex_ip_packet_source::open() gr_complex_ip_packet_source::~gr_complex_ip_packet_source() { - if (d_pcap_thread != NULL) + if (d_pcap_thread != nullptr) { delete d_pcap_thread; } @@ -232,7 +233,7 @@ gr_complex_ip_packet_source::~gr_complex_ip_packet_source() void gr_complex_ip_packet_source::static_pcap_callback(u_char *args, const struct pcap_pkthdr *pkthdr, const u_char *packet) { - gr_complex_ip_packet_source *bridge = reinterpret_cast(args); + auto *bridge = reinterpret_cast(args); bridge->pcap_callback(args, pkthdr, packet); } @@ -327,22 +328,22 @@ void gr_complex_ip_packet_source::demux_samples(gr_vector_void_star output_items switch (d_wire_sample_type) { case 1: // interleaved byte samples - for (long unsigned int i = 0; i < output_items.size(); i++) + for (auto &output_item : output_items) { real = fifo_buff[fifo_read_ptr++]; imag = fifo_buff[fifo_read_ptr++]; if (d_IQ_swap) { - static_cast(output_items[i])[n] = gr_complex(real, imag); + static_cast(output_item)[n] = gr_complex(real, imag); } else { - static_cast(output_items[i])[n] = gr_complex(imag, real); + static_cast(output_item)[n] = gr_complex(imag, real); } } break; case 2: // 4-bit samples - for (long unsigned int i = 0; i < output_items.size(); i++) + for (auto &output_item : output_items) { tmp_char2 = fifo_buff[fifo_read_ptr] & 0x0F; if (tmp_char2 >= 8) @@ -365,11 +366,11 @@ void gr_complex_ip_packet_source::demux_samples(gr_vector_void_star output_items } if (d_IQ_swap) { - static_cast(output_items[i])[n] = gr_complex(imag, real); + static_cast(output_item)[n] = gr_complex(imag, real); } else { - static_cast(output_items[i])[n] = gr_complex(real, imag); + static_cast(output_item)[n] = gr_complex(real, imag); } } break; @@ -390,7 +391,7 @@ int gr_complex_ip_packet_source::work(int noutput_items, boost::mutex::scoped_lock lock(d_mutex); // hold mutex for duration of this function if (fifo_items == 0) return 0; - if (output_items.size() > static_cast(d_n_baseband_channels)) + if (output_items.size() > static_cast(d_n_baseband_channels)) { std::cout << "Configuration error: more baseband channels connected than the available in the UDP source\n"; exit(0); @@ -439,7 +440,7 @@ int gr_complex_ip_packet_source::work(int noutput_items, // update fifo items fifo_items = fifo_items - bytes_requested; - for (long unsigned int n = 0; n < output_items.size(); n++) + for (uint64_t n = 0; n < output_items.size(); n++) { produce(static_cast(n), num_samples_readed); } diff --git a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h index 0661e0911..d008e1314 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h +++ b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h @@ -33,13 +33,13 @@ #ifndef INCLUDED_GR_COMPLEX_IP_PACKET_SOURCE_H #define INCLUDED_GR_COMPLEX_IP_PACKET_SOURCE_H -#include #include -#include +#include #include -#include #include +#include #include +#include #include #include @@ -84,19 +84,19 @@ private: public: typedef boost::shared_ptr sptr; static sptr make(std::string src_device, - std::string origin_address, + const std::string &origin_address, int udp_port, int udp_packet_size, int n_baseband_channels, - std::string wire_sample_type, + const std::string &wire_sample_type, size_t item_size, bool IQ_swap_); gr_complex_ip_packet_source(std::string src_device, - std::string origin_address, + const std::string &origin_address, int udp_port, int udp_packet_size, int n_baseband_channels, - std::string wire_sample_type, + const std::string &wire_sample_type, size_t item_size, bool IQ_swap_); ~gr_complex_ip_packet_source(); 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 1a70636cf..971908e3d 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 @@ -32,8 +32,8 @@ #include "rtl_tcp_signal_source_c.h" #include "rtl_tcp_commands.h" -#include #include +#include #include using google::LogMessage; diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h index 218d12166..62e7f2c07 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h @@ -39,11 +39,11 @@ #define GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_C_H #include "rtl_tcp_dongle_info.h" -#include -#include -#include #include +#include #include +#include +#include #include #include #include diff --git a/src/algorithms/signal_source/libs/ad9361_manager.cc b/src/algorithms/signal_source/libs/ad9361_manager.cc index 7c9c9f3c9..c1786ec08 100644 --- a/src/algorithms/signal_source/libs/ad9361_manager.cc +++ b/src/algorithms/signal_source/libs/ad9361_manager.cc @@ -75,10 +75,10 @@ bool get_ad9361_stream_dev(struct iio_context *ctx, enum iodev d, struct iio_dev { case TX: *dev = iio_context_find_device(ctx, "cf-ad9361-dds-core-lpc"); - return *dev != NULL; + return *dev != nullptr; case RX: *dev = iio_context_find_device(ctx, "cf-ad9361-lpc"); - return *dev != NULL; + return *dev != nullptr; default: return false; } @@ -100,7 +100,7 @@ bool get_ad9361_stream_ch(struct iio_context *ctx __attribute__((unused)), enum name << chid; *chn = iio_device_find_channel(dev, name.str().c_str(), d == TX); } - return *chn != NULL; + return *chn != nullptr; } @@ -115,14 +115,14 @@ bool get_phy_chan(struct iio_context *ctx, enum iodev d, int chid, struct iio_ch name << "voltage"; name << chid; *chn = iio_device_find_channel(get_ad9361_phy(ctx), name.str().c_str(), false); - return *chn != NULL; + return *chn != nullptr; break; case TX: name.str(""); name << "voltage"; name << chid; *chn = iio_device_find_channel(get_ad9361_phy(ctx), name.str().c_str(), true); - return *chn != NULL; + return *chn != nullptr; break; default: return false; @@ -138,10 +138,10 @@ bool get_lo_chan(struct iio_context *ctx, enum iodev d, struct iio_channel **chn // LO chan is always output, i.e. true case RX: *chn = iio_device_find_channel(get_ad9361_phy(ctx), "altvoltage0", true); - return *chn != NULL; + return *chn != nullptr; case TX: *chn = iio_device_find_channel(get_ad9361_phy(ctx), "altvoltage1", true); - return *chn != NULL; + return *chn != nullptr; default: return false; } @@ -151,7 +151,7 @@ bool get_lo_chan(struct iio_context *ctx, enum iodev d, struct iio_channel **chn /* applies streaming configuration through IIO */ bool cfg_ad9361_streaming_ch(struct iio_context *ctx, struct stream_cfg *cfg, enum iodev type, int chid) { - struct iio_channel *chn = NULL; + struct iio_channel *chn = nullptr; // Configure phy and lo channels //LOG(INFO)<<"* Acquiring AD9361 phy channel"<(d_map_base); + auto *aux = const_cast(d_map_base); if (munmap(static_cast(aux), PAGE_SIZE) == -1) { std::cout << "Failed to unmap memory uio" << std::endl; diff --git a/src/algorithms/signal_source/libs/fpga_switch.h b/src/algorithms/signal_source/libs/fpga_switch.h index f4a755775..2ab67dbef 100644 --- a/src/algorithms/signal_source/libs/fpga_switch.h +++ b/src/algorithms/signal_source/libs/fpga_switch.h @@ -44,13 +44,13 @@ class fpga_switch { public: - fpga_switch(std::string device_name); + fpga_switch(const std::string& device_name); ~fpga_switch(); void set_switch_position(int switch_position); private: int d_device_descriptor; // driver descriptor - volatile unsigned *d_map_base; // driver memory map + volatile unsigned* d_map_base; // driver memory map // private functions unsigned fpga_switch_test_register(unsigned writeval); diff --git a/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.cc index 300bb3100..be7dd59ce 100644 --- a/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.cc @@ -33,12 +33,12 @@ #include "galileo_e1b_telemetry_decoder.h" #include "configuration_interface.h" -#include "galileo_ephemeris.h" #include "galileo_almanac.h" +#include "galileo_ephemeris.h" #include "galileo_iono.h" #include "galileo_utc_model.h" -#include #include +#include using google::LogMessage; diff --git a/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.h index 1e921a2a7..c277725ce 100644 --- a/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.h +++ b/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.h @@ -35,9 +35,9 @@ #define GNSS_SDR_GALILEO_E1B_TELEMETRY_DECODER_H_ -#include "telemetry_decoder_interface.h" #include "galileo_telemetry_decoder_cc.h" #include "gnss_satellite.h" +#include "telemetry_decoder_interface.h" #include diff --git a/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.cc index 7f0b0c49e..715e5c1cb 100644 --- a/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.cc @@ -36,12 +36,12 @@ #include "galileo_e5a_telemetry_decoder.h" #include "configuration_interface.h" -#include "galileo_ephemeris.h" #include "galileo_almanac.h" +#include "galileo_ephemeris.h" #include "galileo_iono.h" #include "galileo_utc_model.h" -#include #include +#include using google::LogMessage; diff --git a/src/algorithms/telemetry_decoder/adapters/glonass_l1_ca_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/glonass_l1_ca_telemetry_decoder.cc index e01bb5552..c0d88314f 100644 --- a/src/algorithms/telemetry_decoder/adapters/glonass_l1_ca_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/glonass_l1_ca_telemetry_decoder.cc @@ -33,11 +33,11 @@ #include "glonass_l1_ca_telemetry_decoder.h" #include "configuration_interface.h" -#include "glonass_gnav_ephemeris.h" #include "glonass_gnav_almanac.h" +#include "glonass_gnav_ephemeris.h" #include "glonass_gnav_utc_model.h" -#include #include +#include using google::LogMessage; diff --git a/src/algorithms/telemetry_decoder/adapters/glonass_l1_ca_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/glonass_l1_ca_telemetry_decoder.h index 7823071f0..33bc3ecbd 100644 --- a/src/algorithms/telemetry_decoder/adapters/glonass_l1_ca_telemetry_decoder.h +++ b/src/algorithms/telemetry_decoder/adapters/glonass_l1_ca_telemetry_decoder.h @@ -34,8 +34,8 @@ #ifndef GNSS_SDR_GLONASS_L1_CA_TELEMETRY_DECODER_H_ #define GNSS_SDR_GLONASS_L1_CA_TELEMETRY_DECODER_H_ -#include "telemetry_decoder_interface.h" #include "glonass_l1_ca_telemetry_decoder_cc.h" +#include "telemetry_decoder_interface.h" #include class ConfigurationInterface; diff --git a/src/algorithms/telemetry_decoder/adapters/glonass_l2_ca_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/glonass_l2_ca_telemetry_decoder.cc index fb4d95bea..c96851552 100644 --- a/src/algorithms/telemetry_decoder/adapters/glonass_l2_ca_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/glonass_l2_ca_telemetry_decoder.cc @@ -32,11 +32,11 @@ #include "glonass_l2_ca_telemetry_decoder.h" #include "configuration_interface.h" -#include "glonass_gnav_ephemeris.h" #include "glonass_gnav_almanac.h" +#include "glonass_gnav_ephemeris.h" #include "glonass_gnav_utc_model.h" -#include #include +#include using google::LogMessage; diff --git a/src/algorithms/telemetry_decoder/adapters/glonass_l2_ca_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/glonass_l2_ca_telemetry_decoder.h index bd0f5d346..83c7c8c4e 100644 --- a/src/algorithms/telemetry_decoder/adapters/glonass_l2_ca_telemetry_decoder.h +++ b/src/algorithms/telemetry_decoder/adapters/glonass_l2_ca_telemetry_decoder.h @@ -33,8 +33,8 @@ #ifndef GNSS_SDR_GLONASS_L2_CA_TELEMETRY_DECODER_H_ #define GNSS_SDR_GLONASS_L2_CA_TELEMETRY_DECODER_H_ -#include "telemetry_decoder_interface.h" #include "glonass_l2_ca_telemetry_decoder_cc.h" +#include "telemetry_decoder_interface.h" #include class ConfigurationInterface; diff --git a/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc index 4075b6662..b7a4530b3 100644 --- a/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc @@ -32,12 +32,12 @@ #include "gps_l1_ca_telemetry_decoder.h" #include "configuration_interface.h" -#include "gps_ephemeris.h" #include "gps_almanac.h" +#include "gps_ephemeris.h" #include "gps_iono.h" #include "gps_utc_model.h" -#include #include +#include using google::LogMessage; diff --git a/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.cc index 5e99f3791..db451a045 100644 --- a/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.cc @@ -32,12 +32,12 @@ #include "gps_l2c_telemetry_decoder.h" #include "configuration_interface.h" -#include "gps_cnav_ephemeris.h" #include "gps_almanac.h" +#include "gps_cnav_ephemeris.h" #include "gps_cnav_iono.h" #include "gps_cnav_utc_model.h" -#include #include +#include using google::LogMessage; diff --git a/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.cc index 17a09550f..68fa96d26 100644 --- a/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.cc @@ -32,8 +32,8 @@ #include "gps_l5_telemetry_decoder.h" #include "configuration_interface.h" -#include #include +#include using google::LogMessage; diff --git a/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.h index d9a200fd6..c895b3b48 100644 --- a/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.h +++ b/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.h @@ -34,9 +34,9 @@ #define GNSS_SDR_GPS_L5_TELEMETRY_DECODER_H_ -#include "telemetry_decoder_interface.h" -#include "gps_l5_telemetry_decoder_cc.h" #include "gnss_satellite.h" +#include "gps_l5_telemetry_decoder_cc.h" +#include "telemetry_decoder_interface.h" #include diff --git a/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.cc index 38c731f98..2083509e1 100644 --- a/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.cc @@ -34,8 +34,8 @@ #include "configuration_interface.h" #include "sbas_ephemeris.h" #include "sbas_l1_telemetry_decoder_cc.h" -#include #include +#include using google::LogMessage; diff --git a/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.h index 1616f4ea0..c7ab0043b 100644 --- a/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.h +++ b/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.h @@ -34,8 +34,8 @@ #define GNSS_SDR_SBAS_L1_TELEMETRY_DECODER_H_ -#include "telemetry_decoder_interface.h" #include "sbas_l1_telemetry_decoder_cc.h" +#include "telemetry_decoder_interface.h" #include diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc index 183cf5a88..3a265a6d5 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc @@ -35,8 +35,8 @@ #include "display.h" #include "gnss_synchro.h" #include -#include #include +#include #include #include @@ -60,7 +60,7 @@ void galileo_telemetry_decoder_cc::viterbi_decoder(double *page_part_symbols, in } -void galileo_telemetry_decoder_cc::deinterleaver(int32_t rows, int32_t cols, double *in, double *out) +void galileo_telemetry_decoder_cc::deinterleaver(int32_t rows, int32_t cols, const double *in, double *out) { for (int32_t r = 0; r < rows; r++) { diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.h index a78ee4d6b..c06df6010 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.h @@ -35,11 +35,11 @@ #include "Galileo_E1.h" #include "Galileo_E5a.h" -#include "galileo_navigation_message.h" -#include "galileo_fnav_message.h" -#include "galileo_ephemeris.h" #include "galileo_almanac_helper.h" +#include "galileo_ephemeris.h" +#include "galileo_fnav_message.h" #include "galileo_iono.h" +#include "galileo_navigation_message.h" #include "galileo_utc_model.h" #include "gnss_satellite.h" #include "gnss_synchro.h" @@ -78,7 +78,7 @@ private: void viterbi_decoder(double *page_part_symbols, int32_t *page_part_bits); - void deinterleaver(int32_t rows, int32_t cols, double *in, double *out); + void deinterleaver(int32_t rows, int32_t cols, const double *in, double *out); void decode_INAV_word(double *symbols, int32_t frame_length); void decode_FNAV_word(double *page_symbols, int32_t frame_length); diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc index d1ba8137a..7ead9f53b 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc @@ -33,8 +33,8 @@ #include "glonass_l1_ca_telemetry_decoder_cc.h" #include -#include #include +#include #define CRC_ERROR_LIMIT 6 @@ -124,7 +124,7 @@ glonass_l1_ca_telemetry_decoder_cc::~glonass_l1_ca_telemetry_decoder_cc() } -void glonass_l1_ca_telemetry_decoder_cc::decode_string(double *frame_symbols, int32_t frame_length) +void glonass_l1_ca_telemetry_decoder_cc::decode_string(const double *frame_symbols, int32_t frame_length) { double chip_acc = 0.0; int32_t chip_acc_counter = 0; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.h index 72fd730d2..1bdde14da 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.h @@ -34,13 +34,13 @@ #define GNSS_SDR_GLONASS_L1_CA_TELEMETRY_DECODER_CC_H -#include "glonass_gnav_navigation_message.h" -#include "glonass_gnav_ephemeris.h" +#include "GLONASS_L1_L2_CA.h" #include "glonass_gnav_almanac.h" +#include "glonass_gnav_ephemeris.h" +#include "glonass_gnav_navigation_message.h" #include "glonass_gnav_utc_model.h" #include "gnss_satellite.h" #include "gnss_synchro.h" -#include "GLONASS_L1_L2_CA.h" #include #include #include @@ -76,7 +76,7 @@ private: glonass_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); glonass_l1_ca_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); - void decode_string(double *symbols, int32_t frame_length); + void decode_string(const double *symbols, int32_t frame_length); //!< Help with coherent tracking double d_preamble_time_samples; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc index 7384486d8..b250fb912 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc @@ -124,7 +124,7 @@ glonass_l2_ca_telemetry_decoder_cc::~glonass_l2_ca_telemetry_decoder_cc() } -void glonass_l2_ca_telemetry_decoder_cc::decode_string(double *frame_symbols, int32_t frame_length) +void glonass_l2_ca_telemetry_decoder_cc::decode_string(const double *frame_symbols, int32_t frame_length) { double chip_acc = 0.0; int32_t chip_acc_counter = 0; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.h index e30c6326b..8b1a25ee9 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.h @@ -34,9 +34,9 @@ #include "GLONASS_L1_L2_CA.h" -#include "glonass_gnav_navigation_message.h" -#include "glonass_gnav_ephemeris.h" #include "glonass_gnav_almanac.h" +#include "glonass_gnav_ephemeris.h" +#include "glonass_gnav_navigation_message.h" #include "glonass_gnav_utc_model.h" #include "gnss_satellite.h" #include "gnss_synchro.h" @@ -74,7 +74,7 @@ private: glonass_l2_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); glonass_l2_ca_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); - void decode_string(double *symbols, int32_t frame_length); + void decode_string(const double *symbols, int32_t frame_length); //!< Help with coherent tracking double d_preamble_time_samples; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc index 7dd78171c..33522ddc8 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc @@ -321,7 +321,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__ current_symbol = in[0][0]; // record the oldest subframe symbol before inserting a new symbol into the circular buffer - if (d_current_subframe_symbol < GPS_SUBFRAME_MS and d_symbol_history.size() > 0) + if (d_current_subframe_symbol < GPS_SUBFRAME_MS and !d_symbol_history.empty()) { d_subframe_symbols[d_current_subframe_symbol] = d_symbol_history[0].Prompt_I; d_current_subframe_symbol++; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h index 5d7728821..c1b55cd9f 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h @@ -32,13 +32,13 @@ #define GNSS_SDR_GPS_L1_CA_TELEMETRY_DECODER_CC_H #include "GPS_L1_CA.h" -#include "gps_navigation_message.h" #include "gnss_satellite.h" #include "gnss_synchro.h" +#include "gps_navigation_message.h" +#include #include #include #include -#include class gps_l1_ca_telemetry_decoder_cc; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc index 6bef581a4..49e5704d6 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc @@ -31,8 +31,8 @@ #include "gps_l2c_telemetry_decoder_cc.h" -#include "gnss_synchro.h" #include "display.h" +#include "gnss_synchro.h" #include #include #include diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.h index 97817c24f..8b5922575 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.h @@ -33,9 +33,9 @@ #include "gnss_satellite.h" -#include "gps_cnav_navigation_message.h" #include "gps_cnav_ephemeris.h" #include "gps_cnav_iono.h" +#include "gps_cnav_navigation_message.h" #include #include // for copy #include @@ -48,9 +48,9 @@ extern "C" { +#include "bits.h" #include "cnav_msg.h" #include "edc.h" -#include "bits.h" } #include "GPS_L2C.h" diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.h index 4ca206e55..eb57696bc 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.h @@ -44,9 +44,9 @@ extern "C" { +#include "bits.h" #include "cnav_msg.h" #include "edc.h" -#include "bits.h" } #include "GPS_L5.h" diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc index acb071f51..705df32a4 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc @@ -125,7 +125,7 @@ void sbas_l1_telemetry_decoder_cc::sample_aligner::reset() /* * samples length must be a multiple of two */ -bool sbas_l1_telemetry_decoder_cc::sample_aligner::get_symbols(const std::vector& samples, std::vector &symbols) +bool sbas_l1_telemetry_decoder_cc::sample_aligner::get_symbols(const std::vector &samples, std::vector &symbols) { double smpls[3] = {}; double corr_diff; @@ -213,7 +213,7 @@ void sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::reset() } -bool sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::get_bits(const std::vector& symbols, std::vector &bits) +bool sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::get_bits(const std::vector &symbols, std::vector &bits) { const int32_t traceback_depth = 5 * d_KK; int32_t nbits_requested = symbols.size() / d_symbols_per_bit; @@ -258,7 +258,7 @@ void sbas_l1_telemetry_decoder_cc::frame_detector::reset() } -void sbas_l1_telemetry_decoder_cc::frame_detector::get_frame_candidates(const std::vector& bits, std::vector>> &msg_candidates) +void sbas_l1_telemetry_decoder_cc::frame_detector::get_frame_candidates(const std::vector &bits, std::vector>> &msg_candidates) { std::stringstream ss; uint32_t sbas_msg_length = 250; @@ -299,7 +299,7 @@ void sbas_l1_telemetry_decoder_cc::frame_detector::get_frame_candidates(const st if (inv_preamble_detected) { // invert bits - for (int & candidate_bit_it : candidate) + for (int &candidate_bit_it : candidate) candidate_bit_it = candidate_bit_it == 0 ? 1 : 0; } msg_candidates.emplace_back(relative_preamble_start, candidate); @@ -323,7 +323,7 @@ void sbas_l1_telemetry_decoder_cc::crc_verifier::reset() } -void sbas_l1_telemetry_decoder_cc::crc_verifier::get_valid_frames(const std::vector& msg_candidates, std::vector &valid_msgs) +void sbas_l1_telemetry_decoder_cc::crc_verifier::get_valid_frames(const std::vector &msg_candidates, std::vector &valid_msgs) { std::stringstream ss; VLOG(FLOW) << "get_valid_frames(): " @@ -361,7 +361,7 @@ void sbas_l1_telemetry_decoder_cc::crc_verifier::get_valid_frames(const std::vec } -void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_back_and_convert_to_bytes(const std::vector& msg_candidate, std::vector &bytes) +void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_back_and_convert_to_bytes(const std::vector &msg_candidate, std::vector &bytes) { std::stringstream ss; const size_t bits_per_byte = 8; @@ -388,7 +388,7 @@ void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_back_and_convert_to_by } -void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_front_and_convert_to_bytes(const std::vector& msg_candidate, std::vector &bytes) +void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_front_and_convert_to_bytes(const std::vector &msg_candidate, std::vector &bytes) { std::stringstream ss; const size_t bits_per_byte = 8; @@ -460,7 +460,7 @@ int sbas_l1_telemetry_decoder_cc::general_work(int noutput_items __attribute__(( // compute message sample stamp // and fill messages in SBAS raw message objects //std::vector sbas_raw_msgs; - for (const auto & valid_msg : valid_msgs) + for (const auto &valid_msg : valid_msgs) { int32_t message_sample_offset = (sample_alignment ? 0 : -1) + d_samples_per_symbol * (symbol_alignment ? -1 : 0) + d_samples_per_symbol * d_symbols_per_bit * valid_msg.first; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.h index 9bf2f05f3..5dcf4f27b 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.h @@ -104,7 +104,7 @@ private: * samples length must be a multiple of two * for block operation */ - bool get_symbols(const std::vector& samples, std::vector &symbols); + bool get_symbols(const std::vector &samples, std::vector &symbols); private: int32_t d_n_smpls_in_history; @@ -122,7 +122,7 @@ private: symbol_aligner_and_decoder(); ~symbol_aligner_and_decoder(); void reset(); - bool get_bits(const std::vector& symbols, std::vector &bits); + bool get_bits(const std::vector &symbols, std::vector &bits); private: int32_t d_KK; @@ -137,7 +137,7 @@ private: { public: void reset(); - void get_frame_candidates(const std::vector& bits, std::vector>> &msg_candidates); + void get_frame_candidates(const std::vector &bits, std::vector>> &msg_candidates); private: std::deque d_buffer; @@ -149,13 +149,13 @@ private: { public: void reset(); - void get_valid_frames(const std::vector& msg_candidates, std::vector &valid_msgs); + void get_valid_frames(const std::vector &msg_candidates, std::vector &valid_msgs); private: typedef boost::crc_optimal<24, 0x1864CFBu, 0x0, 0x0, false, false> crc_24_q_type; crc_24_q_type d_checksum_agent; - void zerropad_front_and_convert_to_bytes(const std::vector& msg_candidate, std::vector &bytes); - void zerropad_back_and_convert_to_bytes(const std::vector& msg_candidate, std::vector &bytes); + void zerropad_front_and_convert_to_bytes(const std::vector &msg_candidate, std::vector &bytes); + void zerropad_back_and_convert_to_bytes(const std::vector &msg_candidate, std::vector &bytes); } d_crc_verifier; }; diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/cnav_msg.h b/src/algorithms/telemetry_decoder/libs/libswiftcnav/cnav_msg.h index 23e29d958..f402675c5 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/cnav_msg.h +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/cnav_msg.h @@ -34,13 +34,11 @@ #define LIBSWIFTNAV_CNAV_MSG_H #include "fec.h" - +#include "swift_common.h" +#include #include #include #include -#include - -#include "swift_common.h" /** \addtogroup GPS_L2 * \{ */ diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/swift_common.h b/src/algorithms/telemetry_decoder/libs/libswiftcnav/swift_common.h index 78d99ca0f..b4a3a6fae 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/swift_common.h +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/swift_common.h @@ -44,9 +44,9 @@ #define MAX(x, y) (((x) > (y)) ? (x) : (y)) #define CLAMP_DIFF(a, b) (MAX((a), (b)) - (b)) -#include -#include #include +#include +#include #ifndef COMMON_INT_TYPES #define COMMON_INT_TYPES diff --git a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc index ef71c4537..957efa9a6 100644 --- a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc +++ b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc @@ -354,7 +354,7 @@ int Viterbi_Decoder::do_tb_and_decode(int traceback_length, int requested_decodi nn The length of the received vector This function is used by siso() */ -float Viterbi_Decoder::gamma(float rec_array[], int symbol, int nn) +float Viterbi_Decoder::gamma(const float rec_array[], int symbol, int nn) { float rm = 0; int i; diff --git a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h index 29d656bee..c2ae1327a 100644 --- a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h +++ b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h @@ -116,7 +116,7 @@ private: int do_tb_and_decode(int traceback_length, int requested_decoding_length, int state, int bits[], float& indicator_metric); // branch metric function - float gamma(float rec_array[], int symbol, int nn); + float gamma(const float rec_array[], int symbol, int nn); // trellis generation void nsc_transit(int output_p[], int trans_p[], int input, const int g[], int KK, int nn); 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 2853dc995..3bb059dc2 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 @@ -34,12 +34,12 @@ * ------------------------------------------------------------------------- */ -#include "dll_pll_conf.h" #include "galileo_e1_dll_pll_veml_tracking.h" -#include "configuration_interface.h" #include "Galileo_E1.h" -#include "gnss_sdr_flags.h" +#include "configuration_interface.h" #include "display.h" +#include "dll_pll_conf.h" +#include "gnss_sdr_flags.h" #include diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.h b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.h index 04014d31b..035daf48e 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.h +++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.h @@ -37,8 +37,8 @@ #ifndef GNSS_SDR_GALILEO_E1_DLL_PLL_VEML_TRACKING_H_ #define GNSS_SDR_GALILEO_E1_DLL_PLL_VEML_TRACKING_H_ -#include "tracking_interface.h" #include "dll_pll_veml_tracking.h" +#include "tracking_interface.h" #include 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 179e19f3c..31d2cbfff 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 @@ -35,11 +35,11 @@ */ #include "galileo_e1_dll_pll_veml_tracking_fpga.h" -#include "configuration_interface.h" #include "Galileo_E1.h" +#include "configuration_interface.h" +#include "display.h" #include "galileo_e1_signal_processing.h" #include "gnss_sdr_flags.h" -#include "display.h" #include //#define NUM_PRNs_GALILEO_E1 50 @@ -51,7 +51,7 @@ void GalileoE1DllPllVemlTrackingFpga::stop_tracking() } GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( - ConfigurationInterface* configuration, std::string role, + ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { //dllpllconf_t trk_param; diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.h b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.h index 55d8127ee..794aa22d4 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.h +++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.h @@ -37,8 +37,8 @@ #ifndef GNSS_SDR_GALILEO_E1_DLL_PLL_VEML_TRACKING_FPGA_H_ #define GNSS_SDR_GALILEO_E1_DLL_PLL_VEML_TRACKING_FPGA_H_ -#include "tracking_interface.h" #include "dll_pll_veml_tracking_fpga.h" +#include "tracking_interface.h" #include @@ -52,7 +52,7 @@ class GalileoE1DllPllVemlTrackingFpga : public TrackingInterface { public: GalileoE1DllPllVemlTrackingFpga(ConfigurationInterface* configuration, - std::string role, + const std::string& role, unsigned int in_streams, unsigned int out_streams); 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 eac7a8edf..70fdd98a2 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc @@ -36,12 +36,11 @@ */ #include "galileo_e1_tcp_connector_tracking.h" -#include - -#include #include "Galileo_E1.h" #include "configuration_interface.h" #include "gnss_sdr_flags.h" +#include +#include using google::LogMessage; diff --git a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.h b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.h index 01d62b60b..ff68056f7 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.h +++ b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.h @@ -39,9 +39,9 @@ #ifndef GNSS_SDR_GALILEO_E1_TCP_CONNECTOR_TRACKING_H_ #define GNSS_SDR_GALILEO_E1_TCP_CONNECTOR_TRACKING_H_ -#include -#include "tracking_interface.h" #include "galileo_e1_tcp_connector_tracking_cc.h" +#include "tracking_interface.h" +#include class ConfigurationInterface; 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 7bc826568..b0e0a0730 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc @@ -35,12 +35,12 @@ * * ------------------------------------------------------------------------- */ -#include "dll_pll_conf.h" #include "galileo_e5a_dll_pll_tracking.h" -#include "configuration_interface.h" #include "Galileo_E5a.h" -#include "gnss_sdr_flags.h" +#include "configuration_interface.h" #include "display.h" +#include "dll_pll_conf.h" +#include "gnss_sdr_flags.h" #include using google::LogMessage; diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.h b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.h index a91b8b556..1aefcf2cf 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.h @@ -39,8 +39,8 @@ #ifndef GNSS_SDR_GALILEO_E5A_DLL_PLL_TRACKING_H_ #define GNSS_SDR_GALILEO_E5A_DLL_PLL_TRACKING_H_ -#include "tracking_interface.h" #include "dll_pll_veml_tracking.h" +#include "tracking_interface.h" #include class ConfigurationInterface; 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 d4fa38d2f..1a5e1cf09 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,11 +37,11 @@ */ #include "galileo_e5a_dll_pll_tracking_fpga.h" -#include "configuration_interface.h" #include "Galileo_E5a.h" +#include "configuration_interface.h" +#include "display.h" #include "galileo_e5_signal_processing.h" #include "gnss_sdr_flags.h" -#include "display.h" #include using google::LogMessage; @@ -51,7 +51,7 @@ void GalileoE5aDllPllTrackingFpga::stop_tracking() } GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( - ConfigurationInterface *configuration, std::string role, + ConfigurationInterface *configuration, const std::string &role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { //printf("creating the E5A tracking"); @@ -136,9 +136,9 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( //################# PRE-COMPUTE ALL THE CODES ################# unsigned int code_samples_per_chip = 1; - unsigned int code_length_chips = static_cast(Galileo_E5a_CODE_LENGTH_CHIPS); + auto code_length_chips = static_cast(Galileo_E5a_CODE_LENGTH_CHIPS); - gr_complex *aux_code = static_cast(volk_gnsssdr_malloc(sizeof(gr_complex) * code_length_chips * code_samples_per_chip, volk_gnsssdr_get_alignment())); + auto *aux_code = static_cast(volk_gnsssdr_malloc(sizeof(gr_complex) * code_length_chips * code_samples_per_chip, volk_gnsssdr_get_alignment())); float *tracking_code; float *data_code; diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.h b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.h index 45325d458..49c52de5e 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.h +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.h @@ -39,8 +39,8 @@ #ifndef GNSS_SDR_GALILEO_E5A_DLL_PLL_TRACKING_FPGA_H_ #define GNSS_SDR_GALILEO_E5A_DLL_PLL_TRACKING_FPGA_H_ -#include "tracking_interface.h" #include "dll_pll_veml_tracking_fpga.h" +#include "tracking_interface.h" #include class ConfigurationInterface; @@ -52,7 +52,7 @@ class GalileoE5aDllPllTrackingFpga : public TrackingInterface { public: GalileoE5aDllPllTrackingFpga(ConfigurationInterface* configuration, - std::string role, + const std::string& role, unsigned int in_streams, unsigned int out_streams); 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 d72de6894..30101a0ff 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 @@ -38,9 +38,9 @@ */ #include "glonass_l1_ca_dll_pll_c_aid_tracking.h" +#include "GLONASS_L1_L2_CA.h" #include "configuration_interface.h" #include "gnss_sdr_flags.h" -#include "GLONASS_L1_L2_CA.h" #include diff --git a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.h b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.h index aa9ab78d5..d50003964 100644 --- a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.h +++ b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.h @@ -40,9 +40,9 @@ #ifndef GNSS_SDR_GLONASS_L1_CA_DLL_PLL_C_AID_TRACKING_H_ #define GNSS_SDR_GLONASS_L1_CA_DLL_PLL_C_AID_TRACKING_H_ -#include "tracking_interface.h" #include "glonass_l1_ca_dll_pll_c_aid_tracking_cc.h" #include "glonass_l1_ca_dll_pll_c_aid_tracking_sc.h" +#include "tracking_interface.h" #include class ConfigurationInterface; 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 d5d530761..a96165d47 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 @@ -37,9 +37,9 @@ */ #include "glonass_l1_ca_dll_pll_tracking.h" +#include "GLONASS_L1_L2_CA.h" #include "configuration_interface.h" #include "gnss_sdr_flags.h" -#include "GLONASS_L1_L2_CA.h" #include diff --git a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.h b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.h index 57c4db85e..cd8482113 100644 --- a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.h @@ -39,8 +39,8 @@ #ifndef GNSS_SDR_GLONASS_L1_CA_DLL_PLL_TRACKING_H_ #define GNSS_SDR_GLONASS_L1_CA_DLL_PLL_TRACKING_H_ -#include "tracking_interface.h" #include "glonass_l1_ca_dll_pll_tracking_cc.h" +#include "tracking_interface.h" #include class ConfigurationInterface; 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 346f89778..4ddff7163 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 @@ -36,8 +36,8 @@ */ #include "glonass_l2_ca_dll_pll_c_aid_tracking.h" -#include "configuration_interface.h" #include "GLONASS_L1_L2_CA.h" +#include "configuration_interface.h" #include "gnss_sdr_flags.h" #include diff --git a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.h b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.h index a35fec269..b5659c527 100644 --- a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.h +++ b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.h @@ -38,9 +38,9 @@ #ifndef GNSS_SDR_GLONASS_L2_CA_DLL_PLL_C_AID_TRACKING_H_ #define GNSS_SDR_GLONASS_L2_CA_DLL_PLL_C_AID_TRACKING_H_ -#include "tracking_interface.h" #include "glonass_l2_ca_dll_pll_c_aid_tracking_cc.h" #include "glonass_l2_ca_dll_pll_c_aid_tracking_sc.h" +#include "tracking_interface.h" #include class ConfigurationInterface; 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 16b223000..3c39300af 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 @@ -35,8 +35,8 @@ */ #include "glonass_l2_ca_dll_pll_tracking.h" -#include "configuration_interface.h" #include "GLONASS_L1_L2_CA.h" +#include "configuration_interface.h" #include "gnss_sdr_flags.h" #include diff --git a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.h b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.h index 7cf16c5ef..1ca41a94b 100644 --- a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.h @@ -38,8 +38,8 @@ #ifndef GNSS_SDR_GLONASS_L2_CA_DLL_PLL_TRACKING_H_ #define GNSS_SDR_GLONASS_L2_CA_DLL_PLL_TRACKING_H_ -#include "tracking_interface.h" #include "glonass_l2_ca_dll_pll_tracking_cc.h" +#include "tracking_interface.h" #include class ConfigurationInterface; diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.h b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.h index 04793a841..a1c54aa46 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.h @@ -38,9 +38,9 @@ #ifndef GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_H_ #define GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_H_ -#include "tracking_interface.h" #include "gps_l1_ca_dll_pll_c_aid_tracking_cc.h" #include "gps_l1_ca_dll_pll_c_aid_tracking_sc.h" +#include "tracking_interface.h" #include 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 df14b07c2..394574667 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 @@ -35,12 +35,12 @@ * ------------------------------------------------------------------------- */ -#include "dll_pll_conf.h" #include "gps_l1_ca_dll_pll_tracking.h" -#include "configuration_interface.h" #include "GPS_L1_CA.h" -#include "gnss_sdr_flags.h" +#include "configuration_interface.h" #include "display.h" +#include "dll_pll_conf.h" +#include "gnss_sdr_flags.h" #include using google::LogMessage; diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.h b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.h index f3d62a2e5..288de9ae0 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.h @@ -38,8 +38,8 @@ #ifndef GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_H_ #define GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_H_ -#include "tracking_interface.h" #include "dll_pll_veml_tracking.h" +#include "tracking_interface.h" #include class ConfigurationInterface; 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 37f946e9f..e81e7a905 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 @@ -36,13 +36,13 @@ * ------------------------------------------------------------------------- */ -#include -#include "gps_sdr_signal_processing.h" #include "gps_l1_ca_dll_pll_tracking_fpga.h" -#include "configuration_interface.h" #include "GPS_L1_CA.h" -#include "gnss_sdr_flags.h" +#include "configuration_interface.h" #include "display.h" +#include "gnss_sdr_flags.h" +#include "gps_sdr_signal_processing.h" +#include #define NUM_PRNs 32 @@ -53,7 +53,7 @@ void GpsL1CaDllPllTrackingFpga::stop_tracking() } GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga( - ConfigurationInterface* configuration, std::string role, + ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga(); diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.h b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.h index 80b998246..5cc38f230 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.h +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_fpga.h @@ -39,9 +39,9 @@ #ifndef GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_FPGA_H_ #define GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_FPGA_H_ -#include -#include "tracking_interface.h" #include "dll_pll_veml_tracking_fpga.h" +#include "tracking_interface.h" +#include class ConfigurationInterface; @@ -53,7 +53,7 @@ class GpsL1CaDllPllTrackingFpga : public TrackingInterface { public: GpsL1CaDllPllTrackingFpga(ConfigurationInterface* configuration, - std::string role, + const std::string& role, unsigned int in_streams, unsigned int out_streams); 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 c82f228b5..848cd2bd6 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 @@ -36,10 +36,10 @@ #include "gps_l1_ca_dll_pll_tracking_gpu.h" -#include #include "GPS_L1_CA.h" #include "configuration_interface.h" #include "gnss_sdr_flags.h" +#include using google::LogMessage; diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.h b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.h index 794152bb8..1a5c381ab 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.h +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.h @@ -37,9 +37,9 @@ #ifndef GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_GPU_H_ #define GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_GPU_H_ -#include -#include "tracking_interface.h" #include "gps_l1_ca_dll_pll_tracking_gpu_cc.h" +#include "tracking_interface.h" +#include class ConfigurationInterface; 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 37b4d817b..e0960758f 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc @@ -39,9 +39,9 @@ #include "gps_l1_ca_kf_tracking.h" -#include "gnss_sdr_flags.h" #include "GPS_L1_CA.h" #include "configuration_interface.h" +#include "gnss_sdr_flags.h" #include 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 db4370b74..3000ac8ae 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 @@ -36,11 +36,10 @@ */ #include "gps_l1_ca_tcp_connector_tracking.h" -#include - -#include #include "GPS_L1_CA.h" #include "configuration_interface.h" +#include +#include using google::LogMessage; diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.h b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.h index d81f1af9e..1e910839e 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.h @@ -38,9 +38,9 @@ #ifndef GNSS_SDR_GPS_L1_CA_TCP_CONNECTOR_TRACKING_H_ #define GNSS_SDR_GPS_L1_CA_TCP_CONNECTOR_TRACKING_H_ -#include -#include "tracking_interface.h" #include "gps_l1_ca_tcp_connector_tracking_cc.h" +#include "tracking_interface.h" +#include class ConfigurationInterface; 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 08fecebc4..332b7b9c2 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 @@ -34,12 +34,12 @@ * ------------------------------------------------------------------------- */ -#include "dll_pll_conf.h" #include "gps_l2_m_dll_pll_tracking.h" -#include "configuration_interface.h" #include "GPS_L2C.h" -#include "gnss_sdr_flags.h" +#include "configuration_interface.h" #include "display.h" +#include "dll_pll_conf.h" +#include "gnss_sdr_flags.h" #include diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.h b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.h index 854fd61e7..20618a4cf 100644 --- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.h @@ -38,8 +38,8 @@ #ifndef GNSS_SDR_gps_l2_m_dll_pll_tracking_H_ #define GNSS_SDR_gps_l2_m_dll_pll_tracking_H_ -#include "tracking_interface.h" #include "dll_pll_veml_tracking.h" +#include "tracking_interface.h" #include class ConfigurationInterface; 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 f10d876dc..c133b1ea1 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 @@ -36,11 +36,11 @@ #include "gps_l2_m_dll_pll_tracking_fpga.h" -#include "configuration_interface.h" #include "GPS_L2C.h" -#include "gps_l2c_signal.h" -#include "gnss_sdr_flags.h" +#include "configuration_interface.h" #include "display.h" +#include "gnss_sdr_flags.h" +#include "gps_l2c_signal.h" #include #define NUM_PRNs 32 @@ -52,7 +52,7 @@ void GpsL2MDllPllTrackingFpga::stop_tracking() } GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga( - ConfigurationInterface* configuration, std::string role, + ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { //dllpllconf_t trk_param; @@ -125,7 +125,7 @@ GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga( //d_tracking_code = static_cast(volk_gnsssdr_malloc(2 * static_cast(GPS_L2_M_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment())); d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L2_M_CODE_LENGTH_CHIPS) * NUM_PRNs * sizeof(int), volk_gnsssdr_get_alignment())); - float* ca_codes_f = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L2_M_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment())); + auto* ca_codes_f = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L2_M_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment())); //################# PRE-COMPUTE ALL THE CODES ################# d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(GPS_L2_M_CODE_LENGTH_CHIPS * NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment())); @@ -167,9 +167,7 @@ GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga( } -GpsL2MDllPllTrackingFpga::~GpsL2MDllPllTrackingFpga() -{ -} +GpsL2MDllPllTrackingFpga::~GpsL2MDllPllTrackingFpga() = default; void GpsL2MDllPllTrackingFpga::start_tracking() diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.h b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.h index 2cde19cd7..7d36d1e74 100644 --- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.h +++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking_fpga.h @@ -52,7 +52,7 @@ class GpsL2MDllPllTrackingFpga : public TrackingInterface { public: GpsL2MDllPllTrackingFpga(ConfigurationInterface* configuration, - std::string role, + const std::string& role, unsigned int in_streams, unsigned int out_streams); 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 22bcb5c25..c471f98b8 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc @@ -34,12 +34,12 @@ * ------------------------------------------------------------------------- */ -#include "dll_pll_conf.h" #include "gps_l5_dll_pll_tracking.h" -#include "configuration_interface.h" #include "GPS_L5.h" -#include "gnss_sdr_flags.h" +#include "configuration_interface.h" #include "display.h" +#include "dll_pll_conf.h" +#include "gnss_sdr_flags.h" #include diff --git a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.h b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.h index 83ce4865d..763df8bb0 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.h @@ -37,8 +37,8 @@ #ifndef GNSS_SDR_GPS_L5_DLL_PLL_TRACKING_H_ #define GNSS_SDR_GPS_L5_DLL_PLL_TRACKING_H_ -#include "tracking_interface.h" #include "dll_pll_veml_tracking.h" +#include "tracking_interface.h" #include class ConfigurationInterface; 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 bbc5c17bb..effa0c5b7 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 @@ -36,11 +36,11 @@ #include "gps_l5_dll_pll_tracking_fpga.h" -#include "configuration_interface.h" #include "GPS_L5.h" -#include "gps_l5_signal.h" -#include "gnss_sdr_flags.h" +#include "configuration_interface.h" #include "display.h" +#include "gnss_sdr_flags.h" +#include "gps_l5_signal.h" #include #define NUM_PRNs 32 @@ -52,7 +52,7 @@ void GpsL5DllPllTrackingFpga::stop_tracking() } GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( - ConfigurationInterface *configuration, std::string role, + ConfigurationInterface *configuration, const std::string &role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { //printf("L5 TRK CLASS CREATED\n"); @@ -136,7 +136,7 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( //################# PRE-COMPUTE ALL THE CODES ################# unsigned int code_samples_per_chip = 1; - unsigned int code_length_chips = static_cast(GPS_L5i_CODE_LENGTH_CHIPS); + auto code_length_chips = static_cast(GPS_L5i_CODE_LENGTH_CHIPS); //printf("TRK code_length_chips = %d\n", code_length_chips); float *tracking_code; diff --git a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.h b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.h index 64043fb70..087f3730c 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.h +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.h @@ -37,8 +37,8 @@ #ifndef GNSS_SDR_GPS_L5_DLL_PLL_TRACKING_FPGA_H_ #define GNSS_SDR_GPS_L5_DLL_PLL_TRACKING_FPGA_H_ -#include "tracking_interface.h" #include "dll_pll_veml_tracking_fpga.h" +#include "tracking_interface.h" #include class ConfigurationInterface; @@ -50,7 +50,7 @@ class GpsL5DllPllTrackingFpga : public TrackingInterface { public: GpsL5DllPllTrackingFpga(ConfigurationInterface* configuration, - std::string role, + const std::string& role, unsigned int in_streams, unsigned int out_streams); diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc old mode 100755 new mode 100644 index 27da0a132..b6853a0a9 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -35,21 +35,21 @@ */ #include "dll_pll_veml_tracking.h" -#include "tracking_discriminators.h" -#include "lock_detectors.h" -#include "control_message_factory.h" -#include "MATH_CONSTANTS.h" -#include "Galileo_E1.h" -#include "galileo_e1_signal_processing.h" -#include "Galileo_E5a.h" -#include "galileo_e5_signal_processing.h" #include "GPS_L1_CA.h" -#include "gps_sdr_signal_processing.h" #include "GPS_L2C.h" -#include "gps_l2c_signal.h" #include "GPS_L5.h" -#include "gps_l5_signal.h" +#include "Galileo_E1.h" +#include "Galileo_E5a.h" +#include "MATH_CONSTANTS.h" +#include "control_message_factory.h" +#include "galileo_e1_signal_processing.h" +#include "galileo_e5_signal_processing.h" #include "gnss_sdr_create_directory.h" +#include "gps_l2c_signal.h" +#include "gps_l5_signal.h" +#include "gps_sdr_signal_processing.h" +#include "lock_detectors.h" +#include "tracking_discriminators.h" #include #include #include @@ -58,8 +58,8 @@ #include #include #include -#include #include +#include using google::LogMessage; diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h old mode 100755 new mode 100644 index 59a980b31..a79c7ffc3 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h @@ -32,18 +32,18 @@ #ifndef GNSS_SDR_DLL_PLL_VEML_TRACKING_H #define GNSS_SDR_DLL_PLL_VEML_TRACKING_H +#include "cpu_multicorrelator_real_codes.h" #include "dll_pll_conf.h" #include "gnss_synchro.h" #include "tracking_2nd_DLL_filter.h" #include "tracking_2nd_PLL_filter.h" -#include "cpu_multicorrelator_real_codes.h" +#include #include #include -#include #include #include +#include #include -#include class dll_pll_veml_tracking; diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc index f73ed6c90..b683e6a15 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc @@ -36,18 +36,18 @@ */ #include "dll_pll_veml_tracking_fpga.h" -#include "tracking_discriminators.h" -#include "lock_detectors.h" -#include "control_message_factory.h" -#include "MATH_CONSTANTS.h" -#include "Galileo_E1.h" -#include "Galileo_E5a.h" #include "GPS_L1_CA.h" #include "GPS_L2C.h" -#include "gps_l2c_signal.h" #include "GPS_L5.h" -#include "gps_l5_signal.h" +#include "Galileo_E1.h" +#include "Galileo_E5a.h" +#include "MATH_CONSTANTS.h" +#include "control_message_factory.h" #include "gnss_sdr_create_directory.h" +#include "gps_l2c_signal.h" +#include "gps_l5_signal.h" +#include "lock_detectors.h" +#include "tracking_discriminators.h" #include #include #include @@ -103,7 +103,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & if (trk_parameters.system == 'G') { systemName = "GPS"; - if (signal_type.compare("1C") == 0) + if (signal_type == "1C") { d_signal_carrier_freq = GPS_L1_FREQ_HZ; d_code_period = GPS_L1_CA_CODE_PERIOD; @@ -124,11 +124,11 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & // preamble bits to sampled symbols d_gps_l1ca_preambles_symbols = static_cast(volk_gnsssdr_malloc(GPS_CA_PREAMBLE_LENGTH_SYMBOLS * sizeof(int32_t), volk_gnsssdr_get_alignment())); int32_t n = 0; - for (int32_t i = 0; i < GPS_CA_PREAMBLE_LENGTH_BITS; i++) + for (unsigned short preambles_bit : preambles_bits) { for (uint32_t j = 0; j < GPS_CA_TELEMETRY_SYMBOLS_PER_BIT; j++) { - if (preambles_bits[i] == 1) + if (preambles_bit == 1) { d_gps_l1ca_preambles_symbols[n] = 1; } @@ -142,7 +142,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & d_symbol_history.resize(GPS_CA_PREAMBLE_LENGTH_SYMBOLS); // Change fixed buffer size d_symbol_history.clear(); // Clear all the elements in the buffer } - else if (signal_type.compare("2S") == 0) + else if (signal_type == "2S") { d_signal_carrier_freq = GPS_L2_FREQ_HZ; d_code_period = GPS_L2_M_PERIOD; @@ -156,7 +156,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & trk_parameters.track_pilot = false; interchange_iq = false; } - else if (signal_type.compare("L5") == 0) + else if (signal_type == "L5") { d_signal_carrier_freq = GPS_L5_FREQ_HZ; d_code_period = GPS_L5i_PERIOD; @@ -199,7 +199,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & else if (trk_parameters.system == 'E') { systemName = "Galileo"; - if (signal_type.compare("1B") == 0) + if (signal_type == "1B") { d_signal_carrier_freq = Galileo_E1_FREQ_HZ; d_code_period = Galileo_E1_CODE_PERIOD; @@ -223,7 +223,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & } interchange_iq = false; // Note that E1-B and E1-C are in anti-phase, NOT IN QUADRATURE. See Galileo ICD. } - else if (signal_type.compare("5X") == 0) + else if (signal_type == "5X") { d_signal_carrier_freq = Galileo_E5a_FREQ_HZ; d_code_period = GALILEO_E5a_CODE_PERIOD; @@ -428,10 +428,10 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & { d_dump_filename = trk_parameters.dump_filename; std::string dump_path; - if (d_dump_filename.find_last_of("/") != std::string::npos) + if (d_dump_filename.find_last_of('/') != std::string::npos) { - std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of("/") + 1); - dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of("/")); + std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of('/') + 1); + dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of('/')); d_dump_filename = dump_filename_; } else @@ -443,9 +443,9 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & d_dump_filename = "trk_channel_"; } // remove extension if any - if (d_dump_filename.substr(1).find_last_of(".") != std::string::npos) + if (d_dump_filename.substr(1).find_last_of('.') != std::string::npos) { - d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of(".")); + d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of('.')); } d_dump_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename; @@ -501,15 +501,15 @@ void dll_pll_veml_tracking_fpga::start_tracking() d_carrier_loop_filter.initialize(); // initialize the carrier filter d_code_loop_filter.initialize(); // initialize the code filter - if (systemName.compare("GPS") == 0 and signal_type.compare("1C") == 0) + if (systemName == "GPS" and signal_type == "1C") { // nothing to compute : the local codes are pre-computed in the adapter class } - else if (systemName.compare("GPS") == 0 and signal_type.compare("2S") == 0) + else if (systemName == "GPS" and signal_type == "2S") { // nothing to compute : the local codes are pre-computed in the adapter class } - else if (systemName.compare("GPS") == 0 and signal_type.compare("L5") == 0) + else if (systemName == "GPS" and signal_type == "L5") { if (trk_parameters.track_pilot) { @@ -520,7 +520,7 @@ void dll_pll_veml_tracking_fpga::start_tracking() // nothing to compute : the local codes are pre-computed in the adapter class } } - else if (systemName.compare("Galileo") == 0 and signal_type.compare("1B") == 0) + else if (systemName == "Galileo" and signal_type == "1B") { if (trk_parameters.track_pilot) { @@ -533,7 +533,7 @@ void dll_pll_veml_tracking_fpga::start_tracking() // nothing to compute : the local codes are pre-computed in the adapter class } } - else if (systemName.compare("Galileo") == 0 and signal_type.compare("5X") == 0) + else if (systemName == "Galileo" and signal_type == "5X") { if (trk_parameters.track_pilot) { @@ -604,7 +604,7 @@ void dll_pll_veml_tracking_fpga::start_tracking() dll_pll_veml_tracking_fpga::~dll_pll_veml_tracking_fpga() { - if (signal_type.compare("1C") == 0) + if (signal_type == "1C") { volk_gnsssdr_free(d_gps_l1ca_preambles_symbols); } @@ -1025,26 +1025,26 @@ int32_t dll_pll_veml_tracking_fpga::save_matfile() { return 1; } - float *abs_VE = new float[num_epoch]; - float *abs_E = new float[num_epoch]; - float *abs_P = new float[num_epoch]; - float *abs_L = new float[num_epoch]; - float *abs_VL = new float[num_epoch]; - float *Prompt_I = new float[num_epoch]; - float *Prompt_Q = new float[num_epoch]; - uint64_t *PRN_start_sample_count = new uint64_t[num_epoch]; - float *acc_carrier_phase_rad = new float[num_epoch]; - float *carrier_doppler_hz = new float[num_epoch]; - float *code_freq_chips = new float[num_epoch]; - float *carr_error_hz = new float[num_epoch]; - float *carr_error_filt_hz = new float[num_epoch]; - float *code_error_chips = new float[num_epoch]; - float *code_error_filt_chips = new float[num_epoch]; - float *CN0_SNV_dB_Hz = new float[num_epoch]; - float *carrier_lock_test = new float[num_epoch]; - float *aux1 = new float[num_epoch]; - double *aux2 = new double[num_epoch]; - uint32_t *PRN = new uint32_t[num_epoch]; + auto *abs_VE = new float[num_epoch]; + auto *abs_E = new float[num_epoch]; + auto *abs_P = new float[num_epoch]; + auto *abs_L = new float[num_epoch]; + auto *abs_VL = new float[num_epoch]; + auto *Prompt_I = new float[num_epoch]; + auto *Prompt_Q = new float[num_epoch]; + auto *PRN_start_sample_count = new uint64_t[num_epoch]; + auto *acc_carrier_phase_rad = new float[num_epoch]; + auto *carrier_doppler_hz = new float[num_epoch]; + auto *code_freq_chips = new float[num_epoch]; + auto *carr_error_hz = new float[num_epoch]; + auto *carr_error_filt_hz = new float[num_epoch]; + auto *code_error_chips = new float[num_epoch]; + auto *code_error_filt_chips = new float[num_epoch]; + auto *CN0_SNV_dB_Hz = new float[num_epoch]; + auto *carrier_lock_test = new float[num_epoch]; + auto *aux1 = new float[num_epoch]; + auto *aux2 = new double[num_epoch]; + auto *PRN = new uint32_t[num_epoch]; try { @@ -1108,8 +1108,8 @@ int32_t dll_pll_veml_tracking_fpga::save_matfile() std::string filename = dump_filename_; filename.erase(filename.length() - 4, 4); filename.append(".mat"); - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if (reinterpret_cast(matfp) != NULL) + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); + if (reinterpret_cast(matfp) != nullptr) { size_t dims[2] = {1, static_cast(num_epoch)}; matvar = Mat_VarCreate("abs_VE", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_VE, 0); @@ -1264,7 +1264,7 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un { gr::thread::scoped_lock l(d_setlock); // Block input data and block output stream pointers - Gnss_Synchro **out = reinterpret_cast(&output_items[0]); + auto **out = reinterpret_cast(&output_items[0]); // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder Gnss_Synchro current_synchro_data = Gnss_Synchro(); @@ -1297,7 +1297,7 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un //printf("333333 d_correlation_length_samples = %d\n", d_correlation_length_samples); uint32_t num_frames = ceil((counter_value - current_synchro_data.Acq_samplestamp_samples - current_synchro_data.Acq_delay_samples) / d_correlation_length_samples); //printf("333333 num_frames = %d\n", num_frames); - uint64_t absolute_samples_offset = static_cast(current_synchro_data.Acq_delay_samples + current_synchro_data.Acq_samplestamp_samples + num_frames * d_correlation_length_samples); + auto absolute_samples_offset = static_cast(current_synchro_data.Acq_delay_samples + current_synchro_data.Acq_samplestamp_samples + num_frames * d_correlation_length_samples); //printf("333333 absolute_samples_offset = %llu\n", absolute_samples_offset); multicorrelator_fpga->set_initial_sample(absolute_samples_offset); d_absolute_samples_offset = absolute_samples_offset; diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h index 91e34d400..4230a018d 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h @@ -40,17 +40,16 @@ #define GNSS_SDR_DLL_PLL_VEML_TRACKING_FPGA_H #include "dll_pll_conf_fpga.h" +#include "fpga_multicorrelator.h" #include "gnss_synchro.h" #include "tracking_2nd_DLL_filter.h" #include "tracking_2nd_PLL_filter.h" -#include "fpga_multicorrelator.h" +#include #include #include -#include #include #include -#include -#include "fpga_multicorrelator.h" +#include class dll_pll_veml_tracking_fpga; diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc index 91cea2f28..2c755b088 100644 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc @@ -37,25 +37,25 @@ */ #include "galileo_e1_tcp_connector_tracking_cc.h" +#include "GPS_L1_CA.h" +#include "Galileo_E1.h" +#include "control_message_factory.h" +#include "galileo_e1_signal_processing.h" +#include "gnss_sdr_flags.h" +#include "lock_detectors.h" +#include "tcp_communication.h" +#include "tcp_packet_data.h" +#include "tracking_discriminators.h" +#include +#include +#include +#include +#include #include #include #include #include -#include -#include #include -#include -#include -#include -#include "galileo_e1_signal_processing.h" -#include "tracking_discriminators.h" -#include "lock_detectors.h" -#include "GPS_L1_CA.h" -#include "Galileo_E1.h" -#include "control_message_factory.h" -#include "gnss_sdr_flags.h" -#include "tcp_communication.h" -#include "tcp_packet_data.h" using google::LogMessage; @@ -90,7 +90,7 @@ Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc( int64_t fs_in, uint32_t vector_length, bool dump, - const std::string& dump_filename, + const std::string &dump_filename, float pll_bw_hz __attribute__((unused)), float dll_bw_hz __attribute__((unused)), float early_late_space_chips, diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.h index 7f93ebb03..acce9db54 100644 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.h @@ -39,14 +39,14 @@ #ifndef GNSS_SDR_GALILEO_E1_TCP_CONNECTOR_TRACKING_CC_H #define GNSS_SDR_GALILEO_E1_TCP_CONNECTOR_TRACKING_CC_H +#include "cpu_multicorrelator.h" +#include "gnss_synchro.h" +#include "tcp_communication.h" +#include +#include #include #include #include -#include -#include -#include "gnss_synchro.h" -#include "cpu_multicorrelator.h" -#include "tcp_communication.h" class Galileo_E1_Tcp_Connector_Tracking_cc; @@ -57,7 +57,7 @@ galileo_e1_tcp_connector_tracking_cc_sptr galileo_e1_tcp_connector_make_tracking_cc( int64_t fs_in, uint32_t vector_length, bool dump, - const std::string& dump_filename, + const std::string &dump_filename, float pll_bw_hz, float dll_bw_hz, float early_late_space_chips, @@ -87,7 +87,7 @@ private: galileo_e1_tcp_connector_make_tracking_cc( int64_t fs_in, uint32_t vector_length, bool dump, - const std::string& dump_filename, + const std::string &dump_filename, float pll_bw_hz, float dll_bw_hz, float early_late_space_chips, @@ -97,7 +97,7 @@ private: Galileo_E1_Tcp_Connector_Tracking_cc( int64_t fs_in, uint32_t vector_length, bool dump, - const std::string& dump_filename, + const std::string &dump_filename, float pll_bw_hz, float dll_bw_hz, float early_late_space_chips, diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc index 74e6ef179..77603d0aa 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -37,18 +37,18 @@ */ #include "glonass_l1_ca_dll_pll_c_aid_tracking_cc.h" -#include "glonass_l1_signal_processing.h" #include "GLONASS_L1_L2_CA.h" -#include "tracking_discriminators.h" -#include "lock_detectors.h" -#include "gnss_sdr_flags.h" #include "control_message_factory.h" +#include "glonass_l1_signal_processing.h" +#include "gnss_sdr_flags.h" +#include "lock_detectors.h" +#include "tracking_discriminators.h" #include +#include #include #include #include #include -#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.h index a5e4dfcf9..10f1064f5 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.h @@ -46,9 +46,9 @@ #include "cpu_multicorrelator.h" #include #include +#include #include #include -#include #include class glonass_l1_ca_dll_pll_c_aid_tracking_cc; diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc index 13d672ac5..96009c777 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -37,17 +37,17 @@ */ #include "glonass_l1_ca_dll_pll_c_aid_tracking_sc.h" -#include "glonass_l1_signal_processing.h" #include "GLONASS_L1_L2_CA.h" -#include "tracking_discriminators.h" -#include "lock_detectors.h" -#include "gnss_sdr_flags.h" #include "control_message_factory.h" +#include "glonass_l1_signal_processing.h" +#include "gnss_sdr_flags.h" +#include "lock_detectors.h" +#include "tracking_discriminators.h" #include +#include #include #include #include -#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h index 83fbe4007..b0717532e 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h @@ -39,11 +39,11 @@ #ifndef GNSS_SDR_GLONASS_L1_CA_DLL_PLL_C_AID_TRACKING_SC_H #define GNSS_SDR_GLONASS_L1_CA_DLL_PLL_C_AID_TRACKING_SC_H +#include "cpu_multicorrelator_16sc.h" #include "glonass_l1_signal_processing.h" #include "gnss_synchro.h" #include "tracking_2nd_DLL_filter.h" #include "tracking_FLL_PLL_filter.h" -#include "cpu_multicorrelator_16sc.h" #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc index 600edeb51..70cc662bb 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc @@ -37,14 +37,14 @@ */ #include "glonass_l1_ca_dll_pll_tracking_cc.h" -#include "glonass_l1_signal_processing.h" #include "GLONASS_L1_L2_CA.h" -#include "tracking_discriminators.h" -#include "lock_detectors.h" -#include "gnss_sdr_flags.h" #include "control_message_factory.h" -#include +#include "glonass_l1_signal_processing.h" +#include "gnss_sdr_flags.h" +#include "lock_detectors.h" +#include "tracking_discriminators.h" #include +#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.h index 8f64c5d86..d8716f5ee 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.h @@ -39,10 +39,10 @@ #ifndef GNSS_SDR_GLONASS_L1_CA_DLL_PLL_TRACKING_CC_H #define GNSS_SDR_GLONASS_L1_CA_DLL_PLL_TRACKING_CC_H +#include "cpu_multicorrelator.h" #include "gnss_synchro.h" #include "tracking_2nd_DLL_filter.h" #include "tracking_2nd_PLL_filter.h" -#include "cpu_multicorrelator.h" #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc index 1ad32b44e..0299968b3 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc @@ -35,18 +35,18 @@ */ #include "glonass_l2_ca_dll_pll_c_aid_tracking_cc.h" -#include "glonass_l2_signal_processing.h" -#include "tracking_discriminators.h" -#include "lock_detectors.h" #include "GLONASS_L1_L2_CA.h" -#include "gnss_sdr_flags.h" #include "control_message_factory.h" +#include "glonass_l2_signal_processing.h" +#include "gnss_sdr_flags.h" +#include "lock_detectors.h" +#include "tracking_discriminators.h" #include +#include #include #include #include #include -#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.h index 34462476c..129e4609e 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.h @@ -44,9 +44,9 @@ #include "cpu_multicorrelator.h" #include #include +#include #include #include -#include #include class glonass_l2_ca_dll_pll_c_aid_tracking_cc; diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc index dcabc0a7c..ec9db011a 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc @@ -35,17 +35,17 @@ */ #include "glonass_l2_ca_dll_pll_c_aid_tracking_sc.h" -#include "glonass_l2_signal_processing.h" -#include "tracking_discriminators.h" -#include "lock_detectors.h" #include "GLONASS_L1_L2_CA.h" -#include "gnss_sdr_flags.h" #include "control_message_factory.h" +#include "glonass_l2_signal_processing.h" +#include "gnss_sdr_flags.h" +#include "lock_detectors.h" +#include "tracking_discriminators.h" #include +#include #include #include #include -#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h index 746df0595..5745d8ff9 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h @@ -37,11 +37,11 @@ #ifndef GNSS_SDR_GLONASS_L2_CA_DLL_PLL_C_AID_TRACKING_SC_H #define GNSS_SDR_GLONASS_L2_CA_DLL_PLL_C_AID_TRACKING_SC_H +#include "cpu_multicorrelator_16sc.h" #include "glonass_l2_signal_processing.h" #include "gnss_synchro.h" #include "tracking_2nd_DLL_filter.h" #include "tracking_FLL_PLL_filter.h" -#include "cpu_multicorrelator_16sc.h" #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc index 99ddb9b35..62b90e984 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc @@ -37,14 +37,14 @@ */ #include "glonass_l2_ca_dll_pll_tracking_cc.h" -#include "glonass_l2_signal_processing.h" -#include "tracking_discriminators.h" -#include "lock_detectors.h" #include "GLONASS_L1_L2_CA.h" -#include "gnss_sdr_flags.h" #include "control_message_factory.h" -#include +#include "glonass_l2_signal_processing.h" +#include "gnss_sdr_flags.h" +#include "lock_detectors.h" +#include "tracking_discriminators.h" #include +#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.h index 1839ea51b..f2f4ebab5 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.h @@ -37,10 +37,10 @@ #ifndef GNSS_SDR_GLONASS_L2_CA_DLL_PLL_TRACKING_CC_H #define GNSS_SDR_GLONASS_L2_CA_DLL_PLL_TRACKING_CC_H +#include "cpu_multicorrelator.h" #include "gnss_synchro.h" #include "tracking_2nd_DLL_filter.h" #include "tracking_2nd_PLL_filter.h" -#include "cpu_multicorrelator.h" #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc index 8647fed8d..5db4bef9b 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -29,17 +29,17 @@ */ #include "gps_l1_ca_dll_pll_c_aid_tracking_cc.h" -#include "gps_sdr_signal_processing.h" -#include "tracking_discriminators.h" -#include "lock_detectors.h" -#include "gnss_sdr_flags.h" #include "GPS_L1_CA.h" #include "control_message_factory.h" +#include "gnss_sdr_flags.h" +#include "gps_sdr_signal_processing.h" +#include "lock_detectors.h" +#include "tracking_discriminators.h" #include +#include #include #include #include -#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.h index 42f5a4902..43db468ae 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.h @@ -44,9 +44,9 @@ #include "cpu_multicorrelator.h" #include #include +#include #include #include -#include #include class gps_l1_ca_dll_pll_c_aid_tracking_cc; diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc index 9b2f34cc7..457b7e65f 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -29,17 +29,17 @@ */ #include "gps_l1_ca_dll_pll_c_aid_tracking_sc.h" -#include "gps_sdr_signal_processing.h" -#include "tracking_discriminators.h" -#include "lock_detectors.h" #include "GPS_L1_CA.h" -#include "gnss_sdr_flags.h" #include "control_message_factory.h" +#include "gnss_sdr_flags.h" +#include "gps_sdr_signal_processing.h" +#include "lock_detectors.h" +#include "tracking_discriminators.h" #include -#include -#include #include +#include #include +#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.h index 7bd75d974..f7624e944 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.h @@ -37,11 +37,11 @@ #ifndef GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_SC_H #define GNSS_SDR_GPS_L1_CA_DLL_PLL_C_AID_TRACKING_SC_H -#include "gps_sdr_signal_processing.h" +#include "cpu_multicorrelator_16sc.h" #include "gnss_synchro.h" +#include "gps_sdr_signal_processing.h" #include "tracking_2nd_DLL_filter.h" #include "tracking_FLL_PLL_filter.h" -#include "cpu_multicorrelator_16sc.h" #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc index 713d43164..36d27c0f6 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc @@ -29,17 +29,17 @@ */ #include "gps_l1_ca_dll_pll_tracking_gpu_cc.h" -#include "gps_sdr_signal_processing.h" -#include "tracking_discriminators.h" -#include "lock_detectors.h" #include "GPS_L1_CA.h" #include "control_message_factory.h" #include "gnss_sdr_flags.h" +#include "gps_sdr_signal_processing.h" +#include "lock_detectors.h" +#include "tracking_discriminators.h" #include -#include -#include #include +#include #include +#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc index 249ac5d32..20c800430 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc @@ -38,16 +38,16 @@ */ #include "gps_l1_ca_kf_tracking_cc.h" -#include "gps_sdr_signal_processing.h" -#include "tracking_discriminators.h" -#include "lock_detectors.h" -#include "gnss_sdr_flags.h" #include "GPS_L1_CA.h" #include "control_message_factory.h" -#include +#include "gnss_sdr_flags.h" +#include "gps_sdr_signal_processing.h" +#include "lock_detectors.h" +#include "tracking_discriminators.h" #include -#include +#include #include +#include #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h index 7f714500e..a40e257b9 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h @@ -40,11 +40,11 @@ #ifndef GNSS_SDR_GPS_L1_CA_KF_TRACKING_CC_H #define GNSS_SDR_GPS_L1_CA_KF_TRACKING_CC_H +#include "bayesian_estimation.h" +#include "cpu_multicorrelator_real_codes.h" #include "gnss_synchro.h" #include "tracking_2nd_DLL_filter.h" #include "tracking_2nd_PLL_filter.h" -#include "cpu_multicorrelator_real_codes.h" -#include "bayesian_estimation.h" #include #include #include diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc index c5e4c1e98..832e94207 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc @@ -36,18 +36,18 @@ */ #include "gps_l1_ca_tcp_connector_tracking_cc.h" +#include "GPS_L1_CA.h" #include "control_message_factory.h" #include "gnss_sdr_flags.h" #include "gps_sdr_signal_processing.h" -#include "GPS_L1_CA.h" #include "lock_detectors.h" #include "tcp_communication.h" #include "tcp_packet_data.h" #include "tracking_discriminators.h" #include #include -#include #include +#include #include #include #include @@ -85,7 +85,7 @@ Gps_L1_Ca_Tcp_Connector_Tracking_cc::Gps_L1_Ca_Tcp_Connector_Tracking_cc( int64_t fs_in, uint32_t vector_length, bool dump, - const std::string& dump_filename, + const std::string &dump_filename, float early_late_space_chips, size_t port_ch0) : gr::block("Gps_L1_Ca_Tcp_Connector_Tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h index 3acbdb54e..636a9fe28 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h @@ -54,7 +54,7 @@ gps_l1_ca_tcp_connector_tracking_cc_sptr gps_l1_ca_tcp_connector_make_tracking_cc( int64_t fs_in, uint32_t vector_length, bool dump, - const std::string& dump_filename, + const std::string &dump_filename, float early_late_space_chips, size_t port_ch0); @@ -86,14 +86,14 @@ private: gps_l1_ca_tcp_connector_make_tracking_cc( int64_t fs_in, uint32_t vector_length, bool dump, - const std::string& dump_filename, + const std::string &dump_filename, float early_late_space_chips, size_t port_ch0); Gps_L1_Ca_Tcp_Connector_Tracking_cc( int64_t fs_in, uint32_t vector_length, bool dump, - const std::string& dump_filename, + const std::string &dump_filename, float early_late_space_chips, size_t port_ch0); diff --git a/src/algorithms/tracking/libs/bayesian_estimation.h b/src/algorithms/tracking/libs/bayesian_estimation.h index 002e7a75c..02f54143e 100644 --- a/src/algorithms/tracking/libs/bayesian_estimation.h +++ b/src/algorithms/tracking/libs/bayesian_estimation.h @@ -40,8 +40,8 @@ #ifndef GNSS_SDR_BAYESIAN_ESTIMATION_H_ #define GNSS_SDR_BAYESIAN_ESTIMATION_H_ -#include #include +#include /*! \brief Bayesian_estimator is an estimator of noise characteristics (i.e. mean, covariance) * diff --git a/src/algorithms/tracking/libs/fpga_multicorrelator.cc b/src/algorithms/tracking/libs/fpga_multicorrelator.cc index 80123157d..add36b0a8 100644 --- a/src/algorithms/tracking/libs/fpga_multicorrelator.cc +++ b/src/algorithms/tracking/libs/fpga_multicorrelator.cc @@ -35,27 +35,26 @@ */ #include "fpga_multicorrelator.h" - #include // FPGA stuff #include // libraries used by DMA test code and GIPO test code -#include +#include +#include #include #include -#include // libraries used by DMA test code +#include +#include #include -#include #include -#include // libraries used by GPIO test code -#include -#include +#include +#include #include // logging @@ -63,6 +62,7 @@ // string manipulation #include +#include // constants #include "GPS_L1_CA.h" @@ -161,7 +161,7 @@ fpga_multicorrelator_8sc::fpga_multicorrelator_8sc(int32_t n_correlators, { //printf("tracking fpga class created\n"); d_n_correlators = n_correlators; - d_device_name = device_name; + d_device_name = std::move(device_name); d_device_base = device_base; d_track_pilot = track_pilot; d_device_descriptor = 0; @@ -346,7 +346,7 @@ void fpga_multicorrelator_8sc::set_channel(uint32_t channel) // std::cout << "deviceio" << device_io_name << " opened successfully" << std::endl; // // } - d_map_base = reinterpret_cast(mmap(NULL, PAGE_SIZE, + d_map_base = reinterpret_cast(mmap(nullptr, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, d_device_descriptor, 0)); if (d_map_base == reinterpret_cast(-1)) @@ -710,7 +710,7 @@ void fpga_multicorrelator_8sc::unlock_channel(void) void fpga_multicorrelator_8sc::close_device() { - uint32_t *aux = const_cast(d_map_base); + auto *aux = const_cast(d_map_base); if (munmap(static_cast(aux), PAGE_SIZE) == -1) { printf("Failed to unmap memory uio\n"); diff --git a/src/algorithms/tracking/libs/tcp_communication.cc b/src/algorithms/tracking/libs/tcp_communication.cc index 2ecd3c2a8..8ca6fde27 100644 --- a/src/algorithms/tracking/libs/tcp_communication.cc +++ b/src/algorithms/tracking/libs/tcp_communication.cc @@ -29,8 +29,8 @@ * ------------------------------------------------------------------------- */ -#include "tcp_packet_data.h" #include "tcp_communication.h" +#include "tcp_packet_data.h" #include #include diff --git a/src/algorithms/tracking/libs/tcp_communication.h b/src/algorithms/tracking/libs/tcp_communication.h index 05860b9cf..1a36d8212 100644 --- a/src/algorithms/tracking/libs/tcp_communication.h +++ b/src/algorithms/tracking/libs/tcp_communication.h @@ -32,9 +32,9 @@ #ifndef GNSS_SDR_TCP_COMMUNICATION_H_ #define GNSS_SDR_TCP_COMMUNICATION_H_ -#include -#include #include "tcp_packet_data.h" +#include +#include #define NUM_TX_VARIABLES_GALILEO_E1 13 #define NUM_TX_VARIABLES_GPS_L1_CA 9 diff --git a/src/algorithms/tracking/libs/tracking_loop_filter.cc b/src/algorithms/tracking/libs/tracking_loop_filter.cc index 6bb23c793..f5ebd5a10 100644 --- a/src/algorithms/tracking/libs/tracking_loop_filter.cc +++ b/src/algorithms/tracking/libs/tracking_loop_filter.cc @@ -33,8 +33,8 @@ #include "tracking_loop_filter.h" -#include #include +#include Tracking_loop_filter::Tracking_loop_filter(float update_interval, diff --git a/src/core/interfaces/acquisition_interface.h b/src/core/interfaces/acquisition_interface.h index d76e79bfc..794748175 100644 --- a/src/core/interfaces/acquisition_interface.h +++ b/src/core/interfaces/acquisition_interface.h @@ -65,6 +65,7 @@ public: virtual signed int mag() = 0; virtual void reset() = 0; virtual void stop_acquisition() = 0; + virtual void set_resampler_latency(uint32_t latency_samples) = 0; }; #endif /* GNSS_SDR_ACQUISITION_INTERFACE */ diff --git a/src/core/interfaces/channel_interface.h b/src/core/interfaces/channel_interface.h index db449941c..d4f97aea5 100644 --- a/src/core/interfaces/channel_interface.h +++ b/src/core/interfaces/channel_interface.h @@ -51,6 +51,10 @@ class ChannelInterface : public GNSSBlockInterface { public: + virtual gr::basic_block_sptr get_left_block_trk() = 0; + virtual gr::basic_block_sptr get_left_block_acq() = 0; + virtual gr::basic_block_sptr get_left_block() = 0; + virtual gr::basic_block_sptr get_right_block() = 0; virtual Gnss_Signal get_signal() const = 0; virtual void start_acquisition() = 0; virtual void stop_channel() = 0; diff --git a/src/core/interfaces/pvt_interface.h b/src/core/interfaces/pvt_interface.h index afabfa590..20b3df8e4 100644 --- a/src/core/interfaces/pvt_interface.h +++ b/src/core/interfaces/pvt_interface.h @@ -37,11 +37,11 @@ #ifndef GNSS_SDR_PVT_INTERFACE_H_ #define GNSS_SDR_PVT_INTERFACE_H_ -#include "gnss_block_interface.h" -#include "gps_ephemeris.h" -#include "galileo_ephemeris.h" -#include "gps_almanac.h" #include "galileo_almanac.h" +#include "galileo_ephemeris.h" +#include "gnss_block_interface.h" +#include "gps_almanac.h" +#include "gps_ephemeris.h" /*! * \brief This class represents an interface to a PVT block. diff --git a/src/core/libs/gnss_sdr_supl_client.h b/src/core/libs/gnss_sdr_supl_client.h index 2ea7f60c6..281d2a82d 100644 --- a/src/core/libs/gnss_sdr_supl_client.h +++ b/src/core/libs/gnss_sdr_supl_client.h @@ -38,24 +38,24 @@ extern "C" { #include "supl.h" } +#include "GPS_L1_CA.h" #include "agnss_ref_location.h" #include "agnss_ref_time.h" -#include "GPS_L1_CA.h" -#include "gps_ephemeris.h" -#include "gps_iono.h" -#include "gps_almanac.h" -#include "gps_utc_model.h" -#include "gps_cnav_utc_model.h" -#include "gps_acq_assist.h" -#include "gps_cnav_ephemeris.h" -#include "galileo_ephemeris.h" -#include "galileo_utc_model.h" -#include "galileo_iono.h" #include "galileo_almanac.h" +#include "galileo_ephemeris.h" +#include "galileo_iono.h" +#include "galileo_utc_model.h" #include "glonass_gnav_ephemeris.h" #include "glonass_gnav_utc_model.h" -#include +#include "gps_acq_assist.h" +#include "gps_almanac.h" +#include "gps_cnav_ephemeris.h" +#include "gps_cnav_utc_model.h" +#include "gps_ephemeris.h" +#include "gps_iono.h" +#include "gps_utc_model.h" #include +#include #include #include #include diff --git a/src/core/libs/supl/supl.h b/src/core/libs/supl/supl.h index 3761eda24..fc64e1ecd 100644 --- a/src/core/libs/supl/supl.h +++ b/src/core/libs/supl/supl.h @@ -17,7 +17,7 @@ #else #define EXPORT #endif - +// clang-format off #if USE_OPENSSL_FALLBACK #include #include @@ -31,7 +31,7 @@ #include #include #endif - +// clang-format on #include #include diff --git a/src/core/monitor/gnss_synchro_monitor.h b/src/core/monitor/gnss_synchro_monitor.h index 9547bf12d..db991a9ae 100644 --- a/src/core/monitor/gnss_synchro_monitor.h +++ b/src/core/monitor/gnss_synchro_monitor.h @@ -38,8 +38,8 @@ #include "gnss_synchro_udp_sink.h" #include #include -#include #include +#include class gnss_synchro_monitor; diff --git a/src/core/monitor/gnss_synchro_udp_sink.cc b/src/core/monitor/gnss_synchro_udp_sink.cc index cdd4608a6..46b2d33c9 100644 --- a/src/core/monitor/gnss_synchro_udp_sink.cc +++ b/src/core/monitor/gnss_synchro_udp_sink.cc @@ -32,8 +32,8 @@ #include "gnss_synchro_udp_sink.h" #include #include -#include #include +#include Gnss_Synchro_Udp_Sink::Gnss_Synchro_Udp_Sink(std::vector addresses, const uint16_t& port) : socket{io_service} { diff --git a/src/core/monitor/gnss_synchro_udp_sink.h b/src/core/monitor/gnss_synchro_udp_sink.h index 680aa455f..ebfb854a0 100644 --- a/src/core/monitor/gnss_synchro_udp_sink.h +++ b/src/core/monitor/gnss_synchro_udp_sink.h @@ -32,8 +32,8 @@ #ifndef GNSS_SYNCHRO_UDP_SINK_H_ #define GNSS_SYNCHRO_UDP_SINK_H_ -#include #include "gnss_synchro.h" +#include class Gnss_Synchro_Udp_Sink { diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 5fc45e668..9ebda09d0 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -33,40 +33,41 @@ */ #include "control_thread.h" -#include "concurrent_queue.h" #include "concurrent_map.h" -#include "pvt_interface.h" +#include "concurrent_queue.h" #include "control_message_factory.h" #include "file_configuration.h" -#include "gnss_flowgraph.h" -#include "gnss_sdr_flags.h" +#include "galileo_almanac.h" #include "galileo_ephemeris.h" #include "galileo_iono.h" #include "galileo_utc_model.h" -#include "galileo_almanac.h" +#include "geofunctions.h" +#include "glonass_gnav_ephemeris.h" +#include "glonass_gnav_utc_model.h" +#include "gnss_flowgraph.h" +#include "gnss_sdr_flags.h" +#include "gps_almanac.h" #include "gps_ephemeris.h" #include "gps_iono.h" #include "gps_utc_model.h" -#include "gps_almanac.h" -#include "glonass_gnav_ephemeris.h" -#include "glonass_gnav_utc_model.h" -#include "geofunctions.h" -#include "rtklib_rtkcmn.h" +#include "pvt_interface.h" #include "rtklib_conversions.h" #include "rtklib_ephemeris.h" -#include +#include "rtklib_rtkcmn.h" #include +#include #include #include -#include -#include -#include #include #include #include #include #include #include +#include +#include +#include +#include extern concurrent_map global_gps_acq_assist_map; @@ -196,8 +197,12 @@ ControlThread::~ControlThread() void ControlThread::telecommand_listener() { - int tcp_cmd_port = configuration_->property("GNSS-SDR.telecontrol_tcp_port", 3333); - cmd_interface_.run_cmd_server(tcp_cmd_port); + bool telecommand_enabled = configuration_->property("GNSS-SDR.telecommand_enabled", false); + if (telecommand_enabled) + { + int tcp_cmd_port = configuration_->property("GNSS-SDR.telecommand_tcp_port", 3333); + cmd_interface_.run_cmd_server(tcp_cmd_port); + } } @@ -294,14 +299,14 @@ int ControlThread::run() } -void ControlThread::set_control_queue(gr::msg_queue::sptr control_queue) +void ControlThread::set_control_queue(const gr::msg_queue::sptr &control_queue) { if (flowgraph_->running()) { LOG(WARNING) << "Unable to set control queue while flowgraph is running"; return; } - control_queue_ = control_queue; + control_queue_ = std::move(control_queue); cmd_interface_.set_msg_queue(control_queue_); } diff --git a/src/core/receiver/control_thread.h b/src/core/receiver/control_thread.h index bf78028c1..b500e43fa 100644 --- a/src/core/receiver/control_thread.h +++ b/src/core/receiver/control_thread.h @@ -35,19 +35,19 @@ #ifndef GNSS_SDR_CONTROL_THREAD_H_ #define GNSS_SDR_CONTROL_THREAD_H_ -#include "gnss_satellite.h" -#include "control_message_factory.h" -#include "gnss_sdr_supl_client.h" -#include "tcp_cmd_interface.h" -#include "gnss_flowgraph.h" -#include "configuration_interface.h" #include "agnss_ref_location.h" #include "agnss_ref_time.h" +#include "configuration_interface.h" +#include "control_message_factory.h" +#include "gnss_flowgraph.h" +#include "gnss_satellite.h" +#include "gnss_sdr_supl_client.h" +#include "tcp_cmd_interface.h" +#include #include #include #include #include -#include /*! @@ -93,7 +93,7 @@ public: * * \param[in] boost::shared_ptr control_queue */ - void set_control_queue(gr::msg_queue::sptr control_queue); + void set_control_queue(const gr::msg_queue::sptr& control_queue); unsigned int processed_control_messages() diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index 55218ee8d..fac2d38d9 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -36,91 +36,90 @@ #include "gnss_block_factory.h" - -#include "configuration_interface.h" -#include "in_memory_configuration.h" -#include "gnss_block_interface.h" -#include "pass_through.h" -#include "file_signal_source.h" -#include "nsr_file_signal_source.h" -#include "two_bit_cpx_file_signal_source.h" -#include "spir_file_signal_source.h" -#include "spir_gss6450_file_signal_source.h" -#include "rtl_tcp_signal_source.h" -#include "two_bit_packed_file_signal_source.h" -#include "labsat_signal_source.h" -#include "channel.h" -#include "signal_conditioner.h" #include "array_signal_conditioner.h" +#include "beamformer_filter.h" #include "byte_to_short.h" -#include "ibyte_to_cbyte.h" -#include "ibyte_to_cshort.h" -#include "ibyte_to_complex.h" -#include "ishort_to_cshort.h" -#include "ishort_to_complex.h" +#include "channel.h" +#include "configuration_interface.h" #include "direct_resampler_conditioner.h" -#include "mmse_resampler_conditioner.h" +#include "file_signal_source.h" #include "fir_filter.h" #include "freq_xlating_fir_filter.h" -#include "beamformer_filter.h" -#include "pulse_blanking_filter.h" -#include "notch_filter.h" -#include "notch_filter_lite.h" -#include "gps_l1_ca_pcps_acquisition.h" -#include "gps_l2_m_pcps_acquisition.h" -#include "gps_l5i_pcps_acquisition.h" -#include "gps_l1_ca_pcps_tong_acquisition.h" -#include "gps_l1_ca_pcps_assisted_acquisition.h" -#include "gps_l1_ca_pcps_acquisition_fine_doppler.h" -#include "gps_l1_ca_pcps_quicksync_acquisition.h" -#include "galileo_e1_pcps_ambiguous_acquisition.h" +#include "galileo_e1_dll_pll_veml_tracking.h" #include "galileo_e1_pcps_8ms_ambiguous_acquisition.h" -#include "galileo_e1_pcps_tong_ambiguous_acquisition.h" +#include "galileo_e1_pcps_ambiguous_acquisition.h" #include "galileo_e1_pcps_cccwsr_ambiguous_acquisition.h" #include "galileo_e1_pcps_quicksync_ambiguous_acquisition.h" +#include "galileo_e1_pcps_tong_ambiguous_acquisition.h" +#include "galileo_e1_tcp_connector_tracking.h" +#include "galileo_e1b_telemetry_decoder.h" +#include "galileo_e5a_dll_pll_tracking.h" #include "galileo_e5a_noncoherent_iq_acquisition_caf.h" #include "galileo_e5a_pcps_acquisition.h" -#include "glonass_l1_ca_pcps_acquisition.h" -#include "glonass_l2_ca_pcps_acquisition.h" -#include "gps_l1_ca_dll_pll_tracking.h" -#include "gps_l1_ca_dll_pll_c_aid_tracking.h" -#include "gps_l1_ca_tcp_connector_tracking.h" -#include "galileo_e1_dll_pll_veml_tracking.h" -#include "galileo_e1_tcp_connector_tracking.h" -#include "galileo_e5a_dll_pll_tracking.h" -#include "gps_l2_m_dll_pll_tracking.h" -#include "glonass_l1_ca_dll_pll_tracking.h" -#include "glonass_l1_ca_dll_pll_c_aid_tracking.h" -#include "glonass_l2_ca_dll_pll_tracking.h" -#include "glonass_l2_ca_dll_pll_c_aid_tracking.h" -#include "gps_l5_dll_pll_tracking.h" -#include "gps_l1_ca_telemetry_decoder.h" -#include "gps_l2c_telemetry_decoder.h" -#include "gps_l5_telemetry_decoder.h" -#include "galileo_e1b_telemetry_decoder.h" #include "galileo_e5a_telemetry_decoder.h" +#include "glonass_l1_ca_dll_pll_c_aid_tracking.h" +#include "glonass_l1_ca_dll_pll_tracking.h" +#include "glonass_l1_ca_pcps_acquisition.h" #include "glonass_l1_ca_telemetry_decoder.h" +#include "glonass_l2_ca_dll_pll_c_aid_tracking.h" +#include "glonass_l2_ca_dll_pll_tracking.h" +#include "glonass_l2_ca_pcps_acquisition.h" #include "glonass_l2_ca_telemetry_decoder.h" -#include "sbas_l1_telemetry_decoder.h" -#include "hybrid_observables.h" -#include "rtklib_pvt.h" +#include "gnss_block_interface.h" +#include "gps_l1_ca_dll_pll_c_aid_tracking.h" +#include "gps_l1_ca_dll_pll_tracking.h" #include "gps_l1_ca_kf_tracking.h" +#include "gps_l1_ca_pcps_acquisition.h" +#include "gps_l1_ca_pcps_acquisition_fine_doppler.h" +#include "gps_l1_ca_pcps_assisted_acquisition.h" +#include "gps_l1_ca_pcps_quicksync_acquisition.h" +#include "gps_l1_ca_pcps_tong_acquisition.h" +#include "gps_l1_ca_tcp_connector_tracking.h" +#include "gps_l1_ca_telemetry_decoder.h" +#include "gps_l2_m_dll_pll_tracking.h" +#include "gps_l2_m_pcps_acquisition.h" +#include "gps_l2c_telemetry_decoder.h" +#include "gps_l5_dll_pll_tracking.h" +#include "gps_l5_telemetry_decoder.h" +#include "gps_l5i_pcps_acquisition.h" +#include "hybrid_observables.h" +#include "ibyte_to_cbyte.h" +#include "ibyte_to_complex.h" +#include "ibyte_to_cshort.h" +#include "in_memory_configuration.h" +#include "ishort_to_complex.h" +#include "ishort_to_cshort.h" +#include "labsat_signal_source.h" +#include "mmse_resampler_conditioner.h" +#include "notch_filter.h" +#include "notch_filter_lite.h" +#include "nsr_file_signal_source.h" +#include "pass_through.h" +#include "pulse_blanking_filter.h" +#include "rtklib_pvt.h" +#include "rtl_tcp_signal_source.h" +#include "sbas_l1_telemetry_decoder.h" +#include "signal_conditioner.h" +#include "spir_file_signal_source.h" +#include "spir_gss6450_file_signal_source.h" +#include "two_bit_cpx_file_signal_source.h" +#include "two_bit_packed_file_signal_source.h" #if RAW_UDP #include "custom_udp_signal_source.h" #endif #if ENABLE_FPGA -#include "gps_l1_ca_pcps_acquisition_fpga.h" -#include "gps_l2_m_pcps_acquisition_fpga.h" -#include "galileo_e1_pcps_ambiguous_acquisition_fpga.h" -#include "galileo_e5a_pcps_acquisition_fpga.h" -#include "gps_l5i_pcps_acquisition_fpga.h" -#include "gps_l1_ca_dll_pll_tracking_fpga.h" -#include "gps_l2_m_dll_pll_tracking_fpga.h" #include "galileo_e1_dll_pll_veml_tracking_fpga.h" +#include "galileo_e1_pcps_ambiguous_acquisition_fpga.h" #include "galileo_e5a_dll_pll_tracking_fpga.h" +#include "galileo_e5a_pcps_acquisition_fpga.h" +#include "gps_l1_ca_dll_pll_tracking_fpga.h" +#include "gps_l1_ca_pcps_acquisition_fpga.h" +#include "gps_l2_m_dll_pll_tracking_fpga.h" +#include "gps_l2_m_pcps_acquisition_fpga.h" #include "gps_l5_dll_pll_tracking_fpga.h" +#include "gps_l5i_pcps_acquisition_fpga.h" #endif #if OPENCL_BLOCKS @@ -164,9 +163,9 @@ #endif #include -#include -#include #include +#include +#include using google::LogMessage; @@ -361,12 +360,11 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1C( } config->set_property("Channel.item_type", acq_item_type); - std::unique_ptr pass_through_ = GetBlock(config, "Channel", "Pass_Through", 1, 1, queue); std::unique_ptr acq_ = GetAcqBlock(configuration, "Acquisition_1C" + appendix1, acq, 1, 0); std::unique_ptr trk_ = GetTrkBlock(configuration, "Tracking_1C" + appendix2, trk, 1, 1); std::unique_ptr tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_1C" + appendix3, tlm, 1, 1); - std::unique_ptr channel_(new Channel(configuration.get(), channel, std::move(pass_through_), + std::unique_ptr channel_(new Channel(configuration.get(), channel, std::move(acq_), std::move(trk_), std::move(tlm_), @@ -426,12 +424,11 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2S( } config->set_property("Channel.item_type", acq_item_type); - std::unique_ptr pass_through_ = GetBlock(configuration, "Channel", "Pass_Through", 1, 1, queue); std::unique_ptr acq_ = GetAcqBlock(configuration, "Acquisition_2S" + appendix1, acq, 1, 0); std::unique_ptr trk_ = GetTrkBlock(configuration, "Tracking_2S" + appendix2, trk, 1, 1); std::unique_ptr tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_2S" + appendix3, tlm, 1, 1); - std::unique_ptr channel_(new Channel(configuration.get(), channel, std::move(pass_through_), + std::unique_ptr channel_(new Channel(configuration.get(), channel, std::move(acq_), std::move(trk_), std::move(tlm_), @@ -494,12 +491,11 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1B( } config->set_property("Channel.item_type", acq_item_type); - std::unique_ptr pass_through_ = GetBlock(configuration, "Channel", "Pass_Through", 1, 1, queue); std::unique_ptr acq_ = GetAcqBlock(configuration, "Acquisition_1B" + appendix1, acq, 1, 0); std::unique_ptr trk_ = GetTrkBlock(configuration, "Tracking_1B" + appendix2, trk, 1, 1); std::unique_ptr tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_1B" + appendix3, tlm, 1, 1); - std::unique_ptr channel_(new Channel(configuration.get(), channel, std::move(pass_through_), + std::unique_ptr channel_(new Channel(configuration.get(), channel, std::move(acq_), std::move(trk_), std::move(tlm_), @@ -562,12 +558,11 @@ std::unique_ptr GNSSBlockFactory::GetChannel_5X( } config->set_property("Channel.item_type", acq_item_type); - std::unique_ptr pass_through_ = GetBlock(configuration, "Channel", "Pass_Through", 1, 1, queue); std::unique_ptr acq_ = GetAcqBlock(configuration, "Acquisition_5X" + appendix1, acq, 1, 0); std::unique_ptr trk_ = GetTrkBlock(configuration, "Tracking_5X" + appendix2, trk, 1, 1); std::unique_ptr tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_5X" + appendix3, tlm, 1, 1); - std::unique_ptr channel_(new Channel(configuration.get(), channel, std::move(pass_through_), + std::unique_ptr channel_(new Channel(configuration.get(), channel, std::move(acq_), std::move(trk_), std::move(tlm_), @@ -631,12 +626,11 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( } config->set_property("Channel.item_type", acq_item_type); - std::unique_ptr pass_through_ = GetBlock(config, "Channel", "Pass_Through", 1, 1, queue); std::unique_ptr acq_ = GetAcqBlock(configuration, "Acquisition_1G" + appendix1, acq, 1, 0); std::unique_ptr trk_ = GetTrkBlock(configuration, "Tracking_1G" + appendix2, trk, 1, 1); std::unique_ptr tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_1G" + appendix3, tlm, 1, 1); - std::unique_ptr channel_(new Channel(configuration.get(), channel, std::move(pass_through_), + std::unique_ptr channel_(new Channel(configuration.get(), channel, std::move(acq_), std::move(trk_), std::move(tlm_), @@ -700,12 +694,11 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( } config->set_property("Channel.item_type", acq_item_type); - std::unique_ptr pass_through_ = GetBlock(config, "Channel", "Pass_Through", 1, 1, queue); std::unique_ptr acq_ = GetAcqBlock(configuration, "Acquisition_2G" + appendix1, acq, 1, 0); std::unique_ptr trk_ = GetTrkBlock(configuration, "Tracking_2G" + appendix2, trk, 1, 1); std::unique_ptr tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_2G" + appendix3, tlm, 1, 1); - std::unique_ptr channel_(new Channel(configuration.get(), channel, std::move(pass_through_), + std::unique_ptr channel_(new Channel(configuration.get(), channel, std::move(acq_), std::move(trk_), std::move(tlm_), @@ -768,12 +761,11 @@ std::unique_ptr GNSSBlockFactory::GetChannel_L5( } config->set_property("Channel.item_type", acq_item_type); - std::unique_ptr pass_through_ = GetBlock(configuration, "Channel", "Pass_Through", 1, 1, queue); std::unique_ptr acq_ = GetAcqBlock(configuration, "Acquisition_L5" + appendix1, acq, 1, 0); std::unique_ptr trk_ = GetTrkBlock(configuration, "Tracking_L5" + appendix2, trk, 1, 1); std::unique_ptr tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_L5" + appendix3, tlm, 1, 1); - std::unique_ptr channel_(new Channel(configuration.get(), channel, std::move(pass_through_), + std::unique_ptr channel_(new Channel(configuration.get(), channel, std::move(acq_), std::move(trk_), std::move(tlm_), diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 5131dadf2..08d47a376 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -33,30 +33,41 @@ */ #include "gnss_flowgraph.h" -#include "gnss_synchro.h" -#include "configuration_interface.h" -#include "gnss_block_interface.h" +#include "GPS_L1_CA.h" +#include "GPS_L2C.h" +#include "GPS_L5.h" +#include "Galileo_E1.h" +#include "Galileo_E5a.h" +#include "channel.h" #include "channel_interface.h" +#include "configuration_interface.h" #include "gnss_block_factory.h" #include #include #include +#include #include #include #include #include +#include +#ifdef GR_GREATER_38 +#include +#else +#include +#endif #define GNSS_SDR_ARRAY_SIGNAL_CONDITIONER_CHANNELS 8 using google::LogMessage; -GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr configuration, gr::msg_queue::sptr queue) +GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr configuration, const gr::msg_queue::sptr& queue) { connected_ = false; running_ = false; configuration_ = configuration; - queue_ = queue; + queue_ = std::move(queue); init(); } @@ -343,6 +354,8 @@ void GNSSFlowgraph::connect() #endif // Signal conditioner (selected_signal_source) >> channels (i) (dependent of their associated SignalSource_ID) int selected_signal_conditioner_ID = 0; + bool use_acq_resampler = configuration_->property("GNSS-SDR.use_acquisition_resampler", false); + uint32_t fs = configuration_->property("GNSS-SDR.internal_fs_sps", 0); for (unsigned int i = 0; i < channels_count_; i++) { if (FPGA_enabled == false) @@ -357,8 +370,119 @@ void GNSSFlowgraph::connect() } try { - top_block_->connect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0, - channels_.at(i)->get_left_block(), 0); + // Enable automatic resampler for the acquisition, if required + if (use_acq_resampler == true) + { + //create acquisition resamplers if required + double resampler_ratio = 1.0; + double acq_fs = fs; + //find the signal associated to this channel + switch (mapStringValues_[channels_.at(i)->implementation()]) + { + case evGPS_1C: + acq_fs = GPS_L1_CA_OPT_ACQ_FS_HZ; + break; + case evGPS_2S: + acq_fs = GPS_L2C_OPT_ACQ_FS_HZ; + break; + case evGPS_L5: + acq_fs = GPS_L5_OPT_ACQ_FS_HZ; + break; + case evSBAS_1C: + acq_fs = GPS_L1_CA_OPT_ACQ_FS_HZ; + break; + case evGAL_1B: + acq_fs = Galileo_E1_OPT_ACQ_FS_HZ; + break; + case evGAL_5X: + acq_fs = Galileo_E5a_OPT_ACQ_FS_HZ; + break; + case evGLO_1G: + acq_fs = fs; + break; + case evGLO_2G: + acq_fs = fs; + break; + } + + if (acq_fs < fs) + { + //check if the resampler is already created for the channel system/signal and for the specific RF Channel + std::string map_key = channels_.at(i)->implementation() + std::to_string(selected_signal_conditioner_ID); + resampler_ratio = static_cast(fs) / acq_fs; + int decimation = floor(resampler_ratio); + while (fs % decimation > 0) + { + decimation--; + }; + double acq_fs = fs / decimation; + + if (decimation > 1) + { + //create a FIR low pass filter + std::vector taps; + taps = gr::filter::firdes::low_pass(1.0, + fs, + acq_fs / 2.1, + acq_fs / 10, + gr::filter::firdes::win_type::WIN_HAMMING); + + gr::basic_block_sptr fir_filter_ccf_ = gr::filter::fir_filter_ccf::make(decimation, taps); + + std::pair::iterator, bool> ret; + ret = acq_resamplers_.insert(std::pair(map_key, fir_filter_ccf_)); + if (ret.second == true) + { + top_block_->connect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0, + acq_resamplers_.at(map_key), 0); + LOG(INFO) << "Created " + << channels_.at(i)->implementation() + << " acquisition resampler for RF channel " << std::to_string(signal_conditioner_ID) << " with " << taps.size() << " taps and decimation factor of " << decimation; + } + else + { + LOG(INFO) << "Found existing " + << channels_.at(i)->implementation() + << " acquisition resampler for RF channel " << std::to_string(signal_conditioner_ID) << " with " << taps.size() << " taps and decimation factor of " << decimation; + } + + + top_block_->connect(acq_resamplers_.at(map_key), 0, + channels_.at(i)->get_left_block_acq(), 0); + + top_block_->connect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0, + channels_.at(i)->get_left_block_trk(), 0); + + std::shared_ptr channel_ptr; + channel_ptr = std::dynamic_pointer_cast(channels_.at(i)); + channel_ptr->acquisition()->set_resampler_latency((taps.size() - 1) / 2); + } + else + { + LOG(INFO) << "Disabled acquisition resampler because the input sampling frequency is too low"; + //resampler not required! + top_block_->connect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0, + channels_.at(i)->get_left_block_acq(), 0); + top_block_->connect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0, + channels_.at(i)->get_left_block_trk(), 0); + } + } + else + { + LOG(INFO) << "Disabled acquisition resampler because the input sampling frequency is too low"; + top_block_->connect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0, + channels_.at(i)->get_left_block_acq(), 0); + top_block_->connect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0, + channels_.at(i)->get_left_block_trk(), 0); + } + } + else + { + top_block_->connect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0, + channels_.at(i)->get_left_block_acq(), 0); + top_block_->connect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0, + channels_.at(i)->get_left_block_trk(), 0); + } } catch (const std::exception& e) { @@ -678,7 +802,7 @@ void GNSSFlowgraph::disconnect() try { top_block_->disconnect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0, - channels_.at(i)->get_left_block(), 0); + channels_.at(i)->get_left_block_trk(), 0); } catch (const std::exception& e) { diff --git a/src/core/receiver/gnss_flowgraph.h b/src/core/receiver/gnss_flowgraph.h index 6ad1063ea..929243939 100644 --- a/src/core/receiver/gnss_flowgraph.h +++ b/src/core/receiver/gnss_flowgraph.h @@ -38,16 +38,16 @@ #define GNSS_SDR_GNSS_FLOWGRAPH_H_ #include "GPS_L1_CA.h" -#include "gnss_signal.h" -#include "gnss_sdr_sample_counter.h" -#include "gnss_synchro_monitor.h" -#include "gnss_block_interface.h" -#include "pvt_interface.h" #include "channel_interface.h" #include "configuration_interface.h" #include "gnss_block_factory.h" -#include +#include "gnss_block_interface.h" +#include "gnss_sdr_sample_counter.h" +#include "gnss_signal.h" +#include "gnss_synchro_monitor.h" +#include "pvt_interface.h" #include +#include #include #include #include @@ -55,6 +55,7 @@ #include #include #include +#include #if ENABLE_FPGA #include "gnss_sdr_fpga_sample_counter.h" @@ -72,7 +73,7 @@ public: /*! * \brief Constructor that initializes the receiver flow graph */ - GNSSFlowgraph(std::shared_ptr configuration, gr::msg_queue::sptr queue); + GNSSFlowgraph(std::shared_ptr configuration, const gr::msg_queue::sptr& queue); /*! * \brief Destructor @@ -166,6 +167,7 @@ private: std::shared_ptr observables_; std::shared_ptr pvt_; + std::map acq_resamplers_; std::vector> channels_; gnss_sdr_sample_counter_sptr ch_out_sample_counter; #if ENABLE_FPGA diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index cccb12857..57b274757 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -1,7 +1,7 @@ /*! * \file tcp_cmd_interface.cc * - * \brief Class that implements a TCP telecontrol command line interface + * \brief Class that implements a TCP/IP telecommand command line interface * for GNSS-SDR * \author Javier Arribas jarribas (at) cttc.es * ------------------------------------------------------------------------- diff --git a/src/core/receiver/tcp_cmd_interface.h b/src/core/receiver/tcp_cmd_interface.h index 841270668..4cafb898d 100644 --- a/src/core/receiver/tcp_cmd_interface.h +++ b/src/core/receiver/tcp_cmd_interface.h @@ -1,7 +1,7 @@ /*! * \file tcp_cmd_interface.h * - * \brief Class that implements a TCP telecontrol command line interface + * \brief Class that implements a TCP/IP telecommand command line interface * for GNSS-SDR * \author Javier Arribas jarribas (at) cttc.es * ------------------------------------------------------------------------- diff --git a/src/core/system_parameters/GLONASS_L1_L2_CA.h b/src/core/system_parameters/GLONASS_L1_L2_CA.h index 27a7425d8..816b2c9aa 100644 --- a/src/core/system_parameters/GLONASS_L1_L2_CA.h +++ b/src/core/system_parameters/GLONASS_L1_L2_CA.h @@ -33,12 +33,12 @@ #ifndef GNSS_SDR_GLONASS_L1_L2_CA_H_ #define GNSS_SDR_GLONASS_L1_L2_CA_H_ -#include "gnss_frequencies.h" #include "MATH_CONSTANTS.h" +#include "gnss_frequencies.h" #include #include -#include #include // std::pair +#include // Physical constants diff --git a/src/core/system_parameters/GPS_CNAV.h b/src/core/system_parameters/GPS_CNAV.h index 5ab606bc4..b12b50056 100644 --- a/src/core/system_parameters/GPS_CNAV.h +++ b/src/core/system_parameters/GPS_CNAV.h @@ -34,8 +34,8 @@ #include "MATH_CONSTANTS.h" #include -#include #include // std::pair +#include // CNAV GPS NAVIGATION MESSAGE STRUCTURE diff --git a/src/core/system_parameters/GPS_L1_CA.h b/src/core/system_parameters/GPS_L1_CA.h index 9879716e4..138e74844 100644 --- a/src/core/system_parameters/GPS_L1_CA.h +++ b/src/core/system_parameters/GPS_L1_CA.h @@ -32,11 +32,11 @@ #ifndef GNSS_SDR_GPS_L1_CA_H_ #define GNSS_SDR_GPS_L1_CA_H_ -#include "gnss_frequencies.h" #include "MATH_CONSTANTS.h" +#include "gnss_frequencies.h" #include -#include #include // std::pair +#include // Physical constants @@ -57,6 +57,9 @@ const double GPS_L1_CA_CODE_PERIOD = 0.001; //!< GPS L1 C/A code period const uint32_t GPS_L1_CA_CODE_PERIOD_MS = 1U; //!< GPS L1 C/A code period [ms] const double GPS_L1_CA_CHIP_PERIOD = 9.7752e-07; //!< GPS L1 C/A chip period [seconds] +//optimum parameters +const uint32_t GPS_L1_CA_OPT_ACQ_FS_HZ = 1000000; //!< Sampling frequncy that maximizes the acquisition SNR while using a non-multiple of chip rate + /*! * \brief Maximum Time-Of-Arrival (TOA) difference between satellites for a receiver operated on Earth surface is 20 ms * diff --git a/src/core/system_parameters/GPS_L2C.h b/src/core/system_parameters/GPS_L2C.h index b156dfe4a..40986fd5b 100644 --- a/src/core/system_parameters/GPS_L2C.h +++ b/src/core/system_parameters/GPS_L2C.h @@ -33,12 +33,12 @@ #define GNSS_SDR_GPS_L2C_H_ -#include "gnss_frequencies.h" #include "GPS_CNAV.h" #include "MATH_CONSTANTS.h" +#include "gnss_frequencies.h" #include -#include #include // std::pair +#include // Physical constants @@ -63,6 +63,10 @@ const double GPS_L2_L_PERIOD = 1.5; //!< GPS L2 L code period [s const int32_t GPS_L2C_HISTORY_DEEP = 5; +//optimum parameters +const uint32_t GPS_L2C_OPT_ACQ_FS_HZ = 1000000; //!< Sampling frequncy that maximizes the acquisition SNR while using a non-multiple of chip rate + + const int32_t GPS_L2C_M_INIT_REG[115] = {0742417664, 0756014035, 0002747144, 0066265724, // 1:4 0601403471, 0703232733, 0124510070, 0617316361, // 5:8 diff --git a/src/core/system_parameters/GPS_L5.h b/src/core/system_parameters/GPS_L5.h index fe270f204..ff669d8b0 100644 --- a/src/core/system_parameters/GPS_L5.h +++ b/src/core/system_parameters/GPS_L5.h @@ -32,9 +32,9 @@ #ifndef GNSS_SDR_GPS_L5_H_ #define GNSS_SDR_GPS_L5_H_ -#include "gnss_frequencies.h" #include "GPS_CNAV.h" #include "MATH_CONSTANTS.h" +#include "gnss_frequencies.h" #include #include @@ -64,6 +64,9 @@ const double GPS_L5q_PERIOD = 0.001; //!< GPS L5 code period [secon const int32_t GPS_L5_HISTORY_DEEP = 5; +//optimum parameters +const uint32_t GPS_L5_OPT_ACQ_FS_HZ = 10000000; //!< Sampling frequncy that maximizes the acquisition SNR while using a non-multiple of chip rate + const int32_t GPS_L5i_INIT_REG[210] = {266, 365, 804, 1138, 1509, 1559, 1756, 2084, diff --git a/src/core/system_parameters/Galileo_E1.h b/src/core/system_parameters/Galileo_E1.h index 7cb1ac433..d6f08a19e 100644 --- a/src/core/system_parameters/Galileo_E1.h +++ b/src/core/system_parameters/Galileo_E1.h @@ -33,12 +33,12 @@ #ifndef GNSS_SDR_GALILEO_E1_H_ #define GNSS_SDR_GALILEO_E1_H_ -#include "gnss_frequencies.h" #include "MATH_CONSTANTS.h" +#include "gnss_frequencies.h" #include #include -#include #include // std::pair +#include // Physical constants @@ -63,6 +63,11 @@ const int32_t Galileo_E1_B_SAMPLES_PER_SYMBOL = 1; //!< (Galileo_E1_CODE_ const int32_t Galileo_E1_C_SECONDARY_CODE_LENGTH = 25; //!< Galileo E1-C secondary code length [chips] const int32_t Galileo_E1_NUMBER_OF_CODES = 50; + +//optimum parameters +const uint32_t Galileo_E1_OPT_ACQ_FS_HZ = 2000000; //!< Sampling frequncy that maximizes the acquisition SNR while using a non-multiple of chip rate + + const double GALILEO_STARTOFFSET_ms = 68.802; //[ms] Initial sign. travel time (this cannot go here) diff --git a/src/core/system_parameters/Galileo_E5a.h b/src/core/system_parameters/Galileo_E5a.h index b8540d32c..c1cf20350 100644 --- a/src/core/system_parameters/Galileo_E5a.h +++ b/src/core/system_parameters/Galileo_E5a.h @@ -31,12 +31,12 @@ #ifndef GNSS_SDR_GALILEO_E5A_H_ #define GNSS_SDR_GALILEO_E5A_H_ -#include "gnss_frequencies.h" #include "MATH_CONSTANTS.h" +#include "gnss_frequencies.h" #include #include -#include #include // std::pair +#include // Carrier and code frequencies @@ -57,6 +57,9 @@ const int32_t Galileo_E5a_NUMBER_OF_CODES = 50; const int32_t GALILEO_E5A_HISTORY_DEEP = 20; const int32_t GALILEO_E5A_CRC_ERROR_LIMIT = 6; +//optimum parameters +const uint32_t Galileo_E5a_OPT_ACQ_FS_HZ = 10000000; //!< Sampling frequncy that maximizes the acquisition SNR while using a non-multiple of chip rate + // F/NAV message structure const int32_t GALILEO_FNAV_PREAMBLE_LENGTH_BITS = 12; diff --git a/src/core/system_parameters/MATH_CONSTANTS.h b/src/core/system_parameters/MATH_CONSTANTS.h index 62090dd6e..1b415fa37 100644 --- a/src/core/system_parameters/MATH_CONSTANTS.h +++ b/src/core/system_parameters/MATH_CONSTANTS.h @@ -31,7 +31,7 @@ #ifndef GNSS_SDR_MATH_CONSTANTS_H_ #define GNSS_SDR_MATH_CONSTANTS_H_ -#include +#include /* Constants for scaling the ephemeris found in the data message the format is the following: TWO_N5 -> 2^-5, TWO_P4 -> 2^4, PI_TWO_N43 -> Pi*2^-43, etc etc diff --git a/src/core/system_parameters/galileo_fnav_message.h b/src/core/system_parameters/galileo_fnav_message.h index c08c6d7c7..ff69df958 100644 --- a/src/core/system_parameters/galileo_fnav_message.h +++ b/src/core/system_parameters/galileo_fnav_message.h @@ -38,16 +38,16 @@ #define GNSS_SDR_GALILEO_FNAV_MESSAGE_H_ +#include "Galileo_E5a.h" +#include "galileo_almanac_helper.h" #include "galileo_ephemeris.h" #include "galileo_iono.h" -#include "galileo_almanac_helper.h" #include "galileo_utc_model.h" -#include "Galileo_E5a.h" #include #include #include -#include #include +#include /*! * \brief This class handles the Galileo F/NAV Data message, as described in the diff --git a/src/core/system_parameters/galileo_navigation_message.h b/src/core/system_parameters/galileo_navigation_message.h index c62dc863f..302c38424 100644 --- a/src/core/system_parameters/galileo_navigation_message.h +++ b/src/core/system_parameters/galileo_navigation_message.h @@ -33,11 +33,11 @@ #ifndef GNSS_SDR_GALILEO_NAVIGATION_MESSAGE_H_ #define GNSS_SDR_GALILEO_NAVIGATION_MESSAGE_H_ +#include "Galileo_E1.h" +#include "galileo_almanac_helper.h" #include "galileo_ephemeris.h" #include "galileo_iono.h" -#include "galileo_almanac_helper.h" #include "galileo_utc_model.h" -#include "Galileo_E1.h" #include #include #include diff --git a/src/core/system_parameters/glonass_gnav_ephemeris.cc b/src/core/system_parameters/glonass_gnav_ephemeris.cc index b063d22ba..1e0941dd7 100644 --- a/src/core/system_parameters/glonass_gnav_ephemeris.cc +++ b/src/core/system_parameters/glonass_gnav_ephemeris.cc @@ -31,8 +31,8 @@ */ #include "glonass_gnav_ephemeris.h" -#include "gnss_satellite.h" #include "GLONASS_L1_L2_CA.h" +#include "gnss_satellite.h" #include diff --git a/src/core/system_parameters/glonass_gnav_ephemeris.h b/src/core/system_parameters/glonass_gnav_ephemeris.h index ebea99d58..6f53a992f 100644 --- a/src/core/system_parameters/glonass_gnav_ephemeris.h +++ b/src/core/system_parameters/glonass_gnav_ephemeris.h @@ -35,8 +35,8 @@ #define GNSS_SDR_GLONASS_GNAV_EPHEMERIS_H_ -#include #include +#include #include /*! diff --git a/src/core/system_parameters/glonass_gnav_navigation_message.h b/src/core/system_parameters/glonass_gnav_navigation_message.h index 58b060518..6f1f92312 100644 --- a/src/core/system_parameters/glonass_gnav_navigation_message.h +++ b/src/core/system_parameters/glonass_gnav_navigation_message.h @@ -35,10 +35,10 @@ #define GNSS_SDR_GLONASS_GNAV_NAVIGATION_MESSAGE_H_ -#include "glonass_gnav_ephemeris.h" -#include "glonass_gnav_almanac.h" -#include "glonass_gnav_utc_model.h" #include "GLONASS_L1_L2_CA.h" +#include "glonass_gnav_almanac.h" +#include "glonass_gnav_ephemeris.h" +#include "glonass_gnav_utc_model.h" #include #include diff --git a/src/core/system_parameters/gnss_satellite.h b/src/core/system_parameters/gnss_satellite.h index 58a3b1165..519deb671 100644 --- a/src/core/system_parameters/gnss_satellite.h +++ b/src/core/system_parameters/gnss_satellite.h @@ -34,8 +34,8 @@ #include #include -#include #include +#include /*! diff --git a/src/core/system_parameters/gnss_synchro.h b/src/core/system_parameters/gnss_synchro.h index 9e0580544..117bdda7e 100644 --- a/src/core/system_parameters/gnss_synchro.h +++ b/src/core/system_parameters/gnss_synchro.h @@ -33,8 +33,8 @@ #ifndef GNSS_SDR_GNSS_SYNCHRO_H_ #define GNSS_SDR_GNSS_SYNCHRO_H_ -#include #include "gnss_signal.h" +#include #include /*! diff --git a/src/core/system_parameters/gps_cnav_navigation_message.h b/src/core/system_parameters/gps_cnav_navigation_message.h index f34e33e91..2a817e32d 100644 --- a/src/core/system_parameters/gps_cnav_navigation_message.h +++ b/src/core/system_parameters/gps_cnav_navigation_message.h @@ -41,8 +41,8 @@ #include #include #include -#include #include +#include //TODO: Create GPS CNAV almanac //#include "gps_almanac.h" diff --git a/src/core/system_parameters/gps_ephemeris.h b/src/core/system_parameters/gps_ephemeris.h index 5466b54d9..5e6613d9d 100644 --- a/src/core/system_parameters/gps_ephemeris.h +++ b/src/core/system_parameters/gps_ephemeris.h @@ -34,8 +34,8 @@ #include -#include #include +#include #include #include #include diff --git a/src/core/system_parameters/gps_navigation_message.h b/src/core/system_parameters/gps_navigation_message.h index 7c70e25c9..57b76f62b 100644 --- a/src/core/system_parameters/gps_navigation_message.h +++ b/src/core/system_parameters/gps_navigation_message.h @@ -34,9 +34,9 @@ #include "GPS_L1_CA.h" +#include "gps_almanac.h" #include "gps_ephemeris.h" #include "gps_iono.h" -#include "gps_almanac.h" #include "gps_utc_model.h" #include #include diff --git a/src/core/system_parameters/rtcm.cc b/src/core/system_parameters/rtcm.cc index d089f3779..31640ce0a 100644 --- a/src/core/system_parameters/rtcm.cc +++ b/src/core/system_parameters/rtcm.cc @@ -29,8 +29,8 @@ */ #include "rtcm.h" -#include "Galileo_E1.h" #include "GPS_L2C.h" +#include "Galileo_E1.h" #include // for to_upper_copy #include #include diff --git a/src/core/system_parameters/rtcm.h b/src/core/system_parameters/rtcm.h index 6194bc6ff..77696cf88 100644 --- a/src/core/system_parameters/rtcm.h +++ b/src/core/system_parameters/rtcm.h @@ -34,13 +34,14 @@ #include "concurrent_queue.h" -#include "gnss_synchro.h" #include "galileo_fnav_message.h" -#include "gps_navigation_message.h" -#include "gps_cnav_navigation_message.h" #include "glonass_gnav_navigation_message.h" +#include "gnss_synchro.h" +#include "gps_cnav_navigation_message.h" +#include "gps_navigation_message.h" #include #include +#include #include #include #include @@ -51,7 +52,6 @@ #include #include #include -#include /*! diff --git a/src/main/main.cc b/src/main/main.cc index b7e06ea78..9b8354276 100644 --- a/src/main/main.cc +++ b/src/main/main.cc @@ -43,16 +43,19 @@ #include "concurrent_queue.h" #include "control_thread.h" #include "gnss_sdr_flags.h" +#include "gps_acq_assist.h" #include -#include -#include // for create_directories, exists -#include // for path, operator<< -#include // for filesystem +#include // for exception +#include // for create_directories, exists +#include // for path, operator<< +#include // for error_code +#include #include #include +#include #include #include - +#include #if CUDA_GPU_ACCEL // For the CUDA runtime routines (prefixed with "cuda_") diff --git a/src/tests/common-files/gnuplot_i.h b/src/tests/common-files/gnuplot_i.h index 111e71613..7a971f02e 100644 --- a/src/tests/common-files/gnuplot_i.h +++ b/src/tests/common-files/gnuplot_i.h @@ -48,18 +48,18 @@ #define GNSS_SDR_GNUPLOT_I_H_ #include -#include -#include -#include -#include -#include // for std::ostringstream -#include +#include #include #include // for getenv() #include // for strncpy -#include -#include // for std::list +#include +#include +#include // for std::list +#include // for std::ostringstream +#include +#include #include +#include DEFINE_bool(show_plots, true, "Show plots on screen. Disable for non-interactive testing."); @@ -2100,19 +2100,19 @@ std::string Gnuplot::create_tmpfile(std::ofstream &tmp) throw GnuplotException(except.str()); } -// int mkstemp(char *name); -// shall replace the contents of the string pointed to by "name" by a unique -// filename, and return a file descriptor for the file open for reading and -// writing. Otherwise, -1 shall be returned if no suitable file could be -// created. The string in template should look like a filename with six -// trailing 'X' s; mkstemp() replaces each 'X' with a character from the -// portable filename character set. The characters are chosen such that the -// resulting name does not duplicate the name of an existing file at the -// time of a call to mkstemp() + // int mkstemp(char *name); + // shall replace the contents of the string pointed to by "name" by a unique + // filename, and return a file descriptor for the file open for reading and + // writing. Otherwise, -1 shall be returned if no suitable file could be + // created. The string in template should look like a filename with six + // trailing 'X' s; mkstemp() replaces each 'X' with a character from the + // portable filename character set. The characters are chosen such that the + // resulting name does not duplicate the name of an existing file at the + // time of a call to mkstemp() -// -// open temporary files for output -// + // + // open temporary files for output + // #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) if (_mktemp(name) == NULL) @@ -2153,7 +2153,7 @@ void Gnuplot::remove_tmpfiles() { if ((tmpfile_list).size() > 0) { - for (auto & i : tmpfile_list) + for (auto &i : tmpfile_list) if (remove(i.c_str()) != 0) std::cout << "Problem closing files" << std::endl; diff --git a/src/tests/common-files/tracking_tests_flags.h b/src/tests/common-files/tracking_tests_flags.h index 2ff85dabf..1724fcf68 100644 --- a/src/tests/common-files/tracking_tests_flags.h +++ b/src/tests/common-files/tracking_tests_flags.h @@ -42,6 +42,7 @@ DEFINE_double(external_signal_acquisition_threshold, 2.5, "Threshold for satelli DEFINE_int32(external_signal_acquisition_dwells, 5, "Maximum dwells count for satellite acquisition when external file is used"); DEFINE_double(external_signal_acquisition_doppler_max_hz, 5000.0, "Doppler max for satellite acquisition when external file is used"); DEFINE_double(external_signal_acquisition_doppler_step_hz, 125.0, "Doppler step for satellite acquisition when external file is used"); +DEFINE_bool(use_acquisition_resampler, false, "Reduce the sampling rate of the input signal for the acquisition in order to optimize the SNR and decrease the processor load"); DEFINE_string(signal_file, std::string("signal_out.bin"), "Path of the external signal capture file"); DEFINE_double(CN0_dBHz_start, std::numeric_limits::infinity(), "Enable noise generator and set the CN0 start sweep value [dB-Hz]"); diff --git a/src/tests/single_test_main.cc b/src/tests/single_test_main.cc index d539f2563..66a8ab7de 100644 --- a/src/tests/single_test_main.cc +++ b/src/tests/single_test_main.cc @@ -31,16 +31,16 @@ #include "agnss_ref_location.h" #include "agnss_ref_time.h" -#include "concurrent_queue.h" #include "concurrent_map.h" -#include "gps_navigation_message.h" -#include "gps_ephemeris.h" +#include "concurrent_queue.h" +#include "galileo_navigation_message.h" +#include "gps_acq_assist.h" #include "gps_cnav_ephemeris.h" #include "gps_cnav_iono.h" -#include "gps_acq_assist.h" -#include "galileo_navigation_message.h" -#include +#include "gps_ephemeris.h" +#include "gps_navigation_message.h" #include +#include #include #include #include diff --git a/src/tests/system-tests/position_test.cc b/src/tests/system-tests/position_test.cc index af63e8b38..b719dba55 100644 --- a/src/tests/system-tests/position_test.cc +++ b/src/tests/system-tests/position_test.cc @@ -32,31 +32,32 @@ * ------------------------------------------------------------------------- */ -#include "geofunctions.h" -#include "position_test_flags.h" -#include "rtklib_solver_dump_reader.h" -#include "spirent_motion_csv_dump_reader.h" +#include "MATH_CONSTANTS.h" +#include "acquisition_msg_rx.h" #include "concurrent_map.h" #include "concurrent_queue.h" #include "control_thread.h" -#include "in_memory_configuration.h" #include "file_configuration.h" -#include "MATH_CONSTANTS.h" +#include "geofunctions.h" #include "gnuplot_i.h" -#include "test_flags.h" +#include "in_memory_configuration.h" +#include "position_test_flags.h" +#include "rtklib_solver_dump_reader.h" #include "signal_generator_flags.h" -#include +#include "spirent_motion_csv_dump_reader.h" +#include "test_flags.h" +#include "tracking_tests_flags.h" //acquisition resampler #include +#include #include #include +#include #include #include #include #include #include #include -#include -#include // For GPS NAVIGATION (L1) concurrent_queue global_gps_acq_assist_queue; @@ -184,6 +185,11 @@ int PositionSystemTest::configure_receiver() const int output_rate_ms = 100; config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(sampling_rate_internal)); + // Enable automatic resampler for the acquisition, if required + if (FLAGS_use_acquisition_resampler == true) + { + config->set_property("GNSS-SDR.use_acquisition_resampler", "true"); + } // Set the assistance system parameters config->set_property("GNSS-SDR.SUPL_read_gps_assistance_xml", "false"); @@ -831,7 +837,7 @@ void PositionSystemTest::print_results(const arma::mat& R_eb_enu) { boost::filesystem::path p(gnuplot_executable); boost::filesystem::path dir = p.parent_path(); - std::string gnuplot_path = dir.native(); + const std::string& gnuplot_path = dir.native(); Gnuplot::set_GNUPlotPath(gnuplot_path); Gnuplot g1("points"); diff --git a/src/tests/system-tests/ttff.cc b/src/tests/system-tests/ttff.cc index 8d0cc4328..e9a51e762 100644 --- a/src/tests/system-tests/ttff.cc +++ b/src/tests/system-tests/ttff.cc @@ -34,9 +34,9 @@ #include "concurrent_queue.h" #include "control_thread.h" #include "file_configuration.h" -#include "in_memory_configuration.h" #include "gnss_flowgraph.h" #include "gps_acq_assist.h" +#include "in_memory_configuration.h" #include #include #include @@ -48,9 +48,9 @@ #include #include #include -#include #include #include +#include #include diff --git a/src/tests/test_main.cc b/src/tests/test_main.cc index 79627ae9a..6a96003fd 100644 --- a/src/tests/test_main.cc +++ b/src/tests/test_main.cc @@ -29,40 +29,35 @@ * ------------------------------------------------------------------------- */ -#include "concurrent_queue.h" #include "concurrent_map.h" +#include "concurrent_queue.h" #include "control_thread.h" -#include "gps_navigation_message.h" - -#include "gps_ephemeris.h" -#include "gps_cnav_ephemeris.h" -#include "gps_almanac.h" -#include "gps_iono.h" -#include "gps_cnav_iono.h" -#include "gps_utc_model.h" - -#include "galileo_ephemeris.h" #include "galileo_almanac.h" +#include "galileo_ephemeris.h" #include "galileo_iono.h" #include "galileo_utc_model.h" - -#include "sbas_ephemeris.h" - -#include "glonass_gnav_ephemeris.h" #include "glonass_gnav_almanac.h" +#include "glonass_gnav_ephemeris.h" #include "glonass_gnav_utc_model.h" - -#include -#include +#include "gps_almanac.h" +#include "gps_cnav_ephemeris.h" +#include "gps_cnav_iono.h" +#include "gps_ephemeris.h" +#include "gps_iono.h" +#include "gps_navigation_message.h" +#include "gps_utc_model.h" +#include "sbas_ephemeris.h" #include +#include +#include #include #include #include #include #include #include -#include #include +#include using google::LogMessage; @@ -84,99 +79,92 @@ DECLARE_string(log_dir); #else +#include "unit-tests/arithmetic/matio_test.cc" +#include "unit-tests/arithmetic/code_generation_test.cc" #include "unit-tests/arithmetic/complex_carrier_test.cc" #include "unit-tests/arithmetic/conjugate_test.cc" -#include "unit-tests/arithmetic/magnitude_squared_test.cc" -#include "unit-tests/arithmetic/multiply_test.cc" -#include "unit-tests/arithmetic/code_generation_test.cc" #include "unit-tests/arithmetic/fft_length_test.cc" #include "unit-tests/arithmetic/fft_speed_test.cc" -#include "unit-tests/arithmetic/matio_test.cc" - -#include "unit-tests/control-plane/file_configuration_test.cc" -#include "unit-tests/control-plane/in_memory_configuration_test.cc" +#include "unit-tests/arithmetic/magnitude_squared_test.cc" +#include "unit-tests/arithmetic/multiply_test.cc" #include "unit-tests/control-plane/control_message_factory_test.cc" #include "unit-tests/control-plane/control_thread_test.cc" -#include "unit-tests/control-plane/gnss_flowgraph_test.cc" -#include "unit-tests/control-plane/string_converter_test.cc" +#include "unit-tests/control-plane/file_configuration_test.cc" #include "unit-tests/control-plane/gnss_block_factory_test.cc" - +#include "unit-tests/control-plane/gnss_flowgraph_test.cc" +#include "unit-tests/control-plane/in_memory_configuration_test.cc" +#include "unit-tests/control-plane/string_converter_test.cc" +#include "unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc" +#include "unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc" +#include "unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc" +#include "unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc" +#include "unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc" +#include "unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc" +#include "unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc" +#include "unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc" +#include "unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc" +#include "unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc" +#include "unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc" +#include "unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc" +#include "unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc" +#include "unit-tests/signal-processing-blocks/adapter/adapter_test.cc" +#include "unit-tests/signal-processing-blocks/adapter/pass_through_test.cc" +#include "unit-tests/signal-processing-blocks/filter/fir_filter_test.cc" +#include "unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc" +#include "unit-tests/signal-processing-blocks/filter/notch_filter_test.cc" +#include "unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc" +#include "unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc" +#include "unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc" #include "unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc" #include "unit-tests/signal-processing-blocks/sources/gnss_sdr_valve_test.cc" #include "unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc" - -#include "unit-tests/signal-processing-blocks/adapter/pass_through_test.cc" -#include "unit-tests/signal-processing-blocks/adapter/adapter_test.cc" - -#include "unit-tests/signal-processing-blocks/filter/fir_filter_test.cc" -#include "unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc" -#include "unit-tests/signal-processing-blocks/filter/notch_filter_test.cc" -#include "unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc" - -#include "unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc" -#include "unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc" - -#include "unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc" -#include "unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc" -#include "unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc" -#include "unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc" -#include "unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc" -#include "unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc" -#include "unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc" -#include "unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc" -#include "unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc" -#include "unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc" -#include "unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc" -#include "unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc" -#include "unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc" // #include "unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc" #if OPENCL_BLOCKS_TEST #include "unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc" #endif +#include "unit-tests/signal-processing-blocks/tracking/bayesian_estimation_test.cc" +#include "unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc" +#include "unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc" #include "unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc" #include "unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc" -#include "unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc" #include "unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc" +#include "unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc" #include "unit-tests/signal-processing-blocks/tracking/tracking_loop_filter_test.cc" -#include "unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc" -#include "unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc" -#include "unit-tests/signal-processing-blocks/tracking/bayesian_estimation_test.cc" #if CUDA_BLOCKS_TEST #include "unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc" #endif #if FPGA_BLOCKS_TEST -#include "unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc" #include "unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc" +#include "unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc" #endif +#include "unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc" +#include "unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc" +#include "unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc" +#include "unit-tests/signal-processing-blocks/pvt/rtcm_test.cc" #include "unit-tests/signal-processing-blocks/telemetry_decoder/galileo_fnav_inav_decoder_test.cc" #include "unit-tests/system-parameters/glonass_gnav_ephemeris_test.cc" #include "unit-tests/system-parameters/glonass_gnav_nav_message_test.cc" -#include "unit-tests/signal-processing-blocks/pvt/rtcm_test.cc" -#include "unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc" -#include "unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc" -#include "unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc" - #if EXTRA_TESTS -#include "unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc" -#include "unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc" #include "unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc" -#include "unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc" +#include "unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc" +#include "unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc" +#include "unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc" #include "unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc" #include "unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc" +#include "unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc" #include "unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc" -#include "unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc" #if ENABLE_FPGA #include "unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc" #endif -#include "unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc" #include "unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc" +#include "unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc" #endif #endif // UNIT_TESTING_MINIMAL diff --git a/src/tests/unit-tests/arithmetic/code_generation_test.cc b/src/tests/unit-tests/arithmetic/code_generation_test.cc index 21f32dd47..d89b03365 100644 --- a/src/tests/unit-tests/arithmetic/code_generation_test.cc +++ b/src/tests/unit-tests/arithmetic/code_generation_test.cc @@ -29,10 +29,10 @@ * ------------------------------------------------------------------------- */ +#include "gnss_signal_processing.h" +#include "gps_sdr_signal_processing.h" #include #include -#include "gps_sdr_signal_processing.h" -#include "gnss_signal_processing.h" TEST(CodeGenerationTest, CodeGenGPSL1Test) diff --git a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc index 1d4a0a900..3cac38fbe 100644 --- a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc +++ b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc @@ -29,10 +29,10 @@ * ------------------------------------------------------------------------- */ +#include "gnss_signal_processing.h" +#include #include #include -#include -#include "gnss_signal_processing.h" DEFINE_int32(size_carrier_test, 100000, "Size of the arrays used for complex carrier testing"); diff --git a/src/tests/unit-tests/arithmetic/conjugate_test.cc b/src/tests/unit-tests/arithmetic/conjugate_test.cc index ec1c6e3f0..1eaa4cc09 100644 --- a/src/tests/unit-tests/arithmetic/conjugate_test.cc +++ b/src/tests/unit-tests/arithmetic/conjugate_test.cc @@ -29,12 +29,12 @@ * ------------------------------------------------------------------------- */ -#include -#include -#include #include #include #include +#include +#include +#include DEFINE_int32(size_conjugate_test, 100000, "Size of the arrays used for conjugate testing"); diff --git a/src/tests/unit-tests/arithmetic/fft_length_test.cc b/src/tests/unit-tests/arithmetic/fft_length_test.cc index f7f006d99..3e75c4285 100644 --- a/src/tests/unit-tests/arithmetic/fft_length_test.cc +++ b/src/tests/unit-tests/arithmetic/fft_length_test.cc @@ -29,14 +29,14 @@ * ------------------------------------------------------------------------- */ +#include "gnuplot_i.h" +#include "test_flags.h" +#include +#include #include #include #include #include -#include -#include -#include "gnuplot_i.h" -#include "test_flags.h" DEFINE_int32(fft_iterations_test, 1000, "Number of averaged iterations in FFT length timing test"); diff --git a/src/tests/unit-tests/arithmetic/fft_speed_test.cc b/src/tests/unit-tests/arithmetic/fft_speed_test.cc index c18c0f822..009b40838 100644 --- a/src/tests/unit-tests/arithmetic/fft_speed_test.cc +++ b/src/tests/unit-tests/arithmetic/fft_speed_test.cc @@ -30,10 +30,10 @@ * ------------------------------------------------------------------------- */ +#include +#include #include #include -#include -#include DEFINE_int32(fft_speed_iterations_test, 100, "Number of averaged iterations in FFT length timing test"); diff --git a/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc b/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc index 616487a8a..5a51b32be 100644 --- a/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc +++ b/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc @@ -30,12 +30,12 @@ * ------------------------------------------------------------------------- */ -#include -#include -#include #include #include #include +#include +#include +#include DEFINE_int32(size_magnitude_test, 100000, "Size of the arrays used for magnitude testing"); diff --git a/src/tests/unit-tests/arithmetic/matio_test.cc b/src/tests/unit-tests/arithmetic/matio_test.cc index d8a51f46b..681aa8a94 100644 --- a/src/tests/unit-tests/arithmetic/matio_test.cc +++ b/src/tests/unit-tests/arithmetic/matio_test.cc @@ -30,10 +30,10 @@ * ------------------------------------------------------------------------- */ -#include -#include #include #include +#include +#include TEST(MatioTest, WriteAndReadDoubles) { diff --git a/src/tests/unit-tests/arithmetic/multiply_test.cc b/src/tests/unit-tests/arithmetic/multiply_test.cc index 19abb0434..f4747431f 100644 --- a/src/tests/unit-tests/arithmetic/multiply_test.cc +++ b/src/tests/unit-tests/arithmetic/multiply_test.cc @@ -30,13 +30,13 @@ * ------------------------------------------------------------------------- */ +#include +#include +#include #include #include #include #include -#include -#include -#include DEFINE_int32(size_multiply_test, 100000, "Size of the arrays used for multiply testing"); diff --git a/src/tests/unit-tests/control-plane/control_message_factory_test.cc b/src/tests/unit-tests/control-plane/control_message_factory_test.cc index dd372de97..7440d37f4 100644 --- a/src/tests/unit-tests/control-plane/control_message_factory_test.cc +++ b/src/tests/unit-tests/control-plane/control_message_factory_test.cc @@ -31,9 +31,9 @@ */ -#include -#include #include "control_message_factory.h" +#include +#include TEST(ControlMessageFactoryTest, GetQueueMessage) diff --git a/src/tests/unit-tests/control-plane/control_thread_test.cc b/src/tests/unit-tests/control-plane/control_thread_test.cc index 2cc7c6ca2..0155cb227 100644 --- a/src/tests/unit-tests/control-plane/control_thread_test.cc +++ b/src/tests/unit-tests/control-plane/control_thread_test.cc @@ -31,25 +31,25 @@ */ -#include +#include "control_message_factory.h" +#include "control_thread.h" +#include "in_memory_configuration.h" +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -#include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include "control_thread.h" -#include "in_memory_configuration.h" -#include "control_message_factory.h" +#include class ControlThreadTest : public ::testing::Test @@ -88,7 +88,7 @@ int ControlThreadTest::stop_receiver() } -TEST_F(ControlThreadTest, InstantiateRunControlMessages) +TEST_F(ControlThreadTest /*unused*/, InstantiateRunControlMessages /*unused*/) { std::shared_ptr config = std::make_shared(); @@ -150,7 +150,7 @@ TEST_F(ControlThreadTest, InstantiateRunControlMessages) } -TEST_F(ControlThreadTest, InstantiateRunControlMessages2) +TEST_F(ControlThreadTest /*unused*/, InstantiateRunControlMessages2 /*unused*/) { std::shared_ptr config = std::make_shared(); config->set_property("SignalSource.implementation", "File_Signal_Source"); @@ -214,7 +214,7 @@ TEST_F(ControlThreadTest, InstantiateRunControlMessages2) } -TEST_F(ControlThreadTest, StopReceiverProgrammatically) +TEST_F(ControlThreadTest /*unused*/, StopReceiverProgrammatically /*unused*/) { std::shared_ptr config = std::make_shared(); config->set_property("SignalSource.implementation", "File_Signal_Source"); diff --git a/src/tests/unit-tests/control-plane/file_configuration_test.cc b/src/tests/unit-tests/control-plane/file_configuration_test.cc index 68fa64aad..6f7661f30 100644 --- a/src/tests/unit-tests/control-plane/file_configuration_test.cc +++ b/src/tests/unit-tests/control-plane/file_configuration_test.cc @@ -30,8 +30,8 @@ */ -#include #include "file_configuration.h" +#include TEST(FileConfigurationTest, OverridedProperties) diff --git a/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc b/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc index 1dfa028cf..9eff70397 100644 --- a/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc +++ b/src/tests/unit-tests/control-plane/gnss_block_factory_test.cc @@ -33,18 +33,18 @@ * ------------------------------------------------------------------------- */ -#include -#include -#include -#include "in_memory_configuration.h" -#include "gnss_block_interface.h" #include "acquisition_interface.h" -#include "tracking_interface.h" -#include "telemetry_decoder_interface.h" +#include "channel.h" +#include "gnss_block_factory.h" +#include "gnss_block_interface.h" +#include "in_memory_configuration.h" #include "observables_interface.h" #include "pvt_interface.h" -#include "gnss_block_factory.h" -#include "channel.h" +#include "telemetry_decoder_interface.h" +#include "tracking_interface.h" +#include +#include +#include TEST(GNSSBlockFactoryTest, InstantiateFileSignalSource) { diff --git a/src/tests/unit-tests/control-plane/gnss_flowgraph_test.cc b/src/tests/unit-tests/control-plane/gnss_flowgraph_test.cc index bca21b629..711b49d5f 100644 --- a/src/tests/unit-tests/control-plane/gnss_flowgraph_test.cc +++ b/src/tests/unit-tests/control-plane/gnss_flowgraph_test.cc @@ -30,21 +30,21 @@ * ------------------------------------------------------------------------- */ +#include "acquisition_interface.h" +#include "channel.h" +#include "channel_interface.h" +#include "file_configuration.h" +#include "file_signal_source.h" +#include "gnss_block_interface.h" +#include "gnss_flowgraph.h" +#include "in_memory_configuration.h" +#include "pass_through.h" +#include "tracking_interface.h" #include #include -#include "gnss_flowgraph.h" -#include "gnss_block_interface.h" -#include "in_memory_configuration.h" -#include "file_configuration.h" -#include "channel.h" -#include "acquisition_interface.h" -#include "tracking_interface.h" -#include "channel_interface.h" -#include "pass_through.h" -#include "file_signal_source.h" -TEST(GNSSFlowgraph, InstantiateConnectStartStopOldNotation) +TEST(GNSSFlowgraph /*unused*/, InstantiateConnectStartStopOldNotation /*unused*/) { std::shared_ptr config = std::make_shared(); @@ -80,7 +80,7 @@ TEST(GNSSFlowgraph, InstantiateConnectStartStopOldNotation) } -TEST(GNSSFlowgraph, InstantiateConnectStartStop) +TEST(GNSSFlowgraph /*unused*/, InstantiateConnectStartStop /*unused*/) { std::shared_ptr config = std::make_shared(); config->set_property("GNSS-SDR.internal_fs_sps", "4000000"); @@ -114,7 +114,7 @@ TEST(GNSSFlowgraph, InstantiateConnectStartStop) EXPECT_FALSE(flowgraph->running()); } -TEST(GNSSFlowgraph, InstantiateConnectStartStopGalileoE1B) +TEST(GNSSFlowgraph /*unused*/, InstantiateConnectStartStopGalileoE1B /*unused*/) { std::shared_ptr config = std::make_shared(); config->set_property("GNSS-SDR.internal_fs_sps", "4000000"); @@ -149,7 +149,7 @@ TEST(GNSSFlowgraph, InstantiateConnectStartStopGalileoE1B) } -TEST(GNSSFlowgraph, InstantiateConnectStartStopHybrid) +TEST(GNSSFlowgraph /*unused*/, InstantiateConnectStartStopHybrid /*unused*/) { std::shared_ptr config = std::make_shared(); config->set_property("GNSS-SDR.internal_fs_sps", "4000000"); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc index d0dcc4673..8b738eebf 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc @@ -29,29 +29,29 @@ * ------------------------------------------------------------------------- */ -#include "gps_l1_ca_pcps_acquisition.h" -#include "gps_l1_ca_pcps_acquisition_fine_doppler.h" +#include "acquisition_dump_reader.h" +#include "display.h" +#include "file_configuration.h" #include "galileo_e1_pcps_ambiguous_acquisition.h" #include "galileo_e5a_pcps_acquisition.h" #include "glonass_l1_ca_pcps_acquisition.h" #include "glonass_l2_ca_pcps_acquisition.h" +#include "gnss_sdr_valve.h" +#include "gnuplot_i.h" +#include "gps_l1_ca_pcps_acquisition.h" +#include "gps_l1_ca_pcps_acquisition_fine_doppler.h" #include "gps_l2_m_pcps_acquisition.h" #include "gps_l5i_pcps_acquisition.h" #include "in_memory_configuration.h" -#include "file_configuration.h" -#include "gnss_sdr_valve.h" -#include "acquisition_dump_reader.h" -#include "display.h" -#include "gnuplot_i.h" #include "signal_generator_flags.h" #include "test_flags.h" #include "tracking_true_obs_reader.h" #include "true_observables_reader.h" #include -#include #include #include #include +#include DEFINE_string(config_file_ptest, std::string(""), "File containing alternative configuration parameters for the acquisition performance test."); @@ -87,6 +87,8 @@ DEFINE_int32(acq_test_iterations, 1, "Number of iterations (same signal, differe DEFINE_bool(plot_acq_test, false, "Plots results with gnuplot, if available"); DEFINE_int32(acq_test_skiphead, 0, "Number of samples to skip in the input file"); +DEFINE_bool(acq_test_dump, false, "Dump the results of an acquisition block into .mat files."); + // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class AcqPerfTest_msg_rx; @@ -523,8 +525,15 @@ int AcquisitionPerformanceTest::configure_receiver(double cn0, float pfa, unsign config->set_property("Acquisition.make_two_steps", "false"); } + if (FLAGS_acq_test_dump) + { + config->set_property("Acquisition.dump", "true"); + } + else + { + config->set_property("Acquisition.dump", "false"); + } - config->set_property("Acquisition.dump", "true"); std::string dump_file = path_str + std::string("/acquisition_") + std::to_string(cn0) + "_" + std::to_string(iter) + "_" + std::to_string(pfa); config->set_property("Acquisition.dump_filename", dump_file); config->set_property("Acquisition.dump_channel", std::to_string(dump_channel)); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc index edc2eb3ce..7e3be06c6 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc @@ -30,27 +30,27 @@ */ -#include #include -#include -#include #include +#include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include "gnss_block_interface.h" -#include "in_memory_configuration.h" -#include "gnss_synchro.h" +#include "fir_filter.h" #include "galileo_e1_pcps_8ms_ambiguous_acquisition.h" +#include "gen_signal_source.h" +#include "gnss_block_interface.h" +#include "gnss_sdr_valve.h" +#include "gnss_synchro.h" +#include "in_memory_configuration.h" #include "signal_generator.h" #include "signal_generator_c.h" -#include "fir_filter.h" -#include "gen_signal_source.h" -#include "gnss_sdr_valve.h" +#include +#include // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc index d5cbef8c0..7f15ac400 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc @@ -31,26 +31,26 @@ */ -#include -#include -#include #include +#include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include "gnss_block_interface.h" -#include "in_memory_configuration.h" -#include "gnss_synchro.h" +#include "fir_filter.h" #include "galileo_e1_pcps_ambiguous_acquisition.h" +#include "gen_signal_source.h" +#include "gnss_block_interface.h" +#include "gnss_sdr_valve.h" +#include "gnss_synchro.h" +#include "in_memory_configuration.h" #include "signal_generator.h" #include "signal_generator_c.h" -#include "fir_filter.h" -#include "gen_signal_source.h" -#include "gnss_sdr_valve.h" +#include +#include // ######## GNURADIO BLOCK MESSAGE RECEVER ######### diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc index e0c6b4534..73b67416b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc @@ -41,25 +41,25 @@ */ -#include -#include -#include #include +#include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include +#include "galileo_e1_pcps_ambiguous_acquisition.h" #include "gnss_block_factory.h" #include "gnss_block_interface.h" -#include "in_memory_configuration.h" #include "gnss_sdr_valve.h" #include "gnss_signal.h" #include "gnss_synchro.h" -#include "galileo_e1_pcps_ambiguous_acquisition.h" +#include "in_memory_configuration.h" +#include +#include +#include // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc index 10ed1e676..786bfbff7 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc @@ -31,31 +31,31 @@ */ -#include #include #include -#include -#include #include +#include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include +#include "Galileo_E1.h" +#include "acquisition_dump_reader.h" +#include "galileo_e1_pcps_ambiguous_acquisition.h" #include "gnss_block_factory.h" #include "gnss_block_interface.h" -#include "in_memory_configuration.h" #include "gnss_sdr_valve.h" #include "gnss_signal.h" #include "gnss_synchro.h" #include "gnuplot_i.h" +#include "in_memory_configuration.h" #include "test_flags.h" -#include "acquisition_dump_reader.h" -#include "galileo_e1_pcps_ambiguous_acquisition.h" -#include "Galileo_E1.h" +#include +#include +#include // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc index d2738a9a3..3388bf162 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc @@ -31,27 +31,27 @@ */ -#include #include -#include -#include #include +#include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include "gnss_block_interface.h" -#include "in_memory_configuration.h" -#include "gnss_synchro.h" +#include "fir_filter.h" #include "galileo_e1_pcps_cccwsr_ambiguous_acquisition.h" +#include "gen_signal_source.h" +#include "gnss_block_interface.h" +#include "gnss_sdr_valve.h" +#include "gnss_synchro.h" +#include "in_memory_configuration.h" #include "signal_generator.h" #include "signal_generator_c.h" -#include "fir_filter.h" -#include "gen_signal_source.h" -#include "gnss_sdr_valve.h" +#include +#include // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc index 9acd50a0a..b4a7b4410 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc @@ -31,29 +31,29 @@ */ +#include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include #ifdef GR_GREATER_38 #include #else #include #endif -#include +#include "fir_filter.h" +#include "galileo_e1_pcps_quicksync_ambiguous_acquisition.h" +#include "gen_signal_source.h" #include "gnss_block_interface.h" -#include "in_memory_configuration.h" +#include "gnss_sdr_valve.h" #include "gnss_synchro.h" +#include "in_memory_configuration.h" #include "signal_generator.h" #include "signal_generator_c.h" -#include "fir_filter.h" -#include "gen_signal_source.h" -#include "gnss_sdr_valve.h" -#include "galileo_e1_pcps_quicksync_ambiguous_acquisition.h" +#include DEFINE_double(e1_value_threshold, 0.3, "Value of the threshold for the acquisition"); DEFINE_int32(e1_value_CN0_dB_0, 50, "Value for the CN0_dB_0 in channel 0"); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc index ce86126ea..8fe2305a3 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc @@ -30,30 +30,30 @@ * ------------------------------------------------------------------------- */ -#include #include #include -#include -#include #include +#include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include -#include "gnss_block_interface.h" -#include "in_memory_configuration.h" #include "configuration_interface.h" -#include "gnss_synchro.h" +#include "fir_filter.h" #include "galileo_e1_pcps_tong_ambiguous_acquisition.h" +#include "gen_signal_source.h" +#include "gnss_block_interface.h" +#include "gnss_sdr_valve.h" +#include "gnss_synchro.h" +#include "in_memory_configuration.h" #include "signal_generator.h" #include "signal_generator_c.h" -#include "fir_filter.h" -#include "gen_signal_source.h" -#include "gnss_sdr_valve.h" +#include +#include +#include // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc index 63cf64e3e..df67c7756 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc @@ -29,27 +29,27 @@ * ------------------------------------------------------------------------- */ -#include -#include -#include #include +#include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include "gnss_block_interface.h" -#include "in_memory_configuration.h" -#include "gnss_synchro.h" +#include "fir_filter.h" #include "galileo_e5a_noncoherent_iq_acquisition_caf.h" +#include "gen_signal_source.h" +#include "gnss_block_interface.h" +#include "gnss_sdr_valve.h" +#include "gnss_synchro.h" +#include "in_memory_configuration.h" +#include "pass_through.h" #include "signal_generator.h" #include "signal_generator_c.h" -#include "fir_filter.h" -#include "gen_signal_source.h" -#include "gnss_sdr_valve.h" -#include "pass_through.h" +#include +#include // ######## GNURADIO BLOCK MESSAGE RECEVER ######### diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc index 30758feac..70ad8e25e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc @@ -31,30 +31,30 @@ */ -#include -#include -#include #include +#include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include -#include "gnss_block_interface.h" -#include "in_memory_configuration.h" #include "configuration_interface.h" -#include "gnss_synchro.h" -#include "glonass_l1_ca_pcps_acquisition.h" -#include "signal_generator.h" -#include "signal_generator_c.h" #include "freq_xlating_fir_filter.h" #include "gen_signal_source.h" +#include "glonass_l1_ca_pcps_acquisition.h" +#include "gnss_block_interface.h" #include "gnss_sdr_valve.h" -#include "boost/shared_ptr.hpp" +#include "gnss_synchro.h" +#include "in_memory_configuration.h" #include "pass_through.h" +#include "signal_generator.h" +#include "signal_generator_c.h" +#include "boost/shared_ptr.hpp" +#include +#include +#include // ######## GNURADIO BLOCK MESSAGE RECEVER ######### diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc index b250b7e64..9fca76da0 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc @@ -30,28 +30,28 @@ * ------------------------------------------------------------------------- */ -#include -#include #include #include -#include -#include #include +#include +#include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include -#include "gnss_block_factory.h" -#include "gnss_block_interface.h" -#include "in_memory_configuration.h" -#include "gnss_sdr_valve.h" -#include "gnss_synchro.h" #include "freq_xlating_fir_filter.h" #include "glonass_l1_ca_pcps_acquisition.h" +#include "gnss_block_factory.h" +#include "gnss_block_interface.h" +#include "gnss_sdr_valve.h" +#include "gnss_synchro.h" +#include "in_memory_configuration.h" +#include +#include +#include // ######## GNURADIO BLOCK MESSAGE RECEVER ######### diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc index cf2af8a56..a8f668f69 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc @@ -30,30 +30,30 @@ */ -#include -#include -#include #include +#include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include -#include "gnss_block_interface.h" -#include "in_memory_configuration.h" #include "configuration_interface.h" -#include "gnss_synchro.h" -#include "glonass_l2_ca_pcps_acquisition.h" -#include "signal_generator.h" -#include "signal_generator_c.h" #include "fir_filter.h" #include "gen_signal_source.h" +#include "glonass_l2_ca_pcps_acquisition.h" +#include "gnss_block_interface.h" #include "gnss_sdr_valve.h" -#include "boost/shared_ptr.hpp" +#include "gnss_synchro.h" +#include "in_memory_configuration.h" #include "pass_through.h" +#include "signal_generator.h" +#include "signal_generator_c.h" +#include "boost/shared_ptr.hpp" +#include +#include +#include // ######## GNURADIO BLOCK MESSAGE RECEVER ######### diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc index 7fe814a5c..af4f5b6a5 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc @@ -31,30 +31,30 @@ */ -#include -#include -#include #include +#include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include -#include "gnss_block_interface.h" -#include "in_memory_configuration.h" #include "configuration_interface.h" -#include "gnss_synchro.h" -#include "gps_l1_ca_pcps_acquisition.h" -#include "signal_generator.h" -#include "signal_generator_c.h" #include "fir_filter.h" #include "gen_signal_source.h" +#include "gnss_block_interface.h" #include "gnss_sdr_valve.h" -#include "boost/shared_ptr.hpp" +#include "gnss_synchro.h" +#include "gps_l1_ca_pcps_acquisition.h" +#include "in_memory_configuration.h" #include "pass_through.h" +#include "signal_generator.h" +#include "signal_generator_c.h" +#include "boost/shared_ptr.hpp" +#include +#include +#include // ######## GNURADIO BLOCK MESSAGE RECEVER ######### diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc index 1f3f2cd04..d93f11918 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc @@ -31,32 +31,32 @@ */ -#include #include #include -#include #include -#include -#include #include +#include +#include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include +#include "GPS_L1_CA.h" +#include "acquisition_dump_reader.h" #include "gnss_block_factory.h" #include "gnss_block_interface.h" -#include "in_memory_configuration.h" #include "gnss_sdr_valve.h" #include "gnss_synchro.h" #include "gnuplot_i.h" -#include "GPS_L1_CA.h" -#include "test_flags.h" -#include "acquisition_dump_reader.h" #include "gps_l1_ca_pcps_acquisition.h" +#include "in_memory_configuration.h" +#include "test_flags.h" +#include +#include +#include // ######## GNURADIO BLOCK MESSAGE RECEVER ######### @@ -199,7 +199,7 @@ void GpsL1CaPcpsAcquisitionTest::plot_grid() { boost::filesystem::path p(gnuplot_executable); boost::filesystem::path dir = p.parent_path(); - const std::string& gnuplot_path = dir.native(); + const std::string &gnuplot_path = dir.native(); Gnuplot::set_GNUPlotPath(gnuplot_path); Gnuplot g1("lines"); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc index 4fba7a4b9..79515988e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc @@ -29,29 +29,28 @@ * ------------------------------------------------------------------------- */ -#include -#include #include #include -#include -#include #include +#include +#include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include -#include #include "gnss_block_factory.h" #include "gnss_block_interface.h" -#include "in_memory_configuration.h" #include "gnss_sdr_valve.h" #include "gnss_synchro.h" #include "gps_l1_ca_pcps_acquisition_fpga.h" - +#include "in_memory_configuration.h" +#include +#include +#include +#include #include #define DMA_ACQ_TRANSFER_SIZE 2046 // DMA transfer size for the acquisition diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc index 4ff687b66..2fa64118b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc @@ -31,28 +31,28 @@ */ -#include #include -#include -#include #include +#include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include "gnss_block_interface.h" -#include "in_memory_configuration.h" #include "configuration_interface.h" -#include "gnss_synchro.h" -#include "gps_l1_ca_pcps_opencl_acquisition.h" -#include "signal_generator.h" -#include "signal_generator_c.h" #include "fir_filter.h" #include "gen_signal_source.h" +#include "gnss_block_interface.h" #include "gnss_sdr_valve.h" +#include "gnss_synchro.h" +#include "gps_l1_ca_pcps_opencl_acquisition.h" +#include "in_memory_configuration.h" +#include "signal_generator.h" +#include "signal_generator_c.h" +#include +#include // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc index 2ffd1bd15..966b33473 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc @@ -31,28 +31,28 @@ */ +#include +#include +#include +#include #include #include -#include -#include -#include -#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include #include "gnss_block_factory.h" #include "gnss_block_interface.h" -#include "in_memory_configuration.h" #include "gnss_sdr_valve.h" #include "gnss_synchro.h" +#include "gps_l1_ca_pcps_quicksync_acquisition.h" +#include "in_memory_configuration.h" #include "signal_generator.h" #include "signal_generator_c.h" -#include "gps_l1_ca_pcps_quicksync_acquisition.h" +#include +#include +#include DEFINE_double(value_threshold, 1, "Value of the threshold for the acquisition"); DEFINE_int32(value_CN0_dB_0, 44, "Value for the CN0_dB_0 in channel 0"); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc index d069fd703..d24b4b0f7 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc @@ -31,29 +31,29 @@ */ -#include #include -#include -#include #include +#include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include -#include "gnss_block_interface.h" -#include "in_memory_configuration.h" #include "configuration_interface.h" -#include "gnss_synchro.h" -#include "gps_l1_ca_pcps_tong_acquisition.h" -#include "signal_generator.h" -#include "signal_generator_c.h" #include "fir_filter.h" #include "gen_signal_source.h" +#include "gnss_block_interface.h" #include "gnss_sdr_valve.h" +#include "gnss_synchro.h" +#include "gps_l1_ca_pcps_tong_acquisition.h" +#include "in_memory_configuration.h" +#include "signal_generator.h" +#include "signal_generator_c.h" +#include +#include +#include // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc index d6cb2813c..f2d5e8e41 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc @@ -31,32 +31,32 @@ */ -#include #include #include -#include -#include #include +#include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include -#include -#include +#include "GPS_L2C.h" +#include "acquisition_dump_reader.h" #include "gnss_block_factory.h" #include "gnss_block_interface.h" -#include "in_memory_configuration.h" #include "gnss_sdr_valve.h" #include "gnss_synchro.h" #include "gnuplot_i.h" -#include "test_flags.h" -#include "acquisition_dump_reader.h" #include "gps_l2_m_pcps_acquisition.h" -#include "GPS_L2C.h" +#include "in_memory_configuration.h" +#include "test_flags.h" +#include +#include +#include +#include +#include // ######## GNURADIO BLOCK MESSAGE RECEVER ######### diff --git a/src/tests/unit-tests/signal-processing-blocks/adapter/adapter_test.cc b/src/tests/unit-tests/signal-processing-blocks/adapter/adapter_test.cc index 9c6540e9b..89f2cd338 100644 --- a/src/tests/unit-tests/signal-processing-blocks/adapter/adapter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/adapter/adapter_test.cc @@ -29,22 +29,22 @@ * ------------------------------------------------------------------------- */ +#include "byte_to_short.h" +#include "ibyte_to_cbyte.h" +#include "ibyte_to_complex.h" +#include "ibyte_to_cshort.h" +#include "in_memory_configuration.h" +#include "ishort_to_complex.h" +#include "ishort_to_cshort.h" +#include +#include +#include #include #include #include #include #include #include -#include -#include -#include -#include "byte_to_short.h" -#include "ibyte_to_cbyte.h" -#include "ibyte_to_complex.h" -#include "ibyte_to_cshort.h" -#include "ishort_to_complex.h" -#include "ishort_to_cshort.h" -#include "in_memory_configuration.h" class DataTypeAdapter : public ::testing::Test diff --git a/src/tests/unit-tests/signal-processing-blocks/adapter/pass_through_test.cc b/src/tests/unit-tests/signal-processing-blocks/adapter/pass_through_test.cc index 224c073e1..e15c5d253 100644 --- a/src/tests/unit-tests/signal-processing-blocks/adapter/pass_through_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/adapter/pass_through_test.cc @@ -31,9 +31,9 @@ */ +#include "in_memory_configuration.h" #include "pass_through.h" #include -#include "in_memory_configuration.h" TEST(PassThroughTest, Instantiate) diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc index 35f7b1211..9c411c862 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc @@ -28,28 +28,28 @@ * ------------------------------------------------------------------------- */ +#include +#include +#include #include #include #include -#include -#include -#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include +#include "file_signal_source.h" +#include "fir_filter.h" #include "gnss_block_factory.h" #include "gnss_block_interface.h" -#include "in_memory_configuration.h" #include "gnss_sdr_valve.h" +#include "in_memory_configuration.h" #include "interleaved_byte_to_complex_byte.h" #include "interleaved_short_to_complex_short.h" -#include "fir_filter.h" -#include "file_signal_source.h" +#include +#include +#include DEFINE_int32(filter_test_nsamples, 1000000, "Number of samples to filter in the tests (max: 2147483647)"); diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc index 459a096da..f23a84558 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc @@ -28,26 +28,26 @@ * ------------------------------------------------------------------------- */ +#include +#include +#include #include #include #include -#include -#include -#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include +#include "file_signal_source.h" #include "gnss_block_factory.h" #include "gnss_block_interface.h" -#include "in_memory_configuration.h" #include "gnss_sdr_valve.h" +#include "in_memory_configuration.h" #include "notch_filter_lite.h" -#include "file_signal_source.h" +#include +#include +#include DEFINE_int32(notch_filter_lite_test_nsamples, 1000000, "Number of samples to filter in the tests (max: 2147483647)"); diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc index aa61101f4..b3c9fbece 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc @@ -28,26 +28,26 @@ * ------------------------------------------------------------------------- */ +#include +#include +#include #include #include #include -#include -#include -#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include +#include "file_signal_source.h" #include "gnss_block_factory.h" #include "gnss_block_interface.h" -#include "in_memory_configuration.h" #include "gnss_sdr_valve.h" +#include "in_memory_configuration.h" #include "notch_filter.h" -#include "file_signal_source.h" +#include +#include +#include DEFINE_int32(notch_filter_test_nsamples, 1000000, "Number of samples to filter in the tests (max: 2147483647)"); diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc index 17c2e49db..729ff78dd 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc @@ -28,26 +28,26 @@ * ------------------------------------------------------------------------- */ +#include +#include +#include #include #include #include -#include -#include -#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include +#include "file_signal_source.h" #include "gnss_block_factory.h" #include "gnss_block_interface.h" -#include "in_memory_configuration.h" #include "gnss_sdr_valve.h" +#include "in_memory_configuration.h" #include "pulse_blanking_filter.h" -#include "file_signal_source.h" +#include +#include +#include DEFINE_int32(pb_filter_test_nsamples, 1000000, "Number of samples to filter in the tests (max: 2147483647)"); diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc index dc5a7a40b..4295a6564 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.cc @@ -31,11 +31,11 @@ */ #include "acquisition_msg_rx.h" -#include #include -#include #include #include +#include +#include Acquisition_msg_rx_sptr Acquisition_msg_rx_make() diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.h b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.h index 2095bff72..90a61a482 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.h @@ -33,8 +33,8 @@ #ifndef GNSS_SDR_ACQUISITION_MSG_RX_H #define GNSS_SDR_ACQUISITION_MSG_RX_H -#include #include +#include #include // ######## GNURADIO ACQUISITION BLOCK MESSAGE RECEVER ######### diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc index 25ec5b66b..efa913404 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc @@ -92,7 +92,7 @@ bool tracking_true_obs_reader::open_obs_file(std::string out_file) } catch (const std::ifstream::failure &e) { - std::cout << "Problem opening Tracking dump Log file: " << d_dump_filename.c_str() << " Error: " << e.what() << std::endl; + std::cout << "Problem opening Tracking dump Log file: " << d_dump_filename.c_str() << std::endl; return false; } } diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc index 4883b3c60..feccb8105 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc @@ -30,51 +30,61 @@ * ------------------------------------------------------------------------- */ -#include -#include -#include +#include "GPS_L1_CA.h" +#include "GPS_L2C.h" +#include "GPS_L5.h" +#include "Galileo_E1.h" +#include "Galileo_E5a.h" +#include "acquisition_msg_rx.h" +#include "galileo_e1_pcps_ambiguous_acquisition.h" +#include "galileo_e5a_noncoherent_iq_acquisition_caf.h" +#include "galileo_e5a_pcps_acquisition.h" +#include "glonass_l1_ca_pcps_acquisition.h" +#include "glonass_l2_ca_pcps_acquisition.h" +#include "gnss_block_factory.h" +#include "gnss_block_interface.h" +#include "gnss_satellite.h" +#include "gnss_sdr_sample_counter.h" +#include "gnss_synchro.h" +#include "gnuplot_i.h" +#include "gps_l1_ca_dll_pll_tracking.h" +#include "gps_l1_ca_pcps_acquisition.h" +#include "gps_l2_m_pcps_acquisition.h" +#include "gps_l5i_pcps_acquisition.h" +#include "hybrid_observables.h" +#include "in_memory_configuration.h" +#include "observable_tests_flags.h" +#include "observables_dump_reader.h" +#include "signal_generator_flags.h" +#include "telemetry_decoder_interface.h" +#include "test_flags.h" +#include "tlm_dump_reader.h" +#include "tracking_dump_reader.h" +#include "tracking_interface.h" +#include "tracking_tests_flags.h" +#include "tracking_true_obs_reader.h" +#include "true_observables_reader.h" #include -#include #include #include #include -#include -#include +#include +#include #include #include #include #include +#include +#include #include -#include "GPS_L1_CA.h" -#include "gnss_satellite.h" -#include "gnss_block_factory.h" -#include "gnss_block_interface.h" -#include "acquisition_msg_rx.h" -#include "gps_l1_ca_pcps_acquisition.h" -#include "galileo_e1_pcps_ambiguous_acquisition.h" -#include "galileo_e5a_pcps_acquisition.h" -#include "galileo_e5a_noncoherent_iq_acquisition_caf.h" -#include "glonass_l1_ca_pcps_acquisition.h" -#include "glonass_l2_ca_pcps_acquisition.h" -#include "gps_l2_m_pcps_acquisition.h" -#include "gps_l5i_pcps_acquisition.h" -#include "tracking_interface.h" -#include "telemetry_decoder_interface.h" -#include "in_memory_configuration.h" -#include "gnss_synchro.h" -#include "tracking_true_obs_reader.h" -#include "true_observables_reader.h" -#include "tracking_dump_reader.h" -#include "observables_dump_reader.h" -#include "tlm_dump_reader.h" -#include "gps_l1_ca_dll_pll_tracking.h" -#include "hybrid_observables.h" -#include "signal_generator_flags.h" -#include "gnss_sdr_sample_counter.h" -#include "test_flags.h" -#include "tracking_tests_flags.h" -#include "observable_tests_flags.h" -#include "gnuplot_i.h" +#include +#include +#include +#ifdef GR_GREATER_38 +#include +#else +#include +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER FOR TRACKING MESSAGES ######### @@ -186,6 +196,19 @@ HybridObservablesTest_tlm_msg_rx::~HybridObservablesTest_tlm_msg_rx() class HybridObservablesTest : public ::testing::Test { public: + enum StringValue + { + evGPS_1C, + evGPS_2S, + evGPS_L5, + evSBAS_1C, + evGAL_1B, + evGAL_5X, + evGLO_1G, + evGLO_2G + }; + std::map mapStringValues_; + std::string generator_binary; std::string p1; std::string p2; @@ -247,6 +270,13 @@ public: factory = std::make_shared(); config = std::make_shared(); item_size = sizeof(gr_complex); + mapStringValues_["1C"] = evGPS_1C; + mapStringValues_["2S"] = evGPS_2S; + mapStringValues_["L5"] = evGPS_L5; + mapStringValues_["1B"] = evGAL_1B; + mapStringValues_["5X"] = evGAL_5X; + mapStringValues_["1G"] = evGLO_1G; + mapStringValues_["2G"] = evGLO_2G; } ~HybridObservablesTest() @@ -328,6 +358,11 @@ bool HybridObservablesTest::acquire_signal() tmp_gnss_synchro.Channel_ID = 0; config = std::make_shared(); config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(baseband_sampling_freq)); + // Enable automatic resampler for the acquisition, if required + if (FLAGS_use_acquisition_resampler == true) + { + config->set_property("GNSS-SDR.use_acquisition_resampler", "true"); + } config->set_property("Acquisition.blocking_on_standby", "true"); config->set_property("Acquisition.blocking", "true"); config->set_property("Acquisition.dump", "false"); @@ -337,11 +372,12 @@ bool HybridObservablesTest::acquire_signal() std::shared_ptr acquisition; std::string System_and_Signal; + std::string signal; //create the correspondign acquisition block according to the desired tracking signal if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking") == 0) { tmp_gnss_synchro.System = 'G'; - std::string signal = "1C"; + signal = "1C"; const char* str = signal.c_str(); // get a C style null terminated string std::memcpy(static_cast(tmp_gnss_synchro.Signal), str, 3); // copy string into synchro char array: 2 char + null tmp_gnss_synchro.PRN = SV_ID; @@ -353,7 +389,7 @@ bool HybridObservablesTest::acquire_signal() else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking") == 0) { tmp_gnss_synchro.System = 'E'; - std::string signal = "1B"; + signal = "1B"; const char* str = signal.c_str(); // get a C style null terminated string std::memcpy(static_cast(tmp_gnss_synchro.Signal), str, 3); // copy string into synchro char array: 2 char + null tmp_gnss_synchro.PRN = SV_ID; @@ -364,7 +400,7 @@ bool HybridObservablesTest::acquire_signal() else if (implementation.compare("GPS_L2_M_DLL_PLL_Tracking") == 0) { tmp_gnss_synchro.System = 'G'; - std::string signal = "2S"; + signal = "2S"; const char* str = signal.c_str(); // get a C style null terminated string std::memcpy(static_cast(tmp_gnss_synchro.Signal), str, 3); // copy string into synchro char array: 2 char + null tmp_gnss_synchro.PRN = SV_ID; @@ -375,7 +411,7 @@ bool HybridObservablesTest::acquire_signal() else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_b") == 0) { tmp_gnss_synchro.System = 'E'; - std::string signal = "5X"; + signal = "5X"; const char* str = signal.c_str(); // get a C style null terminated string std::memcpy(static_cast(tmp_gnss_synchro.Signal), str, 3); // copy string into synchro char array: 2 char + null tmp_gnss_synchro.PRN = SV_ID; @@ -391,7 +427,7 @@ bool HybridObservablesTest::acquire_signal() else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking") == 0) { tmp_gnss_synchro.System = 'E'; - std::string signal = "5X"; + signal = "5X"; const char* str = signal.c_str(); // get a C style null terminated string std::memcpy(static_cast(tmp_gnss_synchro.Signal), str, 3); // copy string into synchro char array: 2 char + null tmp_gnss_synchro.PRN = SV_ID; @@ -402,7 +438,7 @@ bool HybridObservablesTest::acquire_signal() else if (implementation.compare("GPS_L5_DLL_PLL_Tracking") == 0) { tmp_gnss_synchro.System = 'G'; - std::string signal = "L5"; + signal = "L5"; const char* str = signal.c_str(); // get a C style null terminated string std::memcpy(static_cast(tmp_gnss_synchro.Signal), str, 3); // copy string into synchro char array: 2 char + null tmp_gnss_synchro.PRN = SV_ID; @@ -433,10 +469,88 @@ bool HybridObservablesTest::acquire_signal() file_source->seek(2 * FLAGS_skip_samples, 0); //skip head. ibyte, two bytes per complex sample gr::blocks::interleaved_char_to_complex::sptr gr_interleaved_char_to_complex = gr::blocks::interleaved_char_to_complex::make(); //gr::blocks::head::sptr head_samples = gr::blocks::head::make(sizeof(gr_complex), baseband_sampling_freq * FLAGS_duration); + //top_block->connect(head_samples, 0, acquisition->get_left_block(), 0); top_block->connect(file_source, 0, gr_interleaved_char_to_complex, 0); - top_block->connect(gr_interleaved_char_to_complex, 0, acquisition->get_left_block(), 0); - //top_block->connect(head_samples, 0, acquisition->get_left_block(), 0); + + // Enable automatic resampler for the acquisition, if required + if (FLAGS_use_acquisition_resampler == true) + { + //create acquisition resamplers if required + double resampler_ratio = 1.0; + + double opt_fs = baseband_sampling_freq; + //find the signal associated to this channel + switch (mapStringValues_[signal]) + { + case evGPS_1C: + opt_fs = GPS_L1_CA_OPT_ACQ_FS_HZ; + break; + case evGPS_2S: + opt_fs = GPS_L2C_OPT_ACQ_FS_HZ; + break; + case evGPS_L5: + opt_fs = GPS_L5_OPT_ACQ_FS_HZ; + break; + case evSBAS_1C: + opt_fs = GPS_L1_CA_OPT_ACQ_FS_HZ; + break; + case evGAL_1B: + opt_fs = Galileo_E1_OPT_ACQ_FS_HZ; + break; + case evGAL_5X: + opt_fs = Galileo_E5a_OPT_ACQ_FS_HZ; + break; + case evGLO_1G: + opt_fs = baseband_sampling_freq; + break; + case evGLO_2G: + opt_fs = baseband_sampling_freq; + break; + } + if (opt_fs < baseband_sampling_freq) + { + resampler_ratio = baseband_sampling_freq / opt_fs; + int decimation = floor(resampler_ratio); + while (baseband_sampling_freq % decimation > 0) + { + decimation--; + }; + double acq_fs = baseband_sampling_freq / decimation; + + if (decimation > 1) + { + //create a FIR low pass filter + std::vector taps; + taps = gr::filter::firdes::low_pass(1.0, + baseband_sampling_freq, + acq_fs / 2.1, + acq_fs / 10, + gr::filter::firdes::win_type::WIN_HAMMING); + std::cout << "Enabled decimation low pass filter with " << taps.size() << " taps and decimation factor of " << decimation << std::endl; + acquisition->set_resampler_latency((taps.size() - 1) / 2); + gr::basic_block_sptr fir_filter_ccf_ = gr::filter::fir_filter_ccf::make(decimation, taps); + top_block->connect(gr_interleaved_char_to_complex, 0, fir_filter_ccf_, 0); + top_block->connect(fir_filter_ccf_, 0, acquisition->get_left_block(), 0); + } + else + { + std::cout << "Disabled acquisition resampler because the input sampling frequency is too low\n"; + top_block->connect(gr_interleaved_char_to_complex, 0, acquisition->get_left_block(), 0); + } + } + else + { + std::cout << "Disabled acquisition resampler because the input sampling frequency is too low\n"; + top_block->connect(gr_interleaved_char_to_complex, 0, acquisition->get_left_block(), 0); + } + } + else + { + top_block->connect(gr_interleaved_char_to_complex, 0, acquisition->get_left_block(), 0); + //top_block->connect(head_samples, 0, acquisition->get_left_block(), 0); + } + boost::shared_ptr msg_rx; try diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc index ccf97ecaa..074deea05 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc @@ -29,10 +29,10 @@ */ +#include "nmea_printer.h" #include #include #include -#include "nmea_printer.h" class NmeaPrinterTest : public ::testing::Test diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc index 007ace647..c4a559448 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc @@ -28,8 +28,8 @@ * ------------------------------------------------------------------------- */ -#include #include "rinex_printer.h" +#include TEST(RinexPrinterTest, GalileoObsHeader) diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc index 4f648e0b7..a1e52190d 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc @@ -29,8 +29,8 @@ */ -#include #include "rtcm_printer.h" +#include TEST(RtcmPrinterTest, Instantiate) 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 4d8e54af6..cd8771880 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 @@ -29,10 +29,10 @@ * ------------------------------------------------------------------------- */ +#include "Galileo_E1.h" +#include "rtcm.h" #include #include -#include "rtcm.h" -#include "Galileo_E1.h" TEST(RtcmTest, HexToBin) { diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc index fe0c81ab6..d4ae24ba8 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc @@ -28,18 +28,18 @@ * ------------------------------------------------------------------------- */ +#include "geofunctions.h" +#include "gnss_sdr_supl_client.h" +#include "in_memory_configuration.h" +#include "rtklib_solver.h" +#include +#include +#include +#include #include -#include #include #include -#include -#include -#include -#include "rtklib_solver.h" -#include "in_memory_configuration.h" -#include "gnss_sdr_supl_client.h" -#include "geofunctions.h" -#include +#include rtk_t configure_rtklib_options() diff --git a/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc b/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc index 55c49c568..d8ce67450 100644 --- a/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/resampler/direct_resampler_conditioner_cc_test.cc @@ -31,18 +31,18 @@ */ -#include -#include #include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include "gnss_sdr_valve.h" #include "direct_resampler_conditioner_cc.h" +#include "gnss_sdr_valve.h" +#include +#include TEST(DirectResamplerConditionerCcTest, InstantiationAndRunTest) diff --git a/src/tests/unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc b/src/tests/unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc index c00561eb3..2bc26b8b4 100644 --- a/src/tests/unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/resampler/mmse_resampler_test.cc @@ -29,18 +29,18 @@ * ------------------------------------------------------------------------- */ -#include -#include #include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include #include "gnss_sdr_valve.h" #include "mmse_resampler_conditioner.h" +#include +#include TEST(MmseResamplerTest, InstantiationAndRunTestWarning) { diff --git a/src/tests/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc b/src/tests/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc index 8634d72bc..344d1c1bc 100644 --- a/src/tests/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc @@ -29,13 +29,13 @@ * ------------------------------------------------------------------------- */ -#include -#include -#include -#include -#include #include "file_signal_source.h" #include "in_memory_configuration.h" +#include +#include +#include +#include +#include TEST(FileSignalSource, Instantiate) { diff --git a/src/tests/unit-tests/signal-processing-blocks/sources/gnss_sdr_valve_test.cc b/src/tests/unit-tests/signal-processing-blocks/sources/gnss_sdr_valve_test.cc index 41c10d607..02e1b09df 100644 --- a/src/tests/unit-tests/signal-processing-blocks/sources/gnss_sdr_valve_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/sources/gnss_sdr_valve_test.cc @@ -31,16 +31,16 @@ */ -#include #include +#include #ifdef GR_GREATER_38 #include #else #include #endif +#include "gnss_sdr_valve.h" #include #include -#include "gnss_sdr_valve.h" TEST(ValveTest, CheckEventSentAfter100Samples) { diff --git a/src/tests/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc b/src/tests/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc index d0ce537df..7fc787352 100644 --- a/src/tests/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc @@ -31,18 +31,18 @@ */ -#include #include +#include #ifdef GR_GREATER_38 -#include #include +#include #else +#include #include #include -#include #endif -#include #include "unpack_2bit_samples.h" +#include std::vector packData(std::vector const &raw_data, bool big_endian) diff --git a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/galileo_fnav_inav_decoder_test.cc b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/galileo_fnav_inav_decoder_test.cc index 1db19d4a7..748811a20 100644 --- a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/galileo_fnav_inav_decoder_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/galileo_fnav_inav_decoder_test.cc @@ -30,16 +30,16 @@ * ------------------------------------------------------------------------- */ -#include "galileo_navigation_message.h" -#include "galileo_fnav_message.h" #include "convolutional.h" -#include +#include "galileo_fnav_message.h" +#include "galileo_navigation_message.h" +#include +#include +#include #include #include #include -#include -#include -#include +#include class Galileo_FNAV_INAV_test : public ::testing::Test diff --git a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc index 22a1118d9..4f5da024e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc @@ -30,37 +30,37 @@ * ------------------------------------------------------------------------- */ -#include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include +#include #ifdef GR_GREATER_38 #include #else #include #endif +#include "GPS_L1_CA.h" +#include "gnss_block_factory.h" +#include "gnss_block_interface.h" +#include "gnss_synchro.h" +#include "gps_l1_ca_dll_pll_c_aid_tracking.h" +#include "gps_l1_ca_dll_pll_tracking.h" +#include "gps_l1_ca_telemetry_decoder.h" +#include "in_memory_configuration.h" +#include "signal_generator_flags.h" +#include "telemetry_decoder_interface.h" +#include "tlm_dump_reader.h" +#include "tracking_dump_reader.h" +#include "tracking_interface.h" +#include "tracking_true_obs_reader.h" #include #include #include #include -#include "GPS_L1_CA.h" -#include "gnss_block_factory.h" -#include "gnss_block_interface.h" -#include "tracking_interface.h" -#include "telemetry_decoder_interface.h" -#include "in_memory_configuration.h" -#include "gnss_synchro.h" -#include "gps_l1_ca_telemetry_decoder.h" -#include "tracking_true_obs_reader.h" -#include "tracking_dump_reader.h" -#include "tlm_dump_reader.h" -#include "gps_l1_ca_dll_pll_tracking.h" -#include "gps_l1_ca_dll_pll_c_aid_tracking.h" -#include "signal_generator_flags.h" // ######## GNURADIO BLOCK MESSAGE RECEVER FOR TRACKING MESSAGES ######### diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/bayesian_estimation_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/bayesian_estimation_test.cc index f32e82f16..dd7d0398b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/bayesian_estimation_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/bayesian_estimation_test.cc @@ -29,10 +29,10 @@ * ------------------------------------------------------------------------- */ -#include +#include "bayesian_estimation.h" #include #include -#include "bayesian_estimation.h" +#include #define BAYESIAN_TEST_N_TRIALS 100 #define BAYESIAN_TEST_ITER 10000 diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc index 3b0c24883..68eae1518 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc @@ -29,17 +29,17 @@ * ------------------------------------------------------------------------- */ +#include "GPS_L1_CA.h" +#include "cpu_multicorrelator_real_codes.h" +#include "gps_sdr_signal_processing.h" +#include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include -#include "cpu_multicorrelator_real_codes.h" -#include "gps_sdr_signal_processing.h" -#include "GPS_L1_CA.h" DEFINE_int32(cpu_multicorrelator_real_codes_iterations_test, 100, "Number of averaged iterations in CPU multicorrelator test timing test"); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc index 068a9dce5..706c6fe45 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc @@ -29,17 +29,17 @@ * ------------------------------------------------------------------------- */ +#include "GPS_L1_CA.h" +#include "cpu_multicorrelator.h" +#include "gps_sdr_signal_processing.h" +#include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include -#include "cpu_multicorrelator.h" -#include "gps_sdr_signal_processing.h" -#include "GPS_L1_CA.h" DEFINE_int32(cpu_multicorrelator_iterations_test, 100, "Number of averaged iterations in CPU multicorrelator test timing test"); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc index 5c521f279..897257b93 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc @@ -31,26 +31,25 @@ */ -#include -#include -#include +#include "galileo_e1_dll_pll_veml_tracking.h" +#include "gnss_block_factory.h" +#include "gnss_block_interface.h" +#include "gnss_sdr_valve.h" +#include "gnss_synchro.h" +#include "in_memory_configuration.h" #include +#include +#include +#include +#include +#include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include -#include -#include "gnss_block_factory.h" -#include "gnss_block_interface.h" -#include "in_memory_configuration.h" -#include "gnss_sdr_valve.h" -#include "gnss_synchro.h" -#include "galileo_e1_dll_pll_veml_tracking.h" - class GalileoE1DllPllVemlTrackingInternalTest : public ::testing::Test { diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc index 9c6d274f7..29ffe6edd 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc @@ -31,25 +31,25 @@ */ -#include -#include -#include +#include "galileo_e5a_dll_pll_tracking.h" +#include "gnss_block_factory.h" +#include "gnss_block_interface.h" +#include "gnss_sdr_valve.h" +#include "gnss_synchro.h" +#include "in_memory_configuration.h" #include +#include +#include +#include +#include +#include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include -#include -#include "gnss_block_factory.h" -#include "gnss_block_interface.h" -#include "in_memory_configuration.h" -#include "gnss_sdr_valve.h" -#include "gnss_synchro.h" -#include "galileo_e5a_dll_pll_tracking.h" class GalileoE5aTrackingTest : public ::testing::Test diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc index 352c837e1..64c6df3b5 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc @@ -31,27 +31,26 @@ */ -#include -#include -#include +#include "glonass_l1_ca_dll_pll_c_aid_tracking.h" +#include "gnss_block_factory.h" +#include "gnss_block_interface.h" +#include "gnss_sdr_valve.h" +#include "gnss_synchro.h" +#include "in_memory_configuration.h" +#include "tracking_interface.h" #include +#include +#include +#include +#include +#include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include -#include -#include "gnss_block_factory.h" -#include "gnss_block_interface.h" -#include "tracking_interface.h" -#include "in_memory_configuration.h" -#include "gnss_sdr_valve.h" -#include "gnss_synchro.h" -#include "glonass_l1_ca_dll_pll_c_aid_tracking.h" - // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GlonassL1CaDllPllCAidTrackingTest_msg_rx; @@ -162,7 +161,7 @@ TEST_F(GlonassL1CaDllPllCAidTrackingTest, ValidationOfResults) init(); queue = gr::msg_queue::make(0); top_block = gr::make_top_block("Tracking test"); - std::shared_ptr tracking = std::make_shared(config.get(), "Tracking_1G", 1, 1); + std::shared_ptr tracking = std::make_shared(config.get(), "Tracking_1G", 1, 1); boost::shared_ptr msg_rx = GlonassL1CaDllPllCAidTrackingTest_msg_rx_make(); gnss_synchro.Acq_delay_samples = 1343; diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc index 6503e30db..2bf4f8938 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc @@ -31,26 +31,26 @@ */ -#include -#include -#include +#include "glonass_l1_ca_dll_pll_tracking.h" +#include "gnss_block_factory.h" +#include "gnss_block_interface.h" +#include "gnss_sdr_valve.h" +#include "gnss_synchro.h" +#include "in_memory_configuration.h" +#include "tracking_interface.h" #include +#include +#include +#include +#include +#include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include -#include -#include "gnss_block_factory.h" -#include "gnss_block_interface.h" -#include "tracking_interface.h" -#include "in_memory_configuration.h" -#include "gnss_sdr_valve.h" -#include "gnss_synchro.h" -#include "glonass_l1_ca_dll_pll_tracking.h" // ######## GNURADIO BLOCK MESSAGE RECEVER ######### diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc index 3484fc791..58fd52407 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc @@ -30,35 +30,34 @@ * ------------------------------------------------------------------------- */ +#include "GPS_L1_CA.h" +#include "gnss_block_factory.h" +#include "gnuplot_i.h" +#include "in_memory_configuration.h" +#include "signal_generator_flags.h" +#include "test_flags.h" +#include "tracking_dump_reader.h" +#include "tracking_interface.h" +#include "tracking_tests_flags.h" +#include "tracking_true_obs_reader.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include -#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include -#include -#include "GPS_L1_CA.h" -#include "gnss_block_factory.h" -#include "tracking_interface.h" -#include "in_memory_configuration.h" -#include "tracking_true_obs_reader.h" -#include "tracking_dump_reader.h" -#include "signal_generator_flags.h" -#include "gnuplot_i.h" -#include "test_flags.h" -#include "tracking_tests_flags.h" - // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CADllPllTrackingTest_msg_rx; diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc index 977f87f7a..ffaeffc76 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc @@ -2,7 +2,7 @@ * \file gps_l1_ca_dll_pll_tracking_test.cc * \brief This class implements a tracking test for Galileo_E5a_DLL_PLL_Tracking * implementation based on some input parameters. - * \author Marc Majoral, 2017. mmajoral(at)cttc.cat + * \author Marc Majoral, 2017. mmajoral(at)cttc.cat * \author Javier Arribas, 2017. jarribas(at)cttc.es * * @@ -31,46 +31,46 @@ * ------------------------------------------------------------------------- */ +#include "GPS_L1_CA.h" +#include "gnss_block_factory.h" +#include "gnss_block_interface.h" +#include "gnss_synchro.h" +#include "gps_l1_ca_dll_pll_tracking_fpga.h" +#include "in_memory_configuration.h" +#include "interleaved_byte_to_complex_short.h" +#include "signal_generator_flags.h" +#include "tracking_dump_reader.h" +#include "tracking_interface.h" +#include "tracking_true_obs_reader.h" +#include +#include // to test the FPGA we have to create a simultaneous task to send the samples using the DMA and stop the test +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include // FPGA read input file #include #include #include -#include -#include // to test the FPGA we have to create a simultaneous task to send the samples using the DMA and stop the test -#include // FPGA read input file -#include -#include -#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include -#include -#include -#include -#include "GPS_L1_CA.h" -#include "gnss_block_factory.h" -#include "gnss_block_interface.h" -#include "tracking_interface.h" -#include "in_memory_configuration.h" -#include "gnss_synchro.h" -//#include "gps_l1_ca_dll_pll_c_aid_tracking_fpga.h" -#include "gps_l1_ca_dll_pll_tracking_fpga.h" -#include "tracking_true_obs_reader.h" -#include "tracking_dump_reader.h" -#include "signal_generator_flags.h" -#include "interleaved_byte_to_complex_short.h" #define DMA_TRACK_TRANSFER_SIZE 2046 // DMA transfer size for tracking #define MIN_SAMPLES_REMAINING 20000 // number of remaining samples in the DMA that causes the CPU to stop the flowgraph (it has to be a bit alrger than 2x max packet size) #define FIVE_SECONDS 5000000 // five seconds in microseconds void send_tracking_gps_input_samples(FILE *rx_signal_file, - int num_remaining_samples, gr::top_block_sptr top_block) + int num_remaining_samples, const gr::top_block_sptr& top_block) { int num_samples_transferred = 0; // number of samples that have been transferred to the DMA so far static int flowgraph_stopped = 0; // flag to indicate if the flowgraph is stopped already @@ -143,7 +143,7 @@ void sending_thread(gr::top_block_sptr top_block, const char *file_name) usleep(FIVE_SECONDS); // wait for some time to give time to the other thread to program the device //send_tracking_gps_input_samples(dma_descr, rx_signal_file, file_length); - send_tracking_gps_input_samples(rx_signal_file, file_length, top_block); + send_tracking_gps_input_samples(rx_signal_file, file_length, std::move(top_block)); fclose(rx_signal_file); } @@ -152,7 +152,7 @@ void sending_thread(gr::top_block_sptr top_block, const char *file_name) // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CADllPllTrackingTestFpga_msg_rx; -typedef boost::shared_ptr GpsL1CADllPllTrackingTestFpga_msg_rx_sptr; +using GpsL1CADllPllTrackingTestFpga_msg_rx_sptr = boost::shared_ptr; GpsL1CADllPllTrackingTestFpga_msg_rx_sptr GpsL1CADllPllTrackingTestFpga_msg_rx_make(); @@ -181,7 +181,7 @@ void GpsL1CADllPllTrackingTestFpga_msg_rx::msg_handler_events(pmt::pmt_t msg) { try { - int64_t message = pmt::to_long(msg); + int64_t message = pmt::to_long(std::move(msg)); rx_message = message; } catch (boost::bad_any_cast &e) @@ -205,9 +205,7 @@ GpsL1CADllPllTrackingTestFpga_msg_rx::GpsL1CADllPllTrackingTestFpga_msg_rx() : g } -GpsL1CADllPllTrackingTestFpga_msg_rx::~GpsL1CADllPllTrackingTestFpga_msg_rx() -{ -} +GpsL1CADllPllTrackingTestFpga_msg_rx::~GpsL1CADllPllTrackingTestFpga_msg_rx() = default; // ########################################################### @@ -244,9 +242,7 @@ public: gnss_synchro = Gnss_Synchro(); } - ~GpsL1CADllPllTrackingTestFpga() - { - } + ~GpsL1CADllPllTrackingTestFpga() = default; void configure_receiver(); @@ -284,7 +280,7 @@ int GpsL1CADllPllTrackingTestFpga::generate_signal() int child_status; char *const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], - &p4[0], &p5[0], NULL}; + &p4[0], &p5[0], nullptr}; int pid; if ((pid = fork()) == -1) diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc index 775c3540b..96c84302f 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc @@ -30,33 +30,33 @@ * ------------------------------------------------------------------------- */ +#include "GPS_L1_CA.h" +#include "gnss_block_factory.h" +#include "gnss_sdr_flags.h" +#include "gnuplot_i.h" +#include "in_memory_configuration.h" +#include "signal_generator_flags.h" +#include "test_flags.h" +#include "tracking_dump_reader.h" +#include "tracking_interface.h" +#include "tracking_true_obs_reader.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include -#include -#include "GPS_L1_CA.h" -#include "gnss_block_factory.h" -#include "tracking_interface.h" -#include "in_memory_configuration.h" -#include "tracking_true_obs_reader.h" -#include "tracking_dump_reader.h" -#include "signal_generator_flags.h" -#include "gnuplot_i.h" -#include "test_flags.h" -#include "gnss_sdr_flags.h" DEFINE_bool(plot_gps_l1_kf_tracking_test, false, "Plots results of GpsL1CAKfTrackingTest with gnuplot"); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc index 3c40eb54c..d56f2f3ab 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc @@ -31,26 +31,26 @@ */ -#include -#include -#include +#include "gnss_block_factory.h" +#include "gnss_block_interface.h" +#include "gnss_sdr_valve.h" +#include "gnss_synchro.h" +#include "gps_l2_m_dll_pll_tracking.h" +#include "in_memory_configuration.h" +#include "tracking_interface.h" #include +#include +#include +#include +#include +#include +#include +#include #ifdef GR_GREATER_38 #include #else #include #endif -#include -#include -#include -#include -#include "gnss_block_factory.h" -#include "gnss_block_interface.h" -#include "tracking_interface.h" -#include "in_memory_configuration.h" -#include "gnss_sdr_valve.h" -#include "gnss_synchro.h" -#include "gps_l2_m_dll_pll_tracking.h" // ######## GNURADIO BLOCK MESSAGE RECEVER ######### diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc index 35095ad7f..5048fe638 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gpu_multicorrelator_test.cc @@ -29,15 +29,15 @@ * ------------------------------------------------------------------------- */ -#include -#include -#include -#include -#include -#include +#include "GPS_L1_CA.h" #include "cuda_multicorrelator.h" #include "gps_sdr_signal_processing.h" -#include "GPS_L1_CA.h" +#include +#include +#include +#include +#include +#include DEFINE_int32(gpu_multicorrelator_iterations_test, 1000, "Number of averaged iterations in GPU multicorrelator test timing test"); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc index 6b33a2c33..2d9861d6f 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc @@ -30,40 +30,49 @@ * ------------------------------------------------------------------------- */ - #include "GPS_L1_CA.h" -#include "gnss_block_factory.h" +#include "GPS_L2C.h" +#include "GPS_L5.h" +#include "Galileo_E1.h" +#include "Galileo_E5a.h" +#include "acquisition_msg_rx.h" #include "control_message_factory.h" -#include "tracking_interface.h" -#include "gnss_sdr_valve.h" -#include "gps_l2_m_pcps_acquisition.h" -#include "gps_l1_ca_pcps_acquisition.h" -#include "gps_l1_ca_pcps_acquisition_fine_doppler.h" #include "galileo_e1_pcps_ambiguous_acquisition.h" #include "galileo_e5a_noncoherent_iq_acquisition_caf.h" #include "galileo_e5a_pcps_acquisition.h" +#include "gnss_block_factory.h" +#include "gnss_sdr_valve.h" +#include "gnuplot_i.h" +#include "gps_l1_ca_pcps_acquisition.h" +#include "gps_l1_ca_pcps_acquisition_fine_doppler.h" +#include "gps_l2_m_pcps_acquisition.h" #include "gps_l5i_pcps_acquisition.h" #include "in_memory_configuration.h" -#include "tracking_true_obs_reader.h" -#include "tracking_dump_reader.h" #include "signal_generator_flags.h" -#include "gnuplot_i.h" #include "test_flags.h" +#include "tracking_dump_reader.h" +#include "tracking_interface.h" #include "tracking_tests_flags.h" -#include "acquisition_msg_rx.h" +#include "tracking_true_obs_reader.h" +#include #include -#include #include +#include #include #include #include -#include +#include #include +#include #include #include #include #include -#include +#ifdef GR_GREATER_38 +#include +#else +#include +#endif // ######## GNURADIO TRACKING BLOCK MESSAGE RECEVER ######### @@ -126,6 +135,19 @@ TrackingPullInTest_msg_rx::~TrackingPullInTest_msg_rx() class TrackingPullInTest : public ::testing::Test { public: + enum StringValue + { + evGPS_1C, + evGPS_2S, + evGPS_L5, + evSBAS_1C, + evGAL_1B, + evGAL_5X, + evGLO_1G, + evGLO_2G + }; + std::map mapStringValues_; + std::string generator_binary; std::string p1; std::string p2; @@ -171,6 +193,13 @@ public: config = std::make_shared(); item_size = sizeof(gr_complex); gnss_synchro = Gnss_Synchro(); + mapStringValues_["1C"] = evGPS_1C; + mapStringValues_["2S"] = evGPS_2S; + mapStringValues_["L5"] = evGPS_L5; + mapStringValues_["1B"] = evGAL_1B; + mapStringValues_["5X"] = evGAL_5X; + mapStringValues_["1G"] = evGLO_1G; + mapStringValues_["2G"] = evGLO_2G; } ~TrackingPullInTest() @@ -289,7 +318,7 @@ void TrackingPullInTest::configure_receiver( System_and_Signal = "GPS L2CM"; signal.copy(gnss_synchro.Signal, 2, 0); config->set_property("Tracking.early_late_space_chips", "0.5"); - config->set_property("Tracking.track_pilot", "false"); + config->set_property("Tracking.track_pilot", "true"); } else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking") == 0 or implementation.compare("Galileo_E5a_DLL_PLL_Tracking_b") == 0) { @@ -302,7 +331,7 @@ void TrackingPullInTest::configure_receiver( config->supersede_property("Tracking.implementation", std::string("Galileo_E5a_DLL_PLL_Tracking")); } config->set_property("Tracking.early_late_space_chips", "0.5"); - config->set_property("Tracking.track_pilot", "false"); + config->set_property("Tracking.track_pilot", "true"); config->set_property("Tracking.order", "2"); } else if (implementation.compare("GPS_L5_DLL_PLL_Tracking") == 0) @@ -312,7 +341,7 @@ void TrackingPullInTest::configure_receiver( System_and_Signal = "GPS L5I"; signal.copy(gnss_synchro.Signal, 2, 0); config->set_property("Tracking.early_late_space_chips", "0.5"); - config->set_property("Tracking.track_pilot", "false"); + config->set_property("Tracking.track_pilot", "true"); config->set_property("Tracking.order", "2"); } else @@ -345,8 +374,15 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) // Satellite signal definition Gnss_Synchro tmp_gnss_synchro; tmp_gnss_synchro.Channel_ID = 0; + + config = std::make_shared(); config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(baseband_sampling_freq)); + // Enable automatic resampler for the acquisition, if required + if (FLAGS_use_acquisition_resampler == true) + { + config->set_property("GNSS-SDR.use_acquisition_resampler", "true"); + } config->set_property("Acquisition.blocking_on_standby", "true"); config->set_property("Acquisition.blocking", "true"); config->set_property("Acquisition.dump", "false"); @@ -356,11 +392,12 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) std::shared_ptr acquisition; std::string System_and_Signal; + std::string signal; //create the correspondign acquisition block according to the desired tracking signal if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking") == 0) { tmp_gnss_synchro.System = 'G'; - std::string signal = "1C"; + signal = "1C"; const char* str = signal.c_str(); // get a C style null terminated string std::memcpy(static_cast(tmp_gnss_synchro.Signal), str, 3); // copy string into synchro char array: 2 char + null tmp_gnss_synchro.PRN = SV_ID; @@ -372,7 +409,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking") == 0) { tmp_gnss_synchro.System = 'E'; - std::string signal = "1B"; + signal = "1B"; const char* str = signal.c_str(); // get a C style null terminated string std::memcpy(static_cast(tmp_gnss_synchro.Signal), str, 3); // copy string into synchro char array: 2 char + null tmp_gnss_synchro.PRN = SV_ID; @@ -383,7 +420,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) else if (implementation.compare("GPS_L2_M_DLL_PLL_Tracking") == 0) { tmp_gnss_synchro.System = 'G'; - std::string signal = "2S"; + signal = "2S"; const char* str = signal.c_str(); // get a C style null terminated string std::memcpy(static_cast(tmp_gnss_synchro.Signal), str, 3); // copy string into synchro char array: 2 char + null tmp_gnss_synchro.PRN = SV_ID; @@ -394,7 +431,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_b") == 0) { tmp_gnss_synchro.System = 'E'; - std::string signal = "5X"; + signal = "5X"; const char* str = signal.c_str(); // get a C style null terminated string std::memcpy(static_cast(tmp_gnss_synchro.Signal), str, 3); // copy string into synchro char array: 2 char + null tmp_gnss_synchro.PRN = SV_ID; @@ -410,7 +447,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking") == 0) { tmp_gnss_synchro.System = 'E'; - std::string signal = "5X"; + signal = "5X"; const char* str = signal.c_str(); // get a C style null terminated string std::memcpy(static_cast(tmp_gnss_synchro.Signal), str, 3); // copy string into synchro char array: 2 char + null tmp_gnss_synchro.PRN = SV_ID; @@ -421,7 +458,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) else if (implementation.compare("GPS_L5_DLL_PLL_Tracking") == 0) { tmp_gnss_synchro.System = 'G'; - std::string signal = "L5"; + signal = "L5"; const char* str = signal.c_str(); // get a C style null terminated string std::memcpy(static_cast(tmp_gnss_synchro.Signal), str, 3); // copy string into synchro char array: 2 char + null tmp_gnss_synchro.PRN = SV_ID; @@ -449,13 +486,90 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) std::string file = FLAGS_signal_file; const char* file_name = file.c_str(); file_source = gr::blocks::file_source::make(sizeof(int8_t), file_name, false); - file_source->seek(2 * FLAGS_skip_samples, 0); //skip head. ibyte, two bytes per complex sample + file_source->seek(2 * FLAGS_skip_samples, SEEK_SET); //skip head. ibyte, two bytes per complex sample gr::blocks::interleaved_char_to_complex::sptr gr_interleaved_char_to_complex = gr::blocks::interleaved_char_to_complex::make(); //gr::blocks::head::sptr head_samples = gr::blocks::head::make(sizeof(gr_complex), baseband_sampling_freq * FLAGS_duration); top_block->connect(file_source, 0, gr_interleaved_char_to_complex, 0); - top_block->connect(gr_interleaved_char_to_complex, 0, acquisition->get_left_block(), 0); - //top_block->connect(head_samples, 0, acquisition->get_left_block(), 0); + + // Enable automatic resampler for the acquisition, if required + if (FLAGS_use_acquisition_resampler == true) + { + //create acquisition resamplers if required + double resampler_ratio = 1.0; + + double opt_fs = baseband_sampling_freq; + //find the signal associated to this channel + switch (mapStringValues_[signal]) + { + case evGPS_1C: + opt_fs = GPS_L1_CA_OPT_ACQ_FS_HZ; + break; + case evGPS_2S: + opt_fs = GPS_L2C_OPT_ACQ_FS_HZ; + break; + case evGPS_L5: + opt_fs = GPS_L5_OPT_ACQ_FS_HZ; + break; + case evSBAS_1C: + opt_fs = GPS_L1_CA_OPT_ACQ_FS_HZ; + break; + case evGAL_1B: + opt_fs = Galileo_E1_OPT_ACQ_FS_HZ; + break; + case evGAL_5X: + opt_fs = Galileo_E5a_OPT_ACQ_FS_HZ; + break; + case evGLO_1G: + opt_fs = baseband_sampling_freq; + break; + case evGLO_2G: + opt_fs = baseband_sampling_freq; + break; + } + if (opt_fs < baseband_sampling_freq) + { + resampler_ratio = baseband_sampling_freq / opt_fs; + int decimation = floor(resampler_ratio); + while (baseband_sampling_freq % decimation > 0) + { + decimation--; + }; + double acq_fs = baseband_sampling_freq / decimation; + + if (decimation > 1) + { + //create a FIR low pass filter + std::vector taps; + taps = gr::filter::firdes::low_pass(1.0, + baseband_sampling_freq, + acq_fs / 2.1, + acq_fs / 10, + gr::filter::firdes::win_type::WIN_HAMMING); + std::cout << "Enabled decimation low pass filter with " << taps.size() << " taps and decimation factor of " << decimation << std::endl; + acquisition->set_resampler_latency((taps.size() - 1) / 2); + gr::basic_block_sptr fir_filter_ccf_ = gr::filter::fir_filter_ccf::make(decimation, taps); + top_block->connect(gr_interleaved_char_to_complex, 0, fir_filter_ccf_, 0); + top_block->connect(fir_filter_ccf_, 0, acquisition->get_left_block(), 0); + } + else + { + std::cout << "Disabled acquisition resampler because the input sampling frequency is too low\n"; + top_block->connect(gr_interleaved_char_to_complex, 0, acquisition->get_left_block(), 0); + } + } + else + { + std::cout << "Disabled acquisition resampler because the input sampling frequency is too low\n"; + top_block->connect(gr_interleaved_char_to_complex, 0, acquisition->get_left_block(), 0); + } + } + else + { + top_block->connect(gr_interleaved_char_to_complex, 0, acquisition->get_left_block(), 0); + //top_block->connect(head_samples, 0, acquisition->get_left_block(), 0); + } + boost::shared_ptr msg_rx; try @@ -531,7 +645,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) std::cout << " . "; } top_block->stop(); - file_source->seek(2 * FLAGS_skip_samples, 0); //skip head. ibyte, two bytes per complex sample + file_source->seek(2 * FLAGS_skip_samples, SEEK_SET); //skip head. ibyte, two bytes per complex sample std::cout.flush(); } std::cout << "]" << std::endl; diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc index 1c35cc64e..0c4683d7a 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc @@ -30,34 +30,34 @@ * ------------------------------------------------------------------------- */ -#include -#include -#include +#include "GPS_L1_CA.h" +#include "galileo_e5a_noncoherent_iq_acquisition_caf.h" +#include "galileo_e5a_pcps_acquisition.h" +#include "gnss_block_factory.h" +#include "gnuplot_i.h" +#include "gps_l1_ca_pcps_acquisition.h" +#include "gps_l1_ca_pcps_acquisition_fine_doppler.h" +#include "gps_l2_m_pcps_acquisition.h" +#include "gps_l5i_pcps_acquisition.h" +#include "in_memory_configuration.h" +#include "signal_generator_flags.h" +#include "test_flags.h" +#include "tracking_dump_reader.h" +#include "tracking_interface.h" +#include "tracking_tests_flags.h" +#include "tracking_true_obs_reader.h" #include #include -#include #include +#include #include #include #include -#include +#include #include -#include "GPS_L1_CA.h" -#include "gnss_block_factory.h" -#include "tracking_interface.h" -#include "gps_l2_m_pcps_acquisition.h" -#include "gps_l1_ca_pcps_acquisition.h" -#include "gps_l1_ca_pcps_acquisition_fine_doppler.h" -#include "galileo_e5a_noncoherent_iq_acquisition_caf.h" -#include "galileo_e5a_pcps_acquisition.h" -#include "gps_l5i_pcps_acquisition.h" -#include "in_memory_configuration.h" -#include "tracking_true_obs_reader.h" -#include "tracking_dump_reader.h" -#include "signal_generator_flags.h" -#include "gnuplot_i.h" -#include "test_flags.h" -#include "tracking_tests_flags.h" +#include +#include +#include // ######## GNURADIO ACQUISITION BLOCK MESSAGE RECEVER ######### 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 d73c9e767..b69c8fd15 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 @@ -31,8 +31,8 @@ */ -#include "gnss_signal_processing.h" #include "glonass_gnav_ephemeris.h" +#include "gnss_signal_processing.h" TEST(GlonassGnavEphemerisTest, ComputeGlonassTime) diff --git a/src/tests/unit-tests/system-parameters/glonass_gnav_nav_message_test.cc b/src/tests/unit-tests/system-parameters/glonass_gnav_nav_message_test.cc index f42a0d04d..3b91be0e6 100644 --- a/src/tests/unit-tests/system-parameters/glonass_gnav_nav_message_test.cc +++ b/src/tests/unit-tests/system-parameters/glonass_gnav_nav_message_test.cc @@ -31,8 +31,8 @@ * ------------------------------------------------------------------------- */ -#include "gnss_signal_processing.h" #include "glonass_gnav_navigation_message.h" +#include "gnss_signal_processing.h" /*! * \brief Testing CRC computation for GLONASS GNAV data bits of a string diff --git a/src/utils/front-end-cal/front_end_cal.cc b/src/utils/front-end-cal/front_end_cal.cc index 4f66a6fd7..9fd80f772 100644 --- a/src/utils/front-end-cal/front_end_cal.cc +++ b/src/utils/front-end-cal/front_end_cal.cc @@ -30,23 +30,23 @@ */ #include "front_end_cal.h" -#include -#include -#include +#include "gnss_sdr_supl_client.h" +#include "gps_almanac.h" +#include "gps_cnav_ephemeris.h" +#include "gps_cnav_iono.h" +#include "gps_ephemeris.h" +#include "gps_iono.h" +#include "gps_navigation_message.h" +#include "gps_utc_model.h" #include -#include +#include #include #include -#include +#include +#include +#include +#include #include -#include "gps_navigation_message.h" -#include "gps_ephemeris.h" -#include "gps_cnav_ephemeris.h" -#include "gps_almanac.h" -#include "gps_iono.h" -#include "gps_cnav_iono.h" -#include "gps_utc_model.h" -#include "gnss_sdr_supl_client.h" extern concurrent_map global_gps_ephemeris_map; extern concurrent_map global_gps_iono_map; diff --git a/src/utils/front-end-cal/front_end_cal.h b/src/utils/front-end-cal/front_end_cal.h index 3a6e9aeeb..261043461 100644 --- a/src/utils/front-end-cal/front_end_cal.h +++ b/src/utils/front-end-cal/front_end_cal.h @@ -32,9 +32,9 @@ #ifndef GNSS_SDR_FRONT_END_CAL_H_ #define GNSS_SDR_FRONT_END_CAL_H_ -#include -#include "file_configuration.h" #include "concurrent_map.h" +#include "file_configuration.h" +#include class FrontEndCal diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index 379465faa..b1680d51f 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -32,43 +32,43 @@ #define FRONT_END_CAL_VERSION "0.0.1" #endif -#include "front_end_cal.h" #include "concurrent_map.h" #include "concurrent_queue.h" #include "file_configuration.h" -#include "gps_l1_ca_pcps_acquisition_fine_doppler.h" -#include "gnss_signal.h" -#include "gnss_synchro.h" -#include "gnss_block_factory.h" -#include "gps_navigation_message.h" -#include "gps_ephemeris.h" -#include "gps_cnav_ephemeris.h" -#include "gps_almanac.h" -#include "gps_iono.h" -#include "gps_cnav_iono.h" -#include "gps_utc_model.h" -#include "galileo_ephemeris.h" +#include "front_end_cal.h" #include "galileo_almanac.h" +#include "galileo_ephemeris.h" #include "galileo_iono.h" #include "galileo_utc_model.h" -#include "sbas_ephemeris.h" -#include "gnss_sdr_supl_client.h" +#include "gnss_block_factory.h" #include "gnss_sdr_flags.h" +#include "gnss_sdr_supl_client.h" +#include "gnss_signal.h" +#include "gnss_synchro.h" +#include "gps_almanac.h" +#include "gps_cnav_ephemeris.h" +#include "gps_cnav_iono.h" +#include "gps_ephemeris.h" +#include "gps_iono.h" +#include "gps_l1_ca_pcps_acquisition_fine_doppler.h" +#include "gps_navigation_message.h" +#include "gps_utc_model.h" +#include "sbas_ephemeris.h" +#include #include #include #include -#include #include -#include -#include +#include +#include +#include #include #include -#include -#include -#include -#include +#include +#include #include #include +#include #include // for ctime #include #include @@ -191,7 +191,7 @@ bool front_end_capture(const std::shared_ptr& configurat catch (const boost::exception_ptr& e) { std::cout << "Exception caught in creating source " << e << std::endl; - return 0; + return false; } std::shared_ptr conditioner; @@ -202,7 +202,7 @@ bool front_end_capture(const std::shared_ptr& configurat catch (const boost::exception_ptr& e) { std::cout << "Exception caught in creating signal conditioner " << e << std::endl; - return 0; + return false; } gr::block_sptr sink; sink = gr::blocks::file_sink::make(sizeof(gr_complex), "tmp_capture.dat"); @@ -430,7 +430,7 @@ int main(int argc, char** argv) std::cout << "["; start_msg = false; } - if (gnss_sync_vector.size() > 0) + if (!gnss_sync_vector.empty()) { std::cout << " " << PRN << " "; double doppler_measurement_hz = 0; @@ -523,7 +523,7 @@ int main(int argc, char** argv) std::cout << "Longitude=" << lon_deg << " [ยบ]" << std::endl; std::cout << "Altitude=" << altitude_m << " [m]" << std::endl; - if (doppler_measurements_map.size() == 0) + if (doppler_measurements_map.empty()) { std::cout << "Sorry, no GPS satellites detected in the front-end capture, please check the antenna setup..." << std::endl; delete acquisition; diff --git a/src/utils/rinex2assist/main.cc b/src/utils/rinex2assist/main.cc index f01c5eb8c..f23b58ed7 100644 --- a/src/utils/rinex2assist/main.cc +++ b/src/utils/rinex2assist/main.cc @@ -30,21 +30,21 @@ */ -#include "gps_ephemeris.h" #include "galileo_ephemeris.h" -#include "gps_utc_model.h" -#include "gps_iono.h" -#include "galileo_utc_model.h" #include "galileo_iono.h" -#include -#include -#include -#include +#include "galileo_utc_model.h" +#include "gps_ephemeris.h" +#include "gps_iono.h" +#include "gps_utc_model.h" #include -#include -#include #include #include +#include +#include +#include +#include +#include +#include #include #include @@ -260,15 +260,15 @@ int main(int argc, char** argv) eph.d_TGD = rne.Tgd; eph.d_IODC = rne.IODC; eph.i_AODO = 0; // - eph.b_fit_interval_flag = (rne.fitint > 4) ? 1 : 0; + eph.b_fit_interval_flag = (rne.fitint > 4) ? true : false; eph.d_spare1 = 0.0; eph.d_spare2 = 0.0; eph.d_A_f0 = rne.af0; eph.d_A_f1 = rne.af1; eph.d_A_f2 = rne.af2; - eph.b_integrity_status_flag = 0; // - eph.b_alert_flag = 0; // - eph.b_antispoofing_flag = 0; // + eph.b_integrity_status_flag = false; // + eph.b_alert_flag = false; // + eph.b_antispoofing_flag = false; // eph_map[i] = eph; i++; }