diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index add1f38ed..9ec599576 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -1212,7 +1212,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) { d_user_pvt_solver->gps_iono = *gps_iono; } - DLOG(INFO) << "New IONO record has arrived "; + DLOG(INFO) << "New IONO record has arrived"; } else if (msg_type_hash_code == d_gps_utc_model_sptr_type_hash_code) { @@ -1223,7 +1223,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) { d_user_pvt_solver->gps_utc_model = *gps_utc_model; } - DLOG(INFO) << "New UTC record has arrived "; + DLOG(INFO) << "New UTC record has arrived"; } else if (msg_type_hash_code == d_gps_cnav_ephemeris_sptr_type_hash_code) { @@ -1263,7 +1263,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) << " does not report a healthy status in the CNAV message," << " use PVT solutions at your own risk.\n"; } - DLOG(INFO) << "New GPS CNAV ephemeris record has arrived "; + DLOG(INFO) << "New GPS CNAV ephemeris record has arrived"; } else if (msg_type_hash_code == d_gps_cnav_iono_sptr_type_hash_code) { @@ -1274,7 +1274,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) { d_user_pvt_solver->gps_cnav_iono = *gps_cnav_iono; } - DLOG(INFO) << "New CNAV IONO record has arrived "; + DLOG(INFO) << "New CNAV IONO record has arrived"; } else if (msg_type_hash_code == d_gps_cnav_utc_model_sptr_type_hash_code) { @@ -1284,7 +1284,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) { d_user_pvt_solver->gps_cnav_utc_model = *gps_cnav_utc_model; } - DLOG(INFO) << "New CNAV UTC record has arrived "; + DLOG(INFO) << "New CNAV UTC record has arrived"; } else if (msg_type_hash_code == d_gps_almanac_sptr_type_hash_code) @@ -1296,7 +1296,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) { d_user_pvt_solver->gps_almanac_map[gps_almanac->PRN] = *gps_almanac; } - DLOG(INFO) << "New GPS almanac record has arrived "; + DLOG(INFO) << "New GPS almanac record has arrived"; } // *********************** Galileo telemetry *********************** @@ -1359,7 +1359,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) { d_user_pvt_solver->galileo_iono = *galileo_iono; } - DLOG(INFO) << "New IONO record has arrived "; + DLOG(INFO) << "New IONO record has arrived"; } else if (msg_type_hash_code == d_galileo_utc_model_sptr_type_hash_code) { @@ -1370,7 +1370,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) { d_user_pvt_solver->galileo_utc_model = *galileo_utc_model; } - DLOG(INFO) << "New UTC record has arrived "; + DLOG(INFO) << "New UTC record has arrived"; } else if (msg_type_hash_code == d_galileo_almanac_helper_sptr_type_hash_code) { @@ -1404,7 +1404,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) d_user_pvt_solver->galileo_almanac_map[sv3.PRN] = sv3; } } - DLOG(INFO) << "New Galileo Almanac data have arrived "; + DLOG(INFO) << "New Galileo Almanac data have arrived"; } else if (msg_type_hash_code == d_galileo_almanac_sptr_type_hash_code) { @@ -1467,7 +1467,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) { d_user_pvt_solver->glonass_gnav_utc_model = *glonass_gnav_utc_model; } - DLOG(INFO) << "New GLONASS GNAV UTC record has arrived "; + DLOG(INFO) << "New GLONASS GNAV UTC record has arrived"; } else if (msg_type_hash_code == d_glonass_gnav_almanac_sptr_type_hash_code) { @@ -1478,7 +1478,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) { d_user_pvt_solver->glonass_gnav_almanac = *glonass_gnav_almanac; } - DLOG(INFO) << "New GLONASS GNAV Almanac has arrived " + DLOG(INFO) << "New GLONASS GNAV Almanac has arrived" << ", GLONASS GNAV Slot Number =" << glonass_gnav_almanac->d_n_A; } @@ -1535,7 +1535,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) { d_user_pvt_solver->beidou_dnav_iono = *bds_dnav_iono; } - DLOG(INFO) << "New BeiDou DNAV IONO record has arrived "; + DLOG(INFO) << "New BeiDou DNAV IONO record has arrived"; } else if (msg_type_hash_code == d_beidou_dnav_utc_model_sptr_type_hash_code) { @@ -1546,7 +1546,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) { d_user_pvt_solver->beidou_dnav_utc_model = *bds_dnav_utc_model; } - DLOG(INFO) << "New BeiDou DNAV UTC record has arrived "; + DLOG(INFO) << "New BeiDou DNAV UTC record has arrived"; } else if (msg_type_hash_code == d_beidou_dnav_almanac_sptr_type_hash_code) { @@ -1557,7 +1557,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg) { d_user_pvt_solver->beidou_dnav_almanac_map[bds_dnav_almanac->PRN] = *bds_dnav_almanac; } - DLOG(INFO) << "New BeiDou DNAV almanac record has arrived "; + DLOG(INFO) << "New BeiDou DNAV almanac record has arrived"; } else { @@ -1968,7 +1968,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item { if (pmt::any_ref(it.value).type().hash_code() == typeid(const std::shared_ptr).hash_code()) { - const auto timetag = boost::any_cast>(pmt::any_ref(it.value)); + const auto timetag = wht::any_cast>(pmt::any_ref(it.value)); // std::cout << "PVT timetag: " << timetag->rx_time << '\n'; d_TimeChannelTagTimestamps.push(*timetag); } @@ -1977,7 +1977,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item std::cout << "hash code not match\n"; } } - catch (const boost::bad_any_cast& e) + catch (const wht::bad_any_cast& e) { std::cout << "msg Bad any_cast: " << e.what(); } diff --git a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt index 192e307c9..3a27a58d4 100644 --- a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt @@ -34,6 +34,7 @@ target_link_libraries(obs_gr_blocks Gflags::gflags Glog::glog Matio::matio + Gnuradio::pmt ) if(GNURADIO_USES_SPDLOG) diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc index d687694f4..82b86fc9e 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_gs.cc @@ -26,6 +26,7 @@ #include #include #include +#include #include // for std::min #include #include // for round @@ -694,7 +695,7 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused) { if (pmt::any_ref(it.value).type().hash_code() == typeid(const std::shared_ptr).hash_code()) { - const auto timetag = boost::any_cast>(pmt::any_ref(it.value)); + const auto timetag = wht::any_cast>(pmt::any_ref(it.value)); // std::cout << "[Time ch ] timetag: " << timetag->rx_time << "\n"; d_TimeChannelTagTimestamps.push(*timetag); } @@ -703,7 +704,7 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused) std::cout << "hash code not match\n"; } } - catch (const boost::bad_any_cast &e) + catch (const wht::bad_any_cast &e) { std::cout << "msg Bad any_cast: " << e.what(); } @@ -725,7 +726,7 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused) // { // if (pmt::any_ref(it->value).type().hash_code() == typeid(const std::shared_ptr).hash_code()) // { - // const std::shared_ptr timetag = boost::any_cast>(pmt::any_ref(it->value)); + // const std::shared_ptr timetag = wht::any_cast>(pmt::any_ref(it->value)); // //std::cout << "[ch " << n << "] timetag: " << timetag->rx_time << "\n"; // d_SourceTagTimestamps.at(n).push(*timetag); // } @@ -734,7 +735,7 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused) // std::cout << "hash code not match\n"; // } // } - // catch (const boost::bad_any_cast &e) + // catch (const wht::bad_any_cast &e) // { // std::cout << "msg Bad any_cast: " << e.what(); // } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc index e73bba790..b44dc0abc 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_gs.cc @@ -51,6 +51,13 @@ auto rotl = [](uint32_t x, uint32_t n) { return (((x) << (n)) ^ ((x) >> (32 - (n } // namespace my_rotl #endif +#if PMT_USES_BOOST_ANY +#include +namespace wht = boost; +#else +#include +namespace wht = std; +#endif gps_l1_ca_telemetry_decoder_gs_sptr gps_l1_ca_make_telemetry_decoder_gs(const Gnss_Satellite &satellite, const Tlm_Conf &conf) @@ -605,7 +612,7 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__ { if (pmt::any_ref(it.value).type().hash_code() == typeid(const std::shared_ptr).hash_code()) { - const auto timetag = boost::any_cast>(pmt::any_ref(it.value)); + const auto timetag = wht::any_cast>(pmt::any_ref(it.value)); // std::cout << "[" << this->nitems_written(0) + 1 << "] TLM RX TimeTag Week: " << timetag->week << ", TOW: " << timetag->tow_ms << " [ms], TOW fraction: " << timetag->tow_ms_fraction // << " [ms], DELTA TLM TOW: " << static_cast(timetag->tow_ms - current_symbol.TOW_at_current_symbol_ms) + timetag->tow_ms_fraction << " [ms] \n"; add_item_tag(0, this->nitems_written(0) + 1, pmt::mp("timetag"), pmt::make_any(timetag)); @@ -615,12 +622,11 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__ std::cout << "hash code not match\n"; } } - catch (const boost::bad_any_cast &e) + catch (const wht::bad_any_cast &e) { std::cout << "msg Bad any_cast: " << e.what(); } } - if (d_dump == true) { // MULTIPLEXED FILE RECORDING - Record results to file 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 81f56c3fc..aa0f23e63 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -2024,7 +2024,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) { // std::cout << "ch[" << d_acquisition_gnss_synchro->Channel_ID << "] tracking time tag with offset " << it->offset << " vs. counter " << d_sample_counter << " vs. nread " << this->nitems_read(0) << " containing "; // std::cout << "ch[" << d_acquisition_gnss_synchro->Channel_ID << "] tracking time tag with offset " << it->offset << " vs. nread " << this->nitems_read(0) << " containing "; - const auto last_timetag = boost::any_cast>(pmt::any_ref(it.value)); + const auto last_timetag = wht::any_cast>(pmt::any_ref(it.value)); d_last_timetag = *last_timetag; d_last_timetag_samplecounter = it.offset; d_timetag_waiting = true; @@ -2034,7 +2034,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused) std::cout << "hash code not match\n"; } } - catch (const boost::bad_any_cast &e) + catch (const wht::bad_any_cast &e) { std::cout << "msg Bad any_cast: " << e.what(); } diff --git a/src/core/libs/CMakeLists.txt b/src/core/libs/CMakeLists.txt index c04d19695..7b4a271cb 100644 --- a/src/core/libs/CMakeLists.txt +++ b/src/core/libs/CMakeLists.txt @@ -83,6 +83,7 @@ endif() target_link_libraries(core_libs PUBLIC + Boost::headers Gnuradio::blocks Gnuradio::runtime Gnuradio::pmt diff --git a/src/core/libs/gnss_sdr_sample_counter.cc b/src/core/libs/gnss_sdr_sample_counter.cc index c3011081f..e41de7043 100644 --- a/src/core/libs/gnss_sdr_sample_counter.cc +++ b/src/core/libs/gnss_sdr_sample_counter.cc @@ -27,6 +27,13 @@ #include // for string #include +#if PMT_USES_BOOST_ANY +#include +namespace wht = boost; +#else +#include +namespace wht = std; +#endif gnss_sdr_sample_counter::gnss_sdr_sample_counter( double _fs, @@ -156,7 +163,7 @@ int gnss_sdr_sample_counter::work(int noutput_items __attribute__((unused)), { // recompute timestamp to match the last sample in the consumed samples in this batch int64_t diff_samplecount = uint64diff(out[0].Tracking_sample_counter, it.offset); - const auto last_timetag = boost::any_cast>(pmt::any_ref(it.value)); + const auto last_timetag = wht::any_cast>(pmt::any_ref(it.value)); double intpart; last_timetag->tow_ms_fraction += modf(1000.0 * static_cast(diff_samplecount) / fs, &intpart); @@ -172,7 +179,7 @@ int gnss_sdr_sample_counter::work(int noutput_items __attribute__((unused)), std::cout << "hash code not match\n"; } } - catch (const boost::bad_any_cast &e) + catch (const wht::bad_any_cast &e) { std::cout << "msg Bad any_cast: " << e.what(); }