diff --git a/src/algorithms/PVT/adapters/CMakeLists.txt b/src/algorithms/PVT/adapters/CMakeLists.txt index 538a7ddcf..013fcdd83 100644 --- a/src/algorithms/PVT/adapters/CMakeLists.txt +++ b/src/algorithms/PVT/adapters/CMakeLists.txt @@ -32,6 +32,7 @@ add_library(pvt_adapters ${PVT_ADAPTER_SOURCES} ${PVT_ADAPTER_HEADERS}) target_link_libraries(pvt_adapters PUBLIC pvt_gr_blocks + algorithms_libs_rtklib core_system_parameters PRIVATE gnss_sdr_flags diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index 0fcdbd9c5..1d55f8abb 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -30,10 +30,17 @@ #include "rtklib_pvt.h" -#include "configuration_interface.h" -#include "gnss_sdr_flags.h" -#include "pvt_conf.h" -#include +#include "MATH_CONSTANTS.h" // for D2R +#include "configuration_interface.h" // for ConfigurationInterface +#include "galileo_almanac.h" // for Galileo_Almanac +#include "galileo_ephemeris.h" // for Galileo_Ephemeris +#include "gnss_sdr_flags.h" // for FLAGS_RINEX_version +#include "gps_almanac.h" // for Gps_Almanac +#include "gps_ephemeris.h" // for Gps_Ephemeris +#include "pvt_conf.h" // for Pvt_Conf +#include "rtklib_rtkpos.h" // for rtkfree, rtkinit +#include // for LOG +#include // for operator<< #if OLD_BOOST #include namespace bc = boost::math; @@ -43,9 +50,6 @@ namespace bc = boost::integer; #endif -using google::LogMessage; - - Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, @@ -739,7 +743,7 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration, pvt_output_parameters.udp_port = configuration->property(role + ".monitor_udp_port", 1234); // make PVT object - pvt_ = rtklib_make_pvt_cc(in_streams_, pvt_output_parameters, rtk); + pvt_ = rtklib_make_pvt_gs(in_streams_, pvt_output_parameters, rtk); DLOG(INFO) << "pvt(" << pvt_->unique_id() << ")"; if (out_streams_ > 0) { diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.h b/src/algorithms/PVT/adapters/rtklib_pvt.h index ace356712..b61e25604 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.h +++ b/src/algorithms/PVT/adapters/rtklib_pvt.h @@ -32,18 +32,21 @@ #ifndef GNSS_SDR_RTKLIB_PVT_H_ #define GNSS_SDR_RTKLIB_PVT_H_ -#include "galileo_almanac.h" -#include "galileo_ephemeris.h" -#include "gps_almanac.h" -#include "gps_ephemeris.h" -#include "pvt_interface.h" -#include "rtklib.h" -#include "rtklib_pvt_cc.h" -#include -#include - +#include "pvt_interface.h" // for PvtInterface +#include "rtklib.h" // for rtk_t +#include "rtklib_pvt_gs.h" // for rtklib_pvt_gs_sptr +#include // for gr_complex +#include // for basic_block_sptr, top_block_sptr +#include // for size_t +#include // for time_t +#include // for map +#include // for string class ConfigurationInterface; +class Galileo_Almanac; +class Galileo_Ephemeris; +class Gps_Almanac; +class Gps_Ephemeris; /*! * \brief This class implements a PvtInterface for the RTKLIB PVT block @@ -99,7 +102,7 @@ public: time_t* UTC_time) override; private: - rtklib_pvt_cc_sptr pvt_; + rtklib_pvt_gs_sptr pvt_; rtk_t rtk{}; std::string role_; unsigned int in_streams_; diff --git a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt index d59bac863..936f4c05f 100644 --- a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt @@ -17,11 +17,11 @@ # set(PVT_GR_BLOCKS_SOURCES - rtklib_pvt_cc.cc + rtklib_pvt_gs.cc ) set(PVT_GR_BLOCKS_HEADERS - rtklib_pvt_cc.h + rtklib_pvt_gs.h ) source_group(Headers FILES ${PVT_GR_BLOCKS_HEADERS}) @@ -30,12 +30,13 @@ add_library(pvt_gr_blocks ${PVT_GR_BLOCKS_SOURCES} ${PVT_GR_BLOCKS_HEADERS}) target_link_libraries(pvt_gr_blocks PUBLIC - pvt_libs + algorithms_libs_rtklib core_system_parameters Boost::date_time Gnuradio::pmt Gnuradio::runtime PRIVATE + pvt_libs algorithms_libs Gflags::gflags Glog::glog diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc similarity index 98% rename from src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc rename to src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index 0ccb6cd26..7318e87b5 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -1,5 +1,5 @@ /*! - * \file rtklib_pvt_cc.cc + * \file rtklib_pvt_gs.cc * \brief Interface of a Position Velocity and Time computation block * \author Javier Arribas, 2017. jarribas(at)cttc.es * @@ -28,24 +28,58 @@ * ------------------------------------------------------------------------- */ -#include "rtklib_pvt_cc.h" +#include "rtklib_pvt_gs.h" +#include "beidou_dnav_almanac.h" +#include "beidou_dnav_ephemeris.h" +#include "beidou_dnav_iono.h" +#include "beidou_dnav_utc_model.h" #include "display.h" +#include "galileo_almanac.h" #include "galileo_almanac_helper.h" +#include "galileo_ephemeris.h" +#include "galileo_iono.h" +#include "galileo_utc_model.h" +#include "geojson_printer.h" +#include "glonass_gnav_almanac.h" +#include "glonass_gnav_ephemeris.h" +#include "glonass_gnav_utc_model.h" #include "gnss_sdr_create_directory.h" +#include "gps_almanac.h" +#include "gps_cnav_ephemeris.h" +#include "gps_cnav_iono.h" +#include "gps_cnav_utc_model.h" +#include "gps_ephemeris.h" +#include "gps_iono.h" +#include "gps_utc_model.h" +#include "gpx_printer.h" +#include "kml_printer.h" +#include "monitor_pvt.h" +#include "monitor_pvt_udp_sink.h" +#include "nmea_printer.h" #include "pvt_conf.h" -#include -#include -#include +#include "rinex_printer.h" +#include "rtcm_printer.h" +#include "rtklib_solver.h" +#include // for any_cast, any +#include // for xml_iarchive +#include // for xml_oarchive +#include // for bind_t, bind +#include +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include // for nvp, make_nvp +#include // for error_code +#include // for LOG +#include // for io_signature +#include // for mp +#include // for sort, unique +#include // for exception +#include // for ofstream +#include // for operator<< +#include // for length_error +#include // for IPC_CREAT +#include // for msgctl #if OLD_BOOST #include namespace bc = boost::math; @@ -54,22 +88,20 @@ namespace bc = boost::math; namespace bc = boost::integer; #endif -using google::LogMessage; - -rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels, +rtklib_pvt_gs_sptr rtklib_make_pvt_gs(uint32_t nchannels, const Pvt_Conf& conf_, const rtk_t& rtk) { - return rtklib_pvt_cc_sptr(new rtklib_pvt_cc(nchannels, + return rtklib_pvt_gs_sptr(new rtklib_pvt_gs(nchannels, conf_, rtk)); } -rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, +rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, const Pvt_Conf& conf_, - const rtk_t& rtk) : gr::sync_block("rtklib_pvt_cc", + const rtk_t& rtk) : gr::sync_block("rtklib_pvt_gs", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)), gr::io_signature::make(0, 0, 0)) { @@ -118,7 +150,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, // GPS Ephemeris data message port in this->message_port_register_in(pmt::mp("telemetry")); - this->set_msg_handler(pmt::mp("telemetry"), boost::bind(&rtklib_pvt_cc::msg_handler_telemetry, this, _1)); + this->set_msg_handler(pmt::mp("telemetry"), boost::bind(&rtklib_pvt_gs::msg_handler_telemetry, this, _1)); // initialize kml_printer std::string kml_dump_filename; @@ -151,7 +183,6 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, // initialize geojson_printer std::string geojson_dump_filename; geojson_dump_filename = d_dump_filename; - d_geojson_output_enabled = conf_.geojson_output_enabled; if (d_geojson_output_enabled) { @@ -336,7 +367,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, } -rtklib_pvt_cc::~rtklib_pvt_cc() +rtklib_pvt_gs::~rtklib_pvt_gs() { msgctl(sysv_msqid, IPC_RMID, nullptr); try @@ -883,7 +914,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc() } -void rtklib_pvt_cc::msg_handler_telemetry(const pmt::pmt_t& msg) +void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) { try { @@ -1097,43 +1128,43 @@ void rtklib_pvt_cc::msg_handler_telemetry(const pmt::pmt_t& msg) } -std::map rtklib_pvt_cc::get_gps_ephemeris_map() const +std::map rtklib_pvt_gs::get_gps_ephemeris_map() const { return d_pvt_solver->gps_ephemeris_map; } -std::map rtklib_pvt_cc::get_gps_almanac_map() const +std::map rtklib_pvt_gs::get_gps_almanac_map() const { return d_pvt_solver->gps_almanac_map; } -std::map rtklib_pvt_cc::get_galileo_ephemeris_map() const +std::map rtklib_pvt_gs::get_galileo_ephemeris_map() const { return d_pvt_solver->galileo_ephemeris_map; } -std::map rtklib_pvt_cc::get_galileo_almanac_map() const +std::map rtklib_pvt_gs::get_galileo_almanac_map() const { return d_pvt_solver->galileo_almanac_map; } -std::map rtklib_pvt_cc::get_beidou_dnav_ephemeris_map() const +std::map rtklib_pvt_gs::get_beidou_dnav_ephemeris_map() const { return d_pvt_solver->beidou_dnav_ephemeris_map; } -std::map rtklib_pvt_cc::get_beidou_dnav_almanac_map() const +std::map rtklib_pvt_gs::get_beidou_dnav_almanac_map() const { return d_pvt_solver->beidou_dnav_almanac_map; } -void rtklib_pvt_cc::clear_ephemeris() +void rtklib_pvt_gs::clear_ephemeris() { d_pvt_solver->gps_ephemeris_map.clear(); d_pvt_solver->gps_almanac_map.clear(); @@ -1144,13 +1175,13 @@ void rtklib_pvt_cc::clear_ephemeris() } -bool rtklib_pvt_cc::observables_pairCompare_min(const std::pair& a, const std::pair& b) +bool rtklib_pvt_gs::observables_pairCompare_min(const std::pair& a, const std::pair& b) { return (a.second.Pseudorange_m) < (b.second.Pseudorange_m); } -bool rtklib_pvt_cc::send_sys_v_ttff_msg(ttff_msgbuf ttff) +bool rtklib_pvt_gs::send_sys_v_ttff_msg(ttff_msgbuf ttff) { // Fill Sys V message structures int msgsend_size; @@ -1166,7 +1197,7 @@ bool rtklib_pvt_cc::send_sys_v_ttff_msg(ttff_msgbuf ttff) } -bool rtklib_pvt_cc::save_gnss_synchro_map_xml(const std::string& file_name) +bool rtklib_pvt_gs::save_gnss_synchro_map_xml(const std::string& file_name) { if (gnss_observables_map.empty() == false) { @@ -1191,7 +1222,7 @@ bool rtklib_pvt_cc::save_gnss_synchro_map_xml(const std::string& file_name) } -bool rtklib_pvt_cc::load_gnss_synchro_map_xml(const std::string& file_name) +bool rtklib_pvt_gs::load_gnss_synchro_map_xml(const std::string& file_name) { // load from xml (boost serialize) std::ifstream ifs; @@ -1212,7 +1243,7 @@ bool rtklib_pvt_cc::load_gnss_synchro_map_xml(const std::string& file_name) } -std::vector rtklib_pvt_cc::split_string(const std::string& s, char delim) const +std::vector rtklib_pvt_gs::split_string(const std::string& s, char delim) const { std::vector v; std::stringstream ss(s); @@ -1227,7 +1258,7 @@ std::vector rtklib_pvt_cc::split_string(const std::string& s, char } -bool rtklib_pvt_cc::get_latest_PVT(double* longitude_deg, +bool rtklib_pvt_gs::get_latest_PVT(double* longitude_deg, double* latitude_deg, double* height_m, double* ground_speed_kmh, @@ -1250,7 +1281,7 @@ bool rtklib_pvt_cc::get_latest_PVT(double* longitude_deg, } -int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_items, +int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_items, gr_vector_void_star& output_items __attribute__((unused))) { for (int32_t epoch = 0; epoch < noutput_items; epoch++) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h similarity index 73% rename from src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h rename to src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h index dbe2fe3eb..4e3df2672 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h @@ -1,5 +1,5 @@ /*! - * \file rtklib_pvt_cc.h + * \file rtklib_pvt_gs.h * \brief Interface of a Position Velocity and Time computation block * \author Javier Arribas, 2017. jarribas(at)cttc.es * @@ -28,56 +28,61 @@ * ------------------------------------------------------------------------- */ -#ifndef GNSS_SDR_RTKLIB_PVT_CC_H -#define GNSS_SDR_RTKLIB_PVT_CC_H +#ifndef GNSS_SDR_RTKLIB_PVT_GS_H +#define GNSS_SDR_RTKLIB_PVT_GS_H -#include "beidou_dnav_almanac.h" -#include "beidou_dnav_ephemeris.h" -#include "galileo_almanac.h" -#include "galileo_ephemeris.h" -#include "geojson_printer.h" #include "gnss_synchro.h" -#include "gps_almanac.h" -#include "gps_ephemeris.h" -#include "gpx_printer.h" -#include "kml_printer.h" -#include "monitor_pvt_udp_sink.h" -#include "nmea_printer.h" -#include "pvt_conf.h" -#include "rinex_printer.h" -#include "rtcm_printer.h" -#include "rtklib_solver.h" +#include "rtklib.h" #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include // for boost::shared_ptr +#include // for sync_block +#include // for gr_vector_const_void_star +#include // for pmt_t +#include // for system_clock +#include // for int32_t +#include // for time_t +#include // for map +#include // for shared_ptr, unique_ptr +#include // for string +#include // for key_t +#include // for pair +#include // for vector +class Beidou_Dnav_Almanac; +class Beidou_Dnav_Ephemeris; +class Galileo_Almanac; +class Galileo_Ephemeris; +class GeoJSON_Printer; +class Gps_Almanac; +class Gps_Ephemeris; +class Gpx_Printer; +class Kml_Printer; +class Monitor_Pvt_Udp_Sink; +class Nmea_Printer; +class Pvt_Conf; +class Rinex_Printer; +class Rtcm_Printer; +class Rtklib_Solver; +class rtklib_pvt_gs; -class rtklib_pvt_cc; +using rtklib_pvt_gs_sptr = boost::shared_ptr; -using rtklib_pvt_cc_sptr = boost::shared_ptr; - -rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels, +rtklib_pvt_gs_sptr rtklib_make_pvt_gs(uint32_t nchannels, const Pvt_Conf& conf_, const rtk_t& rtk); /*! * \brief This class implements a block that computes the PVT solution using the RTKLIB integrated library */ -class rtklib_pvt_cc : public gr::sync_block +class rtklib_pvt_gs : public gr::sync_block { private: - friend rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels, + friend rtklib_pvt_gs_sptr rtklib_make_pvt_gs(uint32_t nchannels, + const Pvt_Conf& conf_, + const rtk_t& rtk); + + rtklib_pvt_gs(uint32_t nchannels, const Pvt_Conf& conf_, const rtk_t& rtk); @@ -135,7 +140,7 @@ private: int sysv_msqid; typedef struct { - long mtype; //required by sys v message + long mtype; // NOLINT(google-runtime-int) required by SysV queue messaging double ttff; } ttff_msgbuf; bool send_sys_v_ttff_msg(ttff_msgbuf ttff); @@ -158,31 +163,40 @@ private: std::vector split_string(const std::string& s, char delim) const; public: - rtklib_pvt_cc(uint32_t nchannels, - const Pvt_Conf& conf_, - const rtk_t& rtk); - - ~rtklib_pvt_cc(); //!< Default destructor + ~rtklib_pvt_gs(); //!< Default destructor /*! * \brief Get latest set of GPS ephemeris from PVT block - * */ std::map get_gps_ephemeris_map() const; + /*! + * \brief Get latest set of GPS almanac from PVT block + */ std::map get_gps_almanac_map() const; + /*! + * \brief Get latest set of Galileo ephemeris from PVT block + */ std::map get_galileo_ephemeris_map() const; + /*! + * \brief Get latest set of Galileo almanac from PVT block + */ std::map get_galileo_almanac_map() const; + /*! + * \brief Get latest set of BeiDou DNAV ephemeris from PVT block + */ std::map get_beidou_dnav_ephemeris_map() const; + /*! + * \brief Get latest set of BeiDou DNAV almanac from PVT block + */ std::map get_beidou_dnav_almanac_map() const; /*! * \brief Clear all ephemeris information and the almanacs for GPS and Galileo - * */ void clear_ephemeris(); diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index d04fa0cb5..879dd9cba 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -26,6 +26,7 @@ set(PVT_LIB_SOURCES rinex_printer.cc nmea_printer.cc rtcm_printer.cc + rtcm.cc geojson_printer.cc rtklib_solver.cc pvt_conf.cc @@ -41,6 +42,7 @@ set(PVT_LIB_HEADERS rinex_printer.h nmea_printer.h rtcm_printer.h + rtcm.h geojson_printer.h rtklib_solver.h pvt_conf.h @@ -59,10 +61,10 @@ target_link_libraries(pvt_libs PUBLIC Armadillo::armadillo Boost::date_time - algorithms_libs algorithms_libs_rtklib core_system_parameters PRIVATE + algorithms_libs Boost::filesystem Boost::system Gflags::gflags @@ -72,13 +74,20 @@ target_link_libraries(pvt_libs target_include_directories(pvt_libs PUBLIC - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib ${CMAKE_SOURCE_DIR}/src/core/receiver ) target_compile_definitions(pvt_libs PRIVATE -DGNSS_SDR_VERSION="${VERSION}") +if(OS_IS_MACOSX) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # not AppleClang + target_compile_definitions(pvt_libs + PUBLIC + -DBOOST_ASIO_HAS_STD_STRING_VIEW + ) + endif() +endif() + if(ENABLE_CLANG_TIDY) if(CLANG_TIDY_EXE) set_target_properties(pvt_libs diff --git a/src/algorithms/PVT/libs/gpx_printer.cc b/src/algorithms/PVT/libs/gpx_printer.cc index d37b77908..42c32ba5c 100644 --- a/src/algorithms/PVT/libs/gpx_printer.cc +++ b/src/algorithms/PVT/libs/gpx_printer.cc @@ -39,8 +39,6 @@ #include #include -using google::LogMessage; - Gpx_Printer::Gpx_Printer(const std::string& base_path) { diff --git a/src/algorithms/PVT/libs/gpx_printer.h b/src/algorithms/PVT/libs/gpx_printer.h index c584eba4c..740be545c 100644 --- a/src/algorithms/PVT/libs/gpx_printer.h +++ b/src/algorithms/PVT/libs/gpx_printer.h @@ -33,7 +33,6 @@ #ifndef GNSS_SDR_GPX_PRINTER_H_ #define GNSS_SDR_GPX_PRINTER_H_ -#include "pvt_solution.h" #include "rtklib_solver.h" #include #include diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc index 2b1adf739..de9d70b4e 100644 --- a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc +++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc @@ -38,8 +38,6 @@ #include -using google::LogMessage; - Hybrid_Ls_Pvt::Hybrid_Ls_Pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file) : Ls_Pvt() { // init empty ephemeris for all the available GNSS channels diff --git a/src/algorithms/PVT/libs/kml_printer.cc b/src/algorithms/PVT/libs/kml_printer.cc index 790090544..6157f5bc9 100644 --- a/src/algorithms/PVT/libs/kml_printer.cc +++ b/src/algorithms/PVT/libs/kml_printer.cc @@ -39,8 +39,6 @@ #include #include -using google::LogMessage; - Kml_Printer::Kml_Printer(const std::string& base_path) { diff --git a/src/algorithms/PVT/libs/kml_printer.h b/src/algorithms/PVT/libs/kml_printer.h index 1608158b4..bc2db1198 100644 --- a/src/algorithms/PVT/libs/kml_printer.h +++ b/src/algorithms/PVT/libs/kml_printer.h @@ -33,7 +33,6 @@ #ifndef GNSS_SDR_KML_PRINTER_H_ #define GNSS_SDR_KML_PRINTER_H_ -#include "pvt_solution.h" #include "rtklib_solver.h" #include #include diff --git a/src/algorithms/PVT/libs/ls_pvt.cc b/src/algorithms/PVT/libs/ls_pvt.cc index 5f9b9ad48..694b7d946 100644 --- a/src/algorithms/PVT/libs/ls_pvt.cc +++ b/src/algorithms/PVT/libs/ls_pvt.cc @@ -33,13 +33,9 @@ #include "GPS_L1_CA.h" #include "geofunctions.h" #include -#include #include -using google::LogMessage; - - Ls_Pvt::Ls_Pvt() : Pvt_Solution() { } diff --git a/src/algorithms/PVT/libs/nmea_printer.cc b/src/algorithms/PVT/libs/nmea_printer.cc index bbef7b0c7..f01d12272 100644 --- a/src/algorithms/PVT/libs/nmea_printer.cc +++ b/src/algorithms/PVT/libs/nmea_printer.cc @@ -46,9 +46,6 @@ #include -using google::LogMessage; - - Nmea_Printer::Nmea_Printer(const std::string& filename, bool flag_nmea_output_file, bool flag_nmea_tty_port, std::string nmea_dump_devname, const std::string& base_path) { nmea_base_path = base_path; diff --git a/src/algorithms/PVT/libs/pvt_conf.h b/src/algorithms/PVT/libs/pvt_conf.h index 45c960c2f..484961cb2 100644 --- a/src/algorithms/PVT/libs/pvt_conf.h +++ b/src/algorithms/PVT/libs/pvt_conf.h @@ -31,7 +31,6 @@ #ifndef GNSS_SDR_PVT_CONF_H_ #define GNSS_SDR_PVT_CONF_H_ -#include #include #include #include diff --git a/src/algorithms/PVT/libs/pvt_solution.cc b/src/algorithms/PVT/libs/pvt_solution.cc index b1366a751..7e04c58ce 100644 --- a/src/algorithms/PVT/libs/pvt_solution.cc +++ b/src/algorithms/PVT/libs/pvt_solution.cc @@ -33,10 +33,6 @@ #include "GPS_L1_CA.h" #include "geofunctions.h" #include -#include - - -using google::LogMessage; Pvt_Solution::Pvt_Solution() @@ -57,6 +53,7 @@ Pvt_Solution::Pvt_Solution() d_rx_dt_s = 0.0; } + arma::vec Pvt_Solution::rotateSatellite(double const traveltime, const arma::vec &X_sat) { /* diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 9902aa998..39e5d6536 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -48,9 +48,6 @@ #include -using google::LogMessage; - - Rinex_Printer::Rinex_Printer(int32_t conf_version, const std::string& base_path) { std::string base_rinex_path = base_path; diff --git a/src/algorithms/libs/rtcm.cc b/src/algorithms/PVT/libs/rtcm.cc similarity index 99% rename from src/algorithms/libs/rtcm.cc rename to src/algorithms/PVT/libs/rtcm.cc index 43915ee3b..177ea25f6 100644 --- a/src/algorithms/libs/rtcm.cc +++ b/src/algorithms/PVT/libs/rtcm.cc @@ -40,9 +40,6 @@ #include // for std::fmod #include // for strtol #include // for std::stringstream -#include - -using google::LogMessage; Rtcm::Rtcm(uint16_t port) @@ -3366,6 +3363,7 @@ std::map Rtcm::gps_signal_map = [] { gps_signal_map_["5I"] = 22; gps_signal_map_["5Q"] = 23; gps_signal_map_["5X"] = 24; + gps_signal_map_["L5"] = 24; // Workaround. TODO: check if it was I or Q return gps_signal_map_; }(); diff --git a/src/algorithms/libs/rtcm.h b/src/algorithms/PVT/libs/rtcm.h similarity index 99% rename from src/algorithms/libs/rtcm.h rename to src/algorithms/PVT/libs/rtcm.h index 9196a0968..6fd9208af 100644 --- a/src/algorithms/libs/rtcm.h +++ b/src/algorithms/PVT/libs/rtcm.h @@ -43,7 +43,9 @@ #include #include #include +#include // for size_t #include +#include // for memcpy #include #include #include diff --git a/src/algorithms/PVT/libs/rtcm_printer.cc b/src/algorithms/PVT/libs/rtcm_printer.cc index d3416be6e..e999efc42 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.cc +++ b/src/algorithms/PVT/libs/rtcm_printer.cc @@ -45,9 +45,6 @@ #include -using google::LogMessage; - - Rtcm_Printer::Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump, bool flag_rtcm_server, bool flag_rtcm_tty_port, uint16_t rtcm_tcp_port, uint16_t rtcm_station_id, const std::string& rtcm_dump_devname, bool time_tag_name, const std::string& base_path) { boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time(); diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 72e40d2fe..5ee330eb4 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -57,6 +57,7 @@ #include "GPS_L1_CA.h" #include "Galileo_E1.h" #include "rtklib_conversions.h" +#include "rtklib_rtkpos.h" #include "rtklib_solution.h" #include #include @@ -64,8 +65,6 @@ #include -using google::LogMessage; - Rtklib_Solver::Rtklib_Solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t &rtk) { // init empty ephemeris for all the available GNSS channels @@ -481,11 +480,13 @@ double Rtklib_Solver::get_vdop() const return dop_[3]; } + Monitor_Pvt Rtklib_Solver::get_monitor_pvt() const { return monitor_pvt; } + bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_map, bool flag_averaging) { std::map::const_iterator gnss_observables_iter; diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h index 9f8bd86f9..929097de8 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.h +++ b/src/algorithms/PVT/libs/rtklib_solver.h @@ -55,16 +55,28 @@ #define GNSS_SDR_RTKLIB_SOLVER_H_ -#include "beidou_dnav_navigation_message.h" +#include "beidou_dnav_almanac.h" +#include "beidou_dnav_ephemeris.h" +#include "beidou_dnav_iono.h" +#include "beidou_dnav_utc_model.h" #include "galileo_almanac.h" -#include "galileo_navigation_message.h" -#include "glonass_gnav_navigation_message.h" +#include "galileo_ephemeris.h" +#include "galileo_iono.h" +#include "galileo_utc_model.h" +#include "glonass_gnav_almanac.h" +#include "glonass_gnav_ephemeris.h" +#include "glonass_gnav_utc_model.h" #include "gnss_synchro.h" -#include "gps_cnav_navigation_message.h" -#include "gps_navigation_message.h" +#include "gps_almanac.h" +#include "gps_cnav_ephemeris.h" +#include "gps_cnav_iono.h" +#include "gps_cnav_utc_model.h" +#include "gps_ephemeris.h" +#include "gps_iono.h" +#include "gps_utc_model.h" #include "monitor_pvt.h" #include "pvt_solution.h" -#include "rtklib_rtkpos.h" +#include "rtklib.h" #include #include #include @@ -89,12 +101,13 @@ private: Monitor_Pvt monitor_pvt; public: - sol_t pvt_sol; - ssat_t pvt_ssat[MAXSAT]; Rtklib_Solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t& rtk); ~Rtklib_Solver(); bool get_PVT(const std::map& gnss_observables_map, bool flag_averaging); + + sol_t pvt_sol; + ssat_t pvt_ssat[MAXSAT]; double get_hdop() const; double get_vdop() const; double get_pdop() const; diff --git a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc index 7ee2a7277..6c95c26a6 100644 --- a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc @@ -41,8 +41,6 @@ #include -using google::LogMessage; - BeidouB1iPcpsAcquisition::BeidouB1iPcpsAcquisition( ConfigurationInterface* configuration, const std::string& role, 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 14aa840fa..2a8fcebb5 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 @@ -37,8 +37,6 @@ #include #include -using google::LogMessage; - GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( ConfigurationInterface* configuration, 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 24bdc155e..76206cb0e 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc @@ -39,9 +39,6 @@ #include -using google::LogMessage; - - GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( ConfigurationInterface* configuration, const std::string& role, 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 5da2cd5f8..1c3d594bf 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 @@ -37,9 +37,6 @@ #include -using google::LogMessage; - - GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( ConfigurationInterface* configuration, const std::string& role, 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 eab75852e..2241174ec 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 @@ -37,8 +37,6 @@ #include #include -using google::LogMessage; - GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition( ConfigurationInterface* configuration, 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 490ff99bd..527391553 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 @@ -37,8 +37,6 @@ #include #include -using google::LogMessage; - GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcquisition( ConfigurationInterface* configuration, 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 2f538e8f8..24d17fa1b 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 @@ -37,8 +37,6 @@ #include #include -using google::LogMessage; - GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( ConfigurationInterface* configuration, 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 277c48b91..c2b09ba8a 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 @@ -43,8 +43,6 @@ #include #include -using google::LogMessage; - GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( ConfigurationInterface* configuration, diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc index 963cfe5f3..18ff351c2 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc @@ -39,9 +39,6 @@ #include -using google::LogMessage; - - GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, 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 0db1b9802..ef1dcc215 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc @@ -39,9 +39,6 @@ #include -using google::LogMessage; - - GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, 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 4480fd30b..67874f772 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc @@ -41,9 +41,6 @@ #include -using google::LogMessage; - - GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( ConfigurationInterface* configuration, const std::string& role, 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 6770310d7..47d9b51d6 100644 --- a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc @@ -40,9 +40,6 @@ #include -using google::LogMessage; - - GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( ConfigurationInterface* configuration, const std::string& role, 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 e27f37581..7c5b28e8e 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc @@ -43,9 +43,6 @@ #include -using google::LogMessage; - - GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( ConfigurationInterface* configuration, const std::string& role, 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 4fb0e46cf..75f5d5944 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 @@ -40,8 +40,6 @@ #include "gps_sdr_signal_processing.h" #include -using google::LogMessage; - GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( ConfigurationInterface* configuration, 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 6884ba099..3c50cb3b7 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 @@ -44,8 +44,6 @@ #define NUM_PRNs 32 -using google::LogMessage; - GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( ConfigurationInterface* configuration, 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 3770b7c7a..9f361309b 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 @@ -40,9 +40,6 @@ #include -using google::LogMessage; - - GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( ConfigurationInterface* configuration, const std::string& role, 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 1fd9b109f..45c52b10c 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 @@ -38,9 +38,6 @@ #include -using google::LogMessage; - - GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( ConfigurationInterface* configuration, const std::string& role, 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 2691b1161..b38e466e2 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 @@ -39,9 +39,6 @@ #include -using google::LogMessage; - - GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( ConfigurationInterface* configuration, const std::string& role, 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 162ea96ae..cf50926ae 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 @@ -38,9 +38,6 @@ #include -using google::LogMessage; - - GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( ConfigurationInterface* configuration, const std::string& role, 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 41b35b509..4a1377e1b 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc @@ -41,9 +41,6 @@ #include -using google::LogMessage; - - GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( ConfigurationInterface* configuration, const std::string& role, 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 8595b24ec..27115e024 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 @@ -41,8 +41,6 @@ #define NUM_PRNs 32 -using google::LogMessage; - GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( ConfigurationInterface* configuration, @@ -85,6 +83,10 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( //acq_parameters.samples_per_ms = static_cast(std::round(static_cast(fs_in_) * 0.001)); acq_parameters.samples_per_code = nsamples_total; + acq_parameters.downsampling_factor = configuration_->property(role + ".downsampling_factor", 1.0); + acq_parameters.total_block_exp = configuration_->property(role + ".total_block_exp", 14); + acq_parameters.excludelimit = static_cast(std::round(static_cast(fs_in_) / GPS_L2_M_CODE_RATE_HZ)); + // 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) auto* fft_if = new gr::fft::fft_complex(vector_length, true); // Direct FFT @@ -220,6 +222,7 @@ void GpsL2MPcpsAcquisitionFpga::reset() acquisition_fpga_->set_active(true); } + void GpsL2MPcpsAcquisitionFpga::set_state(int state) { acquisition_fpga_->set_state(state); diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc index 69503c7bd..7b595d38a 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc @@ -41,9 +41,6 @@ #include -using google::LogMessage; - - GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( ConfigurationInterface* configuration, const std::string& role, 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 61f2caf88..5a56ee241 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc @@ -42,8 +42,6 @@ #define NUM_PRNs 32 -using google::LogMessage; - GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( ConfigurationInterface* configuration, diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc index c6f14d597..3c5a7e76a 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc @@ -44,7 +44,6 @@ #include #include -using google::LogMessage; galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr galileo_e5a_noncoherentIQ_make_acquisition_caf_cc( unsigned int sampled_ms, 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 cb528d0b1..4d94413db 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 @@ -38,7 +38,6 @@ #include #include -using google::LogMessage; galileo_pcps_8ms_acquisition_cc_sptr galileo_pcps_8ms_make_acquisition_cc( uint32_t sampled_ms, diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc index c43e9d453..0d057d87d 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -45,8 +45,6 @@ #include -using google::LogMessage; - pcps_acquisition_sptr pcps_make_acquisition(const Acq_Conf& conf_) { return pcps_acquisition_sptr(new pcps_acquisition(conf_)); 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 db21bbc2b..ee8ee0c8a 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 @@ -44,8 +44,6 @@ #include -using google::LogMessage; - pcps_acquisition_fine_doppler_cc_sptr pcps_make_acquisition_fine_doppler_cc(const Acq_Conf &conf_) { return pcps_acquisition_fine_doppler_cc_sptr( diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc index 83b5362c9..52441f0ea 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fpga.cc @@ -39,7 +39,6 @@ #define AQ_DOWNSAMPLING_DELAY 40 // delay due to the downsampling filter in the acquisition -using google::LogMessage; pcps_acquisition_fpga_sptr pcps_make_acquisition_fpga(pcpsconf_fpga_t conf_) { @@ -63,6 +62,7 @@ pcps_acquisition_fpga::pcps_acquisition_fpga(pcpsconf_fpga_t conf_) : gr::block( d_num_doppler_bins = 0U; d_threshold = 0.0; d_doppler_step = 0U; + d_doppler_index = 0U; d_test_statistics = 0.0; d_channel = 0U; d_gnss_synchro = nullptr; 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 bf7184488..37690b1b6 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc @@ -44,7 +44,6 @@ extern Concurrent_Map global_gps_acq_assist_map; -using google::LogMessage; pcps_assisted_acquisition_cc_sptr pcps_make_assisted_acquisition_cc( int32_t max_dwells, uint32_t sampled_ms, int32_t doppler_max, int32_t doppler_min, 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 17082ae25..07a208be8 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc @@ -44,7 +44,6 @@ #include #include -using google::LogMessage; pcps_cccwsr_acquisition_cc_sptr pcps_cccwsr_make_acquisition_cc( uint32_t sampled_ms, 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 774022fb2..beb3d74d1 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc @@ -64,8 +64,6 @@ #include -using google::LogMessage; - pcps_opencl_acquisition_cc_sptr pcps_make_opencl_acquisition_cc( uint32_t sampled_ms, uint32_t max_dwells, uint32_t doppler_max, int64_t fs_in, 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 a55b352c9..8c88d614b 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc @@ -40,8 +40,6 @@ #include -using google::LogMessage; - pcps_quicksync_acquisition_cc_sptr pcps_quicksync_make_acquisition_cc( uint32_t folding_factor, uint32_t sampled_ms, 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 7fc685028..60b326d8d 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc @@ -58,7 +58,6 @@ #include #include -using google::LogMessage; pcps_tong_acquisition_cc_sptr pcps_tong_make_acquisition_cc( uint32_t sampled_ms, diff --git a/src/algorithms/channel/adapters/CMakeLists.txt b/src/algorithms/channel/adapters/CMakeLists.txt index 7bf49e73d..7f439ce56 100644 --- a/src/algorithms/channel/adapters/CMakeLists.txt +++ b/src/algorithms/channel/adapters/CMakeLists.txt @@ -30,6 +30,7 @@ target_link_libraries(channel_adapters PUBLIC Gnuradio::runtime channel_libs + core_system_parameters PRIVATE Gflags::gflags Glog::glog diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index 12fafc3de..a6f0bba1c 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -30,12 +30,16 @@ */ #include "channel.h" +#include "acquisition_interface.h" +#include "channel_fsm.h" #include "configuration_interface.h" #include "gnss_sdr_flags.h" +#include "telemetry_decoder_interface.h" +#include "tracking_interface.h" #include -#include +#include // for memcpy +#include -using google::LogMessage; // Constructor Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, std::shared_ptr acq, @@ -158,16 +162,19 @@ gr::basic_block_sptr Channel::get_left_block() 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() { return nav_->get_right_block(); @@ -198,10 +205,10 @@ void Channel::stop_channel() LOG(WARNING) << "Invalid channel event"; return; } - DLOG(INFO) - << "Channel stop_channel()"; + DLOG(INFO) << "Channel stop_channel()"; } + void Channel::start_acquisition() { std::lock_guard lk(mx); diff --git a/src/algorithms/channel/adapters/channel.h b/src/algorithms/channel/adapters/channel.h index 9eda9e474..81030fd51 100644 --- a/src/algorithms/channel/adapters/channel.h +++ b/src/algorithms/channel/adapters/channel.h @@ -35,12 +35,14 @@ #ifndef GNSS_SDR_CHANNEL_H_ #define GNSS_SDR_CHANNEL_H_ -#include "channel_fsm.h" #include "channel_interface.h" #include "channel_msg_receiver_cc.h" +#include "gnss_signal.h" #include "gnss_synchro.h" #include #include +#include +#include #include #include #include @@ -49,6 +51,7 @@ class ConfigurationInterface; class AcquisitionInterface; class TrackingInterface; class TelemetryDecoderInterface; +class ChannelFsm; /*! * \brief This class represents a GNSS channel. It wraps an AcquisitionInterface, diff --git a/src/algorithms/channel/libs/CMakeLists.txt b/src/algorithms/channel/libs/CMakeLists.txt index c055123bc..415b118ec 100644 --- a/src/algorithms/channel/libs/CMakeLists.txt +++ b/src/algorithms/channel/libs/CMakeLists.txt @@ -36,8 +36,10 @@ add_library(channel_libs ${CHANNEL_FSM_SOURCES} ${CHANNEL_FSM_HEADERS}) target_link_libraries(channel_libs PUBLIC Gnuradio::runtime + Gnuradio::pmt core_system_parameters PRIVATE + Boost::boost Gflags::gflags Glog::glog core_receiver diff --git a/src/algorithms/channel/libs/channel_fsm.cc b/src/algorithms/channel/libs/channel_fsm.cc index 968ea2393..cd8e97b26 100644 --- a/src/algorithms/channel/libs/channel_fsm.cc +++ b/src/algorithms/channel/libs/channel_fsm.cc @@ -32,8 +32,7 @@ #include "channel_fsm.h" #include "control_message_factory.h" #include - -using google::LogMessage; +#include ChannelFsm::ChannelFsm() { @@ -58,13 +57,13 @@ bool ChannelFsm::Event_stop_channel() DLOG(INFO) << "CH = " << channel_ << ". Ev stop channel"; switch (d_state) { - case 0: //already in stanby + case 0: // already in stanby break; - case 1: //acquisition + case 1: // acquisition d_state = 0; stop_acquisition(); break; - case 2: //tracking + case 2: // tracking d_state = 0; stop_tracking(); break; @@ -74,6 +73,7 @@ bool ChannelFsm::Event_stop_channel() return true; } + bool ChannelFsm::Event_start_acquisition() { std::lock_guard lk(mx); diff --git a/src/algorithms/channel/libs/channel_fsm.h b/src/algorithms/channel/libs/channel_fsm.h index 2ecc6eb20..8242058cb 100644 --- a/src/algorithms/channel/libs/channel_fsm.h +++ b/src/algorithms/channel/libs/channel_fsm.h @@ -33,7 +33,6 @@ #define GNSS_SDR_CHANNEL_FSM_H #include "acquisition_interface.h" -#include "telemetry_decoder_interface.h" #include "tracking_interface.h" #include #include @@ -55,7 +54,7 @@ public: void set_queue(gr::msg_queue::sptr queue); void set_channel(uint32_t channel); - //FSM EVENTS + // FSM EVENTS bool Event_start_acquisition(); bool Event_valid_acquisition(); bool Event_stop_channel(); @@ -79,4 +78,4 @@ private: std::mutex mx; }; -#endif /*GNSS_SDR_CHANNEL_FSM_H*/ +#endif // GNSS_SDR_CHANNEL_FSM_H diff --git a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc index 82333e6a7..8fb4aa47e 100644 --- a/src/algorithms/channel/libs/channel_msg_receiver_cc.cc +++ b/src/algorithms/channel/libs/channel_msg_receiver_cc.cc @@ -30,12 +30,13 @@ #include "channel_msg_receiver_cc.h" +#include +#include #include #include #include #include - -using google::LogMessage; +#include channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptr channel_fsm, bool repeat) @@ -44,6 +45,19 @@ channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptr channel_fsm, bool repeat) : gr::block("channel_msg_receiver_cc", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) +{ + this->message_port_register_in(pmt::mp("events")); + this->set_msg_handler(pmt::mp("events"), boost::bind(&channel_msg_receiver_cc::msg_handler_events, this, _1)); + + d_channel_fsm = std::move(channel_fsm); + d_repeat = repeat; +} + + +channel_msg_receiver_cc::~channel_msg_receiver_cc() = default; + + void channel_msg_receiver_cc::msg_handler_events(pmt::pmt_t msg) { bool result = false; @@ -82,16 +96,3 @@ void channel_msg_receiver_cc::msg_handler_events(pmt::pmt_t msg) LOG(WARNING) << "msg_handler_telemetry invalid event"; } } - - -channel_msg_receiver_cc::channel_msg_receiver_cc(std::shared_ptr channel_fsm, bool repeat) : gr::block("channel_msg_receiver_cc", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) -{ - this->message_port_register_in(pmt::mp("events")); - this->set_msg_handler(pmt::mp("events"), boost::bind(&channel_msg_receiver_cc::msg_handler_events, this, _1)); - - d_channel_fsm = std::move(channel_fsm); - d_repeat = repeat; -} - - -channel_msg_receiver_cc::~channel_msg_receiver_cc() = default; diff --git a/src/algorithms/channel/libs/channel_msg_receiver_cc.h b/src/algorithms/channel/libs/channel_msg_receiver_cc.h index cc05892d8..40c542dde 100644 --- a/src/algorithms/channel/libs/channel_msg_receiver_cc.h +++ b/src/algorithms/channel/libs/channel_msg_receiver_cc.h @@ -33,6 +33,8 @@ #include "channel_fsm.h" #include +#include +#include class channel_msg_receiver_cc; diff --git a/src/algorithms/conditioner/adapters/array_signal_conditioner.cc b/src/algorithms/conditioner/adapters/array_signal_conditioner.cc index 55970c4d7..d82535e6c 100644 --- a/src/algorithms/conditioner/adapters/array_signal_conditioner.cc +++ b/src/algorithms/conditioner/adapters/array_signal_conditioner.cc @@ -30,12 +30,11 @@ */ #include "array_signal_conditioner.h" +#include "configuration_interface.h" #include #include -using google::LogMessage; - // Constructor ArraySignalConditioner::ArraySignalConditioner(ConfigurationInterface *configuration, std::shared_ptr data_type_adapt, diff --git a/src/algorithms/conditioner/adapters/array_signal_conditioner.h b/src/algorithms/conditioner/adapters/array_signal_conditioner.h index 76809be53..b8f43de03 100644 --- a/src/algorithms/conditioner/adapters/array_signal_conditioner.h +++ b/src/algorithms/conditioner/adapters/array_signal_conditioner.h @@ -34,14 +34,14 @@ #include "gnss_block_interface.h" -#include +#include +#include +#include #include class ConfigurationInterface; -class AcquisitionInterface; -class TrackingInterface; -class TelemetryDecoderInterface; + /*! * \brief This class wraps blocks to change data_type_adapter, input_filter and resampler diff --git a/src/algorithms/conditioner/adapters/signal_conditioner.cc b/src/algorithms/conditioner/adapters/signal_conditioner.cc index e55ba9e1a..72b6ab404 100644 --- a/src/algorithms/conditioner/adapters/signal_conditioner.cc +++ b/src/algorithms/conditioner/adapters/signal_conditioner.cc @@ -30,12 +30,11 @@ */ #include "signal_conditioner.h" +#include "configuration_interface.h" #include #include -using google::LogMessage; - // Constructor SignalConditioner::SignalConditioner(ConfigurationInterface *configuration, std::shared_ptr data_type_adapt, diff --git a/src/algorithms/conditioner/adapters/signal_conditioner.h b/src/algorithms/conditioner/adapters/signal_conditioner.h index 85dc8396c..455c6e287 100644 --- a/src/algorithms/conditioner/adapters/signal_conditioner.h +++ b/src/algorithms/conditioner/adapters/signal_conditioner.h @@ -33,12 +33,12 @@ #define GNSS_SDR_SIGNAL_CONDITIONER_H_ #include "gnss_block_interface.h" +#include +#include +#include #include class ConfigurationInterface; -class AcquisitionInterface; -class TrackingInterface; -class TelemetryDecoderInterface; /*! * \brief This class wraps blocks to change data_type_adapter, input_filter and resampler diff --git a/src/algorithms/data_type_adapter/adapters/byte_to_short.cc b/src/algorithms/data_type_adapter/adapters/byte_to_short.cc index b89fec1ed..778d42d09 100644 --- a/src/algorithms/data_type_adapter/adapters/byte_to_short.cc +++ b/src/algorithms/data_type_adapter/adapters/byte_to_short.cc @@ -35,8 +35,6 @@ #include -using google::LogMessage; - ByteToShort::ByteToShort(ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams) { diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.cc b/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.cc index 5cfbd4186..bc044be04 100644 --- a/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.cc +++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.cc @@ -34,7 +34,6 @@ #include #include -using google::LogMessage; IbyteToCbyte::IbyteToCbyte(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.cc b/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.cc index cd8c14850..e32c4adca 100644 --- a/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.cc +++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.cc @@ -32,7 +32,6 @@ #include "configuration_interface.h" #include -using google::LogMessage; IbyteToComplex::IbyteToComplex(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.cc b/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.cc index f4c8b6207..89aa9f7e8 100644 --- a/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.cc +++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.cc @@ -35,8 +35,6 @@ #include -using google::LogMessage; - IbyteToCshort::IbyteToCshort(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) { diff --git a/src/algorithms/data_type_adapter/adapters/ishort_to_complex.cc b/src/algorithms/data_type_adapter/adapters/ishort_to_complex.cc index 918dbd8a3..8f9d564b1 100644 --- a/src/algorithms/data_type_adapter/adapters/ishort_to_complex.cc +++ b/src/algorithms/data_type_adapter/adapters/ishort_to_complex.cc @@ -32,7 +32,6 @@ #include "configuration_interface.h" #include -using google::LogMessage; IshortToComplex::IshortToComplex(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.cc b/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.cc index c6a7d7490..0af4407c5 100644 --- a/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.cc +++ b/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.cc @@ -34,7 +34,6 @@ #include #include -using google::LogMessage; IshortToCshort::IshortToCshort(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/input_filter/adapters/beamformer_filter.cc b/src/algorithms/input_filter/adapters/beamformer_filter.cc index dae0d1386..2975b8d1d 100644 --- a/src/algorithms/input_filter/adapters/beamformer_filter.cc +++ b/src/algorithms/input_filter/adapters/beamformer_filter.cc @@ -35,8 +35,6 @@ #include -using google::LogMessage; - BeamformerFilter::BeamformerFilter( ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, unsigned int out_stream) : role_(role), in_stream_(in_stream), out_stream_(out_stream) diff --git a/src/algorithms/input_filter/adapters/fir_filter.cc b/src/algorithms/input_filter/adapters/fir_filter.cc index 48dfb4871..9529bcb6c 100644 --- a/src/algorithms/input_filter/adapters/fir_filter.cc +++ b/src/algorithms/input_filter/adapters/fir_filter.cc @@ -37,8 +37,6 @@ #include -using google::LogMessage; - FirFilter::FirFilter(ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams) { 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 17ab25dab..e85c9b88f 100644 --- a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc +++ b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc @@ -38,7 +38,6 @@ #include #include -using google::LogMessage; FreqXlatingFirFilter::FreqXlatingFirFilter(ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/input_filter/adapters/notch_filter.cc b/src/algorithms/input_filter/adapters/notch_filter.cc index c9264e0f7..98bb16b7e 100644 --- a/src/algorithms/input_filter/adapters/notch_filter.cc +++ b/src/algorithms/input_filter/adapters/notch_filter.cc @@ -2,7 +2,7 @@ * \file notch_filter.cc * \brief Adapts a gnuradio gr_notch_filter * \author Antonio Ramos, 2017. antonio.ramosdet(at)gmail.com - * + * * * ------------------------------------------------------------------------- * @@ -36,8 +36,6 @@ #include -using google::LogMessage; - NotchFilter::NotchFilter(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { diff --git a/src/algorithms/input_filter/adapters/notch_filter_lite.cc b/src/algorithms/input_filter/adapters/notch_filter_lite.cc index 3c83369d5..6ebf5cb05 100644 --- a/src/algorithms/input_filter/adapters/notch_filter_lite.cc +++ b/src/algorithms/input_filter/adapters/notch_filter_lite.cc @@ -2,7 +2,7 @@ * \file notch_filter_lite.cc * \brief Adapts a gnuradio gr_notch_filter_lite * \author Antonio Ramos, 2017. antonio.ramosdet(at)gmail.com - * + * * * ------------------------------------------------------------------------- * @@ -36,7 +36,6 @@ #include #include -using google::LogMessage; NotchFilterLite::NotchFilterLite(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc b/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc index fffdefe9f..67b86c817 100644 --- a/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc +++ b/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc @@ -37,7 +37,6 @@ #include #include -using google::LogMessage; PulseBlankingFilter::PulseBlankingFilter(ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index 2b7f2f845..fd44a7524 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -41,7 +41,6 @@ set(GNSS_SPLIBS_SOURCES conjugate_ic.cc gnss_sdr_create_directory.cc geofunctions.cc - rtcm.cc ) set(GNSS_SPLIBS_HEADERS @@ -68,7 +67,6 @@ set(GNSS_SPLIBS_HEADERS gnss_sdr_create_directory.h gnss_circular_deque.h geofunctions.h - rtcm.h ) if(ENABLE_FPGA) @@ -116,20 +114,18 @@ target_link_libraries(algorithms_libs Gflags::gflags Gnuradio::runtime Gnuradio::blocks - Volk::volk ${ORC_LIBRARIES} - Volkgnsssdr::volkgnsssdr - core_system_parameters ${OPT_LIBRARIES} PRIVATE + core_system_parameters + Volk::volk ${ORC_LIBRARIES} + Volkgnsssdr::volkgnsssdr Boost::filesystem - Gflags::gflags Glog::glog ) target_include_directories(algorithms_libs PUBLIC ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver ) target_compile_definitions(algorithms_libs @@ -141,15 +137,6 @@ set_property(TARGET algorithms_libs $ ) -if(OS_IS_MACOSX) - if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # not AppleClang - target_compile_definitions(algorithms_libs - PUBLIC - -DBOOST_ASIO_HAS_STD_STRING_VIEW - ) - endif() -endif() - if(ENABLE_CLANG_TIDY) if(CLANG_TIDY_EXE) set_target_properties(algorithms_libs diff --git a/src/algorithms/libs/byte_x2_to_complex_byte.cc b/src/algorithms/libs/byte_x2_to_complex_byte.cc index a3a78c067..f14474959 100644 --- a/src/algorithms/libs/byte_x2_to_complex_byte.cc +++ b/src/algorithms/libs/byte_x2_to_complex_byte.cc @@ -31,7 +31,10 @@ #include "byte_x2_to_complex_byte.h" #include -#include +#include +#include // for max +#include // for complex +#include // for int8_t byte_x2_to_complex_byte_sptr make_byte_x2_to_complex_byte() @@ -44,7 +47,7 @@ byte_x2_to_complex_byte::byte_x2_to_complex_byte() : sync_block("byte_x2_to_comp gr::io_signature::make(2, 2, sizeof(int8_t)), // int8_t, defined in stdint.h and included in volk.h (signed char) gr::io_signature::make(1, 1, sizeof(lv_8sc_t))) // lv_8sc_t is a Volk's typedef for std::complex { - const int alignment_multiple = volk_get_alignment() / sizeof(lv_8sc_t); + const int alignment_multiple = volk_gnsssdr_get_alignment() / sizeof(lv_8sc_t); set_alignment(std::max(1, alignment_multiple)); } diff --git a/src/algorithms/libs/byte_x2_to_complex_byte.h b/src/algorithms/libs/byte_x2_to_complex_byte.h index 05db6cb2d..d0a4e5dd2 100644 --- a/src/algorithms/libs/byte_x2_to_complex_byte.h +++ b/src/algorithms/libs/byte_x2_to_complex_byte.h @@ -34,6 +34,7 @@ #include #include +#include // for gr_vector_const_void_star class byte_x2_to_complex_byte; @@ -49,10 +50,9 @@ class byte_x2_to_complex_byte : public gr::sync_block { private: friend byte_x2_to_complex_byte_sptr make_byte_x2_to_complex_byte(); - -public: byte_x2_to_complex_byte(); +public: int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); diff --git a/src/algorithms/libs/complex_byte_to_float_x2.cc b/src/algorithms/libs/complex_byte_to_float_x2.cc index 04f4a54b2..1126ad014 100644 --- a/src/algorithms/libs/complex_byte_to_float_x2.cc +++ b/src/algorithms/libs/complex_byte_to_float_x2.cc @@ -32,6 +32,7 @@ #include "complex_byte_to_float_x2.h" #include #include +#include // for max complex_byte_to_float_x2_sptr make_complex_byte_to_float_x2() diff --git a/src/algorithms/libs/complex_byte_to_float_x2.h b/src/algorithms/libs/complex_byte_to_float_x2.h index 170cd6033..f13859633 100644 --- a/src/algorithms/libs/complex_byte_to_float_x2.h +++ b/src/algorithms/libs/complex_byte_to_float_x2.h @@ -34,6 +34,7 @@ #include #include +#include // for gr_vector_const_void_star class complex_byte_to_float_x2; @@ -49,10 +50,9 @@ class complex_byte_to_float_x2 : public gr::sync_block { private: friend complex_byte_to_float_x2_sptr make_complex_byte_to_float_x2(); - -public: complex_byte_to_float_x2(); - + +public: int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); diff --git a/src/algorithms/libs/complex_float_to_complex_byte.cc b/src/algorithms/libs/complex_float_to_complex_byte.cc index d7106bedd..f4b9e44c0 100644 --- a/src/algorithms/libs/complex_float_to_complex_byte.cc +++ b/src/algorithms/libs/complex_float_to_complex_byte.cc @@ -32,7 +32,7 @@ #include "complex_float_to_complex_byte.h" #include #include - +#include // for max complex_float_to_complex_byte_sptr make_complex_float_to_complex_byte() { diff --git a/src/algorithms/libs/complex_float_to_complex_byte.h b/src/algorithms/libs/complex_float_to_complex_byte.h index f8368543e..2e74ae11a 100644 --- a/src/algorithms/libs/complex_float_to_complex_byte.h +++ b/src/algorithms/libs/complex_float_to_complex_byte.h @@ -33,6 +33,8 @@ #include #include +#include // for gr_vector_const_void_star + class complex_float_to_complex_byte; @@ -47,10 +49,9 @@ class complex_float_to_complex_byte : public gr::sync_block { private: friend complex_float_to_complex_byte_sptr make_complex_float_to_complex_byte(); - -public: complex_float_to_complex_byte(); - + +public: int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); diff --git a/src/algorithms/libs/conjugate_cc.cc b/src/algorithms/libs/conjugate_cc.cc index 67077ba23..c3080ffa5 100644 --- a/src/algorithms/libs/conjugate_cc.cc +++ b/src/algorithms/libs/conjugate_cc.cc @@ -31,6 +31,7 @@ #include "conjugate_cc.h" #include #include +#include // for max conjugate_cc_sptr make_conjugate_cc() diff --git a/src/algorithms/libs/conjugate_cc.h b/src/algorithms/libs/conjugate_cc.h index 56a3ece78..6ceb32f6f 100644 --- a/src/algorithms/libs/conjugate_cc.h +++ b/src/algorithms/libs/conjugate_cc.h @@ -33,6 +33,7 @@ #include #include +#include // for gr_vector_const_void_star class conjugate_cc; @@ -48,10 +49,9 @@ class conjugate_cc : public gr::sync_block { private: friend conjugate_cc_sptr make_conjugate_cc(); - -public: conjugate_cc(); - + +public: int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); diff --git a/src/algorithms/libs/conjugate_ic.cc b/src/algorithms/libs/conjugate_ic.cc index d3d00932e..2f2c6a81e 100644 --- a/src/algorithms/libs/conjugate_ic.cc +++ b/src/algorithms/libs/conjugate_ic.cc @@ -31,6 +31,7 @@ #include "conjugate_ic.h" #include #include +#include // for max conjugate_ic_sptr make_conjugate_ic() diff --git a/src/algorithms/libs/conjugate_ic.h b/src/algorithms/libs/conjugate_ic.h index 4acc7af3a..2ffaf9e4c 100644 --- a/src/algorithms/libs/conjugate_ic.h +++ b/src/algorithms/libs/conjugate_ic.h @@ -33,6 +33,7 @@ #include #include +#include // for gr_vector_const_void_star class conjugate_ic; @@ -48,10 +49,9 @@ class conjugate_ic : public gr::sync_block { private: friend conjugate_ic_sptr make_conjugate_ic(); - -public: conjugate_ic(); +public: int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); diff --git a/src/algorithms/libs/conjugate_sc.cc b/src/algorithms/libs/conjugate_sc.cc index e23f1c1a4..e32c39c45 100644 --- a/src/algorithms/libs/conjugate_sc.cc +++ b/src/algorithms/libs/conjugate_sc.cc @@ -31,7 +31,7 @@ #include "conjugate_sc.h" #include #include - +#include // for max conjugate_sc_sptr make_conjugate_sc() { diff --git a/src/algorithms/libs/conjugate_sc.h b/src/algorithms/libs/conjugate_sc.h index a26b39ad7..7f1935d5c 100644 --- a/src/algorithms/libs/conjugate_sc.h +++ b/src/algorithms/libs/conjugate_sc.h @@ -33,6 +33,7 @@ #include #include +#include // for gr_vector_const_void_star class conjugate_sc; @@ -48,10 +49,9 @@ class conjugate_sc : public gr::sync_block { private: friend conjugate_sc_sptr make_conjugate_sc(); - -public: conjugate_sc(); - + +public: int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); diff --git a/src/algorithms/libs/cshort_to_float_x2.cc b/src/algorithms/libs/cshort_to_float_x2.cc index cfde3f79c..a3e8a8a21 100644 --- a/src/algorithms/libs/cshort_to_float_x2.cc +++ b/src/algorithms/libs/cshort_to_float_x2.cc @@ -32,6 +32,7 @@ #include "cshort_to_float_x2.h" #include #include +#include // for max cshort_to_float_x2_sptr make_cshort_to_float_x2() diff --git a/src/algorithms/libs/cshort_to_float_x2.h b/src/algorithms/libs/cshort_to_float_x2.h index 87a5d89a7..74c3ab356 100644 --- a/src/algorithms/libs/cshort_to_float_x2.h +++ b/src/algorithms/libs/cshort_to_float_x2.h @@ -34,6 +34,7 @@ #include #include +#include // for gr_vector_const_void_star class cshort_to_float_x2; @@ -49,10 +50,9 @@ class cshort_to_float_x2 : public gr::sync_block { private: friend cshort_to_float_x2_sptr make_cshort_to_float_x2(); - -public: cshort_to_float_x2(); +public: int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); diff --git a/src/algorithms/libs/galileo_e5_signal_processing.cc b/src/algorithms/libs/galileo_e5_signal_processing.cc index dab7e1d77..d02508f50 100644 --- a/src/algorithms/libs/galileo_e5_signal_processing.cc +++ b/src/algorithms/libs/galileo_e5_signal_processing.cc @@ -131,6 +131,12 @@ void galileo_e5_a_code_gen_complex_sampled(std::complex* _dest, char _Sig { _dest[(i + delay) % _samplesPerCode] = _code[i]; } - - delete[] _code; + if (_fs != _codeFreqBasis) + { + free(_code); + } + else + { + delete[] _code; + } } diff --git a/src/algorithms/libs/gnss_sdr_fpga_sample_counter.cc b/src/algorithms/libs/gnss_sdr_fpga_sample_counter.cc index e8e147e6a..777382909 100644 --- a/src/algorithms/libs/gnss_sdr_fpga_sample_counter.cc +++ b/src/algorithms/libs/gnss_sdr_fpga_sample_counter.cc @@ -40,7 +40,6 @@ #include #include // libraries used by the GIPO -using google::LogMessage; #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) diff --git a/src/algorithms/libs/pass_through.cc b/src/algorithms/libs/pass_through.cc index c2caa83db..1a517a96b 100644 --- a/src/algorithms/libs/pass_through.cc +++ b/src/algorithms/libs/pass_through.cc @@ -33,10 +33,11 @@ #include "pass_through.h" #include "configuration_interface.h" #include -#include -#include +#include +#include +#include // for int8_t +#include // for operator<< -using google::LogMessage; Pass_Through::Pass_Through(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, diff --git a/src/algorithms/libs/pass_through.h b/src/algorithms/libs/pass_through.h index 7ef1838bf..ec8046862 100644 --- a/src/algorithms/libs/pass_through.h +++ b/src/algorithms/libs/pass_through.h @@ -38,7 +38,8 @@ #include "conjugate_sc.h" #include "gnss_block_interface.h" #include -#include +#include +#include #include diff --git a/src/algorithms/libs/rtklib/CMakeLists.txt b/src/algorithms/libs/rtklib/CMakeLists.txt index 6a85ff21b..f15c1c074 100644 --- a/src/algorithms/libs/rtklib/CMakeLists.txt +++ b/src/algorithms/libs/rtklib/CMakeLists.txt @@ -66,9 +66,8 @@ source_group(Headers FILES ${RTKLIB_LIB_HEADERS}) add_library(algorithms_libs_rtklib ${RTKLIB_LIB_SOURCES} ${RTKLIB_LIB_HEADERS}) target_link_libraries(algorithms_libs_rtklib - PUBLIC - core_system_parameters PRIVATE + core_system_parameters Gflags::gflags Glog::glog ) diff --git a/src/algorithms/libs/rtklib/rtklib_conversions.cc b/src/algorithms/libs/rtklib/rtklib_conversions.cc index 6008fdfd4..280d81ebe 100644 --- a/src/algorithms/libs/rtklib/rtklib_conversions.cc +++ b/src/algorithms/libs/rtklib/rtklib_conversions.cc @@ -29,7 +29,20 @@ */ #include "rtklib_conversions.h" +#include "MATH_CONSTANTS.h" // for PI, PI_2 +#include "beidou_dnav_ephemeris.h" // for Beidou_Dnav_Ephemeris +#include "galileo_almanac.h" // for Galileo_Almanac +#include "galileo_ephemeris.h" // for Galileo_Ephemeris +#include "glonass_gnav_ephemeris.h" // for Glonass_Gnav_Ephemeris +#include "glonass_gnav_utc_model.h" // for Glonass_Gnav_Utc_Model +#include "gnss_obs_codes.h" // for CODE_L1C, CODE_L2S, CODE_L5X +#include "gnss_synchro.h" // for Gnss_Synchro +#include "gps_almanac.h" // for Gps_Almanac +#include "gps_cnav_ephemeris.h" // for Gps_CNAV_Ephemeris +#include "gps_ephemeris.h" // for Gps_Ephemeris #include "rtklib_rtkcmn.h" +#include +#include obsd_t insert_obs_to_rtklib(obsd_t& rtklib_obs, const Gnss_Synchro& gnss_synchro, int week, int band) { diff --git a/src/algorithms/libs/rtklib/rtklib_conversions.h b/src/algorithms/libs/rtklib/rtklib_conversions.h index de2b7baaf..a46d90c5f 100644 --- a/src/algorithms/libs/rtklib/rtklib_conversions.h +++ b/src/algorithms/libs/rtklib/rtklib_conversions.h @@ -31,17 +31,18 @@ #ifndef GNSS_SDR_RTKLIB_CONVERSIONS_H_ #define GNSS_SDR_RTKLIB_CONVERSIONS_H_ -#include "beidou_dnav_ephemeris.h" -#include "galileo_almanac.h" -#include "galileo_ephemeris.h" -#include "glonass_gnav_ephemeris.h" -#include "glonass_gnav_utc_model.h" -#include "gnss_synchro.h" -#include "gps_almanac.h" -#include "gps_cnav_ephemeris.h" -#include "gps_ephemeris.h" #include "rtklib.h" +class Beidou_Dnav_Ephemeris; +class Galileo_Almanac; +class Galileo_Ephemeris; +class Glonass_Gnav_Ephemeris; +class Glonass_Gnav_Utc_Model; +class Gnss_Synchro; +class Gps_Almanac; +class Gps_CNAV_Ephemeris; +class Gps_Ephemeris; + eph_t eph_to_rtklib(const Galileo_Ephemeris& gal_eph); eph_t eph_to_rtklib(const Gps_Ephemeris& gps_eph); eph_t eph_to_rtklib(const Gps_CNAV_Ephemeris& gps_cnav_eph); diff --git a/src/algorithms/libs/short_x2_to_cshort.cc b/src/algorithms/libs/short_x2_to_cshort.cc index 90ce99a7e..4561c7a46 100644 --- a/src/algorithms/libs/short_x2_to_cshort.cc +++ b/src/algorithms/libs/short_x2_to_cshort.cc @@ -31,8 +31,9 @@ #include "short_x2_to_cshort.h" #include -#include - +#include +#include // for max +#include // for complex short_x2_to_cshort_sptr make_short_x2_to_cshort() { @@ -44,7 +45,7 @@ short_x2_to_cshort::short_x2_to_cshort() : sync_block("short_x2_to_cshort", gr::io_signature::make(2, 2, sizeof(int16_t)), gr::io_signature::make(1, 1, sizeof(lv_16sc_t))) { - const int alignment_multiple = volk_get_alignment() / sizeof(lv_16sc_t); + const int alignment_multiple = volk_gnsssdr_get_alignment() / sizeof(lv_16sc_t); set_alignment(std::max(1, alignment_multiple)); } @@ -61,7 +62,6 @@ int short_x2_to_cshort::work(int noutput_items, int16_t imag_part; for (int number = 0; number < noutput_items; number++) { - // lv_cmake(r, i) defined at volk/volk_complex.h real_part = *in0++; imag_part = *in1++; *out++ = lv_cmake(real_part, imag_part); diff --git a/src/algorithms/libs/short_x2_to_cshort.h b/src/algorithms/libs/short_x2_to_cshort.h index 1591c5412..eb1c24a06 100644 --- a/src/algorithms/libs/short_x2_to_cshort.h +++ b/src/algorithms/libs/short_x2_to_cshort.h @@ -34,6 +34,7 @@ #include #include +#include // for gr_vector_const_void_star class short_x2_to_cshort; @@ -48,10 +49,9 @@ class short_x2_to_cshort : public gr::sync_block { private: friend short_x2_to_cshort_sptr make_short_x2_to_cshort(); - -public: short_x2_to_cshort(); +public: int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); diff --git a/src/algorithms/observables/adapters/hybrid_observables.cc b/src/algorithms/observables/adapters/hybrid_observables.cc index f92c02b48..e038e47ff 100644 --- a/src/algorithms/observables/adapters/hybrid_observables.cc +++ b/src/algorithms/observables/adapters/hybrid_observables.cc @@ -33,10 +33,9 @@ #include "hybrid_observables.h" #include "configuration_interface.h" #include +#include // for operator<< -using google::LogMessage; - HybridObservables::HybridObservables(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { @@ -46,7 +45,7 @@ HybridObservables::HybridObservables(ConfigurationInterface* configuration, dump_mat_ = configuration->property(role + ".dump_mat", true); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); - observables_ = hybrid_make_observables_cc(in_streams_, out_streams_, dump_, dump_mat_, dump_filename_); + observables_ = hybrid_observables_gs_make(in_streams_, out_streams_, dump_, dump_mat_, dump_filename_); DLOG(INFO) << "Observables block ID (" << observables_->unique_id() << ")"; } diff --git a/src/algorithms/observables/adapters/hybrid_observables.h b/src/algorithms/observables/adapters/hybrid_observables.h index 35015b837..7e2d6c674 100644 --- a/src/algorithms/observables/adapters/hybrid_observables.h +++ b/src/algorithms/observables/adapters/hybrid_observables.h @@ -34,8 +34,11 @@ #ifndef GNSS_SDR_HYBRID_OBSERVABLES_H_ #define GNSS_SDR_HYBRID_OBSERVABLES_H_ -#include "hybrid_observables_cc.h" +#include "hybrid_observables_gs.h" #include "observables_interface.h" +#include // for gr_complex +#include // for basic_block_sptr, top_block_sptr +#include #include class ConfigurationInterface; @@ -81,7 +84,7 @@ public: } private: - hybrid_observables_cc_sptr observables_; + hybrid_observables_gs_sptr observables_; bool dump_; bool dump_mat_; std::string dump_filename_; diff --git a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt index e50fabfd2..90bc7236b 100644 --- a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt @@ -17,11 +17,11 @@ # set(OBS_GR_BLOCKS_SOURCES - hybrid_observables_cc.cc + hybrid_observables_gs.cc ) set(OBS_GR_BLOCKS_HEADERS - hybrid_observables_cc.h + hybrid_observables_gs.h ) source_group(Headers FILES ${OBS_GR_BLOCKS_HEADERS}) @@ -37,13 +37,13 @@ target_link_libraries(obs_gr_blocks PUBLIC Boost::boost Gnuradio::blocks - core_system_parameters PRIVATE + algorithms_libs + core_system_parameters Gflags::gflags Glog::glog Boost::filesystem Matio::matio - algorithms_libs ) if(ENABLE_CLANG_TIDY) diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc similarity index 93% rename from src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc rename to src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc index 382414c44..93564f34a 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc @@ -1,5 +1,5 @@ /*! - * \file hybrid_observables_cc.cc + * \file hybrid_observables_gs.cc * \brief Implementation of the observables computation block * \author Javier Arribas 2017. jarribas(at)cttc.es * \author Antonio Ramos 2018. antonio.ramos(at)cttc.es @@ -29,37 +29,35 @@ * ------------------------------------------------------------------------- */ -#include "hybrid_observables_cc.h" -#include "GPS_L1_CA.h" -#include "display.h" +#include "hybrid_observables_gs.h" +#include "GPS_L1_CA.h" // for GPS_STARTOFFSET_MS, GPS_TWO_PI +#include "MATH_CONSTANTS.h" // for SPEED_OF_LIGHT +#include "gnss_circular_deque.h" #include "gnss_sdr_create_directory.h" +#include "gnss_synchro.h" #include #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include // for round +#include // for size_t, llabs +#include // for exception +#include // for cerr, cout +#include // for numeric_limits +#include // for move -using google::LogMessage; - - -hybrid_observables_cc_sptr hybrid_make_observables_cc(unsigned int nchannels_in, unsigned int nchannels_out, bool dump, bool dump_mat, std::string dump_filename) +hybrid_observables_gs_sptr hybrid_observables_gs_make(unsigned int nchannels_in, unsigned int nchannels_out, bool dump, bool dump_mat, std::string dump_filename) { - return hybrid_observables_cc_sptr(new hybrid_observables_cc(nchannels_in, nchannels_out, dump, dump_mat, std::move(dump_filename))); + return hybrid_observables_gs_sptr(new hybrid_observables_gs(nchannels_in, nchannels_out, dump, dump_mat, std::move(dump_filename))); } -hybrid_observables_cc::hybrid_observables_cc(uint32_t nchannels_in, +hybrid_observables_gs::hybrid_observables_gs(uint32_t nchannels_in, uint32_t nchannels_out, bool dump, bool dump_mat, - std::string dump_filename) : gr::block("hybrid_observables_cc", + std::string dump_filename) : gr::block("hybrid_observables_gs", gr::io_signature::make(nchannels_in, nchannels_in, sizeof(Gnss_Synchro)), gr::io_signature::make(nchannels_out, nchannels_out, sizeof(Gnss_Synchro))) { @@ -120,12 +118,12 @@ hybrid_observables_cc::hybrid_observables_cc(uint32_t nchannels_in, T_rx_TOW_set = false; // rework - d_Rx_clock_buffer.resize(10); // 10*20 ms = 200 ms of data in buffer - d_Rx_clock_buffer.clear(); // Clear all the elements in the buffer + d_Rx_clock_buffer.set_capacity(10); // 10*20 ms = 200 ms of data in buffer + d_Rx_clock_buffer.clear(); // Clear all the elements in the buffer } -hybrid_observables_cc::~hybrid_observables_cc() +hybrid_observables_gs::~hybrid_observables_gs() { delete d_gnss_synchro_history; if (d_dump_file.is_open()) @@ -153,7 +151,7 @@ hybrid_observables_cc::~hybrid_observables_cc() } -int32_t hybrid_observables_cc::save_matfile() +int32_t hybrid_observables_gs::save_matfile() { // READ DUMP FILE std::string dump_filename = d_dump_filename; @@ -342,13 +340,13 @@ int32_t hybrid_observables_cc::save_matfile() } -double hybrid_observables_cc::compute_T_rx_s(const Gnss_Synchro &a) +double hybrid_observables_gs::compute_T_rx_s(const Gnss_Synchro &a) { return ((static_cast(a.Tracking_sample_counter) + a.Code_phase_samples) / static_cast(a.fs)); } -bool hybrid_observables_cc::interp_trk_obs(Gnss_Synchro &interpolated_obs, const uint32_t &ch, const uint64_t &rx_clock) +bool hybrid_observables_gs::interp_trk_obs(Gnss_Synchro &interpolated_obs, const uint32_t &ch, const uint64_t &rx_clock) { int32_t nearest_element = -1; int64_t abs_diff; @@ -427,7 +425,7 @@ bool hybrid_observables_cc::interp_trk_obs(Gnss_Synchro &interpolated_obs, const } -void hybrid_observables_cc::forecast(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items_required) +void hybrid_observables_gs::forecast(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items_required) { for (int32_t n = 0; n < static_cast(d_nchannels_in) - 1; n++) { @@ -438,18 +436,18 @@ void hybrid_observables_cc::forecast(int noutput_items __attribute__((unused)), } -void hybrid_observables_cc::update_TOW(std::vector &data) +void hybrid_observables_gs::update_TOW(const std::vector &data) { //1. Set the TOW using the minimum TOW in the observables. // this will be the receiver time. //2. If the TOW is set, it must be incremented by the desired receiver time step. // the time step must match the observables timer block (connected to the las input channel) - std::vector::iterator it; + std::vector::const_iterator it; // if (!T_rx_TOW_set) // { //uint32_t TOW_ref = std::numeric_limits::max(); uint32_t TOW_ref = 0U; - for (it = data.begin(); it != data.end(); it++) + for (it = data.cbegin(); it != data.cend(); it++) { if (it->Flag_valid_word) { @@ -475,7 +473,7 @@ void hybrid_observables_cc::update_TOW(std::vector &data) } -void hybrid_observables_cc::compute_pranges(std::vector &data) +void hybrid_observables_gs::compute_pranges(std::vector &data) { std::vector::iterator it; for (it = data.begin(); it != data.end(); it++) @@ -498,7 +496,7 @@ void hybrid_observables_cc::compute_pranges(std::vector &data) } -int hybrid_observables_cc::general_work(int noutput_items __attribute__((unused)), +int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -599,12 +597,12 @@ int hybrid_observables_cc::general_work(int noutput_items __attribute__((unused) epoch_data.push_back(interpolated_gnss_synchro); } update_TOW(epoch_data); - //debug code: - // if (T_rx_TOW_ms % 20 != 0) - // { - // std::cout << "Warning: RX TOW is not multiple of 20 ms\n"; - // } - // std::cout << "T_rx_TOW_ms=" << T_rx_TOW_ms << " T_rx_TOW_offset_ms=" << T_rx_TOW_offset_ms << " ->" << T_rx_TOW_ms % 20 << std::endl; + // debug code: + // if (T_rx_TOW_ms % 20 != 0) + // { + // std::cout << "Warning: RX TOW is not multiple of 20 ms\n"; + // } + // std::cout << "T_rx_TOW_ms=" << T_rx_TOW_ms << " T_rx_TOW_offset_ms=" << T_rx_TOW_offset_ms << " ->" << T_rx_TOW_ms % 20 << std::endl; } } diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.h similarity index 68% rename from src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h rename to src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.h index 8a4d4c56e..170396761 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.h @@ -1,5 +1,5 @@ /*! - * \file hybrid_observables_cc.h + * \file hybrid_observables_gs.h * \brief Interface of the observables computation block * \author Mara Branzanti 2013. mara.branzanti(at)gmail.com * \author Javier Arribas 2013. jarribas(at)cttc.es @@ -7,7 +7,7 @@ * * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -31,45 +31,48 @@ */ -#ifndef GNSS_SDR_HYBRID_OBSERVABLES_CC_H -#define GNSS_SDR_HYBRID_OBSERVABLES_CC_H +#ifndef GNSS_SDR_HYBRID_OBSERVABLES_GS_H +#define GNSS_SDR_HYBRID_OBSERVABLES_GS_H -#include "gnss_circular_deque.h" -#include "gnss_synchro.h" -#include -#include -#include -#include -#include +#include // for boost::curcular_buffer +#include // for boost::shared_ptr +#include // for block +#include // for gr_vector_int +#include // for int32_t +#include // for string, ofstream +#include // for vector +class Gnss_Synchro; +class hybrid_observables_gs; -class hybrid_observables_cc; +template +class Gnss_circular_deque; -using hybrid_observables_cc_sptr = boost::shared_ptr; +using hybrid_observables_gs_sptr = boost::shared_ptr; -hybrid_observables_cc_sptr -hybrid_make_observables_cc(unsigned int nchannels_in, unsigned int nchannels_out, bool dump, bool dump_mat, std::string dump_filename); +hybrid_observables_gs_sptr +hybrid_observables_gs_make(unsigned int nchannels_in, unsigned int nchannels_out, bool dump, bool dump_mat, std::string dump_filename); /*! * \brief This class implements a block that computes observables */ -class hybrid_observables_cc : public gr::block +class hybrid_observables_gs : public gr::block { public: - ~hybrid_observables_cc(); + ~hybrid_observables_gs(); int general_work(int noutput_items, gr_vector_int& ninput_items, gr_vector_const_void_star& input_items, gr_vector_void_star& output_items); void forecast(int noutput_items, gr_vector_int& ninput_items_required); private: - friend hybrid_observables_cc_sptr - hybrid_make_observables_cc(uint32_t nchannels_in, uint32_t nchannels_out, bool dump, bool dump_mat, std::string dump_filename); - hybrid_observables_cc(uint32_t nchannels_in, uint32_t nchannels_out, bool dump, bool dump_mat, std::string dump_filename); + friend hybrid_observables_gs_sptr + hybrid_observables_gs_make(uint32_t nchannels_in, uint32_t nchannels_out, bool dump, bool dump_mat, std::string dump_filename); + hybrid_observables_gs(uint32_t nchannels_in, uint32_t nchannels_out, bool dump, bool dump_mat, std::string dump_filename); bool interpolate_data(Gnss_Synchro& out, const uint32_t& ch, const double& ti); bool interp_trk_obs(Gnss_Synchro& interpolated_obs, const uint32_t& ch, const uint64_t& rx_clock); double compute_T_rx_s(const Gnss_Synchro& a); void compute_pranges(std::vector& data); - void update_TOW(std::vector& data); + void update_TOW(const std::vector& data); int32_t save_matfile(); //time history diff --git a/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc b/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc index a1e6e2e1b..37e60b6fa 100644 --- a/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc +++ b/src/algorithms/resampler/adapters/direct_resampler_conditioner.cc @@ -41,7 +41,6 @@ #include #include -using google::LogMessage; DirectResamplerConditioner::DirectResamplerConditioner( ConfigurationInterface* configuration, const std::string& role, diff --git a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc index bc18beba5..4639f1a78 100644 --- a/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc +++ b/src/algorithms/resampler/adapters/mmse_resampler_conditioner.cc @@ -36,7 +36,6 @@ #include #include -using google::LogMessage; MmseResamplerConditioner::MmseResamplerConditioner( ConfigurationInterface* configuration, const std::string& role, diff --git a/src/algorithms/signal_generator/adapters/signal_generator.cc b/src/algorithms/signal_generator/adapters/signal_generator.cc index 8a4d5ab8e..c4dc9dc3d 100644 --- a/src/algorithms/signal_generator/adapters/signal_generator.cc +++ b/src/algorithms/signal_generator/adapters/signal_generator.cc @@ -42,8 +42,6 @@ #include -using google::LogMessage; - SignalGenerator::SignalGenerator(ConfigurationInterface* configuration, 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)) 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 2b4714bca..a51d0c793 100644 --- a/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc +++ b/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc @@ -39,9 +39,6 @@ #include -using google::LogMessage; - - CustomUDPSignalSource::CustomUDPSignalSource(ConfigurationInterface* configuration, 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)) diff --git a/src/algorithms/signal_source/adapters/file_signal_source.cc b/src/algorithms/signal_source/adapters/file_signal_source.cc index d7856ee57..59ad90f50 100644 --- a/src/algorithms/signal_source/adapters/file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/file_signal_source.cc @@ -42,9 +42,6 @@ #include -using google::LogMessage; - - FileSignalSource::FileSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams, boost::shared_ptr queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue)) diff --git a/src/algorithms/signal_source/adapters/flexiband_signal_source.cc b/src/algorithms/signal_source/adapters/flexiband_signal_source.cc index 216fa084c..598bb4640 100644 --- a/src/algorithms/signal_source/adapters/flexiband_signal_source.cc +++ b/src/algorithms/signal_source/adapters/flexiband_signal_source.cc @@ -38,7 +38,6 @@ #include #include -using google::LogMessage; FlexibandSignalSource::FlexibandSignalSource(ConfigurationInterface* configuration, const std::string& role, diff --git a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc index 8f3f5fa82..704c5b01e 100644 --- a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc +++ b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc @@ -1,7 +1,7 @@ /*! * \file fmcomms2_signal_source.cc * \brief Signal source for SDR hardware from Analog Devices based on - * fmcomms2 evaluation board. + * fmcomms2 evaluation board. * \author Rodrigo Muñoz, 2017, rmunozl(at)inacap.cl * * ------------------------------------------------------------------------- @@ -41,8 +41,6 @@ #include -using google::LogMessage; - Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration, 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)) diff --git a/src/algorithms/signal_source/adapters/gen_signal_source.cc b/src/algorithms/signal_source/adapters/gen_signal_source.cc index 69c1151c1..ef8441853 100644 --- a/src/algorithms/signal_source/adapters/gen_signal_source.cc +++ b/src/algorithms/signal_source/adapters/gen_signal_source.cc @@ -39,7 +39,6 @@ #include #include -using google::LogMessage; // Constructor GenSignalSource::GenSignalSource(GNSSBlockInterface *signal_generator, GNSSBlockInterface *filter, diff --git a/src/algorithms/signal_source/adapters/gn3s_signal_source.cc b/src/algorithms/signal_source/adapters/gn3s_signal_source.cc index ebf984c18..3f66591e9 100644 --- a/src/algorithms/signal_source/adapters/gn3s_signal_source.cc +++ b/src/algorithms/signal_source/adapters/gn3s_signal_source.cc @@ -36,8 +36,6 @@ #include -using google::LogMessage; - Gn3sSignalSource::Gn3sSignalSource(ConfigurationInterface* configuration, std::string role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) { diff --git a/src/algorithms/signal_source/adapters/labsat_signal_source.cc b/src/algorithms/signal_source/adapters/labsat_signal_source.cc index cf1278d9d..7925196f6 100644 --- a/src/algorithms/signal_source/adapters/labsat_signal_source.cc +++ b/src/algorithms/signal_source/adapters/labsat_signal_source.cc @@ -36,8 +36,6 @@ #include -using google::LogMessage; - LabsatSignalSource::LabsatSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) { diff --git a/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc b/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc index 2ceeca528..aa31e75a6 100644 --- a/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc @@ -42,9 +42,6 @@ #include -using google::LogMessage; - - NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams, boost::shared_ptr queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue)) diff --git a/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc b/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc index 80f52a290..32ea28cf0 100644 --- a/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc +++ b/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc @@ -40,9 +40,6 @@ #include -using google::LogMessage; - - OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, 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)) diff --git a/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc b/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc index 5c4c71dd9..fc41bd3a9 100644 --- a/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc +++ b/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc @@ -37,9 +37,6 @@ #include -using google::LogMessage; - - PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration, 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)) 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 589af32c5..f9aab0987 100644 --- a/src/algorithms/signal_source/adapters/raw_array_signal_source.cc +++ b/src/algorithms/signal_source/adapters/raw_array_signal_source.cc @@ -36,8 +36,6 @@ #include -using google::LogMessage; - RawArraySignalSource::RawArraySignalSource(ConfigurationInterface* configuration, std::string role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) { @@ -45,10 +43,8 @@ RawArraySignalSource::RawArraySignalSource(ConfigurationInterface* configuration std::string default_dump_file = "./data/raw_array_source.dat"; item_type_ = configuration->property(role + ".item_type", default_item_type); - //dump_ = configuration->property(role + ".dump", false); //dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file); - dump_ = false; std::string default_ethernet_dev = "eth0"; 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 fd9fc9751..2b9574708 100644 --- a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc +++ b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc @@ -41,9 +41,6 @@ #include -using google::LogMessage; - - RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, diff --git a/src/algorithms/signal_source/adapters/spir_file_signal_source.cc b/src/algorithms/signal_source/adapters/spir_file_signal_source.cc index 58675e527..52964abba 100644 --- a/src/algorithms/signal_source/adapters/spir_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/spir_file_signal_source.cc @@ -41,9 +41,6 @@ #include -using google::LogMessage; - - SpirFileSignalSource::SpirFileSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams, boost::shared_ptr queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue)) diff --git a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc index 5b9534129..7e1c3f1ce 100644 --- a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc @@ -39,9 +39,6 @@ #include -using google::LogMessage; - - SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface* configuration, const std::string& role, uint32_t in_streams, uint32_t out_streams, gr::msg_queue::sptr queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue)) { diff --git a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc index b1e578b1b..604f9c536 100644 --- a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc @@ -41,9 +41,6 @@ #include -using google::LogMessage; - - TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc index 00a50257e..684cb5b86 100644 --- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc @@ -43,9 +43,6 @@ #include -using google::LogMessage; - - TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, diff --git a/src/algorithms/signal_source/adapters/uhd_signal_source.cc b/src/algorithms/signal_source/adapters/uhd_signal_source.cc index 1f551fa5d..ee58eb551 100644 --- a/src/algorithms/signal_source/adapters/uhd_signal_source.cc +++ b/src/algorithms/signal_source/adapters/uhd_signal_source.cc @@ -40,8 +40,6 @@ #include -using google::LogMessage; - UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration, 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)) 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 5450a4377..1d0368a6b 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 @@ -36,7 +36,6 @@ #include #include -using google::LogMessage; namespace ip = boost::asio::ip; using boost::asio::ip::tcp; diff --git a/src/algorithms/signal_source/libs/gnss_sdr_valve.cc b/src/algorithms/signal_source/libs/gnss_sdr_valve.cc index 5e0d6f4cd..19626a5d4 100644 --- a/src/algorithms/signal_source/libs/gnss_sdr_valve.cc +++ b/src/algorithms/signal_source/libs/gnss_sdr_valve.cc @@ -32,11 +32,12 @@ */ #include "gnss_sdr_valve.h" -#include "control_message_factory.h" -#include -#include -#include // for min -#include // for memcpy +#include "control_message_factory.h" // for ControlMessageFactory +#include // for LOG +#include // for io_signature +#include // for min +#include // for memcpy +#include // for usleep #include Gnss_Sdr_Valve::Gnss_Sdr_Valve(size_t sizeof_stream_item, diff --git a/src/algorithms/signal_source/libs/gnss_sdr_valve.h b/src/algorithms/signal_source/libs/gnss_sdr_valve.h index 16a141cd4..76ddc9cd6 100644 --- a/src/algorithms/signal_source/libs/gnss_sdr_valve.h +++ b/src/algorithms/signal_source/libs/gnss_sdr_valve.h @@ -35,8 +35,10 @@ #define GNSS_SDR_GNSS_SDR_VALVE_H_ #include -#include -#include +#include // for msg_queue, msg_queue::sptr +#include // for sync_block +#include // for gr_vector_const_void_star +#include // for size_t #include boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, diff --git a/src/algorithms/signal_source/libs/rtl_tcp_commands.cc b/src/algorithms/signal_source/libs/rtl_tcp_commands.cc index 45bb25a9f..31466e612 100644 --- a/src/algorithms/signal_source/libs/rtl_tcp_commands.cc +++ b/src/algorithms/signal_source/libs/rtl_tcp_commands.cc @@ -31,7 +31,9 @@ */ #include "rtl_tcp_commands.h" -#include +#include // for buffer +#include // for host_to_network_long +#include // for memcpy boost::system::error_code rtl_tcp_command(RTL_TCP_COMMAND id, unsigned param, boost::asio::ip::tcp::socket &socket) { diff --git a/src/algorithms/signal_source/libs/rtl_tcp_commands.h b/src/algorithms/signal_source/libs/rtl_tcp_commands.h index 8dab2a0c8..0c5a694e1 100644 --- a/src/algorithms/signal_source/libs/rtl_tcp_commands.h +++ b/src/algorithms/signal_source/libs/rtl_tcp_commands.h @@ -32,7 +32,8 @@ #ifndef GNSS_SDR_RTL_TCP_COMMANDS_H #define GNSS_SDR_RTL_TCP_COMMANDS_H -#include +#include // for tcp, tcp::socket +#include // for error_code /// Command IDs for configuration rtl_tcp enum RTL_TCP_COMMAND diff --git a/src/algorithms/telemetry_decoder/adapters/beidou_b1i_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/beidou_b1i_telemetry_decoder.cc index 3e6bc59f1..0850297cf 100644 --- a/src/algorithms/telemetry_decoder/adapters/beidou_b1i_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/beidou_b1i_telemetry_decoder.cc @@ -31,17 +31,10 @@ #include "beidou_b1i_telemetry_decoder.h" -#include "beidou_dnav_almanac.h" -#include "beidou_dnav_ephemeris.h" -#include "beidou_dnav_iono.h" -#include "beidou_dnav_utc_model.h" #include "configuration_interface.h" #include -#include -using google::LogMessage; - BeidouB1iTelemetryDecoder::BeidouB1iTelemetryDecoder(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, @@ -54,7 +47,7 @@ BeidouB1iTelemetryDecoder::BeidouB1iTelemetryDecoder(ConfigurationInterface* con dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); // make telemetry decoder object - telemetry_decoder_ = beidou_b1i_make_telemetry_decoder_cc(satellite_, dump_); // TODO fix me + telemetry_decoder_ = beidou_b1i_make_telemetry_decoder_gs(satellite_, dump_); // TODO fix me DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")"; channel_ = 0; if (in_streams_ > 1) diff --git a/src/algorithms/telemetry_decoder/adapters/beidou_b1i_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/beidou_b1i_telemetry_decoder.h index 212709580..282520421 100644 --- a/src/algorithms/telemetry_decoder/adapters/beidou_b1i_telemetry_decoder.h +++ b/src/algorithms/telemetry_decoder/adapters/beidou_b1i_telemetry_decoder.h @@ -34,8 +34,11 @@ #ifndef GNSS_SDR_BEIDOU_B1I_TELEMETRY_DECODER_H_ #define GNSS_SDR_BEIDOU_B1I_TELEMETRY_DECODER_H_ -#include "beidou_b1i_telemetry_decoder_cc.h" +#include "beidou_b1i_telemetry_decoder_gs.h" +#include "gnss_satellite.h" // for Gnss_Satellite #include "telemetry_decoder_interface.h" +#include // for basic_block_sptr, top_block_sptr +#include // for size_t #include class ConfigurationInterface; @@ -83,7 +86,7 @@ public: } private: - beidou_b1i_telemetry_decoder_cc_sptr telemetry_decoder_; + beidou_b1i_telemetry_decoder_gs_sptr telemetry_decoder_; Gnss_Satellite satellite_; int channel_; bool dump_; diff --git a/src/algorithms/telemetry_decoder/adapters/beidou_b3i_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/beidou_b3i_telemetry_decoder.cc index 8081b3789..5b967eb87 100644 --- a/src/algorithms/telemetry_decoder/adapters/beidou_b3i_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/beidou_b3i_telemetry_decoder.cc @@ -54,7 +54,7 @@ BeidouB3iTelemetryDecoder::BeidouB3iTelemetryDecoder(ConfigurationInterface* con dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); // make telemetry decoder object - telemetry_decoder_ = beidou_b3i_make_telemetry_decoder_cc(satellite_, dump_); // TODO fix me + telemetry_decoder_ = beidou_b3i_make_telemetry_decoder_gs(satellite_, dump_); DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")"; channel_ = 0; if (in_streams_ > 1) diff --git a/src/algorithms/telemetry_decoder/adapters/beidou_b3i_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/beidou_b3i_telemetry_decoder.h index 32704a514..0fd053642 100644 --- a/src/algorithms/telemetry_decoder/adapters/beidou_b3i_telemetry_decoder.h +++ b/src/algorithms/telemetry_decoder/adapters/beidou_b3i_telemetry_decoder.h @@ -35,7 +35,8 @@ #include "telemetry_decoder_interface.h" #include -#include "beidou_b3i_telemetry_decoder_cc.h" + +#include "../gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.h" class ConfigurationInterface; @@ -82,7 +83,7 @@ public: } private: - beidou_b3i_telemetry_decoder_cc_sptr telemetry_decoder_; + beidou_b3i_telemetry_decoder_gs_sptr telemetry_decoder_; Gnss_Satellite satellite_; int channel_; bool dump_; 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 be7dd59ce..f6614cd5f 100644 --- a/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/galileo_e1b_telemetry_decoder.cc @@ -33,16 +33,9 @@ #include "galileo_e1b_telemetry_decoder.h" #include "configuration_interface.h" -#include "galileo_almanac.h" -#include "galileo_ephemeris.h" -#include "galileo_iono.h" -#include "galileo_utc_model.h" #include -#include -using google::LogMessage; - GalileoE1BTelemetryDecoder::GalileoE1BTelemetryDecoder(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, @@ -55,7 +48,7 @@ GalileoE1BTelemetryDecoder::GalileoE1BTelemetryDecoder(ConfigurationInterface* c dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); // make telemetry decoder object - telemetry_decoder_ = galileo_make_telemetry_decoder_cc(satellite_, 1, dump_); //unified galileo decoder set to INAV (frame_type=1) + telemetry_decoder_ = galileo_make_telemetry_decoder_gs(satellite_, 1, dump_); // unified galileo decoder set to INAV (frame_type=1) DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")"; channel_ = 0; if (in_streams_ > 1) 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 c277725ce..1d39b37e4 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,11 @@ #define GNSS_SDR_GALILEO_E1B_TELEMETRY_DECODER_H_ -#include "galileo_telemetry_decoder_cc.h" +#include "galileo_telemetry_decoder_gs.h" #include "gnss_satellite.h" #include "telemetry_decoder_interface.h" +#include // for basic_block_sptr, top_block_sptr +#include // for size_t #include @@ -87,7 +89,7 @@ public: } private: - galileo_telemetry_decoder_cc_sptr telemetry_decoder_; + galileo_telemetry_decoder_gs_sptr telemetry_decoder_; Gnss_Satellite satellite_; int channel_; bool dump_; 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 715e5c1cb..7c1dff20f 100644 --- a/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.cc @@ -36,16 +36,9 @@ #include "galileo_e5a_telemetry_decoder.h" #include "configuration_interface.h" -#include "galileo_almanac.h" -#include "galileo_ephemeris.h" -#include "galileo_iono.h" -#include "galileo_utc_model.h" #include -#include -using google::LogMessage; - GalileoE5aTelemetryDecoder::GalileoE5aTelemetryDecoder(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, @@ -58,7 +51,7 @@ GalileoE5aTelemetryDecoder::GalileoE5aTelemetryDecoder(ConfigurationInterface* c dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); // make telemetry decoder object - telemetry_decoder_ = galileo_make_telemetry_decoder_cc(satellite_, 2, dump_); //unified galileo decoder set to FNAV (frame_type=2) + telemetry_decoder_ = galileo_make_telemetry_decoder_gs(satellite_, 2, dump_); // unified galileo decoder set to FNAV (frame_type=2) DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")"; channel_ = 0; if (in_streams_ > 1) diff --git a/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.h index cdb21af2d..1bfc7a6e4 100644 --- a/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.h +++ b/src/algorithms/telemetry_decoder/adapters/galileo_e5a_telemetry_decoder.h @@ -37,8 +37,11 @@ #ifndef GNSS_SDR_GALILEO_E5A_TELEMETRY_DECODER_H_ #define GNSS_SDR_GALILEO_E5A_TELEMETRY_DECODER_H_ -#include "galileo_telemetry_decoder_cc.h" +#include "galileo_telemetry_decoder_gs.h" +#include "gnss_satellite.h" // for Gnss_Satellite #include "telemetry_decoder_interface.h" +#include // for basic_block_sptr, top_block_sptr +#include // for size_t #include class ConfigurationInterface; @@ -87,7 +90,7 @@ public: } private: - galileo_telemetry_decoder_cc_sptr telemetry_decoder_; + galileo_telemetry_decoder_gs_sptr telemetry_decoder_; Gnss_Satellite satellite_; int channel_; bool dump_; 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 c0d88314f..fce316a5d 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,15 +33,9 @@ #include "glonass_l1_ca_telemetry_decoder.h" #include "configuration_interface.h" -#include "glonass_gnav_almanac.h" -#include "glonass_gnav_ephemeris.h" -#include "glonass_gnav_utc_model.h" #include -#include -using google::LogMessage; - GlonassL1CaTelemetryDecoder::GlonassL1CaTelemetryDecoder(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, @@ -54,7 +48,7 @@ GlonassL1CaTelemetryDecoder::GlonassL1CaTelemetryDecoder(ConfigurationInterface* dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); // make telemetry decoder object - telemetry_decoder_ = glonass_l1_ca_make_telemetry_decoder_cc(satellite_, dump_); + telemetry_decoder_ = glonass_l1_ca_make_telemetry_decoder_gs(satellite_, dump_); DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")"; channel_ = 0; if (in_streams_ > 1) 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 33bc3ecbd..3b5e13d15 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,11 @@ #ifndef GNSS_SDR_GLONASS_L1_CA_TELEMETRY_DECODER_H_ #define GNSS_SDR_GLONASS_L1_CA_TELEMETRY_DECODER_H_ -#include "glonass_l1_ca_telemetry_decoder_cc.h" +#include "glonass_l1_ca_telemetry_decoder_gs.h" +#include "gnss_satellite.h" // for Gnss_Satellite #include "telemetry_decoder_interface.h" +#include // for basic_block_sptr, top_block_sptr +#include // for size_t #include class ConfigurationInterface; @@ -78,7 +81,7 @@ public: } private: - glonass_l1_ca_telemetry_decoder_cc_sptr telemetry_decoder_; + glonass_l1_ca_telemetry_decoder_gs_sptr telemetry_decoder_; Gnss_Satellite satellite_; int channel_; bool dump_; 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 c96851552..2c8aad54f 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,15 +32,9 @@ #include "glonass_l2_ca_telemetry_decoder.h" #include "configuration_interface.h" -#include "glonass_gnav_almanac.h" -#include "glonass_gnav_ephemeris.h" -#include "glonass_gnav_utc_model.h" #include -#include -using google::LogMessage; - GlonassL2CaTelemetryDecoder::GlonassL2CaTelemetryDecoder(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, @@ -53,7 +47,7 @@ GlonassL2CaTelemetryDecoder::GlonassL2CaTelemetryDecoder(ConfigurationInterface* dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); // make telemetry decoder object - telemetry_decoder_ = glonass_l2_ca_make_telemetry_decoder_cc(satellite_, dump_); + telemetry_decoder_ = glonass_l2_ca_make_telemetry_decoder_gs(satellite_, dump_); DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")"; channel_ = 0; if (in_streams_ > 1) 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 83c7c8c4e..3a36b7deb 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,11 @@ #ifndef GNSS_SDR_GLONASS_L2_CA_TELEMETRY_DECODER_H_ #define GNSS_SDR_GLONASS_L2_CA_TELEMETRY_DECODER_H_ -#include "glonass_l2_ca_telemetry_decoder_cc.h" +#include "gnss_satellite.h" // for Gnss_Satellite +#include "glonass_l2_ca_telemetry_decoder_gs.h" #include "telemetry_decoder_interface.h" +#include // for basic_block_sptr, top_block_sptr +#include // for size_t #include class ConfigurationInterface; @@ -77,7 +80,7 @@ public: } private: - glonass_l2_ca_telemetry_decoder_cc_sptr telemetry_decoder_; + glonass_l2_ca_telemetry_decoder_gs_sptr telemetry_decoder_; Gnss_Satellite satellite_; int channel_; bool dump_; 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 b7a4530b3..5fadb8025 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,16 +32,9 @@ #include "gps_l1_ca_telemetry_decoder.h" #include "configuration_interface.h" -#include "gps_almanac.h" -#include "gps_ephemeris.h" -#include "gps_iono.h" -#include "gps_utc_model.h" #include -#include -using google::LogMessage; - GpsL1CaTelemetryDecoder::GpsL1CaTelemetryDecoder(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, @@ -54,7 +47,7 @@ GpsL1CaTelemetryDecoder::GpsL1CaTelemetryDecoder(ConfigurationInterface* configu dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); // make telemetry decoder object - telemetry_decoder_ = gps_l1_ca_make_telemetry_decoder_cc(satellite_, dump_); // TODO fix me + telemetry_decoder_ = gps_l1_ca_make_telemetry_decoder_gs(satellite_, dump_); // TODO fix me DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")"; channel_ = 0; if (in_streams_ > 1) diff --git a/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.h index 9436e8ae5..b43f8f426 100644 --- a/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.h +++ b/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.h @@ -33,8 +33,11 @@ #ifndef GNSS_SDR_GPS_L1_CA_TELEMETRY_DECODER_H_ #define GNSS_SDR_GPS_L1_CA_TELEMETRY_DECODER_H_ -#include "gps_l1_ca_telemetry_decoder_cc.h" +#include "gnss_satellite.h" // for Gnss_Satellite +#include "gps_l1_ca_telemetry_decoder_gs.h" #include "telemetry_decoder_interface.h" +#include // for basic_block_sptr, top_block_sptr +#include // for size_t #include class ConfigurationInterface; @@ -82,7 +85,7 @@ public: } private: - gps_l1_ca_telemetry_decoder_cc_sptr telemetry_decoder_; + gps_l1_ca_telemetry_decoder_gs_sptr telemetry_decoder_; Gnss_Satellite satellite_; int channel_; bool dump_; 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 db451a045..eccee3f2d 100644 --- a/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.cc @@ -32,16 +32,9 @@ #include "gps_l2c_telemetry_decoder.h" #include "configuration_interface.h" -#include "gps_almanac.h" -#include "gps_cnav_ephemeris.h" -#include "gps_cnav_iono.h" -#include "gps_cnav_utc_model.h" #include -#include -using google::LogMessage; - GpsL2CTelemetryDecoder::GpsL2CTelemetryDecoder(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, @@ -54,7 +47,7 @@ GpsL2CTelemetryDecoder::GpsL2CTelemetryDecoder(ConfigurationInterface* configura dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); // make telemetry decoder object - telemetry_decoder_ = gps_l2c_make_telemetry_decoder_cc(satellite_, dump_); // TODO fix me + telemetry_decoder_ = gps_l2c_make_telemetry_decoder_gs(satellite_, dump_); // TODO fix me DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")"; channel_ = 0; if (in_streams_ > 1) diff --git a/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.h index f7e9fb76b..83263a0c8 100644 --- a/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.h +++ b/src/algorithms/telemetry_decoder/adapters/gps_l2c_telemetry_decoder.h @@ -33,8 +33,11 @@ #ifndef GNSS_SDR_GPS_L2C_TELEMETRY_DECODER_H_ #define GNSS_SDR_GPS_L2C_TELEMETRY_DECODER_H_ -#include "gps_l2c_telemetry_decoder_cc.h" +#include "gnss_satellite.h" // for Gnss_Satellite +#include "gps_l2c_telemetry_decoder_gs.h" #include "telemetry_decoder_interface.h" +#include // for basic_block_sptr, top_block_sptr +#include // for size_t #include class ConfigurationInterface; @@ -81,7 +84,7 @@ public: } private: - gps_l2c_telemetry_decoder_cc_sptr telemetry_decoder_; + gps_l2c_telemetry_decoder_gs_sptr telemetry_decoder_; Gnss_Satellite satellite_; int channel_; bool dump_; 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 68fa96d26..c50ec9f51 100644 --- a/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.cc @@ -33,11 +33,8 @@ #include "gps_l5_telemetry_decoder.h" #include "configuration_interface.h" #include -#include -using google::LogMessage; - GpsL5TelemetryDecoder::GpsL5TelemetryDecoder(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, @@ -50,7 +47,7 @@ GpsL5TelemetryDecoder::GpsL5TelemetryDecoder(ConfigurationInterface* configurati dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); // make telemetry decoder object - telemetry_decoder_ = gps_l5_make_telemetry_decoder_cc(satellite_, dump_); + telemetry_decoder_ = gps_l5_make_telemetry_decoder_gs(satellite_, dump_); DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")"; channel_ = 0; if (in_streams_ > 1) 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 c895b3b48..56fc3afd3 100644 --- a/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.h +++ b/src/algorithms/telemetry_decoder/adapters/gps_l5_telemetry_decoder.h @@ -35,8 +35,10 @@ #include "gnss_satellite.h" -#include "gps_l5_telemetry_decoder_cc.h" +#include "gps_l5_telemetry_decoder_gs.h" #include "telemetry_decoder_interface.h" +#include // for basic_block_sptr, top_block_sptr +#include // for size_t #include @@ -84,7 +86,7 @@ public: } private: - gps_l5_telemetry_decoder_cc_sptr telemetry_decoder_; + gps_l5_telemetry_decoder_gs_sptr telemetry_decoder_; Gnss_Satellite satellite_; int channel_; bool dump_; 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 2083509e1..2621402ab 100644 --- a/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.cc +++ b/src/algorithms/telemetry_decoder/adapters/sbas_l1_telemetry_decoder.cc @@ -32,14 +32,9 @@ #include "sbas_l1_telemetry_decoder.h" #include "configuration_interface.h" -#include "sbas_ephemeris.h" -#include "sbas_l1_telemetry_decoder_cc.h" #include -#include -using google::LogMessage; - SbasL1TelemetryDecoder::SbasL1TelemetryDecoder(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, @@ -52,7 +47,7 @@ SbasL1TelemetryDecoder::SbasL1TelemetryDecoder(ConfigurationInterface* configura dump_ = configuration->property(role + ".dump", false); dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); // make telemetry decoder object - telemetry_decoder_ = sbas_l1_make_telemetry_decoder_cc(satellite_, dump_); // TODO fix me + telemetry_decoder_ = sbas_l1_make_telemetry_decoder_gs(satellite_, dump_); // TODO fix me channel_ = 0; DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")"; if (in_streams_ > 1) 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 c7ab0043b..b6f9a8564 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,11 @@ #define GNSS_SDR_SBAS_L1_TELEMETRY_DECODER_H_ -#include "sbas_l1_telemetry_decoder_cc.h" +#include "gnss_satellite.h" // for Gnss_Satellite +#include "sbas_l1_telemetry_decoder_gs.h" #include "telemetry_decoder_interface.h" +#include // for basic_block_sptr, top_block_sptr +#include // for size_t #include @@ -86,7 +89,7 @@ public: } private: - sbas_l1_telemetry_decoder_cc_sptr telemetry_decoder_; + sbas_l1_telemetry_decoder_gs_sptr telemetry_decoder_; Gnss_Satellite satellite_; int channel_; bool dump_; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt index 0b0db2e39..9a356c790 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt @@ -17,27 +17,27 @@ # set(TELEMETRY_DECODER_GR_BLOCKS_SOURCES - gps_l1_ca_telemetry_decoder_cc.cc - gps_l2c_telemetry_decoder_cc.cc - gps_l5_telemetry_decoder_cc.cc - sbas_l1_telemetry_decoder_cc.cc - glonass_l1_ca_telemetry_decoder_cc.cc - glonass_l2_ca_telemetry_decoder_cc.cc - galileo_telemetry_decoder_cc.cc - beidou_b1i_telemetry_decoder_cc.cc - beidou_b3i_telemetry_decoder_cc.cc + gps_l1_ca_telemetry_decoder_gs.cc + gps_l2c_telemetry_decoder_gs.cc + gps_l5_telemetry_decoder_gs.cc + sbas_l1_telemetry_decoder_gs.cc + glonass_l1_ca_telemetry_decoder_gs.cc + glonass_l2_ca_telemetry_decoder_gs.cc + galileo_telemetry_decoder_gs.cc + beidou_b1i_telemetry_decoder_gs.cc + beidou_b3i_telemetry_decoder_gs.cc ) set(TELEMETRY_DECODER_GR_BLOCKS_HEADERS - gps_l1_ca_telemetry_decoder_cc.h - gps_l2c_telemetry_decoder_cc.h - gps_l5_telemetry_decoder_cc.h - sbas_l1_telemetry_decoder_cc.h - glonass_l1_ca_telemetry_decoder_cc.h - glonass_l2_ca_telemetry_decoder_cc.h - galileo_telemetry_decoder_cc.h - beidou_b1i_telemetry_decoder_cc.h - beidou_b3i_telemetry_decoder_cc.h + gps_l1_ca_telemetry_decoder_gs.h + gps_l2c_telemetry_decoder_gs.h + gps_l5_telemetry_decoder_gs.h + sbas_l1_telemetry_decoder_gs.h + glonass_l1_ca_telemetry_decoder_gs.h + glonass_l2_ca_telemetry_decoder_gs.h + galileo_telemetry_decoder_gs.h + beidou_b1i_telemetry_decoder_gs.h + beidou_b3i_telemetry_decoder_gs.h ) list(SORT TELEMETRY_DECODER_GR_BLOCKS_HEADERS) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc similarity index 94% rename from src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_cc.cc rename to src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc index 38fea3e8e..d45e61e49 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc @@ -1,7 +1,6 @@ /*! - * \file beidou_b1i_telemetry_decoder_cc.cc - * \brief Implementation of an adapter of a BEIDOU BI1 DNAV data decoder block - * to a TelemetryDecoderInterface + * \file beidou_b1i_telemetry_decoder_gs.cc + * \brief Implementation of a BEIDOU BI1 DNAV data decoder block * \note Code added as part of GSoC 2018 program * \author Damian Miralles, 2018. dmiralles2009(at)gmail.com * \author Sergi Segura, 2018. sergi.segura.munoz(at)gmail.es @@ -32,31 +31,37 @@ */ -#include "beidou_b1i_telemetry_decoder_cc.h" +#include "beidou_b1i_telemetry_decoder_gs.h" +#include "Beidou_B1I.h" +#include "beidou_dnav_almanac.h" +#include "beidou_dnav_ephemeris.h" +#include "beidou_dnav_utc_model.h" #include "convolutional.h" #include "display.h" #include "gnss_synchro.h" -#include #include #include +#include // for make_any +#include // for mp #include -#include +#include // for abs +#include // for exception +#include // for cout +#include // for shared_ptr, make_shared #define CRC_ERROR_LIMIT 8 -using google::LogMessage; - -beidou_b1i_telemetry_decoder_cc_sptr -beidou_b1i_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump) +beidou_b1i_telemetry_decoder_gs_sptr +beidou_b1i_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump) { - return beidou_b1i_telemetry_decoder_cc_sptr(new beidou_b1i_telemetry_decoder_cc(satellite, dump)); + return beidou_b1i_telemetry_decoder_gs_sptr(new beidou_b1i_telemetry_decoder_gs(satellite, dump)); } -beidou_b1i_telemetry_decoder_cc::beidou_b1i_telemetry_decoder_cc( +beidou_b1i_telemetry_decoder_gs::beidou_b1i_telemetry_decoder_gs( const Gnss_Satellite &satellite, - bool dump) : gr::block("beidou_b1i_telemetry_decoder_cc", + bool dump) : gr::block("beidou_b1i_telemetry_decoder_gs", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { @@ -65,7 +70,7 @@ beidou_b1i_telemetry_decoder_cc::beidou_b1i_telemetry_decoder_cc( // initialize internal vars d_dump = dump; d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); - LOG(INFO) << "Initializing BeiDou B1i Telemetry Decoding for satellite " << this->d_satellite; + LOG(INFO) << "Initializing BeiDou B1I Telemetry Decoding for satellite " << this->d_satellite; d_samples_per_symbol = (BEIDOU_B1I_CODE_RATE_HZ / BEIDOU_B1I_CODE_LENGTH_CHIPS) / BEIDOU_D1NAV_SYMBOL_RATE_SPS; d_symbols_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS; @@ -133,7 +138,7 @@ beidou_b1i_telemetry_decoder_cc::beidou_b1i_telemetry_decoder_cc( } -beidou_b1i_telemetry_decoder_cc::~beidou_b1i_telemetry_decoder_cc() +beidou_b1i_telemetry_decoder_gs::~beidou_b1i_telemetry_decoder_gs() { volk_gnsssdr_free(d_preamble_samples); volk_gnsssdr_free(d_secondary_code_symbols); @@ -153,7 +158,7 @@ beidou_b1i_telemetry_decoder_cc::~beidou_b1i_telemetry_decoder_cc() } -void beidou_b1i_telemetry_decoder_cc::decode_bch15_11_01(const int32_t *bits, int32_t *decbits) +void beidou_b1i_telemetry_decoder_gs::decode_bch15_11_01(const int32_t *bits, int32_t *decbits) { int32_t bit, err, reg[4] = {1, 1, 1, 1}; int32_t errind[15] = {14, 13, 10, 12, 6, 9, 4, 11, 0, 5, 7, 8, 1, 3, 2}; @@ -182,7 +187,7 @@ void beidou_b1i_telemetry_decoder_cc::decode_bch15_11_01(const int32_t *bits, in } -void beidou_b1i_telemetry_decoder_cc::decode_word( +void beidou_b1i_telemetry_decoder_gs::decode_word( int32_t word_counter, const double *enc_word_symbols, int32_t *dec_word_symbols) @@ -224,7 +229,7 @@ void beidou_b1i_telemetry_decoder_cc::decode_word( } -void beidou_b1i_telemetry_decoder_cc::decode_subframe(double *frame_symbols, int32_t frame_length) +void beidou_b1i_telemetry_decoder_gs::decode_subframe(double *frame_symbols) { // 1. Transform from symbols to bits std::string data_bits; @@ -252,7 +257,6 @@ void beidou_b1i_telemetry_decoder_cc::decode_subframe(double *frame_symbols, int d_nav.d1_subframe_decoder(data_bits); } - // 3. Check operation executed correctly if (d_nav.flag_crc_test == true) { @@ -298,7 +302,7 @@ void beidou_b1i_telemetry_decoder_cc::decode_subframe(double *frame_symbols, int } -void beidou_b1i_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +void beidou_b1i_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satellite) { uint32_t sat_prn = 0; d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); @@ -323,8 +327,7 @@ void beidou_b1i_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satell d_samples_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS * d_samples_per_symbol; d_secondary_code_symbols = nullptr; d_preamble_samples = static_cast(volk_gnsssdr_malloc(d_samples_per_preamble * sizeof(int32_t), volk_gnsssdr_get_alignment())); - d_preamble_period_samples = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS*d_samples_per_symbol; - d_subframe_length_symbols = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; + d_preamble_period_samples = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS * d_samples_per_symbol; // Setting samples of preamble code int32_t n = 0; @@ -354,7 +357,7 @@ void beidou_b1i_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satell } -void beidou_b1i_telemetry_decoder_cc::set_channel(int32_t channel) +void beidou_b1i_telemetry_decoder_gs::set_channel(int32_t channel) { d_channel = channel; LOG(INFO) << "Navigation channel set to " << channel; @@ -381,7 +384,7 @@ void beidou_b1i_telemetry_decoder_cc::set_channel(int32_t channel) } -int beidou_b1i_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), +int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { int32_t corr_value = 0; @@ -505,7 +508,7 @@ int beidou_b1i_telemetry_decoder_cc::general_work(int noutput_items __attribute_ } // call the decoder - decode_subframe(d_subframe_symbols, d_subframe_length_symbols); + decode_subframe(d_subframe_symbols); if (d_nav.flag_crc_test == true) { diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.h similarity index 69% rename from src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_cc.h rename to src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.h index 8574b8183..fd0045ed8 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.h @@ -1,9 +1,8 @@ /*! - * \file beidou_b1i_telemetry_decoder_cc.h - * \brief Implementation of an adapter of a BEIDOU BI1 DNAV data decoder block - * to a TelemetryDecoderInterface - * \details Code added as part of GSoC 2018 program. However new modifications included to mimic - * decoding of existing signals + * \file beidou_b1i_telemetry_decoder_gs.h + * \brief Implementation of a BEIDOU BI1 DNAV data decoder block + * \details Code added as part of GSoC 2018 program. However new modifications + * included to mimic decoding of existing signals * \author Damian Miralles, 2018. dmiralles2009(at)gmail.com * \author Sergi Segura, 2018. sergi.segura.munoz(at)gmail.es * @@ -27,45 +26,41 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . + * along with GNSS-SDR. If not, see . * * ------------------------------------------------------------------------- */ -#ifndef GNSS_SDR_BEIDOU_B1I_TELEMETRY_DECODER_CC_H -#define GNSS_SDR_BEIDOU_B1I_TELEMETRY_DECODER_CC_H +#ifndef GNSS_SDR_BEIDOU_B1I_TELEMETRY_DECODER_GS_H +#define GNSS_SDR_BEIDOU_B1I_TELEMETRY_DECODER_GS_H + -#include "Beidou_DNAV.h" -#include "Beidou_B1I.h" -#include "beidou_dnav_almanac.h" -#include "beidou_dnav_ephemeris.h" -#include "beidou_dnav_navigation_message.h" -#include "beidou_dnav_utc_model.h" #include "gnss_satellite.h" -#include "gnss_synchro.h" +#include "beidou_dnav_navigation_message.h" #include #include +#include // for gr_vector_const_void_star #include #include +#include // for boost::shared_ptr +#include -class beidou_b1i_telemetry_decoder_cc; +class beidou_b1i_telemetry_decoder_gs; -using beidou_b1i_telemetry_decoder_cc_sptr = boost::shared_ptr; +using beidou_b1i_telemetry_decoder_gs_sptr = boost::shared_ptr; -beidou_b1i_telemetry_decoder_cc_sptr beidou_b1i_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); +beidou_b1i_telemetry_decoder_gs_sptr beidou_b1i_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); -//!!!! edit /*! - * \brief This class implements a block that decodes the GNAV data defined in BEIDOU ICD v5.1 + * \brief This class implements a block that decodes the BeiDou DNAV data. * \note Code added as part of GSoC 2018 program - * \see GLONASS ICD * */ -class beidou_b1i_telemetry_decoder_cc : public gr::block +class beidou_b1i_telemetry_decoder_gs : public gr::block { public: - ~beidou_b1i_telemetry_decoder_cc(); //!< Class destructor + ~beidou_b1i_telemetry_decoder_gs(); //!< Class destructor void set_satellite(const Gnss_Satellite &satellite); //!< Set satellite PRN void set_channel(int channel); //!< Set receiver's channel @@ -76,17 +71,16 @@ public: gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); private: - friend beidou_b1i_telemetry_decoder_cc_sptr - beidou_b1i_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); - beidou_b1i_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); + friend beidou_b1i_telemetry_decoder_gs_sptr + beidou_b1i_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); + beidou_b1i_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); - void decode_subframe(double *symbols, int32_t frame_length); + void decode_subframe(double *symbols); void decode_word(int32_t word_counter, const double *enc_word_symbols, int32_t *dec_word_symbols); void decode_bch15_11_01(const int32_t *bits, int32_t *decbits); // Preamble decoding - uint16_t d_preambles_symbols[BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS]; int32_t *d_preamble_samples; int32_t *d_secondary_code_symbols; uint32_t d_samples_per_symbol; @@ -94,7 +88,6 @@ private: int32_t d_samples_per_preamble; int32_t d_preamble_period_samples; double *d_subframe_symbols; - uint32_t d_subframe_length_symbols; uint32_t d_required_symbols; // Storage for incoming data diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc similarity index 91% rename from src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_cc.cc rename to src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc index 8c8f5053b..5808db80e 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.cc @@ -1,7 +1,6 @@ /*! - * \file beidou_b3i_telemetry_decoder_cc.cc + * \file beidou_b3i_telemetry_decoder_gs.cc * \brief Implementation of an adapter of a BEIDOU B31 DNAV data decoder block - * to a TelemetryDecoderInterface * \author Damian Miralles, 2019. dmiralles2009(at)gmail.com * * ------------------------------------------------------------------------- @@ -30,31 +29,38 @@ */ -#include "beidou_b3i_telemetry_decoder_cc.h" +#include "beidou_b3i_telemetry_decoder_gs.h" +#include "Beidou_B3I.h" +#include "Beidou_DNAV.h" +#include "beidou_dnav_almanac.h" +#include "beidou_dnav_ephemeris.h" +#include "beidou_dnav_utc_model.h" #include "convolutional.h" #include "display.h" #include "gnss_synchro.h" -#include -#include #include +#include +#include // for make_any +#include // for mp #include -#include +#include // for abs +#include // for exception +#include // for cout +#include // for shared_ptr, make_shared #define CRC_ERROR_LIMIT 8 -using google::LogMessage; - -beidou_b3i_telemetry_decoder_cc_sptr -beidou_b3i_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump) +beidou_b3i_telemetry_decoder_gs_sptr +beidou_b3i_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump) { - return beidou_b3i_telemetry_decoder_cc_sptr(new beidou_b3i_telemetry_decoder_cc(satellite, dump)); + return beidou_b3i_telemetry_decoder_gs_sptr(new beidou_b3i_telemetry_decoder_gs(satellite, dump)); } -beidou_b3i_telemetry_decoder_cc::beidou_b3i_telemetry_decoder_cc( +beidou_b3i_telemetry_decoder_gs::beidou_b3i_telemetry_decoder_gs( const Gnss_Satellite &satellite, - bool dump) : gr::block("beidou_b3i_telemetry_decoder_cc", + bool dump) : gr::block("beidou_b3i_telemetry_decoder_gs", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { @@ -63,7 +69,7 @@ beidou_b3i_telemetry_decoder_cc::beidou_b3i_telemetry_decoder_cc( // initialize internal vars d_dump = dump; d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); - LOG(INFO) << "Initializing BeiDou B1i Telemetry Decoding for satellite "<< this->d_satellite; + LOG(INFO) << "Initializing BeiDou B3I Telemetry Decoding for satellite "<< this->d_satellite; d_samples_per_symbol = (BEIDOU_B3I_CODE_RATE_HZ / BEIDOU_B3I_CODE_LENGTH_CHIPS) / BEIDOU_D1NAV_SYMBOL_RATE_SPS; d_symbols_per_preamble = BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS; @@ -71,7 +77,6 @@ beidou_b3i_telemetry_decoder_cc::beidou_b3i_telemetry_decoder_cc( d_secondary_code_symbols = static_cast(volk_gnsssdr_malloc(BEIDOU_B3I_SECONDARY_CODE_LENGTH * sizeof(int32_t), volk_gnsssdr_get_alignment())); d_preamble_samples = static_cast(volk_gnsssdr_malloc(d_samples_per_preamble * sizeof(int32_t), volk_gnsssdr_get_alignment())); d_preamble_period_samples = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS*d_samples_per_symbol; - d_subframe_length_symbols = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; // Setting samples of secondary code for (int32_t i = 0; i < BEIDOU_B3I_SECONDARY_CODE_LENGTH; i++) @@ -113,8 +118,9 @@ beidou_b3i_telemetry_decoder_cc::beidou_b3i_telemetry_decoder_cc( } } - d_subframe_symbols = static_cast(volk_gnsssdr_malloc(d_subframe_length_symbols * sizeof(double), volk_gnsssdr_get_alignment())); + d_subframe_symbols = static_cast(volk_gnsssdr_malloc(BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS * sizeof(double), volk_gnsssdr_get_alignment())); d_required_symbols = BEIDOU_DNAV_SUBFRAME_SYMBOLS*d_samples_per_symbol + d_samples_per_preamble; + d_symbol_history.set_capacity(d_required_symbols + 1); // Generic settings d_sample_counter = 0; @@ -131,7 +137,7 @@ beidou_b3i_telemetry_decoder_cc::beidou_b3i_telemetry_decoder_cc( } -beidou_b3i_telemetry_decoder_cc::~beidou_b3i_telemetry_decoder_cc() +beidou_b3i_telemetry_decoder_gs::~beidou_b3i_telemetry_decoder_gs() { volk_gnsssdr_free(d_preamble_samples); volk_gnsssdr_free(d_secondary_code_symbols); @@ -151,7 +157,7 @@ beidou_b3i_telemetry_decoder_cc::~beidou_b3i_telemetry_decoder_cc() } -void beidou_b3i_telemetry_decoder_cc::decode_bch15_11_01(int32_t *bits, int32_t *decbits) +void beidou_b3i_telemetry_decoder_gs::decode_bch15_11_01(int32_t *bits, int32_t *decbits) { int bit, err, reg[4] = {1, 1, 1, 1}; int errind[15] = {14, 13, 10, 12, 6, 9, 4, 11, 0, 5, 7, 8, 1, 3, 2}; @@ -179,7 +185,8 @@ void beidou_b3i_telemetry_decoder_cc::decode_bch15_11_01(int32_t *bits, int32_t } } -void beidou_b3i_telemetry_decoder_cc::decode_word( + +void beidou_b3i_telemetry_decoder_gs::decode_word( int32_t word_counter, double* enc_word_symbols, int32_t* dec_word_symbols) @@ -223,7 +230,7 @@ void beidou_b3i_telemetry_decoder_cc::decode_word( } -void beidou_b3i_telemetry_decoder_cc::decode_subframe(double *frame_symbols, int32_t frame_length) +void beidou_b3i_telemetry_decoder_gs::decode_subframe(double *frame_symbols) { // 1. Transform from symbols to bits std::string data_bits; @@ -297,7 +304,7 @@ void beidou_b3i_telemetry_decoder_cc::decode_subframe(double *frame_symbols, int } -void beidou_b3i_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +void beidou_b3i_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satellite) { uint32_t sat_prn = 0; d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); @@ -323,7 +330,6 @@ void beidou_b3i_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satell d_secondary_code_symbols = nullptr; d_preamble_samples = static_cast(volk_gnsssdr_malloc(d_samples_per_preamble * sizeof(int32_t), volk_gnsssdr_get_alignment())); d_preamble_period_samples = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS*d_samples_per_symbol; - d_subframe_length_symbols = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; // Setting samples of preamble code int32_t n = 0; @@ -347,13 +353,13 @@ void beidou_b3i_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satell } } - d_subframe_symbols = static_cast(volk_gnsssdr_malloc(d_subframe_length_symbols * sizeof(double), volk_gnsssdr_get_alignment())); + d_subframe_symbols = static_cast(volk_gnsssdr_malloc(BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS * sizeof(double), volk_gnsssdr_get_alignment())); d_required_symbols = BEIDOU_DNAV_SUBFRAME_SYMBOLS*d_samples_per_symbol + d_samples_per_preamble; } } -void beidou_b3i_telemetry_decoder_cc::set_channel(int channel) +void beidou_b3i_telemetry_decoder_gs::set_channel(int channel) { d_channel = channel; LOG(INFO) << "Navigation channel set to " << channel; @@ -365,7 +371,7 @@ void beidou_b3i_telemetry_decoder_cc::set_channel(int channel) try { d_dump_filename = "telemetry"; - d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); @@ -380,7 +386,7 @@ void beidou_b3i_telemetry_decoder_cc::set_channel(int channel) } -int beidou_b3i_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), +int beidou_b3i_telemetry_decoder_gs::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { int32_t corr_value = 0; @@ -403,7 +409,7 @@ int beidou_b3i_telemetry_decoder_cc::general_work(int noutput_items __attribute_ //******* preamble correlation ******** for (int i = 0; i < d_samples_per_preamble; i++) { - if (d_symbol_history.at(i) < 0) // symbols clipping + if (d_symbol_history[i] < 0) // symbols clipping { corr_value -= d_preamble_samples[i]; } @@ -457,7 +463,7 @@ int beidou_b3i_telemetry_decoder_cc::general_work(int noutput_items __attribute_ if (corr_value > 0) //normal PLL lock { int k = 0; - for (uint32_t i = 0; i < d_subframe_length_symbols; i++) + for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++) { d_subframe_symbols[i] = 0; //integrate samples into symbols @@ -481,7 +487,7 @@ int beidou_b3i_telemetry_decoder_cc::general_work(int noutput_items __attribute_ else //180 deg. inverted carrier phase PLL lock { int k = 0; - for (uint32_t i = 0; i < d_subframe_length_symbols; i++) + for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++) { d_subframe_symbols[i] = 0; //integrate samples into symbols @@ -504,7 +510,7 @@ int beidou_b3i_telemetry_decoder_cc::general_work(int noutput_items __attribute_ } //call the decoder - decode_subframe(d_subframe_symbols, d_subframe_length_symbols); + decode_subframe(d_subframe_symbols); if (d_nav.flag_crc_test == true) { @@ -581,11 +587,6 @@ int beidou_b3i_telemetry_decoder_cc::general_work(int noutput_items __attribute_ } } - // remove used symbols from history - if (d_symbol_history.size() > d_required_symbols) - { - d_symbol_history.pop_front(); - } //3. Make the output (copy the object contents to the GNURadio reserved memory) *out[0] = current_symbol; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.h similarity index 52% rename from src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_cc.h rename to src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.h index a5d9b376d..b73ed10c3 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b3i_telemetry_decoder_gs.h @@ -1,7 +1,6 @@ /*! - * \file beidou_b3i_telemetry_decoder_cc.h - * \brief Implementation of an adapter of a BEIDOU BI1 DNAV data decoder block - * to a TelemetryDecoderInterface + * \file beidou_b3i_telemetry_decoder_gs.h + * \brief Implementation of a BEIDOU B3I DNAV data decoder block * \author Damian Miralles, 2019. dmiralles2009(at)gmail.com * * ------------------------------------------------------------------------- @@ -29,39 +28,34 @@ * ------------------------------------------------------------------------- */ -#ifndef GNSS_SDR_BEIDOU_B3I_TELEMETRY_DECODER_CC_H -#define GNSS_SDR_BEIDOU_B3I_TELEMETRY_DECODER_CC_H +#ifndef GNSS_SDR_BEIDOU_B3I_TELEMETRY_DECODER_GS_H +#define GNSS_SDR_BEIDOU_B3I_TELEMETRY_DECODER_GS_H -#include "beidou_dnav_navigation_message.h" -#include "beidou_dnav_ephemeris.h" -#include "beidou_dnav_almanac.h" -#include "beidou_dnav_utc_model.h" #include "gnss_satellite.h" -#include "gnss_synchro.h" -#include "Beidou_B3I.h" -#include "Beidou_DNAV.h" +#include "beidou_dnav_navigation_message.h" +#include #include +#include // for gr_vector_const_void_star #include #include +#include // for boost::shared_ptr +#include -class beidou_b3i_telemetry_decoder_cc; +class beidou_b3i_telemetry_decoder_gs; -using beidou_b3i_telemetry_decoder_cc_sptr = boost::shared_ptr; +using beidou_b3i_telemetry_decoder_gs_sptr = boost::shared_ptr; -beidou_b3i_telemetry_decoder_cc_sptr beidou_b3i_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); +beidou_b3i_telemetry_decoder_gs_sptr beidou_b3i_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); -//!!!! edit /*! - * \brief This class implements a block that decodes the GNAV data defined in BEIDOU ICD v5.1 - * \note Code added as part of GSoC 2018 program - * \see GLONASS ICD + * \brief This class implements a block that decodes the BeiDou DNAV data. * */ -class beidou_b3i_telemetry_decoder_cc : public gr::block +class beidou_b3i_telemetry_decoder_gs : public gr::block { public: - ~beidou_b3i_telemetry_decoder_cc(); //!< Class destructor + ~beidou_b3i_telemetry_decoder_gs(); //!< Class destructor void set_satellite(const Gnss_Satellite &satellite); //!< Set satellite PRN void set_channel(int channel); //!< Set receiver's channel @@ -72,17 +66,16 @@ public: gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); private: - friend beidou_b3i_telemetry_decoder_cc_sptr - beidou_b3i_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); - beidou_b3i_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); + friend beidou_b3i_telemetry_decoder_gs_sptr + beidou_b3i_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); + beidou_b3i_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); - void decode_subframe(double *symbols, int32_t frame_length); + void decode_subframe(double *symbols); void decode_word(int32_t word_counter, double* enc_word_symbols, int32_t* dec_word_symbols); void decode_bch15_11_01(int32_t *bits, int32_t *decbits); - //!< Preamble decoding - uint16_t d_preambles_symbols[BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS]; + // Preamble decoding int32_t *d_preamble_samples; int32_t *d_secondary_code_symbols; uint32_t d_samples_per_symbol; @@ -90,30 +83,29 @@ private: int32_t d_samples_per_preamble; int32_t d_preamble_period_samples; double *d_subframe_symbols; - uint32_t d_subframe_length_symbols; uint32_t d_required_symbols; - //!< Storage for incoming data - std::deque d_symbol_history; + // Storage for incoming data + boost::circular_buffer d_symbol_history; - //!< Variables for internal functionality - uint64_t d_sample_counter; //!< Sample counter as an index (1,2,3,..etc) indicating number of samples processed - uint64_t d_preamble_index; //!< Index of sample number where preamble was found - uint32_t d_stat; //!< Status of decoder - bool d_flag_frame_sync; //!< Indicate when a frame sync is achieved - bool d_flag_preamble; //!< Flag indicating when preamble was found - int32_t d_CRC_error_counter; //!< Number of failed CRC operations - bool flag_SOW_set; //!< Indicates when time of week is set + // Variables for internal functionality + uint64_t d_sample_counter; // Sample counter as an index (1,2,3,..etc) indicating number of samples processed + uint64_t d_preamble_index; // Index of sample number where preamble was found + uint32_t d_stat; // Status of decoder + bool d_flag_frame_sync; // Indicate when a frame sync is achieved + bool d_flag_preamble; // Flag indicating when preamble was found + int32_t d_CRC_error_counter; // Number of failed CRC operations + bool flag_SOW_set; // Indicates when time of week is set - //!< Navigation Message variable + // Navigation Message variable Beidou_Dnav_Navigation_Message d_nav; - //!< Values to populate gnss synchronization structure + // Values to populate gnss synchronization structure uint32_t d_TOW_at_Preamble_ms; uint32_t d_TOW_at_current_symbol_ms; bool Flag_valid_word; - //!< Satellite Information and logging capacity + // Satellite Information and logging capacity Gnss_Satellite d_satellite; int32_t d_channel; bool d_dump; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc similarity index 96% rename from src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc rename to src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc index fd86b993c..c311342f1 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc @@ -1,5 +1,5 @@ /*! - * \file galileo_telemetry_decoder_cc.cc + * \file galileo_telemetry_decoder_gs.cc * \brief Implementation of a Galileo unified INAV and FNAV message demodulator block * \author Javier Arribas 2018. jarribas(at)cttc.es * @@ -29,32 +29,41 @@ */ -#include "galileo_telemetry_decoder_cc.h" +#include "galileo_telemetry_decoder_gs.h" +#include "Galileo_E1.h" // for GALILEO_E1_CODE_PERIOD_MS +#include "Galileo_E5a.h" // for GALILEO_E5A_CODE_PERIO... #include "convolutional.h" #include "display.h" +#include "galileo_almanac_helper.h" // for Galileo_Almanac_Helper +#include "galileo_ephemeris.h" // for Galileo_Ephemeris +#include "galileo_iono.h" // for Galileo_Iono +#include "galileo_utc_model.h" // for Galileo_Utc_Model #include "gnss_synchro.h" -#include #include #include +#include // for make_any +#include // for mp #include -#include +#include // for fmod +#include // for abs +#include // for exception +#include // for cout +#include // for shared_ptr, make_shared #define CRC_ERROR_LIMIT 6 -using google::LogMessage; - -galileo_telemetry_decoder_cc_sptr -galileo_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, int frame_type, bool dump) +galileo_telemetry_decoder_gs_sptr +galileo_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, int frame_type, bool dump) { - return galileo_telemetry_decoder_cc_sptr(new galileo_telemetry_decoder_cc(satellite, frame_type, dump)); + return galileo_telemetry_decoder_gs_sptr(new galileo_telemetry_decoder_gs(satellite, frame_type, dump)); } -galileo_telemetry_decoder_cc::galileo_telemetry_decoder_cc( +galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs( const Gnss_Satellite &satellite, int frame_type, - bool dump) : gr::block("galileo_telemetry_decoder_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), + bool dump) : gr::block("galileo_telemetry_decoder_gs", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Ephemeris data port out @@ -213,7 +222,7 @@ galileo_telemetry_decoder_cc::galileo_telemetry_decoder_cc( } -galileo_telemetry_decoder_cc::~galileo_telemetry_decoder_cc() +galileo_telemetry_decoder_gs::~galileo_telemetry_decoder_gs() { volk_gnsssdr_free(d_preamble_samples); if (d_frame_type == 2) @@ -239,14 +248,14 @@ galileo_telemetry_decoder_cc::~galileo_telemetry_decoder_cc() } -void galileo_telemetry_decoder_cc::viterbi_decoder(double *page_part_symbols, int32_t *page_part_bits) +void galileo_telemetry_decoder_gs::viterbi_decoder(double *page_part_symbols, int32_t *page_part_bits) { Viterbi(page_part_bits, out0, state0, out1, state1, page_part_symbols, KK, nn, DataLength); } -void galileo_telemetry_decoder_cc::deinterleaver(int32_t rows, int32_t cols, const double *in, double *out) +void galileo_telemetry_decoder_gs::deinterleaver(int32_t rows, int32_t cols, const double *in, double *out) { for (int32_t r = 0; r < rows; r++) { @@ -258,7 +267,7 @@ void galileo_telemetry_decoder_cc::deinterleaver(int32_t rows, int32_t cols, con } -void galileo_telemetry_decoder_cc::decode_INAV_word(double *page_part_symbols, int32_t frame_length) +void galileo_telemetry_decoder_gs::decode_INAV_word(double *page_part_symbols, int32_t frame_length) { // 1. De-interleave auto *page_part_symbols_deint = static_cast(volk_gnsssdr_malloc(frame_length * sizeof(double), volk_gnsssdr_get_alignment())); @@ -352,7 +361,7 @@ void galileo_telemetry_decoder_cc::decode_INAV_word(double *page_part_symbols, i } -void galileo_telemetry_decoder_cc::decode_FNAV_word(double *page_symbols, int32_t frame_length) +void galileo_telemetry_decoder_gs::decode_FNAV_word(double *page_symbols, int32_t frame_length) { // 1. De-interleave auto *page_symbols_deint = static_cast(volk_gnsssdr_malloc(frame_length * sizeof(double), volk_gnsssdr_get_alignment())); @@ -420,7 +429,7 @@ void galileo_telemetry_decoder_cc::decode_FNAV_word(double *page_symbols, int32_ } -void galileo_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +void galileo_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satellite) { d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; @@ -428,7 +437,7 @@ void galileo_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite } -void galileo_telemetry_decoder_cc::set_channel(int32_t channel) +void galileo_telemetry_decoder_gs::set_channel(int32_t channel) { d_channel = channel; DLOG(INFO) << "Navigation channel set to " << channel; @@ -455,7 +464,7 @@ void galileo_telemetry_decoder_cc::set_channel(int32_t channel) } -int galileo_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), +int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { int32_t corr_value = 0; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.h similarity index 80% rename from src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.h rename to src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.h index e678d1d44..3fbbabd68 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.h @@ -1,5 +1,5 @@ /*! - * \file galileo_telemetry_decoder_cc.h + * \file galileo_telemetry_decoder_gs.h * \brief Implementation of a Galileo unified INAV and FNAV message demodulator block * \author Javier Arribas 2018. jarribas(at)cttc.es * @@ -29,38 +29,34 @@ */ -#ifndef GNSS_SDR_GALILEO_TELEMETRY_DECODER_CC_H -#define GNSS_SDR_GALILEO_TELEMETRY_DECODER_CC_H +#ifndef GNSS_SDR_GALILEO_TELEMETRY_DECODER_GS_H +#define GNSS_SDR_GALILEO_TELEMETRY_DECODER_GS_H -#include "Galileo_E1.h" -#include "Galileo_E5a.h" -#include "galileo_almanac_helper.h" -#include "galileo_ephemeris.h" #include "galileo_fnav_message.h" -#include "galileo_iono.h" +#include // for boost::shared_ptr +#include // for gr_vector_const_void_star #include "galileo_navigation_message.h" -#include "galileo_utc_model.h" #include "gnss_satellite.h" -#include "gnss_synchro.h" #include #include #include #include +#include -class galileo_telemetry_decoder_cc; +class galileo_telemetry_decoder_gs; -using galileo_telemetry_decoder_cc_sptr = boost::shared_ptr; +using galileo_telemetry_decoder_gs_sptr = boost::shared_ptr; -galileo_telemetry_decoder_cc_sptr galileo_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, int frame_type, bool dump); +galileo_telemetry_decoder_gs_sptr galileo_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, int frame_type, bool dump); /*! * \brief This class implements a block that decodes the INAV and FNAV data defined in Galileo ICD */ -class galileo_telemetry_decoder_cc : public gr::block +class galileo_telemetry_decoder_gs : public gr::block { public: - ~galileo_telemetry_decoder_cc(); + ~galileo_telemetry_decoder_gs(); void set_satellite(const Gnss_Satellite &satellite); //!< Set satellite PRN void set_channel(int32_t channel); //!< Set receiver's channel int32_t flag_even_word_arrived; @@ -72,9 +68,9 @@ public: gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); private: - friend galileo_telemetry_decoder_cc_sptr - galileo_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, int frame_type, bool dump); - galileo_telemetry_decoder_cc(const Gnss_Satellite &satellite, int frame_type, bool dump); + friend galileo_telemetry_decoder_gs_sptr + galileo_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, int frame_type, bool dump); + galileo_telemetry_decoder_gs(const Gnss_Satellite &satellite, int frame_type, bool dump); void viterbi_decoder(double *page_part_symbols, int32_t *page_part_bits); 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_gs.cc similarity index 93% rename from src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.cc rename to src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.cc index 4a7b04cd2..e39c84852 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_gs.cc @@ -1,7 +1,6 @@ /*! - * \file glonass_l1_ca_telemetry_decoder_cc.cc - * \brief Implementation of an adapter of a GLONASS L1 C/A NAV data decoder block - * to a TelemetryDecoderInterface + * \file glonass_l1_ca_telemetry_decoder_gs.cc + * \brief Implementation of a GLONASS L1 C/A NAV data decoder block * \note Code added as part of GSoC 2017 program * \author Damian Miralles, 2017. dmiralles2009(at)gmail.com * @@ -31,27 +30,34 @@ */ -#include "glonass_l1_ca_telemetry_decoder_cc.h" -#include +#include "glonass_l1_ca_telemetry_decoder_gs.h" +#include "glonass_gnav_almanac.h" +#include "glonass_gnav_ephemeris.h" +#include "glonass_gnav_utc_model.h" #include #include - +#include // for make_any +#include // for mp +#include // for floor, round +#include // for abs, malloc +#include // for memcpy +#include // for exception +#include // for cout +#include // for shared_ptr, make_shared #define CRC_ERROR_LIMIT 6 -using google::LogMessage; - -glonass_l1_ca_telemetry_decoder_cc_sptr -glonass_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump) +glonass_l1_ca_telemetry_decoder_gs_sptr +glonass_l1_ca_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump) { - return glonass_l1_ca_telemetry_decoder_cc_sptr(new glonass_l1_ca_telemetry_decoder_cc(satellite, dump)); + return glonass_l1_ca_telemetry_decoder_gs_sptr(new glonass_l1_ca_telemetry_decoder_gs(satellite, dump)); } -glonass_l1_ca_telemetry_decoder_cc::glonass_l1_ca_telemetry_decoder_cc( +glonass_l1_ca_telemetry_decoder_gs::glonass_l1_ca_telemetry_decoder_gs( const Gnss_Satellite &satellite, - bool dump) : gr::block("glonass_l1_ca_telemetry_decoder_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), + bool dump) : gr::block("glonass_l1_ca_telemetry_decoder_gs", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Ephemeris data port out @@ -109,7 +115,7 @@ glonass_l1_ca_telemetry_decoder_cc::glonass_l1_ca_telemetry_decoder_cc( } -glonass_l1_ca_telemetry_decoder_cc::~glonass_l1_ca_telemetry_decoder_cc() +glonass_l1_ca_telemetry_decoder_gs::~glonass_l1_ca_telemetry_decoder_gs() { delete d_preambles_symbols; if (d_dump_file.is_open() == true) @@ -126,7 +132,7 @@ glonass_l1_ca_telemetry_decoder_cc::~glonass_l1_ca_telemetry_decoder_cc() } -void glonass_l1_ca_telemetry_decoder_cc::decode_string(const double *frame_symbols, int32_t frame_length) +void glonass_l1_ca_telemetry_decoder_gs::decode_string(const double *frame_symbols, int32_t frame_length) { double chip_acc = 0.0; int32_t chip_acc_counter = 0; @@ -226,7 +232,7 @@ void glonass_l1_ca_telemetry_decoder_cc::decode_string(const double *frame_symbo } -void glonass_l1_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +void glonass_l1_ca_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satellite) { d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; @@ -234,7 +240,7 @@ void glonass_l1_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &sat } -void glonass_l1_ca_telemetry_decoder_cc::set_channel(int32_t channel) +void glonass_l1_ca_telemetry_decoder_gs::set_channel(int32_t channel) { d_channel = channel; LOG(INFO) << "Navigation channel set to " << channel; @@ -261,7 +267,7 @@ void glonass_l1_ca_telemetry_decoder_cc::set_channel(int32_t channel) } -int glonass_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), +int glonass_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { int32_t corr_value = 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_gs.h similarity index 78% rename from src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.h rename to src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_gs.h index 52583ac94..3b82aa5f2 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_gs.h @@ -1,7 +1,6 @@ /*! - * \file glonass_l1_ca_telemetry_decoder_cc.h - * \brief Implementation of an adapter of a GLONASS L1 C/A NAV data decoder block - * to a TelemetryDecoderInterface + * \file glonass_l1_ca_telemetry_decoder_gs.h + * \brief Implementation of a GLONASS L1 C/A NAV data decoder block * \note Code added as part of GSoC 2017 program * \author Damian Miralles, 2017. dmiralles2009(at)gmail.com * @@ -30,28 +29,28 @@ * ------------------------------------------------------------------------- */ -#ifndef GNSS_SDR_GLONASS_L1_CA_TELEMETRY_DECODER_CC_H -#define GNSS_SDR_GLONASS_L1_CA_TELEMETRY_DECODER_CC_H +#ifndef GNSS_SDR_GLONASS_L1_CA_TELEMETRY_DECODER_GS_H +#define GNSS_SDR_GLONASS_L1_CA_TELEMETRY_DECODER_GS_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 -#include -#include +#include // for boost::shared_ptr +#include // for block +#include // for gr_vector_const_void_star +#include +#include // for ofstream #include -class glonass_l1_ca_telemetry_decoder_cc; +class glonass_l1_ca_telemetry_decoder_gs; -using glonass_l1_ca_telemetry_decoder_cc_sptr = boost::shared_ptr; +using glonass_l1_ca_telemetry_decoder_gs_sptr = boost::shared_ptr; -glonass_l1_ca_telemetry_decoder_cc_sptr glonass_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); +glonass_l1_ca_telemetry_decoder_gs_sptr glonass_l1_ca_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); /*! * \brief This class implements a block that decodes the GNAV data defined in GLONASS ICD v5.1 @@ -59,10 +58,10 @@ glonass_l1_ca_telemetry_decoder_cc_sptr glonass_l1_ca_make_telemetry_decoder_cc( * \see GLONASS ICD * */ -class glonass_l1_ca_telemetry_decoder_cc : public gr::block +class glonass_l1_ca_telemetry_decoder_gs : public gr::block { public: - ~glonass_l1_ca_telemetry_decoder_cc(); //!< Class destructor + ~glonass_l1_ca_telemetry_decoder_gs(); //!< Class destructor void set_satellite(const Gnss_Satellite &satellite); //!< Set satellite PRN void set_channel(int32_t channel); //!< Set receiver's channel @@ -73,9 +72,9 @@ public: gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); private: - friend glonass_l1_ca_telemetry_decoder_cc_sptr - 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); + friend glonass_l1_ca_telemetry_decoder_gs_sptr + glonass_l1_ca_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); + glonass_l1_ca_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); void decode_string(const double *symbols, int32_t frame_length); 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_gs.cc similarity index 93% rename from src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.cc rename to src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.cc index a58a61785..6f671bb9b 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_gs.cc @@ -1,7 +1,6 @@ /*! - * \file glonass_l2_ca_telemetry_decoder_cc.cc - * \brief Implementation of an adapter of a GLONASS L1 C/A NAV data decoder block - * to a TelemetryDecoderInterface + * \file glonass_l2_ca_telemetry_decoder_gs.cc + * \brief Implementation of a GLONASS L2 C/A NAV data decoder block * \author Damian Miralles, 2018. dmiralles2009(at)gmail.com * * ------------------------------------------------------------------------- @@ -30,28 +29,35 @@ */ -#include "glonass_l2_ca_telemetry_decoder_cc.h" +#include "glonass_l2_ca_telemetry_decoder_gs.h" #include "display.h" -#include +#include "glonass_gnav_almanac.h" +#include "glonass_gnav_ephemeris.h" +#include "glonass_gnav_utc_model.h" #include #include - +#include // for make_any +#include // for mp +#include // for floor, round +#include // for abs, malloc +#include // for memcpy +#include // for exception +#include // for cout +#include // for shared_ptr, make_shared #define CRC_ERROR_LIMIT 6 -using google::LogMessage; - -glonass_l2_ca_telemetry_decoder_cc_sptr -glonass_l2_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump) +glonass_l2_ca_telemetry_decoder_gs_sptr +glonass_l2_ca_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump) { - return glonass_l2_ca_telemetry_decoder_cc_sptr(new glonass_l2_ca_telemetry_decoder_cc(satellite, dump)); + return glonass_l2_ca_telemetry_decoder_gs_sptr(new glonass_l2_ca_telemetry_decoder_gs(satellite, dump)); } -glonass_l2_ca_telemetry_decoder_cc::glonass_l2_ca_telemetry_decoder_cc( +glonass_l2_ca_telemetry_decoder_gs::glonass_l2_ca_telemetry_decoder_gs( const Gnss_Satellite &satellite, - bool dump) : gr::block("glonass_l2_ca_telemetry_decoder_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), + bool dump) : gr::block("glonass_l2_ca_telemetry_decoder_gs", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Ephemeris data port out @@ -109,7 +115,7 @@ glonass_l2_ca_telemetry_decoder_cc::glonass_l2_ca_telemetry_decoder_cc( } -glonass_l2_ca_telemetry_decoder_cc::~glonass_l2_ca_telemetry_decoder_cc() +glonass_l2_ca_telemetry_decoder_gs::~glonass_l2_ca_telemetry_decoder_gs() { delete d_preambles_symbols; if (d_dump_file.is_open() == true) @@ -126,7 +132,7 @@ glonass_l2_ca_telemetry_decoder_cc::~glonass_l2_ca_telemetry_decoder_cc() } -void glonass_l2_ca_telemetry_decoder_cc::decode_string(const double *frame_symbols, int32_t frame_length) +void glonass_l2_ca_telemetry_decoder_gs::decode_string(const double *frame_symbols, int32_t frame_length) { double chip_acc = 0.0; int32_t chip_acc_counter = 0; @@ -226,7 +232,7 @@ void glonass_l2_ca_telemetry_decoder_cc::decode_string(const double *frame_symbo } -void glonass_l2_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +void glonass_l2_ca_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satellite) { d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite; @@ -234,7 +240,7 @@ void glonass_l2_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &sat } -void glonass_l2_ca_telemetry_decoder_cc::set_channel(int32_t channel) +void glonass_l2_ca_telemetry_decoder_gs::set_channel(int32_t channel) { d_channel = channel; LOG(INFO) << "Navigation channel set to " << channel; @@ -261,7 +267,7 @@ void glonass_l2_ca_telemetry_decoder_cc::set_channel(int32_t channel) } -int glonass_l2_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), +int glonass_l2_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { int32_t corr_value = 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_gs.h similarity index 72% rename from src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.h rename to src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_gs.h index 566f5c855..40737fd85 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_gs.h @@ -1,7 +1,6 @@ /*! - * \file glonass_l2_ca_telemetry_decoder_cc.h - * \brief Implementation of an adapter of a GLONASS L2 C/A NAV data decoder block - * to a TelemetryDecoderInterface + * \file glonass_l2_ca_telemetry_decoder_gs.h + * \brief Implementation of a GLONASS L2 C/A NAV data decoder block * \author Damian Miralles, 2018. dmiralles2009(at)gmail.com * * ------------------------------------------------------------------------- @@ -29,51 +28,51 @@ * ------------------------------------------------------------------------- */ -#ifndef GNSS_SDR_GLONASS_L2_CA_TELEMETRY_DECODER_CC_H -#define GNSS_SDR_GLONASS_L2_CA_TELEMETRY_DECODER_CC_H +#ifndef GNSS_SDR_GLONASS_L2_CA_TELEMETRY_DECODER_GS_H +#define GNSS_SDR_GLONASS_L2_CA_TELEMETRY_DECODER_GS_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 +#include // for boost::shared_ptr #include +#include // for gr_vector_const_void_star +#include #include #include -class glonass_l2_ca_telemetry_decoder_cc; +class glonass_l2_ca_telemetry_decoder_gs; -using glonass_l2_ca_telemetry_decoder_cc_sptr = boost::shared_ptr; +using glonass_l2_ca_telemetry_decoder_gs_sptr = boost::shared_ptr; -glonass_l2_ca_telemetry_decoder_cc_sptr glonass_l2_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); +glonass_l2_ca_telemetry_decoder_gs_sptr glonass_l2_ca_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); /*! - * \brief This class implements a block that decodes the GNAV data defined in GLONASS ICD v5.1 - * \see GLONASS ICD - * - */ -class glonass_l2_ca_telemetry_decoder_cc : public gr::block +* \brief This class implements a block that decodes the GNAV data defined in GLONASS ICD v5.1 +* \see GLONASS ICD +* +*/ +class glonass_l2_ca_telemetry_decoder_gs : public gr::block { public: - ~glonass_l2_ca_telemetry_decoder_cc(); //!< Class destructor + ~glonass_l2_ca_telemetry_decoder_gs(); //!< Class destructor void set_satellite(const Gnss_Satellite &satellite); //!< Set satellite PRN void set_channel(int32_t channel); //!< Set receiver's channel /*! - * \brief This is where all signal processing takes place - */ + * \brief This is where all signal processing takes place + */ int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); private: - friend glonass_l2_ca_telemetry_decoder_cc_sptr - 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); + friend glonass_l2_ca_telemetry_decoder_gs_sptr + glonass_l2_ca_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); + glonass_l2_ca_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); void decode_string(const double *symbols, int32_t frame_length); 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_gs.cc similarity index 94% rename from src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc rename to src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc index c0fcf733b..9125f12de 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_gs.cc @@ -1,5 +1,5 @@ /*! - * \file gps_l1_ca_telemetry_decoder_cc.cc + * \file gps_l1_ca_telemetry_decoder_gs.cc * \brief Implementation of a NAV message demodulator block based on * Kay Borre book MATLAB-based GPS receiver * \author Javier Arribas, 2011. jarribas(at)cttc.es @@ -29,29 +29,37 @@ * ------------------------------------------------------------------------- */ -#include "gps_l1_ca_telemetry_decoder_cc.h" -#include +#include "gps_l1_ca_telemetry_decoder_gs.h" +#include "gps_ephemeris.h" // for Gps_Ephemeris +#include "gps_iono.h" // for Gps_Iono +#include "gps_utc_model.h" // for Gps_Utc_Model #include #include +#include // for make_any +#include // for mp #include +#include // for round +#include // for memcpy +#include // for exception +#include // for cout +#include // for shared_ptr #ifndef _rotl #define _rotl(X, N) (((X) << (N)) ^ ((X) >> (32 - (N)))) // Used in the parity check algorithm #endif -using google::LogMessage; -gps_l1_ca_telemetry_decoder_cc_sptr -gps_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump) +gps_l1_ca_telemetry_decoder_gs_sptr +gps_l1_ca_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump) { - return gps_l1_ca_telemetry_decoder_cc_sptr(new gps_l1_ca_telemetry_decoder_cc(satellite, dump)); + return gps_l1_ca_telemetry_decoder_gs_sptr(new gps_l1_ca_telemetry_decoder_gs(satellite, dump)); } -gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc( +gps_l1_ca_telemetry_decoder_gs::gps_l1_ca_telemetry_decoder_gs( const Gnss_Satellite &satellite, - bool dump) : gr::block("gps_navigation_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), + bool dump) : gr::block("gps_navigation_gs", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { // Ephemeris data port out @@ -98,7 +106,7 @@ gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc( } -gps_l1_ca_telemetry_decoder_cc::~gps_l1_ca_telemetry_decoder_cc() +gps_l1_ca_telemetry_decoder_gs::~gps_l1_ca_telemetry_decoder_gs() { volk_gnsssdr_free(d_preambles_symbols); d_symbol_history.clear(); @@ -116,7 +124,7 @@ gps_l1_ca_telemetry_decoder_cc::~gps_l1_ca_telemetry_decoder_cc() } -bool gps_l1_ca_telemetry_decoder_cc::gps_word_parityCheck(uint32_t gpsword) +bool gps_l1_ca_telemetry_decoder_gs::gps_word_parityCheck(uint32_t gpsword) { uint32_t d1, d2, d3, d4, d5, d6, d7, t, parity; // XOR as many bits in parallel as possible. The magic constants pick @@ -143,7 +151,7 @@ bool gps_l1_ca_telemetry_decoder_cc::gps_word_parityCheck(uint32_t gpsword) } -void gps_l1_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +void gps_l1_ca_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satellite) { d_nav.reset(); d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); @@ -153,7 +161,7 @@ void gps_l1_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satelli } -void gps_l1_ca_telemetry_decoder_cc::set_channel(int32_t channel) +void gps_l1_ca_telemetry_decoder_gs::set_channel(int32_t channel) { d_channel = channel; d_nav.i_channel_ID = channel; @@ -182,7 +190,7 @@ void gps_l1_ca_telemetry_decoder_cc::set_channel(int32_t channel) } -bool gps_l1_ca_telemetry_decoder_cc::decode_subframe() +bool gps_l1_ca_telemetry_decoder_gs::decode_subframe() { char subframe[GPS_SUBFRAME_LENGTH]; @@ -234,7 +242,7 @@ bool gps_l1_ca_telemetry_decoder_cc::decode_subframe() { GPS_frame_4bytes ^= 0x3FFFFFC0; // invert the data bits (using XOR) } - if (gps_l1_ca_telemetry_decoder_cc::gps_word_parityCheck(GPS_frame_4bytes)) + if (gps_l1_ca_telemetry_decoder_gs::gps_word_parityCheck(GPS_frame_4bytes)) { subframe_synchro_confirmation = true; } @@ -310,7 +318,7 @@ bool gps_l1_ca_telemetry_decoder_cc::decode_subframe() } -int gps_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), +int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { int32_t preamble_diff_ms = 0; 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_gs.h similarity index 74% rename from src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h rename to src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.h index f77a98153..ef22e17ca 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_gs.h @@ -1,5 +1,5 @@ /*! - * \file gps_l1_ca_telemetry_decoder_cc.h + * \file gps_l1_ca_telemetry_decoder_gs.h * \brief Interface of a NAV message demodulator block based on * Kay Borre book MATLAB-based GPS receiver * \author Javier Arribas, 2011. jarribas(at)cttc.es @@ -28,33 +28,37 @@ * ------------------------------------------------------------------------- */ -#ifndef GNSS_SDR_GPS_L1_CA_TELEMETRY_DECODER_CC_H -#define GNSS_SDR_GPS_L1_CA_TELEMETRY_DECODER_CC_H +#ifndef GNSS_SDR_GPS_L1_CA_TELEMETRY_DECODER_GS_H +#define GNSS_SDR_GPS_L1_CA_TELEMETRY_DECODER_GS_H #include "GPS_L1_CA.h" #include "gnss_satellite.h" -#include "gnss_synchro.h" #include "gps_navigation_message.h" +#include "gnss_synchro.h" #include -#include -#include -#include +#include // for boost::shared_ptr +#include // for block +#include // for gr_vector_const_void_star +#include // for int32_t +#include // for ofstream +#include // for string -class gps_l1_ca_telemetry_decoder_cc; -using gps_l1_ca_telemetry_decoder_cc_sptr = boost::shared_ptr; +class gps_l1_ca_telemetry_decoder_gs; -gps_l1_ca_telemetry_decoder_cc_sptr -gps_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); +using gps_l1_ca_telemetry_decoder_gs_sptr = boost::shared_ptr; + +gps_l1_ca_telemetry_decoder_gs_sptr +gps_l1_ca_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); /*! * \brief This class implements a block that decodes the NAV data defined in IS-GPS-200E * */ -class gps_l1_ca_telemetry_decoder_cc : public gr::block +class gps_l1_ca_telemetry_decoder_gs : public gr::block { public: - ~gps_l1_ca_telemetry_decoder_cc(); + ~gps_l1_ca_telemetry_decoder_gs(); void set_satellite(const Gnss_Satellite &satellite); //!< Set satellite PRN void set_channel(int channel); //!< Set receiver's channel @@ -65,10 +69,10 @@ public: gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); private: - friend gps_l1_ca_telemetry_decoder_cc_sptr - gps_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); + friend gps_l1_ca_telemetry_decoder_gs_sptr + gps_l1_ca_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); - gps_l1_ca_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); + gps_l1_ca_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); bool gps_word_parityCheck(uint32_t gpsword); 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_gs.cc similarity index 88% rename from src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.cc rename to src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.cc index 49e5704d6..246173919 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_gs.cc @@ -1,5 +1,5 @@ /*! - * \file gps_l2c_telemetry_decoder_cc.cc + * \file gps_l2c_telemetry_decoder_gs.cc * \brief Implementation of a NAV message demodulator block based on * Kay Borre book MATLAB-based GPS receiver * \author Javier Arribas, 2015. jarribas(at)cttc.es @@ -30,28 +30,33 @@ */ -#include "gps_l2c_telemetry_decoder_cc.h" +#include "gps_l2c_telemetry_decoder_gs.h" +#include "GPS_L2C.h" // for GPS_L2_CNAV_DATA_PAGE_BITS, GPS_L... #include "display.h" #include "gnss_synchro.h" -#include +#include "gps_cnav_ephemeris.h" // for Gps_CNAV_Ephemeris +#include "gps_cnav_iono.h" // for Gps_CNAV_Iono +#include "gps_cnav_utc_model.h" // for Gps_CNAV_Utc_Model #include #include -#include -#include -#include +#include // for make_any +#include // for mp +#include // for bitset +#include // for round +#include // for exception +#include // for cout +#include // for shared_ptr, make_shared -using google::LogMessage; - -gps_l2c_telemetry_decoder_cc_sptr -gps_l2c_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump) +gps_l2c_telemetry_decoder_gs_sptr +gps_l2c_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump) { - return gps_l2c_telemetry_decoder_cc_sptr(new gps_l2c_telemetry_decoder_cc(satellite, dump)); + return gps_l2c_telemetry_decoder_gs_sptr(new gps_l2c_telemetry_decoder_gs(satellite, dump)); } -gps_l2c_telemetry_decoder_cc::gps_l2c_telemetry_decoder_cc( - const Gnss_Satellite &satellite, bool dump) : gr::block("gps_l2c_telemetry_decoder_cc", +gps_l2c_telemetry_decoder_gs::gps_l2c_telemetry_decoder_gs( + const Gnss_Satellite &satellite, bool dump) : gr::block("gps_l2c_telemetry_decoder_gs", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { @@ -74,7 +79,7 @@ gps_l2c_telemetry_decoder_cc::gps_l2c_telemetry_decoder_cc( } -gps_l2c_telemetry_decoder_cc::~gps_l2c_telemetry_decoder_cc() +gps_l2c_telemetry_decoder_gs::~gps_l2c_telemetry_decoder_gs() { if (d_dump_file.is_open() == true) { @@ -90,14 +95,14 @@ gps_l2c_telemetry_decoder_cc::~gps_l2c_telemetry_decoder_cc() } -void gps_l2c_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +void gps_l2c_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satellite) { d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); DLOG(INFO) << "GPS L2C CNAV telemetry decoder in channel " << this->d_channel << " set to satellite " << d_satellite; } -void gps_l2c_telemetry_decoder_cc::set_channel(int channel) +void gps_l2c_telemetry_decoder_gs::set_channel(int channel) { d_channel = channel; LOG(INFO) << "GPS L2C CNAV channel set to " << channel; @@ -125,7 +130,7 @@ void gps_l2c_telemetry_decoder_cc::set_channel(int channel) } -int gps_l2c_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), +int gps_l2c_telemetry_decoder_gs::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { // get pointers on in- and output gnss-synchro objects 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_gs.h similarity index 74% rename from src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.h rename to src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.h index b545679fe..241ac81e7 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_gs.h @@ -1,5 +1,5 @@ /*! - * \file gps_l2c_telemetry_decoder_cc.h + * \file gps_l2c_telemetry_decoder_gs.h * \brief Interface of a CNAV message demodulator block based on * Kay Borre book MATLAB-based GPS receiver * \author Javier Arribas, 2015. jarribas(at)cttc.es @@ -28,46 +28,40 @@ * ------------------------------------------------------------------------- */ -#ifndef GNSS_SDR_GPS_L2C_TELEMETRY_DECODER_CC_H -#define GNSS_SDR_GPS_L2C_TELEMETRY_DECODER_CC_H +#ifndef GNSS_SDR_GPS_L2C_TELEMETRY_DECODER_GS_H +#define GNSS_SDR_GPS_L2C_TELEMETRY_DECODER_GS_H -#include "GPS_L2C.h" #include "gnss_satellite.h" -#include "gps_cnav_ephemeris.h" -#include "gps_cnav_iono.h" #include "gps_cnav_navigation_message.h" +#include // for boost::shared_ptr #include -#include // for copy +#include // for gr_vector_const_void_star #include #include #include -#include // for pair -#include extern "C" { -#include "bits.h" #include "cnav_msg.h" -#include "edc.h" } -class gps_l2c_telemetry_decoder_cc; +class gps_l2c_telemetry_decoder_gs; -using gps_l2c_telemetry_decoder_cc_sptr = boost::shared_ptr; +using gps_l2c_telemetry_decoder_gs_sptr = boost::shared_ptr; -gps_l2c_telemetry_decoder_cc_sptr -gps_l2c_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); +gps_l2c_telemetry_decoder_gs_sptr +gps_l2c_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); /*! * \brief This class implements a block that decodes the SBAS integrity and corrections data defined in RTCA MOPS DO-229 * */ -class gps_l2c_telemetry_decoder_cc : public gr::block +class gps_l2c_telemetry_decoder_gs : public gr::block { public: - ~gps_l2c_telemetry_decoder_cc(); + ~gps_l2c_telemetry_decoder_gs(); void set_satellite(const Gnss_Satellite &satellite); //!< Set satellite PRN void set_channel(int32_t channel); //!< Set receiver's channel @@ -78,9 +72,9 @@ public: gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); private: - friend gps_l2c_telemetry_decoder_cc_sptr - gps_l2c_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); - gps_l2c_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); + friend gps_l2c_telemetry_decoder_gs_sptr + gps_l2c_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); + gps_l2c_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); bool d_dump; Gnss_Satellite d_satellite; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc similarity index 92% rename from src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc rename to src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc index 48ff89668..a70aaebb1 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc @@ -1,5 +1,5 @@ /*! - * \file gps_l5_telemetry_decoder_cc.cc + * \file gps_l5_telemetry_decoder_gs.cc * \brief Implementation of a CNAV message demodulator block * \author Antonio Ramos, 2017. antonio.ramos(at)cttc.es * @@ -29,30 +29,32 @@ */ -#include "gps_l5_telemetry_decoder_cc.h" +#include "gps_l5_telemetry_decoder_gs.h" #include "display.h" #include "gnss_synchro.h" #include "gps_cnav_ephemeris.h" #include "gps_cnav_iono.h" -#include +#include "gps_cnav_utc_model.h" // for Gps_CNAV_Utc_Model #include #include +#include // for make_any +#include // for mp #include +#include // for abs +#include // for exception #include -#include +#include // for shared_ptr, make_shared -using google::LogMessage; - -gps_l5_telemetry_decoder_cc_sptr -gps_l5_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump) +gps_l5_telemetry_decoder_gs_sptr +gps_l5_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump) { - return gps_l5_telemetry_decoder_cc_sptr(new gps_l5_telemetry_decoder_cc(satellite, dump)); + return gps_l5_telemetry_decoder_gs_sptr(new gps_l5_telemetry_decoder_gs(satellite, dump)); } -gps_l5_telemetry_decoder_cc::gps_l5_telemetry_decoder_cc( - const Gnss_Satellite &satellite, bool dump) : gr::block("gps_l5_telemetry_decoder_cc", +gps_l5_telemetry_decoder_gs::gps_l5_telemetry_decoder_gs( + const Gnss_Satellite &satellite, bool dump) : gr::block("gps_l5_telemetry_decoder_gs", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { @@ -86,7 +88,7 @@ gps_l5_telemetry_decoder_cc::gps_l5_telemetry_decoder_cc( } -gps_l5_telemetry_decoder_cc::~gps_l5_telemetry_decoder_cc() +gps_l5_telemetry_decoder_gs::~gps_l5_telemetry_decoder_gs() { if (d_dump_file.is_open() == true) { @@ -102,7 +104,7 @@ gps_l5_telemetry_decoder_cc::~gps_l5_telemetry_decoder_cc() } -void gps_l5_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +void gps_l5_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satellite) { d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); DLOG(INFO) << "GPS L5 CNAV telemetry decoder in channel " << this->d_channel << " set to satellite " << d_satellite; @@ -110,7 +112,7 @@ void gps_l5_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) } -void gps_l5_telemetry_decoder_cc::set_channel(int32_t channel) +void gps_l5_telemetry_decoder_gs::set_channel(int32_t channel) { d_channel = channel; d_CNAV_Message.reset(); @@ -139,7 +141,7 @@ void gps_l5_telemetry_decoder_cc::set_channel(int32_t channel) } -int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), +int gps_l5_telemetry_decoder_gs::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { // get pointers on in- and output gnss-synchro objects 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_gs.h similarity index 70% rename from src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.h rename to src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.h index 39471b350..e3fbd2e05 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_gs.h @@ -1,5 +1,5 @@ /*! - * \file gps_l5_telemetry_decoder_cc.h + * \file gps_l5_telemetry_decoder_gs.h * \brief Interface of a CNAV message demodulator block * \author Antonio Ramos, 2017. antonio.ramos(at)cttc.es * ------------------------------------------------------------------------- @@ -27,54 +27,51 @@ * ------------------------------------------------------------------------- */ -#ifndef GNSS_SDR_GPS_L5_TELEMETRY_DECODER_CC_H -#define GNSS_SDR_GPS_L5_TELEMETRY_DECODER_CC_H +#ifndef GNSS_SDR_GPS_L5_TELEMETRY_DECODER_GS_H +#define GNSS_SDR_GPS_L5_TELEMETRY_DECODER_GS_H -#include "GPS_L5.h" -#include "gnss_satellite.h" -#include "gps_cnav_navigation_message.h" +#include "GPS_L5.h" // for GPS_L5I_NH_CODE_LENGTH +#include "gnss_satellite.h" // for Gnss_Satellite +#include "gps_cnav_navigation_message.h" // for Gps_CNAV_Navigation_Message #include +#include // for boost::shared_ptr #include -#include +#include // for gr_vector_const_void_star #include #include #include -#include -#include extern "C" { -#include "bits.h" #include "cnav_msg.h" -#include "edc.h" } -class gps_l5_telemetry_decoder_cc; +class gps_l5_telemetry_decoder_gs; -using gps_l5_telemetry_decoder_cc_sptr = boost::shared_ptr; +using gps_l5_telemetry_decoder_gs_sptr = boost::shared_ptr; -gps_l5_telemetry_decoder_cc_sptr -gps_l5_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); +gps_l5_telemetry_decoder_gs_sptr +gps_l5_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); /*! * \brief This class implements a GPS L5 Telemetry decoder * */ -class gps_l5_telemetry_decoder_cc : public gr::block +class gps_l5_telemetry_decoder_gs : public gr::block { public: - ~gps_l5_telemetry_decoder_cc(); + ~gps_l5_telemetry_decoder_gs(); void set_satellite(const Gnss_Satellite &satellite); //!< Set satellite PRN void set_channel(int32_t channel); //!< Set receiver's channel int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); private: - friend gps_l5_telemetry_decoder_cc_sptr - gps_l5_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); - gps_l5_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); + friend gps_l5_telemetry_decoder_gs_sptr + gps_l5_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); + gps_l5_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); bool d_dump; Gnss_Satellite d_satellite; 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_gs.cc similarity index 91% rename from src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc rename to src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_gs.cc index 8a3628cbd..30da62d4f 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_gs.cc @@ -1,5 +1,5 @@ /*! - * \file sbas_l1_telemetry_decoder_cc.cc + * \file sbas_l1_telemetry_decoder_gs.cc * \brief Implementation of a SBAS telemetry data decoder block * \author Daniel Fehr 2013. daniel.co(at)bluewin.ch * @@ -28,15 +28,15 @@ * ------------------------------------------------------------------------- */ -#include "sbas_l1_telemetry_decoder_cc.h" +#include "sbas_l1_telemetry_decoder_gs.h" #include "gnss_synchro.h" -#include +#include "viterbi_decoder.h" #include #include -#include - - -using google::LogMessage; +#include // for mp +#include // for abs +#include // for exception +#include // for operator<<, setw // logging levels #define EVENT 2 // logs important events which don't occur every block @@ -45,16 +45,16 @@ using google::LogMessage; #define LMORE 5 // -sbas_l1_telemetry_decoder_cc_sptr -sbas_l1_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump) +sbas_l1_telemetry_decoder_gs_sptr +sbas_l1_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump) { - return sbas_l1_telemetry_decoder_cc_sptr(new sbas_l1_telemetry_decoder_cc(satellite, dump)); + return sbas_l1_telemetry_decoder_gs_sptr(new sbas_l1_telemetry_decoder_gs(satellite, dump)); } -sbas_l1_telemetry_decoder_cc::sbas_l1_telemetry_decoder_cc( +sbas_l1_telemetry_decoder_gs::sbas_l1_telemetry_decoder_gs( const Gnss_Satellite &satellite, - bool dump) : gr::block("sbas_l1_telemetry_decoder_cc", + bool dump) : gr::block("sbas_l1_telemetry_decoder_gs", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))) { @@ -70,7 +70,7 @@ sbas_l1_telemetry_decoder_cc::sbas_l1_telemetry_decoder_cc( } -sbas_l1_telemetry_decoder_cc::~sbas_l1_telemetry_decoder_cc() +sbas_l1_telemetry_decoder_gs::~sbas_l1_telemetry_decoder_gs() { if (d_dump_file.is_open() == true) { @@ -86,14 +86,14 @@ sbas_l1_telemetry_decoder_cc::~sbas_l1_telemetry_decoder_cc() } -void sbas_l1_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite) +void sbas_l1_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satellite) { d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); LOG(INFO) << "SBAS telemetry decoder in channel " << this->d_channel << " set to satellite " << d_satellite; } -void sbas_l1_telemetry_decoder_cc::set_channel(int32_t channel) +void sbas_l1_telemetry_decoder_gs::set_channel(int32_t channel) { d_channel = channel; LOG(INFO) << "SBAS channel set to " << channel; @@ -101,7 +101,7 @@ void sbas_l1_telemetry_decoder_cc::set_channel(int32_t channel) // ### helper class for sample alignment ### -sbas_l1_telemetry_decoder_cc::Sample_Aligner::Sample_Aligner() +sbas_l1_telemetry_decoder_gs::Sample_Aligner::Sample_Aligner() { d_n_smpls_in_history = 3; d_iir_par = 0.05; @@ -109,10 +109,10 @@ sbas_l1_telemetry_decoder_cc::Sample_Aligner::Sample_Aligner() } -sbas_l1_telemetry_decoder_cc::Sample_Aligner::~Sample_Aligner() = default; +sbas_l1_telemetry_decoder_gs::Sample_Aligner::~Sample_Aligner() = default; -void sbas_l1_telemetry_decoder_cc::Sample_Aligner::reset() +void sbas_l1_telemetry_decoder_gs::Sample_Aligner::reset() { d_past_sample = 0; d_corr_paired = 0; @@ -124,7 +124,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_gs::Sample_Aligner::get_symbols(const std::vector &samples, std::vector &symbols) { double smpls[3] = {}; double corr_diff; @@ -134,12 +134,12 @@ bool sbas_l1_telemetry_decoder_cc::Sample_Aligner::get_symbols(const std::vector VLOG(FLOW) << "get_symbols(): " << "d_past_sample=" << d_past_sample << "\tsamples size=" << samples.size(); - for (uint32_t i_sym = 0; i_sym < samples.size() / sbas_l1_telemetry_decoder_cc::D_SAMPLES_PER_SYMBOL; i_sym++) + for (uint32_t i_sym = 0; i_sym < samples.size() / sbas_l1_telemetry_decoder_gs::D_SAMPLES_PER_SYMBOL; i_sym++) { // get the next samples for (int32_t i = 0; i < d_n_smpls_in_history; i++) { - smpls[i] = static_cast(i_sym) * sbas_l1_telemetry_decoder_cc::D_SAMPLES_PER_SYMBOL + i - 1 == -1 ? d_past_sample : samples[i_sym * sbas_l1_telemetry_decoder_cc::D_SAMPLES_PER_SYMBOL + i - 1]; + smpls[i] = static_cast(i_sym) * sbas_l1_telemetry_decoder_gs::D_SAMPLES_PER_SYMBOL + i - 1 == -1 ? d_past_sample : samples[i_sym * sbas_l1_telemetry_decoder_gs::D_SAMPLES_PER_SYMBOL + i - 1]; } // update the pseudo correlations (IIR method) of the two possible alignments @@ -182,7 +182,7 @@ bool sbas_l1_telemetry_decoder_cc::Sample_Aligner::get_symbols(const std::vector // ### helper class for symbol alignment and viterbi decoding ### -sbas_l1_telemetry_decoder_cc::Symbol_Aligner_And_Decoder::Symbol_Aligner_And_Decoder() +sbas_l1_telemetry_decoder_gs::Symbol_Aligner_And_Decoder::Symbol_Aligner_And_Decoder() { // convolutional code properties d_KK = 7; @@ -197,14 +197,14 @@ sbas_l1_telemetry_decoder_cc::Symbol_Aligner_And_Decoder::Symbol_Aligner_And_Dec } -sbas_l1_telemetry_decoder_cc::Symbol_Aligner_And_Decoder::~Symbol_Aligner_And_Decoder() +sbas_l1_telemetry_decoder_gs::Symbol_Aligner_And_Decoder::~Symbol_Aligner_And_Decoder() { delete d_vd1; delete d_vd2; } -void sbas_l1_telemetry_decoder_cc::Symbol_Aligner_And_Decoder::reset() +void sbas_l1_telemetry_decoder_gs::Symbol_Aligner_And_Decoder::reset() { d_past_symbol = 0; d_vd1->reset(); @@ -212,7 +212,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_gs::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; @@ -251,13 +251,13 @@ bool sbas_l1_telemetry_decoder_cc::Symbol_Aligner_And_Decoder::get_bits(const st // ### helper class for detecting the preamble and collect the corresponding message candidates ### -void sbas_l1_telemetry_decoder_cc::Frame_Detector::reset() +void sbas_l1_telemetry_decoder_gs::Frame_Detector::reset() { d_buffer.clear(); } -void sbas_l1_telemetry_decoder_cc::Frame_Detector::get_frame_candidates(const std::vector &bits, std::vector>> &msg_candidates) +void sbas_l1_telemetry_decoder_gs::Frame_Detector::get_frame_candidates(const std::vector &bits, std::vector>> &msg_candidates) { std::stringstream ss; uint32_t sbas_msg_length = 250; @@ -321,12 +321,12 @@ void sbas_l1_telemetry_decoder_cc::Frame_Detector::get_frame_candidates(const st // ### helper class for checking the CRC of the message candidates ### -void sbas_l1_telemetry_decoder_cc::Crc_Verifier::reset() +void sbas_l1_telemetry_decoder_gs::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_gs::Crc_Verifier::get_valid_frames(const std::vector &msg_candidates, std::vector &valid_msgs) { std::stringstream ss; VLOG(FLOW) << "get_valid_frames(): " @@ -364,7 +364,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_gs::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; @@ -391,7 +391,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_gs::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; @@ -419,7 +419,7 @@ void sbas_l1_telemetry_decoder_cc::Crc_Verifier::zerropad_front_and_convert_to_b } -int sbas_l1_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), +int sbas_l1_telemetry_decoder_gs::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { VLOG(FLOW) << "general_work(): " 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_gs.h similarity index 84% rename from src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.h rename to src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_gs.h index f1188737b..35306340c 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_gs.h @@ -1,5 +1,5 @@ /*! - * \file sbas_l1_telemetry_decoder_cc.h + * \file sbas_l1_telemetry_decoder_gs.h * \brief Interface of a SBAS telemetry data decoder block * \author Daniel Fehr 2013. daniel.co(at)bluewin.ch * @@ -28,14 +28,15 @@ * ------------------------------------------------------------------------- */ -#ifndef GNSS_SDR_SBAS_L1_TELEMETRY_DECODER_CC_H -#define GNSS_SDR_SBAS_L1_TELEMETRY_DECODER_CC_H +#ifndef GNSS_SDR_SBAS_L1_TELEMETRY_DECODER_GS_H +#define GNSS_SDR_SBAS_L1_TELEMETRY_DECODER_GS_H #include "gnss_satellite.h" -#include "viterbi_decoder.h" -#include +#include // for crc_optimal +#include // for boost::shared_ptr #include -#include // for copy +#include // for gr_vector_const_void_star +#include // for size_t #include #include #include @@ -43,22 +44,23 @@ #include // for pair #include +class Viterbi_Decoder; -class sbas_l1_telemetry_decoder_cc; +class sbas_l1_telemetry_decoder_gs; -using sbas_l1_telemetry_decoder_cc_sptr = boost::shared_ptr; +using sbas_l1_telemetry_decoder_gs_sptr = boost::shared_ptr; -sbas_l1_telemetry_decoder_cc_sptr -sbas_l1_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); +sbas_l1_telemetry_decoder_gs_sptr +sbas_l1_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); /*! * \brief This class implements a block that decodes the SBAS integrity and corrections data defined in RTCA MOPS DO-229 * */ -class sbas_l1_telemetry_decoder_cc : public gr::block +class sbas_l1_telemetry_decoder_gs : public gr::block { public: - ~sbas_l1_telemetry_decoder_cc(); + ~sbas_l1_telemetry_decoder_gs(); void set_satellite(const Gnss_Satellite &satellite); //!< Set satellite PRN void set_channel(int32_t channel); //!< Set receiver's channel @@ -69,9 +71,9 @@ public: gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); private: - friend sbas_l1_telemetry_decoder_cc_sptr - sbas_l1_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); - sbas_l1_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); + friend sbas_l1_telemetry_decoder_gs_sptr + sbas_l1_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); + sbas_l1_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); void viterbi_decoder(double *page_part_symbols, int32_t *page_part_bits); void align_samples(); diff --git a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc index febb18294..9c1fe1c53 100644 --- a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc +++ b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc @@ -31,6 +31,8 @@ #include "viterbi_decoder.h" #include +#include // for memset +#include // for operator<<, basic_ostream, char_traits, endl // logging #define EVENT 2 // logs important events which don't occur every block diff --git a/src/algorithms/tracking/adapters/CMakeLists.txt b/src/algorithms/tracking/adapters/CMakeLists.txt index 7fc9d1359..748d08e2d 100644 --- a/src/algorithms/tracking/adapters/CMakeLists.txt +++ b/src/algorithms/tracking/adapters/CMakeLists.txt @@ -100,6 +100,8 @@ target_link_libraries(tracking_adapters tracking_gr_blocks algorithms_libs gnss_sdr_flags + PRIVATE + Volkgnsssdr::volkgnsssdr ) target_include_directories(tracking_adapters diff --git a/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc index d74732151..6dba51ede 100644 --- a/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc @@ -42,7 +42,6 @@ #include "gnss_sdr_flags.h" #include -using google::LogMessage; BeidouB1iDllPllTracking::BeidouB1iDllPllTracking( ConfigurationInterface* configuration, const std::string& role, 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 6c2bc02d0..ec8e95979 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 @@ -43,9 +43,6 @@ #include -using google::LogMessage; - - GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking( ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) 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 3d692c5db..b9f6cf626 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 @@ -41,8 +41,8 @@ #include "galileo_e1_signal_processing.h" #include "gnss_sdr_flags.h" #include +#include -using google::LogMessage; GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( ConfigurationInterface* configuration, const std::string& role, 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 be3a99f0c..0d74dcb0d 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc @@ -43,9 +43,6 @@ #include -using google::LogMessage; - - GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking( ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) 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 8e5fe8314..aa8b0f998 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc @@ -2,8 +2,6 @@ * \file galileo_e5a_dll_pll_tracking.cc * \brief Adapts a code DLL + carrier PLL * tracking block to a TrackingInterface for Galileo E5a signals - * \brief Adapts a PCPS acquisition block to an AcquisitionInterface for - * Galileo E5a data and pilot Signals * \author Marc Sales, 2014. marcsales92(at)gmail.com * \based on work from: *
    @@ -43,8 +41,6 @@ #include "gnss_sdr_flags.h" #include -using google::LogMessage; - GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( ConfigurationInterface* configuration, const std::string& role, 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 1aefcf2cf..fe29757d7 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.h +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.h @@ -2,8 +2,6 @@ * \file galileo_e5a_dll_pll_tracking.h * \brief Adapts a code DLL + carrier PLL * tracking block to a TrackingInterface for Galileo E5a signals - * \brief Adapts a PCPS acquisition block to an AcquisitionInterface for - * Galileo E5a data and pilot Signals * \author Marc Sales, 2014. marcsales92(at)gmail.com * \based on work from: *
      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 e158d493f..b70ba9bd4 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 @@ -36,12 +36,8 @@ #include "galileo_e5_signal_processing.h" #include "gnss_sdr_flags.h" #include +#include -using google::LogMessage; - -void GalileoE5aDllPllTrackingFpga::stop_tracking() -{ -} GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( ConfigurationInterface *configuration, const std::string &role, @@ -186,6 +182,11 @@ void GalileoE5aDllPllTrackingFpga::start_tracking() } +void GalileoE5aDllPllTrackingFpga::stop_tracking() +{ +} + + /* * Set tracking channel unique ID */ 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 b50f67207..e6d736269 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 @@ -35,6 +35,7 @@ #include "dll_pll_veml_tracking_fpga.h" #include "tracking_interface.h" #include +#include class ConfigurationInterface; @@ -64,7 +65,7 @@ public: inline size_t item_size() override { - return item_size_; + return sizeof(int); } void connect(gr::top_block_sptr top_block) override; @@ -91,13 +92,11 @@ public: private: dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc; - size_t item_size_; uint32_t channel_; std::string role_; uint32_t in_streams_; uint32_t out_streams_; - int32_t* d_ca_codes; int32_t* d_data_codes; bool d_track_pilot; 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 e3ca80dbe..0c425cf0c 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 @@ -44,9 +44,6 @@ #include -using google::LogMessage; - - GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking( ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) 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 406271643..dc4b39f9a 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 @@ -43,9 +43,6 @@ #include -using google::LogMessage; - - GlonassL1CaDllPllTracking::GlonassL1CaDllPllTracking( ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) 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 419ccc462..15bdbd3ae 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 @@ -42,9 +42,6 @@ #include -using google::LogMessage; - - GlonassL2CaDllPllCAidTracking::GlonassL2CaDllPllCAidTracking( ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) 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 1e7ded9da..9647e4f20 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 @@ -41,9 +41,6 @@ #include -using google::LogMessage; - - GlonassL2CaDllPllTracking::GlonassL2CaDllPllTracking( ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc index 5531be4e0..21d174ad4 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc @@ -43,9 +43,6 @@ #include -using google::LogMessage; - - GpsL1CaDllPllCAidTracking::GpsL1CaDllPllCAidTracking( ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) 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 83a60b49a..b8f4815e2 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 @@ -43,8 +43,6 @@ #include "gnss_sdr_flags.h" #include -using google::LogMessage; - GpsL1CaDllPllTracking::GpsL1CaDllPllTracking( ConfigurationInterface* configuration, const std::string& role, 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 57427275a..9ff88bb64 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 @@ -41,14 +41,10 @@ #include "gnss_sdr_flags.h" #include "gps_sdr_signal_processing.h" #include +#include #define NUM_PRNs 32 -using google::LogMessage; - -void GpsL1CaDllPllTrackingFpga::stop_tracking() -{ -} GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga( ConfigurationInterface* configuration, const std::string& role, @@ -148,16 +144,24 @@ GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga( DLOG(INFO) << "tracking(" << tracking_fpga_sc->unique_id() << ")"; } + GpsL1CaDllPllTrackingFpga::~GpsL1CaDllPllTrackingFpga() { delete[] d_ca_codes; } + void GpsL1CaDllPllTrackingFpga::start_tracking() { tracking_fpga_sc->start_tracking(); } + +void GpsL1CaDllPllTrackingFpga::stop_tracking() +{ +} + + /* * Set tracking channel unique ID */ @@ -167,11 +171,13 @@ void GpsL1CaDllPllTrackingFpga::set_channel(unsigned int channel) tracking_fpga_sc->set_channel(channel); } + void GpsL1CaDllPllTrackingFpga::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) { tracking_fpga_sc->set_gnss_synchro(p_gnss_synchro); } + void GpsL1CaDllPllTrackingFpga::connect(gr::top_block_sptr top_block) { if (top_block) 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 848cd2bd6..f845088a9 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking_gpu.cc @@ -42,12 +42,6 @@ #include -using google::LogMessage; - -void GpsL1CaDllPllTrackingGPU::stop_tracking() -{ -} - GpsL1CaDllPllTrackingGPU::GpsL1CaDllPllTrackingGPU( ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) @@ -118,6 +112,12 @@ void GpsL1CaDllPllTrackingGPU::start_tracking() tracking_->start_tracking(); } + +void GpsL1CaDllPllTrackingGPU::stop_tracking() +{ +} + + /* * Set tracking channel unique ID */ @@ -127,11 +127,13 @@ void GpsL1CaDllPllTrackingGPU::set_channel(unsigned int channel) tracking_->set_channel(channel); } + void GpsL1CaDllPllTrackingGPU::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) { tracking_->set_gnss_synchro(p_gnss_synchro); } + void GpsL1CaDllPllTrackingGPU::connect(gr::top_block_sptr top_block) { if (top_block) @@ -140,6 +142,7 @@ void GpsL1CaDllPllTrackingGPU::connect(gr::top_block_sptr top_block) //nothing to connect, now the tracking uses gr_sync_decimator } + void GpsL1CaDllPllTrackingGPU::disconnect(gr::top_block_sptr top_block) { if (top_block) @@ -148,11 +151,13 @@ void GpsL1CaDllPllTrackingGPU::disconnect(gr::top_block_sptr top_block) //nothing to disconnect, now the tracking uses gr_sync_decimator } + gr::basic_block_sptr GpsL1CaDllPllTrackingGPU::get_left_block() { return tracking_; } + gr::basic_block_sptr GpsL1CaDllPllTrackingGPU::get_right_block() { return tracking_; 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 b10cecafd..c3b96d3e5 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc @@ -45,9 +45,6 @@ #include -using google::LogMessage; - - GpsL1CaKfTracking::GpsL1CaKfTracking( ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) 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 15e7f650b..2cb2d0741 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 @@ -42,9 +42,6 @@ #include -using google::LogMessage; - - GpsL1CaTcpConnectorTracking::GpsL1CaTcpConnectorTracking( ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) 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 c55191bd2..a1e2c722c 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 @@ -43,9 +43,6 @@ #include -using google::LogMessage; - - GpsL2MDllPllTracking::GpsL2MDllPllTracking( ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) 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 6db3a0cd6..88bb84253 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 @@ -42,25 +42,18 @@ #include "gnss_sdr_flags.h" #include "gps_l2c_signal.h" #include +#include #define NUM_PRNs 32 -using google::LogMessage; - -void GpsL2MDllPllTrackingFpga::stop_tracking() -{ -} GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga( 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; Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga(); DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## - //std::string default_item_type = "gr_complex"; - //std::string item_type = configuration->property(role + ".item_type", default_item_type); int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000); int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); trk_param_fpga.fs_in = fs_in; @@ -123,15 +116,12 @@ GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga( //unsigned int multicorr_type = configuration->property(role + ".multicorr_type", 0); trk_param_fpga.multicorr_type = 0; //multicorr_type : 0 -> 3 correlators, 1 -> 5 correlators - //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())); 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())); for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) { - //gps_l1_ca_code_gen_int(&d_ca_codes[(int(GPS_L1_CA_CODE_LENGTH_CHIPS)) * (PRN - 1)], PRN, 0); gps_l2c_m_code_gen_float(ca_codes_f, PRN); for (unsigned int s = 0; s < 2 * static_cast(GPS_L2_M_CODE_LENGTH_CHIPS); s++) { @@ -139,27 +129,13 @@ GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga( } } - delete[] ca_codes_f; + volk_gnsssdr_free(ca_codes_f); trk_param_fpga.ca_codes = d_ca_codes; trk_param_fpga.code_length_chips = GPS_L2_M_CODE_LENGTH_CHIPS; trk_param_fpga.code_samples_per_chip = 1; // 1 sample per chip - //################# MAKE TRACKING GNURadio object ################### - - // //################# MAKE TRACKING GNURadio object ################### - // if (item_type.compare("gr_complex") == 0) - // { - // item_size_ = sizeof(gr_complex); - // tracking_ = dll_pll_veml_make_tracking(trk_param); - // } - // else - // { - // item_size_ = sizeof(gr_complex); - // LOG(WARNING) << item_type << " unknown tracking item type."; - // } - - //################# MAKE TRACKING GNURadio object ################### + //################# MAKE TRACKING GNU Radio object ################### tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga); channel_ = 0; @@ -167,30 +143,35 @@ GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga( } -GpsL2MDllPllTrackingFpga::~GpsL2MDllPllTrackingFpga() = default; +GpsL2MDllPllTrackingFpga::~GpsL2MDllPllTrackingFpga() +{ + volk_gnsssdr_free(d_ca_codes); +} void GpsL2MDllPllTrackingFpga::start_tracking() { - //tracking_->start_tracking(); tracking_fpga_sc->start_tracking(); } +void GpsL2MDllPllTrackingFpga::stop_tracking() +{ +} + + /* * Set tracking channel unique ID */ void GpsL2MDllPllTrackingFpga::set_channel(unsigned int channel) { channel_ = channel; - //tracking_->set_channel(channel); tracking_fpga_sc->set_channel(channel); } void GpsL2MDllPllTrackingFpga::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) { - //tracking_->set_gnss_synchro(p_gnss_synchro); tracking_fpga_sc->set_gnss_synchro(p_gnss_synchro); } @@ -200,7 +181,7 @@ void GpsL2MDllPllTrackingFpga::connect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to connect, now the tracking uses gr_sync_decimator + // nothing to connect } @@ -209,19 +190,17 @@ void GpsL2MDllPllTrackingFpga::disconnect(gr::top_block_sptr top_block) if (top_block) { /* top_block is not null */ }; - //nothing to disconnect, now the tracking uses gr_sync_decimator + // nothing to disconnect } gr::basic_block_sptr GpsL2MDllPllTrackingFpga::get_left_block() { - //return tracking_; return tracking_fpga_sc; } gr::basic_block_sptr GpsL2MDllPllTrackingFpga::get_right_block() { - //return tracking_; return tracking_fpga_sc; } 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 e734dea58..77ab71f0d 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 @@ -70,7 +70,7 @@ public: inline size_t item_size() override { - return item_size_; + return sizeof(int); } void connect(gr::top_block_sptr top_block) override; @@ -98,7 +98,6 @@ public: private: //dll_pll_veml_tracking_sptr tracking_; dll_pll_veml_tracking_fpga_sptr tracking_fpga_sc; - size_t item_size_; unsigned int channel_; std::string role_; unsigned int in_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 1fdba0405..2066f99be 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc @@ -43,9 +43,6 @@ #include -using google::LogMessage; - - GpsL5DllPllTracking::GpsL5DllPllTracking( ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) 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 19099270a..ed3ea37a0 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 @@ -43,14 +43,10 @@ #include "gnss_sdr_flags.h" #include "gps_l5_signal.h" #include +#include #define NUM_PRNs 32 -using google::LogMessage; - -void GpsL5DllPllTrackingFpga::stop_tracking() -{ -} GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( ConfigurationInterface *configuration, const std::string &role, @@ -123,7 +119,6 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( trk_param_fpga.carrier_lock_th = carrier_lock_th; // FPGA configuration parameters - std::string default_device_name = "/dev/uio"; std::string device_name = configuration->property(role + ".devicename", default_device_name); trk_param_fpga.device_name = device_name; @@ -150,6 +145,7 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(code_length_chips * NUM_PRNs) * sizeof(int32_t), volk_gnsssdr_get_alignment())); + d_data_codes = nullptr; if (track_pilot) { d_data_codes = static_cast(volk_gnsssdr_malloc((static_cast(code_length_chips)) * NUM_PRNs * sizeof(int32_t), volk_gnsssdr_get_alignment())); @@ -195,10 +191,10 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( GpsL5DllPllTrackingFpga::~GpsL5DllPllTrackingFpga() { - delete[] d_ca_codes; + volk_gnsssdr_free(d_ca_codes); if (d_track_pilot) { - delete[] d_data_codes; + volk_gnsssdr_free(d_data_codes); } } @@ -209,6 +205,11 @@ void GpsL5DllPllTrackingFpga::start_tracking() } +void GpsL5DllPllTrackingFpga::stop_tracking() +{ +} + + /* * Set tracking channel unique ID */ diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index a4e8fdd3e..4c688a2a3 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -48,6 +48,7 @@ #include "galileo_e1_signal_processing.h" #include "galileo_e5_signal_processing.h" #include "gnss_sdr_create_directory.h" +#include "gnss_synchro.h" #include "gps_l2c_signal.h" #include "gps_l5_signal.h" #include "gps_sdr_signal_processing.h" @@ -55,17 +56,17 @@ #include "tracking_discriminators.h" #include #include -#include -#include +#include // for io_signature +#include // for scoped_lock +#include // for Mat_VarCreate +#include // for mp #include -#include -#include -#include -#include -#include -#include +#include // for fill_n +#include // for fmod, round, floor +#include // for exception +#include // for cout, cerr +#include -using google::LogMessage; dll_pll_veml_tracking_sptr dll_pll_veml_make_tracking(const Dll_Pll_Conf &conf_) { diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h index bcf605eb5..c1c9d6532 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h @@ -34,17 +34,19 @@ #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 -#include -#include -#include -#include -#include -#include +#include // for boost::shared_ptr +#include // for block +#include // for gr_complex +#include // for gr_vector_int, gr_vector... +#include // for pmt_t +#include // for int32_t +#include // for string, ofstream +#include // for pair +class Gnss_Synchro; class dll_pll_veml_tracking; using dll_pll_veml_tracking_sptr = boost::shared_ptr; 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 4c7f05109..7715e2f8c 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 @@ -41,7 +41,6 @@ #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" @@ -62,7 +61,6 @@ #include #include -using google::LogMessage; dll_pll_veml_tracking_fpga_sptr dll_pll_veml_make_tracking_fpga(const Dll_Pll_Conf_Fpga &conf_) { @@ -421,6 +419,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & uint32_t multicorr_type = trk_parameters.multicorr_type; multicorrelator_fpga = std::make_shared(d_n_correlator_taps, device_name, device_base, ca_codes, data_codes, d_code_length_chips, trk_parameters.track_pilot, multicorr_type, d_code_samples_per_chip); multicorrelator_fpga->set_output_vectors(d_correlator_outs, d_Prompt_Data); + d_sample_counter_next = 0ULL; } 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 9fe6cbbbc..227939ded 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 @@ -119,8 +119,6 @@ private: int32_t d_correlation_length_ms; int32_t d_n_correlator_taps; - float *d_tracking_code; - float *d_data_code; float *d_local_code_shift_chips; float *d_prompt_data_shift; std::shared_ptr multicorrelator_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 e6177bbe7..b6abc58d7 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 @@ -55,8 +55,6 @@ #include -using google::LogMessage; - galileo_e1_tcp_connector_tracking_cc_sptr galileo_e1_tcp_connector_make_tracking_cc( int64_t fs_in, uint32_t vector_length, 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 21a040646..27ae8ad4d 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 @@ -58,7 +58,6 @@ #define CN0_ESTIMATION_SAMPLES 10 -using google::LogMessage; glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr glonass_l1_ca_dll_pll_c_aid_make_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 3e0338be2..e3d4c509d 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 @@ -56,7 +56,6 @@ #define CN0_ESTIMATION_SAMPLES 10 -using google::LogMessage; glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr glonass_l1_ca_dll_pll_c_aid_make_tracking_sc( 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 e00604c90..e14cd74d2 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 @@ -55,7 +55,6 @@ #define CN0_ESTIMATION_SAMPLES 10 -using google::LogMessage; glonass_l1_ca_dll_pll_tracking_cc_sptr glonass_l1_ca_dll_pll_make_tracking_cc( 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 ae689ab8a..f9f45288e 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 @@ -55,7 +55,6 @@ #define CN0_ESTIMATION_SAMPLES 10 -using google::LogMessage; glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr glonass_l2_ca_dll_pll_c_aid_make_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 aebdf3db7..0958c7b55 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 @@ -54,7 +54,6 @@ #define CN0_ESTIMATION_SAMPLES 10 -using google::LogMessage; glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr glonass_l2_ca_dll_pll_c_aid_make_tracking_sc( 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 b161483c5..bb28a5580 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 @@ -55,7 +55,6 @@ #define CN0_ESTIMATION_SAMPLES 10 -using google::LogMessage; glonass_l2_ca_dll_pll_tracking_cc_sptr glonass_l2_ca_dll_pll_make_tracking_cc( 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 45a890cbe..f2e7a11bc 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 @@ -47,8 +47,6 @@ #include -using google::LogMessage; - gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr gps_l1_ca_dll_pll_c_aid_make_tracking_cc( int64_t fs_in, 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 8a3dd9a7d..782383c0c 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 @@ -47,8 +47,6 @@ #include -using google::LogMessage; - gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr gps_l1_ca_dll_pll_c_aid_make_tracking_sc( int64_t fs_in, 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 6fb8197d1..0031c1c69 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 @@ -44,8 +44,6 @@ #include -using google::LogMessage; - gps_l1_ca_dll_pll_tracking_gpu_cc_sptr gps_l1_ca_dll_pll_make_tracking_gpu_cc( int64_t fs_in, 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 96c478a3f..84cb3d166 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 @@ -55,8 +55,6 @@ #include -using google::LogMessage; - gps_l1_ca_kf_tracking_cc_sptr gps_l1_ca_kf_make_tracking_cc( uint32_t order, 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 8521314b4..f8cf984a1 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 @@ -53,8 +53,6 @@ #include -using google::LogMessage; - gps_l1_ca_tcp_connector_tracking_cc_sptr gps_l1_ca_tcp_connector_make_tracking_cc( int64_t fs_in, diff --git a/src/algorithms/tracking/libs/fpga_multicorrelator.cc b/src/algorithms/tracking/libs/fpga_multicorrelator.cc index 741705303..b832a828c 100644 --- a/src/algorithms/tracking/libs/fpga_multicorrelator.cc +++ b/src/algorithms/tracking/libs/fpga_multicorrelator.cc @@ -36,19 +36,12 @@ #include "fpga_multicorrelator.h" #include -#include -#include +#include #include -#include -#include #include -#include -#include -#include +#include // for O_RDWR, O_RSYNC #include -#include -#include -#include +#include // for PROT_READ, PROT_WRITE, MAP_SHARED #include // FPGA register access constants @@ -248,8 +241,14 @@ void Fpga_Multicorrelator_8sc::set_channel(uint32_t channel) int32_t numdevice = d_device_base + d_channel; devicebasetemp << numdevice; mergedname = d_device_name + devicebasetemp.str(); - strcpy(device_io_name, mergedname.c_str()); + if (mergedname.size() > MAX_LENGTH_DEVICEIO_NAME) + { + mergedname = mergedname.substr(0, MAX_LENGTH_DEVICEIO_NAME); + } + + mergedname.copy(device_io_name, mergedname.size() + 1); + device_io_name[mergedname.size()] = '\0'; std::cout << "trk device_io_name = " << device_io_name << std::endl; if ((d_device_descriptor = open(device_io_name, O_RDWR | O_SYNC)) == -1) @@ -267,14 +266,14 @@ void Fpga_Multicorrelator_8sc::set_channel(uint32_t channel) std::cout << "Cannot map deviceio" << device_io_name << std::endl; } - // sanity check : check test register + // sanity check: check test register uint32_t writeval = TEST_REGISTER_TRACK_WRITEVAL; uint32_t readval; readval = Fpga_Multicorrelator_8sc::fpga_acquisition_test_register(writeval); if (writeval != readval) { LOG(WARNING) << "Test register sanity check failed"; - std::cout << "tracking test register sanity check failed" << std::endl; + std::cout << "Tracking test register sanity check failed" << std::endl; } else { @@ -343,16 +342,14 @@ void Fpga_Multicorrelator_8sc::fpga_compute_code_shift_parameters(void) for (i = 0; i < d_n_correlators; i++) { - temp_calculation = floor( - d_shifts_chips[i] - d_rem_code_phase_chips); + temp_calculation = floor(d_shifts_chips[i] - d_rem_code_phase_chips); if (temp_calculation < 0) { temp_calculation = temp_calculation + (d_code_length_chips * d_code_samples_per_chip); // % operator does not work as in Matlab with negative numbers } d_initial_index[i] = static_cast((static_cast(temp_calculation)) % (d_code_length_chips * d_code_samples_per_chip)); - temp_calculation = fmod(d_shifts_chips[i] - d_rem_code_phase_chips, - 1.0); + temp_calculation = fmod(d_shifts_chips[i] - d_rem_code_phase_chips, 1.0); if (temp_calculation < 0) { temp_calculation = temp_calculation + 1.0; // fmod operator does not work as in Matlab with negative numbers @@ -362,16 +359,14 @@ void Fpga_Multicorrelator_8sc::fpga_compute_code_shift_parameters(void) } if (d_track_pilot) { - temp_calculation = floor( - d_prompt_data_shift[0] - d_rem_code_phase_chips); + temp_calculation = floor(d_prompt_data_shift[0] - d_rem_code_phase_chips); if (temp_calculation < 0) { temp_calculation = temp_calculation + (d_code_length_chips * d_code_samples_per_chip); // % operator does not work as in Matlab with negative numbers } d_initial_index[d_n_correlators] = static_cast((static_cast(temp_calculation)) % (d_code_length_chips * d_code_samples_per_chip)); - temp_calculation = fmod(d_prompt_data_shift[0] - d_rem_code_phase_chips, - 1.0); + temp_calculation = fmod(d_prompt_data_shift[0] - d_rem_code_phase_chips, 1.0); if (temp_calculation < 0) { temp_calculation = temp_calculation + 1.0; // fmod operator does not work as in Matlab with negative numbers @@ -421,14 +416,12 @@ void Fpga_Multicorrelator_8sc::fpga_compute_signal_parameters_in_fpga(void) { d_rem_carrier_phase_in_rad_temp = d_rem_carrier_phase_in_rad; } - d_rem_carr_phase_rad_int = static_cast(roundf( - (fabs(d_rem_carrier_phase_in_rad_temp) / M_PI) * pow(2, PHASE_CARR_NBITS_FRAC))); + d_rem_carr_phase_rad_int = static_cast(roundf((fabs(d_rem_carrier_phase_in_rad_temp) / M_PI) * pow(2, PHASE_CARR_NBITS_FRAC))); if (d_rem_carrier_phase_in_rad_temp < 0) { d_rem_carr_phase_rad_int = -d_rem_carr_phase_rad_int; } - d_phase_step_rad_int = static_cast(roundf( - (fabs(d_phase_step_rad) / M_PI) * pow(2, PHASE_CARR_NBITS_FRAC))); // the FPGA accepts a range for the phase step between -pi and +pi + d_phase_step_rad_int = static_cast(roundf((fabs(d_phase_step_rad) / M_PI) * pow(2, PHASE_CARR_NBITS_FRAC))); // the FPGA accepts a range for the phase step between -pi and +pi if (d_phase_step_rad < 0) { diff --git a/src/algorithms/tracking/libs/fpga_multicorrelator.h b/src/algorithms/tracking/libs/fpga_multicorrelator.h index 1a44de781..df060c362 100644 --- a/src/algorithms/tracking/libs/fpga_multicorrelator.h +++ b/src/algorithms/tracking/libs/fpga_multicorrelator.h @@ -38,7 +38,6 @@ #define GNSS_SDR_FPGA_MULTICORRELATOR_8SC_H_ #include -#include #include // FPGA register addresses diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc index 366d628ae..fb429b7f4 100644 --- a/src/core/libs/gnss_sdr_supl_client.cc +++ b/src/core/libs/gnss_sdr_supl_client.cc @@ -32,10 +32,17 @@ */ #include "gnss_sdr_supl_client.h" +#include "GPS_L1_CA.h" +#include +#include +#include #include #include -#include -#include +#include // for pow +#include // for strcpy +#include // for exception +#include // for cerr +#include // for pair Gnss_Sdr_Supl_Client::Gnss_Sdr_Supl_Client() { diff --git a/src/core/libs/gnss_sdr_supl_client.h b/src/core/libs/gnss_sdr_supl_client.h index af78c9f16..478fe7127 100644 --- a/src/core/libs/gnss_sdr_supl_client.h +++ b/src/core/libs/gnss_sdr_supl_client.h @@ -38,7 +38,6 @@ extern "C" { #include "supl.h" } -#include "GPS_L1_CA.h" #include "agnss_ref_location.h" #include "agnss_ref_time.h" #include "galileo_almanac.h" @@ -54,9 +53,6 @@ extern "C" #include "gps_ephemeris.h" #include "gps_iono.h" #include "gps_utc_model.h" -#include -#include -#include #include #include #include diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index a9225792d..469960d47 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -143,6 +143,7 @@ target_link_libraries(core_receiver core_libs core_monitor PRIVATE + Boost::chrono Gflags::gflags Glog::glog signal_source_adapters diff --git a/src/core/receiver/control_message_factory.cc b/src/core/receiver/control_message_factory.cc index 435a9a6d6..566f884a4 100644 --- a/src/core/receiver/control_message_factory.cc +++ b/src/core/receiver/control_message_factory.cc @@ -30,9 +30,8 @@ #include "control_message_factory.h" #include - - -using google::LogMessage; +#include // for memcpy +#include // for operator<<, basic_ostream // Constructor ControlMessageFactory::ControlMessageFactory() = default; diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 37028109b..e92646586 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -35,6 +35,7 @@ #include "control_thread.h" #include "concurrent_map.h" #include "concurrent_queue.h" +#include "configuration_interface.h" #include "control_message_factory.h" #include "file_configuration.h" #include "galileo_almanac.h" @@ -45,36 +46,41 @@ #include "glonass_gnav_ephemeris.h" #include "glonass_gnav_utc_model.h" #include "gnss_flowgraph.h" +#include "gnss_satellite.h" #include "gnss_sdr_flags.h" -#include "gps_almanac.h" -#include "gps_ephemeris.h" -#include "gps_iono.h" -#include "gps_utc_model.h" -#include "pvt_interface.h" -#include "rtklib_conversions.h" -#include "rtklib_ephemeris.h" -#include "rtklib_rtkcmn.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "gps_acq_assist.h" // for Gps_Acq_Assist +#include "gps_almanac.h" // for Gps_Almanac +#include "gps_cnav_ephemeris.h" // for Gps_CNAV_Ephemeris +#include "gps_cnav_utc_model.h" // for Gps_CNAV_Utc_Model +#include "gps_ephemeris.h" // for Gps_Ephemeris +#include "gps_iono.h" // for Gps_Iono +#include "gps_utc_model.h" // for Gps_Utc_Model +#include "pvt_interface.h" // for PvtInterface +#include "rtklib.h" // for gtime_t, alm_t +#include "rtklib_conversions.h" // for alm_to_rtklib +#include "rtklib_ephemeris.h" // for alm2pos, eph2pos +#include "rtklib_rtkcmn.h" // for utc2gpst +#include // for bad_lexical_cast +#include // for LOG +#include // for message::sptr +#include // for make_any +#include // for find, min +#include // for milliseconds +#include // for floor, fmod, log +#include // for gmtime, strftime +#include // for exception +#include // for operator<<, endl +#include // for numeric_limits +#include // for map +#include // for pthread_cancel +#include // for invalid_argument +#include // for IPC_CREAT +#include // for msgctl, msgget extern Concurrent_Map global_gps_acq_assist_map; extern Concurrent_Queue global_gps_acq_assist_queue; -using google::LogMessage; - ControlThread::ControlThread() { diff --git a/src/core/receiver/control_thread.h b/src/core/receiver/control_thread.h index a1ecc5c1a..7d58226e9 100644 --- a/src/core/receiver/control_thread.h +++ b/src/core/receiver/control_thread.h @@ -35,20 +35,24 @@ #ifndef GNSS_SDR_CONTROL_THREAD_H_ #define GNSS_SDR_CONTROL_THREAD_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 "agnss_ref_location.h" // for Agnss_Ref_Location +#include "agnss_ref_time.h" // for Agnss_Ref_Time +#include "control_message_factory.h" // for ControlMessage +#include "gnss_sdr_supl_client.h" // for Gnss_Sdr_Supl_Client +#include "tcp_cmd_interface.h" // for TcpCmdInterface +#include // for arma::vec +#include // for boost::thread +#include // for msg_queue, msg_queue::sptr +#include // for time_t +#include // for shared_ptr +#include // for string +#include // for std::thread +#include // for pair +#include // for vector +class ConfigurationInterface; +class GNSSFlowgraph; +class Gnss_Satellite; /*! * \brief This class represents the main thread of the application, so the name is ControlThread. diff --git a/src/core/receiver/file_configuration.cc b/src/core/receiver/file_configuration.cc index 62992c074..be921ed3f 100644 --- a/src/core/receiver/file_configuration.cc +++ b/src/core/receiver/file_configuration.cc @@ -41,8 +41,6 @@ #include -using google::LogMessage; - FileConfiguration::FileConfiguration(std::string filename) { filename_ = std::move(filename); diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index 67c84eeea..33248408a 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -36,6 +36,7 @@ #include "gnss_block_factory.h" +#include "acquisition_interface.h" // for AcquisitionInterface #include "array_signal_conditioner.h" #include "beamformer_filter.h" #include "byte_to_short.h" @@ -108,8 +109,13 @@ #include "signal_conditioner.h" #include "spir_file_signal_source.h" #include "spir_gss6450_file_signal_source.h" +#include "telemetry_decoder_interface.h" +#include "tracking_interface.h" #include "two_bit_cpx_file_signal_source.h" #include "two_bit_packed_file_signal_source.h" +#include +#include // for exception +#include // for move #if RAW_UDP #include "custom_udp_signal_source.h" @@ -168,15 +174,6 @@ #include "gps_l1_ca_dll_pll_tracking_gpu.h" #endif -#include -#include -#include -#include -#include - - -using google::LogMessage; - GNSSBlockFactory::GNSSBlockFactory() = default; @@ -590,7 +587,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_5X( std::unique_ptr GNSSBlockFactory::GetChannel_1G( const std::shared_ptr& configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - boost::shared_ptr queue) + gr::msg_queue::sptr queue) { std::stringstream stream; stream << channel; @@ -658,7 +655,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( std::unique_ptr GNSSBlockFactory::GetChannel_2G( const std::shared_ptr& configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - boost::shared_ptr queue) + gr::msg_queue::sptr queue) { std::stringstream stream; stream << channel; diff --git a/src/core/receiver/gnss_block_factory.h b/src/core/receiver/gnss_block_factory.h index df47aeea8..cb7154591 100644 --- a/src/core/receiver/gnss_block_factory.h +++ b/src/core/receiver/gnss_block_factory.h @@ -37,10 +37,10 @@ #ifndef GNSS_SDR_BLOCK_FACTORY_H_ #define GNSS_SDR_BLOCK_FACTORY_H_ -#include -#include -#include -#include +#include // for msg_queue::sptr +#include // for unique_ptr, shared_ptr +#include // for string +#include // for vector class ConfigurationInterface; @@ -100,15 +100,15 @@ private: std::unique_ptr GetChannel_1G(const std::shared_ptr& configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - boost::shared_ptr queue); + gr::msg_queue::sptr queue); std::unique_ptr GetChannel_2G(const std::shared_ptr& configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - boost::shared_ptr queue); + gr::msg_queue::sptr queue); std::unique_ptr GetChannel_B1(const std::shared_ptr& configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, - boost::shared_ptr queue); + gr::msg_queue::sptr queue); std::unique_ptr GetChannel_B3(const std::shared_ptr& configuration, const std::string& acq, const std::string& trk, const std::string& tlm, int channel, diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index b5b49fe92..38a0cf7eb 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -42,16 +42,28 @@ #include "channel_interface.h" #include "configuration_interface.h" #include "gnss_block_factory.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "gnss_block_interface.h" +#include "gnss_satellite.h" +#include "gnss_synchro_monitor.h" +#include // for boost::lexical_cast +#include // for boost::shared_ptr +#include // for boost::tokenizer +#include // for LOG +#include // for basic_block +#include // for gr::filter::firdes +#include // for io_signature +#include // for top_block, make_top_block +#include // for mp +#include // for transform, sort, unique +#include // for floor +#include // for size_t +#include // for exception +#include // for operator<< +#include // for insert_iterator, inserter +#include // for set +#include // for invalid_argument +#include // for thread +#include // for move #ifdef GR_GREATER_38 #include #else @@ -61,7 +73,6 @@ #define GNSS_SDR_ARRAY_SIGNAL_CONDITIONER_CHANNELS 8 -using google::LogMessage; GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr configuration, const gr::msg_queue::sptr queue) // NOLINT(performance-unnecessary-value-param) { @@ -205,12 +216,11 @@ void GNSSFlowgraph::connect() DLOG(INFO) << "blocks connected internally"; // Signal Source (i) > Signal conditioner (i) > - int RF_Channels = 0; - int signal_conditioner_ID = 0; - #ifndef ENABLE_FPGA + int RF_Channels = 0; + int signal_conditioner_ID = 0; for (int i = 0; i < sources_count_; i++) { try @@ -357,12 +367,13 @@ 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++) { #ifndef ENABLE_FPGA + + 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); if (configuration_->property(sig_source_.at(0)->role() + ".enable_FPGA", false) == false) { try @@ -870,9 +881,11 @@ void GNSSFlowgraph::disconnect() } #endif // Signal conditioner (selected_signal_source) >> channels (i) (dependent of their associated SignalSource_ID) - int selected_signal_conditioner_ID; + for (unsigned int i = 0; i < channels_count_; i++) { +#ifndef ENABLE_FPGA + int selected_signal_conditioner_ID; try { selected_signal_conditioner_ID = configuration_->property("Channel" + std::to_string(i) + ".RF_channel_ID", 0); @@ -883,7 +896,6 @@ void GNSSFlowgraph::disconnect() top_block_->disconnect_all(); return; } -#ifndef ENABLE_FPGA try { top_block_->disconnect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0, diff --git a/src/core/receiver/gnss_flowgraph.h b/src/core/receiver/gnss_flowgraph.h index 250c052d6..189f34dca 100644 --- a/src/core/receiver/gnss_flowgraph.h +++ b/src/core/receiver/gnss_flowgraph.h @@ -37,29 +37,27 @@ #ifndef GNSS_SDR_GNSS_FLOWGRAPH_H_ #define GNSS_SDR_GNSS_FLOWGRAPH_H_ -#include "GPS_L1_CA.h" -#include "channel_interface.h" -#include "configuration_interface.h" -#include "gnss_block_factory.h" -#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 -#include -#include -#include -#include - +#include // for msg_queue, msg_queue::sptr +#include // for basic_block_sptr, top_block_sptr +#include // for pmt_t +#include // for list +#include // for map +#include // for for shared_ptr, dynamic_pointer_cast +#include // for mutex +#include // for string +#include // for pair +#include // for vector #if ENABLE_FPGA #include "gnss_sdr_fpga_sample_counter.h" #endif +class ChannelInterface; +class ConfigurationInterface; +class GNSSBlockInterface; +class Gnss_Satellite; /*! \brief This class represents a GNSS flow graph. * diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index 0096c26a1..f6f549735 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -31,9 +31,13 @@ #include "tcp_cmd_interface.h" #include "control_message_factory.h" -#include -#include -#include +#include "pvt_interface.h" +#include +#include // for isnan +#include // for exception +#include // for setprecision +#include // for stringstream +#include // for move TcpCmdInterface::TcpCmdInterface() diff --git a/src/core/receiver/tcp_cmd_interface.h b/src/core/receiver/tcp_cmd_interface.h index 2e75298ec..e5658a6d9 100644 --- a/src/core/receiver/tcp_cmd_interface.h +++ b/src/core/receiver/tcp_cmd_interface.h @@ -31,20 +31,18 @@ #ifndef GNSS_SDR_TCP_CMD_INTERFACE_H_ #define GNSS_SDR_TCP_CMD_INTERFACE_H_ -#include "pvt_interface.h" + #include -#include -#include #include -#include #include #include #include -#include +#include #include #include #include +class PvtInterface; class TcpCmdInterface { diff --git a/src/core/system_parameters/agnss_ref_location.h b/src/core/system_parameters/agnss_ref_location.h index 083305987..2fb96f6ea 100644 --- a/src/core/system_parameters/agnss_ref_location.h +++ b/src/core/system_parameters/agnss_ref_location.h @@ -32,7 +32,6 @@ #ifndef GNSS_SDR_AGNSS_REF_LOCATION_H_ #define GNSS_SDR_AGNSS_REF_LOCATION_H_ -#include #include diff --git a/src/core/system_parameters/agnss_ref_time.h b/src/core/system_parameters/agnss_ref_time.h index 574d9106a..e938ab013 100644 --- a/src/core/system_parameters/agnss_ref_time.h +++ b/src/core/system_parameters/agnss_ref_time.h @@ -32,7 +32,6 @@ #ifndef GNSS_SDR_AGNSS_REF_TIME_H_ #define GNSS_SDR_AGNSS_REF_TIME_H_ -#include #include diff --git a/src/core/system_parameters/beidou_dnav_almanac.h b/src/core/system_parameters/beidou_dnav_almanac.h index 6f5535464..8a53564d6 100644 --- a/src/core/system_parameters/beidou_dnav_almanac.h +++ b/src/core/system_parameters/beidou_dnav_almanac.h @@ -34,7 +34,6 @@ #define GNSS_SDR_BEIDOU_DNAV_ALMANAC_H_ #include -#include /*! diff --git a/src/core/system_parameters/beidou_dnav_navigation_message.cc b/src/core/system_parameters/beidou_dnav_navigation_message.cc index 771072312..6df684581 100644 --- a/src/core/system_parameters/beidou_dnav_navigation_message.cc +++ b/src/core/system_parameters/beidou_dnav_navigation_message.cc @@ -32,13 +32,8 @@ #include "beidou_dnav_navigation_message.h" #include "gnss_satellite.h" -#include // for boost::crc_basic, boost::crc_optimal -#include -#include -#include -#include -#include -#include +#include // for cos, sin, fmod, sqrt, atan2, fabs, floor +#include // for string, operator<<, cout, ostream, endl void Beidou_Dnav_Navigation_Message::reset() diff --git a/src/core/system_parameters/beidou_dnav_navigation_message.h b/src/core/system_parameters/beidou_dnav_navigation_message.h index 2770ba8fb..744a34e7f 100644 --- a/src/core/system_parameters/beidou_dnav_navigation_message.h +++ b/src/core/system_parameters/beidou_dnav_navigation_message.h @@ -42,6 +42,7 @@ #include "beidou_dnav_iono.h" #include "beidou_dnav_utc_model.h" #include +#include #include #include #include @@ -49,9 +50,7 @@ /*! - * \brief This class decodes a BeiDou D1 NAV Data message as described in IS-GPS-200E - * - * See http://www.gps.gov/technical/icwg/IS-GPS-200E.pdf Appendix II + * \brief This class decodes a BeiDou D1 NAV Data message */ class Beidou_Dnav_Navigation_Message { @@ -63,13 +62,17 @@ private: /* * Accounts for the beginning or end of week crossover * - * See paragraph 20.3.3.3.3.1 (IS-GPS-200E) * \param[in] - time in seconds * \param[out] - corrected time, in seconds */ double check_t(double time); public: + /*! + * Default constructor + */ + Beidou_Dnav_Navigation_Message(); + // System flags for data processing bool flag_eph_valid; bool flag_utc_model_valid; @@ -121,7 +124,7 @@ public: double d_Toe_sf2; //!< Ephemeris data reference time of week in subframe 2, D1 Message double d_Toe_sf3; //!< Ephemeris data reference time of week in subframe 3, D1 Message double d_Toe; //!< Ephemeris data reference time of week in subframe 1, D2 Message - double d_Toc; //!< clock data reference time (Ref. 20.3.3.3.3.1 IS-GPS-200E) [s] + double d_Toc; //!< clock data reference time [s] double d_Cic; //!< Amplitude of the Cosine Harmonic Correction Term to the Angle of Inclination [rad] double d_OMEGA0; //!< Longitude of Ascending Node of Orbit Plane at Weekly Epoch [semi-circles] double d_Cis; //!< Amplitude of the Sine Harmonic Correction Term to the Angle of Inclination [rad] @@ -131,7 +134,7 @@ public: double d_OMEGA; //!< Argument of Perigee [semi-cicles] double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] //broadcast orbit 5 - double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s] + double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s] int32_t i_BEIDOU_week; //!< BeiDou week number, aka WN [week] //broadcast orbit 6 int32_t i_SV_accuracy; //!< User Range Accuracy (URA) index of the SV @@ -169,7 +172,7 @@ public: uint64_t d_OMEGA_DOT_lsb_bits; //!< Rate of Right Ascension [semi-circles/s] // Almanac - double d_Toa; //!< Almanac reference time [s] + double d_Toa; //!< Almanac reference time [s] int32_t i_WN_A; //!< Modulo 256 of the GPS week number to which the almanac reference time (d_Toa) is referenced std::map almanacHealth; //!< Map that stores the health information stored in the almanac @@ -221,8 +224,8 @@ public: double d_beta3; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3] // UTC parameters - double d_A1UTC; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200E) [s/s] - double d_A0UTC; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200E) [s] + double d_A1UTC; //!< 1st order term of a model that relates GPS and UTC time [s/s] + double d_A0UTC; //!< Constant of a model that relates GPS and UTC time [s] double d_DeltaT_LS; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. int32_t i_WN_LSF; //!< Week number at the end of which the leap second becomes effective [weeks] int32_t i_DN; //!< Day number (DN) at the end of which the leap second becomes effective [days] @@ -252,26 +255,24 @@ public: double d_satvel_Y; //!< Earth-fixed velocity coordinate y of the satellite [m] double d_satvel_Z; //!< Earth-fixed velocity coordinate z of the satellite [m] - // public functions void reset(); /*! - * \brief Obtain a GPS SV Ephemeris class filled with current SV data + * \brief Obtain a BDS SV Ephemeris class filled with current SV data */ Beidou_Dnav_Ephemeris get_ephemeris(); /*! - * \brief Obtain a GPS ionospheric correction parameters class filled with current SV data + * \brief Obtain a BDS ionospheric correction parameters class filled with current SV data */ Beidou_Dnav_Iono get_iono(); /*! - * \brief Obtain a GPS UTC model parameters class filled with current SV data + * \brief Obtain a BDS UTC model parameters class filled with current SV data */ Beidou_Dnav_Utc_Model get_utc_model(); - /*! * \brief Decodes the BDS D1 NAV message */ @@ -284,20 +285,18 @@ public: /*! * \brief Computes the position of the satellite - * - * Implementation of Table 20-IV (IS-GPS-200E) */ void satellitePosition(double transmitTime); /*! * \brief Sets (\a d_satClkCorr) according to the User Algorithm for SV Clock Correction - * and returns the corrected clock (IS-GPS-200E, 20.3.3.3.3.1) + * and returns the corrected clock */ double sv_clock_correction(double transmitTime); /*! * \brief Computes the Coordinated Universal Time (UTC) and - * returns it in [s] (IS-GPS-200E, 20.3.3.5.2.4) + * returns it in [s] */ double utc_time(const double beidoutime_corrected) const; @@ -322,10 +321,6 @@ public: * \brief Returns true if new UTC model has arrived. The flag is set to false when the function is executed */ bool have_new_almanac(); - /*! - * Default constructor - */ - Beidou_Dnav_Navigation_Message(); }; #endif diff --git a/src/core/system_parameters/galileo_fnav_message.cc b/src/core/system_parameters/galileo_fnav_message.cc index 918b7e9c7..9dc6eb49e 100644 --- a/src/core/system_parameters/galileo_fnav_message.cc +++ b/src/core/system_parameters/galileo_fnav_message.cc @@ -38,8 +38,9 @@ #include // for boost::crc_basic, boost::crc_optimal #include #include -#include - +#include // for reverse +#include // for string, operator<< +#include // for back_insert_iterator using CRC_Galileo_FNAV_type = boost::crc_optimal<24, 0x1864CFBu, 0x0, 0x0, false, false>; @@ -487,13 +488,13 @@ bool Galileo_Fnav_Message::have_new_ephemeris() // Check if we have a new ephem // if all ephemeris pages have the same IOD, then they belong to the same block if ((FNAV_IODnav_1 == FNAV_IODnav_2) and (FNAV_IODnav_3 == FNAV_IODnav_4) and (FNAV_IODnav_1 == FNAV_IODnav_3)) { - std::cout << "Ephemeris (1, 2, 3) have been received and belong to the same batch" << std::endl; + DLOG(INFO) << "Ephemeris (1, 2, 3) have been received and belong to the same batch"; flag_ephemeris_1 = false; // clear the flag flag_ephemeris_2 = false; // clear the flag flag_ephemeris_3 = false; // clear the flag flag_all_ephemeris = true; IOD_ephemeris = FNAV_IODnav_1; - std::cout << "Batch number: " << IOD_ephemeris << std::endl; + DLOG(INFO) << "Batch number: " << IOD_ephemeris; return true; } } diff --git a/src/core/system_parameters/galileo_iono.h b/src/core/system_parameters/galileo_iono.h index ab36199c0..5fb5a3755 100644 --- a/src/core/system_parameters/galileo_iono.h +++ b/src/core/system_parameters/galileo_iono.h @@ -33,6 +33,7 @@ #define GNSS_SDR_GALILEO_IONO_H_ #include +#include /*! * \brief This class is a storage for the GALILEO IONOSPHERIC data as described in Galileo ICD paragraph 5.1.6 diff --git a/src/core/system_parameters/galileo_navigation_message.cc b/src/core/system_parameters/galileo_navigation_message.cc index 263294057..62fe2d243 100644 --- a/src/core/system_parameters/galileo_navigation_message.cc +++ b/src/core/system_parameters/galileo_navigation_message.cc @@ -31,10 +31,11 @@ */ #include "galileo_navigation_message.h" -#include // for boost::crc_basic, boost::crc_optimal -#include -#include -#include +#include // for boost::crc_basic, boost::crc_optimal +#include // for boost::dynamic_bitset +#include // for DLOG +#include // for reverse +#include // for operator<< using CRC_Galileo_INAV_type = boost::crc_optimal<24, 0x1864CFBu, 0x0, 0x0, false, false>; diff --git a/src/core/system_parameters/galileo_navigation_message.h b/src/core/system_parameters/galileo_navigation_message.h index cf1eb0a0f..6d8b0363a 100644 --- a/src/core/system_parameters/galileo_navigation_message.h +++ b/src/core/system_parameters/galileo_navigation_message.h @@ -40,7 +40,6 @@ #include "galileo_utc_model.h" #include #include -#include #include #include #include diff --git a/src/core/system_parameters/glonass_gnav_ephemeris.cc b/src/core/system_parameters/glonass_gnav_ephemeris.cc index 1e0941dd7..9059b5940 100644 --- a/src/core/system_parameters/glonass_gnav_ephemeris.cc +++ b/src/core/system_parameters/glonass_gnav_ephemeris.cc @@ -32,7 +32,8 @@ #include "glonass_gnav_ephemeris.h" #include "GLONASS_L1_L2_CA.h" -#include "gnss_satellite.h" +#include +#include #include diff --git a/src/core/system_parameters/glonass_gnav_ephemeris.h b/src/core/system_parameters/glonass_gnav_ephemeris.h index 6f53a992f..b5cf60f66 100644 --- a/src/core/system_parameters/glonass_gnav_ephemeris.h +++ b/src/core/system_parameters/glonass_gnav_ephemeris.h @@ -35,7 +35,7 @@ #define GNSS_SDR_GLONASS_GNAV_EPHEMERIS_H_ -#include +#include // for ptime #include #include diff --git a/src/core/system_parameters/glonass_gnav_navigation_message.cc b/src/core/system_parameters/glonass_gnav_navigation_message.cc index 4433efc8a..c3d4176cd 100644 --- a/src/core/system_parameters/glonass_gnav_navigation_message.cc +++ b/src/core/system_parameters/glonass_gnav_navigation_message.cc @@ -31,8 +31,11 @@ */ #include "glonass_gnav_navigation_message.h" +#include "MATH_CONSTANTS.h" // for TWO_N20, TWO_N30, TWO_N14, TWO_N15, TWO_N18 #include "gnss_satellite.h" #include +#include +#include // for operator<< void Glonass_Gnav_Navigation_Message::reset() diff --git a/src/core/system_parameters/glonass_gnav_navigation_message.h b/src/core/system_parameters/glonass_gnav_navigation_message.h index 6f1f92312..3c2af1243 100644 --- a/src/core/system_parameters/glonass_gnav_navigation_message.h +++ b/src/core/system_parameters/glonass_gnav_navigation_message.h @@ -41,6 +41,9 @@ #include "glonass_gnav_utc_model.h" #include #include +#include // for pair +#include // for vector +#include /*! diff --git a/src/core/system_parameters/gnss_satellite.h b/src/core/system_parameters/gnss_satellite.h index 064b34b2e..0e97c5ce3 100644 --- a/src/core/system_parameters/gnss_satellite.h +++ b/src/core/system_parameters/gnss_satellite.h @@ -34,6 +34,7 @@ #include #include +#include #include #include diff --git a/src/core/system_parameters/gps_cnav_ephemeris.cc b/src/core/system_parameters/gps_cnav_ephemeris.cc index cb96a8a73..6a6609366 100644 --- a/src/core/system_parameters/gps_cnav_ephemeris.cc +++ b/src/core/system_parameters/gps_cnav_ephemeris.cc @@ -31,8 +31,10 @@ */ #include "gps_cnav_ephemeris.h" +#include "MATH_CONSTANTS.h" // for PI, SPEED_OF_LIGHT #include + Gps_CNAV_Ephemeris::Gps_CNAV_Ephemeris() { i_satellite_PRN = 0U; diff --git a/src/core/system_parameters/gps_cnav_ephemeris.h b/src/core/system_parameters/gps_cnav_ephemeris.h index 5f39454ea..aed92612b 100644 --- a/src/core/system_parameters/gps_cnav_ephemeris.h +++ b/src/core/system_parameters/gps_cnav_ephemeris.h @@ -32,9 +32,8 @@ #ifndef GNSS_SDR_GPS_CNAV_EPHEMERIS_H_ #define GNSS_SDR_GPS_CNAV_EPHEMERIS_H_ -#include "GPS_CNAV.h" -#include #include +#include /*! diff --git a/src/core/system_parameters/gps_cnav_iono.h b/src/core/system_parameters/gps_cnav_iono.h index fa60b6a9b..ae4c57526 100644 --- a/src/core/system_parameters/gps_cnav_iono.h +++ b/src/core/system_parameters/gps_cnav_iono.h @@ -33,7 +33,6 @@ #define GNSS_SDR_GPS_CNAV_IONO_H_ -#include #include diff --git a/src/core/system_parameters/gps_cnav_utc_model.h b/src/core/system_parameters/gps_cnav_utc_model.h index 555c7c640..abe801cf9 100644 --- a/src/core/system_parameters/gps_cnav_utc_model.h +++ b/src/core/system_parameters/gps_cnav_utc_model.h @@ -32,7 +32,6 @@ #ifndef GNSS_SDR_GPS_CNAV_UTC_MODEL_H_ #define GNSS_SDR_GPS_CNAV_UTC_MODEL_H_ -#include #include #include diff --git a/src/core/system_parameters/gps_ephemeris.h b/src/core/system_parameters/gps_ephemeris.h index 683eb9135..e78b34207 100644 --- a/src/core/system_parameters/gps_ephemeris.h +++ b/src/core/system_parameters/gps_ephemeris.h @@ -33,8 +33,6 @@ #define GNSS_SDR_GPS_EPHEMERIS_H_ -#include -#include #include #include #include diff --git a/src/core/system_parameters/gps_iono.h b/src/core/system_parameters/gps_iono.h index 8a87e21d4..069fa20cb 100644 --- a/src/core/system_parameters/gps_iono.h +++ b/src/core/system_parameters/gps_iono.h @@ -33,7 +33,6 @@ #define GNSS_SDR_GPS_IONO_H_ -#include #include diff --git a/src/core/system_parameters/gps_navigation_message.cc b/src/core/system_parameters/gps_navigation_message.cc index e551551dc..8013d4d5f 100644 --- a/src/core/system_parameters/gps_navigation_message.cc +++ b/src/core/system_parameters/gps_navigation_message.cc @@ -32,8 +32,9 @@ m * \file gps_navigation_message.cc #include "gps_navigation_message.h" #include "gnss_satellite.h" -#include -#include +#include // for fmod, abs, floor +#include // for memcpy +#include // for operator<<, cout, endl void Gps_Navigation_Message::reset() diff --git a/src/core/system_parameters/gps_navigation_message.h b/src/core/system_parameters/gps_navigation_message.h index 1e79a02c9..21a4aa4cd 100644 --- a/src/core/system_parameters/gps_navigation_message.h +++ b/src/core/system_parameters/gps_navigation_message.h @@ -34,7 +34,6 @@ #include "GPS_L1_CA.h" -#include "gps_almanac.h" #include "gps_ephemeris.h" #include "gps_iono.h" #include "gps_utc_model.h" @@ -42,7 +41,7 @@ #include #include #include -#include +#include // for pair #include diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index ad785f0f0..4561b7119 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -27,7 +27,6 @@ target_link_libraries(gnss-sdr Glog::glog Threads::Threads core_receiver - gnss_sdr_flags ) target_compile_definitions(gnss-sdr PRIVATE -DGNSS_SDR_VERSION="${VERSION}") diff --git a/src/main/main.cc b/src/main/main.cc index 905a2670a..696ff412b 100644 --- a/src/main/main.cc +++ b/src/main/main.cc @@ -42,20 +42,20 @@ #include "concurrent_map.h" #include "concurrent_queue.h" #include "control_thread.h" -#include "gnss_sdr_flags.h" #include "gps_acq_assist.h" -#include -#include // for exception -#include // for create_directories, exists -#include // for path, operator<< -#include // for error_code -#include -#include -#include -#include -#include -#include -#include +#include // for diagnostic_informatio +#include // for exception +#include // for create_directories, exists +#include // for path, operator<< +#include // for error_code +#include // for thread_resource_error +#include // for ShutDownCommandLineFlags +#include // for FLAGS_log_dir +#include // for time_point +#include // for exception +#include // for operator<<, endl +#include // for unique_ptr +#include // for string #if CUDA_GPU_ACCEL // For the CUDA runtime routines (prefixed with "cuda_") @@ -63,9 +63,6 @@ #endif -using google::LogMessage; - - /* * Concurrent queues that communicates the Telemetry Decoder * to the Observables modules diff --git a/src/tests/common-files/gnuplot_i.h b/src/tests/common-files/gnuplot_i.h index afdc47c3a..2f5d7d979 100644 --- a/src/tests/common-files/gnuplot_i.h +++ b/src/tests/common-files/gnuplot_i.h @@ -2082,12 +2082,16 @@ bool Gnuplot::get_program_path() // Retrieves a C string containing the value of environment variable PATH path = std::getenv("PATH"); std::stringstream s; - s << path; + if (path != nullptr) + { + s << path; + } if (s.fail()) { - throw GnuplotException("Path is not set"); + throw GnuplotException("PATH is not well defined"); } - std::string path_str = s.str(); + std::string path_str; + path_str = s.str(); std::list ls; diff --git a/src/tests/single_test_main.cc b/src/tests/single_test_main.cc index 02814af09..aa981c48a 100644 --- a/src/tests/single_test_main.cc +++ b/src/tests/single_test_main.cc @@ -29,32 +29,20 @@ * ------------------------------------------------------------------------- */ -#include "agnss_ref_location.h" -#include "agnss_ref_time.h" + #include "concurrent_map.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_ephemeris.h" -#include "gps_navigation_message.h" -#include #include #include -#include #include -#include #include -#include Concurrent_Queue global_gps_acq_assist_queue; Concurrent_Map global_gps_acq_assist_map; -using google::LogMessage; - DECLARE_string(log_dir); int main(int argc, char **argv) diff --git a/src/tests/test_main.cc b/src/tests/test_main.cc index 47da084f0..c7a8d6304 100644 --- a/src/tests/test_main.cc +++ b/src/tests/test_main.cc @@ -31,35 +31,11 @@ #include "concurrent_map.h" #include "concurrent_queue.h" -#include "control_thread.h" -#include "galileo_almanac.h" -#include "galileo_ephemeris.h" -#include "galileo_iono.h" -#include "galileo_utc_model.h" -#include "glonass_gnav_almanac.h" -#include "glonass_gnav_ephemeris.h" -#include "glonass_gnav_utc_model.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 "sbas_ephemeris.h" -#include -#include +#include "gps_acq_assist.h" #include #include -#include #include -#include #include -#include -#include - - -using google::LogMessage; DECLARE_string(log_dir); @@ -74,7 +50,7 @@ DECLARE_string(log_dir); #include "unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc" #endif // EXTRA_TESTS -#else +#else // UNIT_TESTING_MINIMAL #include "unit-tests/arithmetic/matio_test.cc" #include "unit-tests/arithmetic/code_generation_test.cc" diff --git a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc index 72e12bcc0..bd87a3da7 100644 --- a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc +++ b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc @@ -29,6 +29,7 @@ * ------------------------------------------------------------------------- */ +#include "GPS_L1_CA.h" #include "gnss_signal_processing.h" #include #include 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 346e59e79..b9c692c4b 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,16 +31,6 @@ */ -#include -#include -#include -#include -#include -#ifdef GR_GREATER_38 -#include -#else -#include -#endif #include "fir_filter.h" #include "galileo_e1_pcps_ambiguous_acquisition.h" #include "gen_signal_source.h" @@ -50,8 +40,18 @@ #include "in_memory_configuration.h" #include "signal_generator.h" #include "signal_generator_c.h" +#include +#include #include #include +#include +#include +#include +#ifdef GR_GREATER_38 +#include +#else +#include +#endif // ######## 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 06ec5811c..591f7bf25 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,8 +41,18 @@ */ +#include "galileo_e1_pcps_ambiguous_acquisition.h" +#include "gnss_block_factory.h" +#include "gnss_block_interface.h" +#include "gnss_sdr_valve.h" +#include "gnss_signal.h" +#include "gnss_synchro.h" +#include "in_memory_configuration.h" #include #include +#include +#include +#include #include #include #include @@ -51,16 +61,6 @@ #else #include #endif -#include "galileo_e1_pcps_ambiguous_acquisition.h" -#include "gnss_block_factory.h" -#include "gnss_block_interface.h" -#include "gnss_sdr_valve.h" -#include "gnss_signal.h" -#include "gnss_synchro.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_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 f2229bc57..8c06a3419 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 @@ -60,8 +60,6 @@ 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"); -using google::LogMessage; - // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_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 f90407d0d..652384472 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,16 +29,6 @@ * ------------------------------------------------------------------------- */ -#include -#include -#include -#include -#include -#ifdef GR_GREATER_38 -#include -#else -#include -#endif #include "fir_filter.h" #include "galileo_e5a_noncoherent_iq_acquisition_caf.h" #include "gen_signal_source.h" @@ -49,9 +39,18 @@ #include "pass_through.h" #include "signal_generator.h" #include "signal_generator_c.h" +#include +#include #include #include - +#include +#include +#include +#ifdef GR_GREATER_38 +#include +#else +#include +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx; 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 d43aef640..58dd36719 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 @@ -46,6 +46,7 @@ #include #include #include +#include // for O_WRONLY #include #include #ifdef GR_GREATER_38 @@ -81,13 +82,16 @@ void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block, buffer_float = (char *)malloc(FLOAT_SIZE); // allocate space for the temporary buffer if (!buffer_float) { - fprintf(stderr, "Memory error!"); + std::cerr << "Memory error!" << std::endl; + return; } rx_signal_file = fopen(file_name, "rb"); // file containing the received signal if (!rx_signal_file) { - printf("Unable to open file!"); + std::cerr << "Unable to open file!" << std::endl; + free(buffer_float); + return; } // determine the length of the file that contains the received signal @@ -96,7 +100,6 @@ void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block, fseek(rx_signal_file, 0, SEEK_SET); // first step: check for the maximum value of the received signal - float max = 0; float *pointer_float; pointer_float = (float *)&buffer_float[0]; @@ -118,23 +121,27 @@ void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block, fseek(rx_signal_file, 0, SEEK_SET); // allocate memory for the samples to be transferred to the DMA - buffer_DMA = (signed char *)malloc(DMA_ACQ_TRANSFER_SIZE); if (!buffer_DMA) { - fprintf(stderr, "Memory error!"); + std::cerr << "Memory error!" << std::endl; + free(buffer_float); + fclose(rx_signal_file); + return; } // open the DMA descriptor dma_descr = open("/dev/loop_tx", O_WRONLY); if (dma_descr < 0) { - printf("can't open loop device\n"); - exit(1); + std::cerr << "Can't open loop device\n"; + free(buffer_float); + free(buffer_DMA); + fclose(rx_signal_file); + return; } // cycle through the file containing the received samples - for (int k = 0; k < NTIMES_CYCLE_THROUGH_RX_SAMPLES_FILE; k++) { fseek(rx_signal_file, 0, SEEK_SET); @@ -176,7 +183,6 @@ void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block, close(dma_descr); // when all the samples are sent stop the top block - top_block->stop(); } 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 db5e51af8..7dfcc5ea1 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 @@ -59,7 +59,6 @@ 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"); -using google::LogMessage; // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx; 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 89cbfad09..1d7580b96 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 @@ -30,6 +30,7 @@ #include "nmea_printer.h" +#include "rtklib_rtkpos.h" #include #include #include 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 d440cb905..1bce1e6b8 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 @@ -293,7 +293,7 @@ std::vector GpsL1CADllPllTrackingTest::check_results_doppler(arma::vec& err = meas_value - true_value_interp; - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector std::vector err_std_vector(err.colptr(0), err.colptr(0) + err.n_rows); arma::vec err2 = arma::square(err); @@ -344,7 +344,7 @@ std::vector GpsL1CADllPllTrackingTest::check_results_acc_carrier_phase(a //it is required to remove the initial offset in the accumulated carrier phase error err = (meas_value - meas_value(0)) - (true_value_interp - true_value_interp(0)); arma::vec err2 = arma::square(err); - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector std::vector err_std_vector(err.colptr(0), err.colptr(0) + err.n_rows); rmse = sqrt(arma::mean(err2)); @@ -392,7 +392,7 @@ std::vector GpsL1CADllPllTrackingTest::check_results_codephase(arma::vec arma::vec err; err = meas_value - true_value_interp; - //conversion between arma::vec and std:vector + // conversion between arma::vec and std:vector std::vector err_std_vector(err.colptr(0), err.colptr(0) + err.n_rows); arma::vec err2 = arma::square(err); @@ -424,10 +424,8 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) //************************************************* //***** STEP 2: Prepare the parameters sweep ****** //************************************************* - std::vector generator_CN0_values; - //data containers for config param sweep std::vector> mean_doppler_error_sweep; //swep config param and cn0 sweep std::vector> std_dev_doppler_error_sweep; //swep config param and cn0 sweep @@ -449,16 +447,13 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) double acq_doppler_hz = 0.0; Tracking_True_Obs_Reader true_obs_data; - // CONFIG PARAM SWEEP LOOP std::vector PLL_wide_bw_values; std::vector DLL_wide_bw_values; - //*********************************************************** //***** STEP 2: Tracking configuration parameters sweep ***** //*********************************************************** - if (FLAGS_PLL_bw_hz_start == FLAGS_PLL_bw_hz_stop) { if (FLAGS_DLL_bw_hz_start == FLAGS_DLL_bw_hz_stop) @@ -490,8 +485,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) //********************************************* //***** STEP 3: Generate the input signal ***** //********************************************* - - std::vector cno_vector; if (FLAGS_CN0_dBHz_start == FLAGS_CN0_dBHz_stop) { @@ -587,7 +580,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) true_obs_data.restart(); } - std::chrono::time_point start, end; top_block = gr::make_top_block("Tracking test"); @@ -625,7 +617,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) top_block->msg_connect(tracking->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events")); }) << "Failure connecting the blocks of tracking test."; - //******************************************************************** //***** STEP 5: Perform the signal tracking and read the results ***** //******************************************************************** @@ -643,8 +634,8 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) int tracking_last_msg = msg_rx->rx_message; //save last aasynchronous tracking message in order to detect a loss of lock - //check results - //load the measured values + // check results + // load the measured values Tracking_Dump_Reader trk_dump; ASSERT_EQ(trk_dump.open_obs_file(std::string("./tracking_ch_0.dat")), true) << "Failure opening tracking dump file"; @@ -736,7 +727,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) trk_Doppler_Hz = trk_Doppler_Hz.subvec(initial_meas_point(0), trk_Doppler_Hz.size() - 1); trk_prn_delay_chips = trk_prn_delay_chips.subvec(initial_meas_point(0), trk_prn_delay_chips.size() - 1); - double mean_error; double std_dev_error; double rmse; @@ -781,7 +771,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) std::cout << "Tracking output could not be used, possible loss of lock " << ex.what() << std::endl; } } - } //CN0 LOOP if (!FLAGS_enable_external_signal_file) @@ -898,7 +887,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) } } - //PLOT ERROR FIGURES (only if it is used the signal generator) + // PLOT ERROR FIGURES (only if it is used the signal generator) if (!FLAGS_enable_external_signal_file) { if (FLAGS_plot_detail_level >= 1) @@ -917,7 +906,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) g5.set_xlabel("Time [s]"); g5.set_ylabel("Code delay error [Chips]"); - for (unsigned int current_cn0_idx = 0; current_cn0_idx < generator_CN0_values_sweep_copy.at(config_idx).size(); current_cn0_idx++) { try @@ -952,7 +940,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) g5b.set_xlabel("Time [s]"); g5b.set_ylabel("Code delay error [meters]"); - for (unsigned int current_cn0_idx = 0; current_cn0_idx < generator_CN0_values_sweep_copy.at(config_idx).size(); current_cn0_idx++) { try @@ -973,7 +960,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) g5b.savetops("Code_error_meters"); g5b.savetopdf("Code_error_meters", 18); - Gnuplot g6("points"); if (FLAGS_show_plots) { @@ -988,7 +974,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) g6.set_xlabel("Time [s]"); g6.set_ylabel("Accumulated carrier phase error [Cycles]"); - for (unsigned int current_cn0_idx = 0; current_cn0_idx < generator_CN0_values_sweep_copy.at(config_idx).size(); current_cn0_idx++) { try @@ -1064,7 +1049,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) if (generator_CN0_values.size() > 1) { //plot metrics - Gnuplot g7("linespoints"); if (FLAGS_show_plots) { @@ -1098,7 +1082,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) g7.savetops("Doppler_error_metrics"); g7.savetopdf("Doppler_error_metrics", 18); - Gnuplot g8("linespoints"); g8.set_title("Accumulated carrier phase error metrics (PRN #" + std::to_string(FLAGS_test_satellite_PRN) + ")"); g8.set_grid(); @@ -1155,6 +1138,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) } } + bool GpsL1CADllPllTrackingTest::save_mat_xy(std::vector& x, std::vector& y, std::string filename) { try 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 b492e7d21..9ca2cd870 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 @@ -79,14 +79,16 @@ void send_tracking_gps_input_samples(FILE *rx_signal_file, dma_descr = open("/dev/loop_tx", O_WRONLY); if (dma_descr < 0) { - printf("can't open loop device\n"); - exit(1); + std::cerr << "Can't open loop device\n"; + return; } buffer_DMA = (char *)malloc(DMA_TRACK_TRANSFER_SIZE); if (!buffer_DMA) { - fprintf(stderr, "Memory error!"); + std::cerr << "Memory error!" << std::endl; + close(dma_descr); + return; } while (num_remaining_samples > 0) @@ -140,7 +142,8 @@ void sending_thread(gr::top_block_sptr top_block, const char *file_name) rx_signal_file = fopen(file_name, "rb"); if (!rx_signal_file) { - printf("Unable to open file!"); + std::cerr << "Unable to open file!" << std::endl; + return; } fseek(rx_signal_file, 0, SEEK_END); @@ -335,7 +338,7 @@ void GpsL1CADllPllTrackingTestFpga::configure_receiver() void GpsL1CADllPllTrackingTestFpga::check_results_doppler(arma::vec &true_time_s, arma::vec &true_value, arma::vec &meas_time_s, arma::vec &meas_value) { - //1. True value interpolation to match the measurement times + // 1. True value interpolation to match the measurement times arma::vec true_value_interp; arma::uvec true_time_s_valid = find(true_time_s > 0); true_time_s = true_time_s(true_time_s_valid); @@ -345,22 +348,21 @@ void GpsL1CADllPllTrackingTestFpga::check_results_doppler(arma::vec &true_time_s meas_value = meas_value(meas_time_s_valid); arma::interp1(true_time_s, true_value, meas_time_s, true_value_interp); - //2. RMSE + // 2. RMSE arma::vec err; - err = meas_value - true_value_interp; arma::vec err2 = arma::square(err); double rmse = sqrt(arma::mean(err2)); - //3. Mean err and variance + // 3. Mean err and variance double error_mean = arma::mean(err); double error_var = arma::var(err); - // 5. Peaks + // 4. Peaks double max_error = arma::max(err); double min_error = arma::min(err); - //5. report + // 5. report std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(10) << "TRK Doppler RMSE=" << rmse << ", mean=" << error_mean << ", stdev=" << sqrt(error_var) @@ -384,14 +386,14 @@ void GpsL1CADllPllTrackingTestFpga::check_results_acc_carrier_phase( meas_value = meas_value(meas_time_s_valid); arma::interp1(true_time_s, true_value, meas_time_s, true_value_interp); - //2. RMSE + // 2. RMSE arma::vec err; err = meas_value - true_value_interp; arma::vec err2 = arma::square(err); double rmse = sqrt(arma::mean(err2)); - //3. Mean err and variance + // 3. Mean err and variance double error_mean = arma::mean(err); double error_var = arma::var(err); @@ -399,7 +401,7 @@ void GpsL1CADllPllTrackingTestFpga::check_results_acc_carrier_phase( double max_error = arma::max(err); double min_error = arma::min(err); - //5. report + // 5. report std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(10) << "TRK acc carrier phase RMSE=" << rmse << ", mean=" << error_mean << ", stdev=" << sqrt(error_var) @@ -413,7 +415,7 @@ void GpsL1CADllPllTrackingTestFpga::check_results_codephase( arma::vec &true_time_s, arma::vec &true_value, arma::vec &meas_time_s, arma::vec &meas_value) { - //1. True value interpolation to match the measurement times + // 1. True value interpolation to match the measurement times arma::vec true_value_interp; arma::uvec true_time_s_valid = find(true_time_s > 0); true_time_s = true_time_s(true_time_s_valid); @@ -423,13 +425,13 @@ void GpsL1CADllPllTrackingTestFpga::check_results_codephase( meas_value = meas_value(meas_time_s_valid); arma::interp1(true_time_s, true_value, meas_time_s, true_value_interp); - //2. RMSE + // 2. RMSE arma::vec err; err = meas_value - true_value_interp; arma::vec err2 = arma::square(err); double rmse = sqrt(arma::mean(err2)); - //3. Mean err and variance + // 3. Mean err and variance double error_mean = arma::mean(err); double error_var = arma::var(err); @@ -437,7 +439,7 @@ void GpsL1CADllPllTrackingTestFpga::check_results_codephase( double max_error = arma::max(err); double min_error = arma::min(err); - //5. report + // 5. report std::streamsize ss = std::cout.precision(); std::cout << std::setprecision(10) << "TRK code phase RMSE=" << rmse << ", mean=" << error_mean << ", stdev=" << sqrt(error_var) @@ -459,7 +461,7 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga) configure_receiver(); - //open true observables log file written by the simulator + // open true observables log file written by the simulator Tracking_True_Obs_Reader true_obs_data; int test_satellite_PRN = FLAGS_test_satellite_PRN; std::cout << "Testing satellite PRN=" << test_satellite_PRN << std::endl; @@ -491,7 +493,7 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga) }) << "Failure reading true observables file"; - //restart the epoch counter + // restart the epoch counter true_obs_data.restart(); std::cout << "Initial Doppler [Hz]=" << true_obs_data.doppler_l1_hz @@ -550,8 +552,8 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga) // wait until child thread terminates t.join(); - //check results - //load the true values + // check results + // load the true values int64_t nepoch = true_obs_data.num_epochs(); std::cout << "True observation epochs=" << nepoch << std::endl; @@ -572,7 +574,7 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga) epoch_counter++; } - //load the measured values + // load the measured values Tracking_Dump_Reader trk_dump; ASSERT_NO_THROW( { @@ -604,7 +606,7 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga) epoch_counter++; } - //Align initial measurements and cut the tracking pull-in transitory + // Align initial measurements and cut the tracking pull-in transitory double pull_in_offset_s = 1.0; arma::uvec initial_meas_point = arma::find(trk_timestamp_s >= (true_timestamp_s(0) + pull_in_offset_s), 1, "first"); diff --git a/src/utils/front-end-cal/front_end_cal.cc b/src/utils/front-end-cal/front_end_cal.cc index 58e38e067..781576efd 100644 --- a/src/utils/front-end-cal/front_end_cal.cc +++ b/src/utils/front-end-cal/front_end_cal.cc @@ -30,6 +30,7 @@ */ #include "front_end_cal.h" +#include "concurrent_map.h" #include "gnss_sdr_supl_client.h" #include "gps_almanac.h" #include "gps_cnav_ephemeris.h" diff --git a/src/utils/front-end-cal/front_end_cal.h b/src/utils/front-end-cal/front_end_cal.h index 261043461..551377ebd 100644 --- a/src/utils/front-end-cal/front_end_cal.h +++ b/src/utils/front-end-cal/front_end_cal.h @@ -32,7 +32,6 @@ #ifndef GNSS_SDR_FRONT_END_CAL_H_ #define GNSS_SDR_FRONT_END_CAL_H_ -#include "concurrent_map.h" #include "file_configuration.h" #include diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index 6d9380cb4..b0dc512a5 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -77,8 +77,6 @@ #include -using google::LogMessage; - DECLARE_string(log_dir); Concurrent_Map global_gps_ephemeris_map; diff --git a/src/utils/matlab/hybrid_observables_plot_sample.m b/src/utils/matlab/hybrid_observables_plot_sample.m index 4cb5842c9..2a8a784e5 100644 --- a/src/utils/matlab/hybrid_observables_plot_sample.m +++ b/src/utils/matlab/hybrid_observables_plot_sample.m @@ -29,8 +29,8 @@ clearvars; close all; addpath('./libs'); -samplingFreq = 10000000; %[Hz] -channels=18; +samplingFreq = 25000000; %[Hz] +channels=10; path='/home/dmiralles/Documents/gnss-sdr/'; observables_log_path=[path 'observables.dat']; GNSS_observables= read_hybrid_observables_dump(channels,observables_log_path); diff --git a/src/utils/rinex2assist/main.cc b/src/utils/rinex2assist/main.cc index f23b58ed7..c0d7f7a45 100644 --- a/src/utils/rinex2assist/main.cc +++ b/src/utils/rinex2assist/main.cc @@ -30,7 +30,7 @@ */ -#include "galileo_ephemeris.h" +#include "galileo_ephemeris.h" // IWYU pragma: keep #include "galileo_iono.h" #include "galileo_utc_model.h" #include "gps_ephemeris.h" @@ -45,6 +45,7 @@ #include #include #include +#include // for size_t #include #include