1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-13 19:50:34 +00:00

Fix building against latest GNU Radio

Replace boost::any by std::any
This commit is contained in:
Carles Fernandez 2021-10-30 05:43:22 +02:00
parent 2fc172c0f0
commit a7a140862b
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
56 changed files with 448 additions and 95 deletions

View File

@ -661,7 +661,9 @@ if(NOT (GNURADIO_VERSION VERSION_LESS 3.8) AND LOG4CPP_READY_FOR_CXX17)
endif()
endif()
endif()
if((NOT PMT_USES_BOOST_ANY) AND (CMAKE_CXX_STANDARD VERSION_LESS 17))
message(FATAL_ERROR "GNU Radio v${GNURADIO_VERSION} requires C++17. Please update your environment.")
endif()
################################################################################

View File

@ -377,6 +377,20 @@ if(GNURADIO_VERSION VERSION_GREATER 3.8.99)
endif()
endif()
# Check if PMT uses boost::any or std::any
if(GNURADIO_PMT_INCLUDE_DIRS)
file(STRINGS ${GNURADIO_PMT_INCLUDE_DIRS}/pmt/pmt.h _pmt_content)
set(_uses_boost TRUE)
foreach(_loop_var IN LISTS _pmt_content)
string(STRIP "${_loop_var}" _file_line)
if("#include <any>" STREQUAL "${_file_line}")
set(_uses_boost FALSE)
endif()
endforeach()
if(${_uses_boost})
set(PMT_USES_BOOST_ANY TRUE)
endif()
endif()
set_package_properties(GNURADIO PROPERTIES
URL "https://www.gnuradio.org/"

View File

@ -58,6 +58,13 @@ else()
)
endif()
if(PMT_USES_BOOST_ANY)
target_compile_definitions(pvt_gr_blocks
PRIVATE
-DPMT_USES_BOOST_ANY=1
)
endif()
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(pvt_gr_blocks

View File

@ -56,7 +56,6 @@
#include "rtcm_printer.h"
#include "rtklib_rtkcmn.h"
#include "rtklib_solver.h"
#include <boost/any.hpp> // for any_cast, any
#include <boost/archive/xml_iarchive.hpp> // for xml_iarchive
#include <boost/archive/xml_oarchive.hpp> // for xml_oarchive
#include <boost/exception/diagnostic_information.hpp>
@ -94,6 +93,13 @@ namespace bc = boost::math;
namespace bc = boost::integer;
#endif
#if PMT_USES_BOOST_ANY
#include <boost/any.hpp>
namespace wht = boost;
#else
#include <any>
namespace wht = std;
#endif
rtklib_pvt_gs_sptr rtklib_make_pvt_gs(uint32_t nchannels,
const Pvt_Conf& conf_,
@ -1115,7 +1121,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
if (msg_type_hash_code == d_gps_ephemeris_sptr_type_hash_code)
{
// ### GPS EPHEMERIS ###
const auto gps_eph = boost::any_cast<std::shared_ptr<Gps_Ephemeris>>(pmt::any_ref(msg));
const auto gps_eph = wht::any_cast<std::shared_ptr<Gps_Ephemeris>>(pmt::any_ref(msg));
DLOG(INFO) << "Ephemeris record has arrived from SAT ID "
<< gps_eph->PRN << " (Block "
<< gps_eph->satelliteBlock[gps_eph->PRN] << ")"
@ -1165,7 +1171,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
else if (msg_type_hash_code == d_gps_iono_sptr_type_hash_code)
{
// ### GPS IONO ###
const auto gps_iono = boost::any_cast<std::shared_ptr<Gps_Iono>>(pmt::any_ref(msg));
const auto gps_iono = wht::any_cast<std::shared_ptr<Gps_Iono>>(pmt::any_ref(msg));
d_internal_pvt_solver->gps_iono = *gps_iono;
if (d_enable_rx_clock_correction == true)
{
@ -1176,7 +1182,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
else if (msg_type_hash_code == d_gps_utc_model_sptr_type_hash_code)
{
// ### GPS UTC MODEL ###
const auto gps_utc_model = boost::any_cast<std::shared_ptr<Gps_Utc_Model>>(pmt::any_ref(msg));
const auto gps_utc_model = wht::any_cast<std::shared_ptr<Gps_Utc_Model>>(pmt::any_ref(msg));
d_internal_pvt_solver->gps_utc_model = *gps_utc_model;
if (d_enable_rx_clock_correction == true)
{
@ -1187,7 +1193,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
else if (msg_type_hash_code == d_gps_cnav_ephemeris_sptr_type_hash_code)
{
// ### GPS CNAV message ###
const auto gps_cnav_ephemeris = boost::any_cast<std::shared_ptr<Gps_CNAV_Ephemeris>>(pmt::any_ref(msg));
const auto gps_cnav_ephemeris = wht::any_cast<std::shared_ptr<Gps_CNAV_Ephemeris>>(pmt::any_ref(msg));
// update/insert new ephemeris record to the global ephemeris map
if (d_rinex_output_enabled && d_rp->is_rinex_header_written()) // The header is already written, we can now log the navigation message data
{
@ -1226,7 +1232,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
else if (msg_type_hash_code == d_gps_cnav_iono_sptr_type_hash_code)
{
// ### GPS CNAV IONO ###
const auto gps_cnav_iono = boost::any_cast<std::shared_ptr<Gps_CNAV_Iono>>(pmt::any_ref(msg));
const auto gps_cnav_iono = wht::any_cast<std::shared_ptr<Gps_CNAV_Iono>>(pmt::any_ref(msg));
d_internal_pvt_solver->gps_cnav_iono = *gps_cnav_iono;
if (d_enable_rx_clock_correction == true)
{
@ -1237,7 +1243,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
else if (msg_type_hash_code == d_gps_cnav_utc_model_sptr_type_hash_code)
{
// ### GPS CNAV UTC MODEL ###
const auto gps_cnav_utc_model = boost::any_cast<std::shared_ptr<Gps_CNAV_Utc_Model>>(pmt::any_ref(msg));
const auto gps_cnav_utc_model = wht::any_cast<std::shared_ptr<Gps_CNAV_Utc_Model>>(pmt::any_ref(msg));
d_internal_pvt_solver->gps_cnav_utc_model = *gps_cnav_utc_model;
{
d_user_pvt_solver->gps_cnav_utc_model = *gps_cnav_utc_model;
@ -1248,7 +1254,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
else if (msg_type_hash_code == d_gps_almanac_sptr_type_hash_code)
{
// ### GPS ALMANAC ###
const auto gps_almanac = boost::any_cast<std::shared_ptr<Gps_Almanac>>(pmt::any_ref(msg));
const auto gps_almanac = wht::any_cast<std::shared_ptr<Gps_Almanac>>(pmt::any_ref(msg));
d_internal_pvt_solver->gps_almanac_map[gps_almanac->PRN] = *gps_almanac;
if (d_enable_rx_clock_correction == true)
{
@ -1261,7 +1267,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
else if (msg_type_hash_code == d_galileo_ephemeris_sptr_type_hash_code)
{
// ### Galileo EPHEMERIS ###
const auto galileo_eph = boost::any_cast<std::shared_ptr<Galileo_Ephemeris>>(pmt::any_ref(msg));
const auto galileo_eph = wht::any_cast<std::shared_ptr<Galileo_Ephemeris>>(pmt::any_ref(msg));
// insert new ephemeris record
DLOG(INFO) << "Galileo New Ephemeris record inserted in global map with TOW =" << galileo_eph->tow
<< ", GALILEO Week Number =" << galileo_eph->WN
@ -1311,7 +1317,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
else if (msg_type_hash_code == d_galileo_iono_sptr_type_hash_code)
{
// ### Galileo IONO ###
const auto galileo_iono = boost::any_cast<std::shared_ptr<Galileo_Iono>>(pmt::any_ref(msg));
const auto galileo_iono = wht::any_cast<std::shared_ptr<Galileo_Iono>>(pmt::any_ref(msg));
d_internal_pvt_solver->galileo_iono = *galileo_iono;
if (d_enable_rx_clock_correction == true)
{
@ -1322,7 +1328,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
else if (msg_type_hash_code == d_galileo_utc_model_sptr_type_hash_code)
{
// ### Galileo UTC MODEL ###
const auto galileo_utc_model = boost::any_cast<std::shared_ptr<Galileo_Utc_Model>>(pmt::any_ref(msg));
const auto galileo_utc_model = wht::any_cast<std::shared_ptr<Galileo_Utc_Model>>(pmt::any_ref(msg));
d_internal_pvt_solver->galileo_utc_model = *galileo_utc_model;
if (d_enable_rx_clock_correction == true)
{
@ -1333,7 +1339,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
else if (msg_type_hash_code == d_galileo_almanac_helper_sptr_type_hash_code)
{
// ### Galileo Almanac ###
const auto galileo_almanac_helper = boost::any_cast<std::shared_ptr<Galileo_Almanac_Helper>>(pmt::any_ref(msg));
const auto galileo_almanac_helper = wht::any_cast<std::shared_ptr<Galileo_Almanac_Helper>>(pmt::any_ref(msg));
const Galileo_Almanac sv1 = galileo_almanac_helper->get_almanac(1);
const Galileo_Almanac sv2 = galileo_almanac_helper->get_almanac(2);
const Galileo_Almanac sv3 = galileo_almanac_helper->get_almanac(3);
@ -1367,7 +1373,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
else if (msg_type_hash_code == d_galileo_almanac_sptr_type_hash_code)
{
// ### Galileo Almanac ###
const auto galileo_alm = boost::any_cast<std::shared_ptr<Galileo_Almanac>>(pmt::any_ref(msg));
const auto galileo_alm = wht::any_cast<std::shared_ptr<Galileo_Almanac>>(pmt::any_ref(msg));
// update/insert new almanac record to the global almanac map
d_internal_pvt_solver->galileo_almanac_map[galileo_alm->PRN] = *galileo_alm;
if (d_enable_rx_clock_correction == true)
@ -1380,7 +1386,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
else if (msg_type_hash_code == d_glonass_gnav_ephemeris_sptr_type_hash_code)
{
// ### GLONASS GNAV EPHEMERIS ###
const auto glonass_gnav_eph = boost::any_cast<std::shared_ptr<Glonass_Gnav_Ephemeris>>(pmt::any_ref(msg));
const auto glonass_gnav_eph = wht::any_cast<std::shared_ptr<Glonass_Gnav_Ephemeris>>(pmt::any_ref(msg));
// TODO Add GLONASS with gps week number and tow,
// insert new ephemeris record
DLOG(INFO) << "GLONASS GNAV New Ephemeris record inserted in global map with TOW =" << glonass_gnav_eph->d_TOW
@ -1419,7 +1425,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
else if (msg_type_hash_code == d_glonass_gnav_utc_model_sptr_type_hash_code)
{
// ### GLONASS GNAV UTC MODEL ###
const auto glonass_gnav_utc_model = boost::any_cast<std::shared_ptr<Glonass_Gnav_Utc_Model>>(pmt::any_ref(msg));
const auto glonass_gnav_utc_model = wht::any_cast<std::shared_ptr<Glonass_Gnav_Utc_Model>>(pmt::any_ref(msg));
d_internal_pvt_solver->glonass_gnav_utc_model = *glonass_gnav_utc_model;
if (d_enable_rx_clock_correction == true)
{
@ -1430,7 +1436,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
else if (msg_type_hash_code == d_glonass_gnav_almanac_sptr_type_hash_code)
{
// ### GLONASS GNAV Almanac ###
const auto glonass_gnav_almanac = boost::any_cast<std::shared_ptr<Glonass_Gnav_Almanac>>(pmt::any_ref(msg));
const auto glonass_gnav_almanac = wht::any_cast<std::shared_ptr<Glonass_Gnav_Almanac>>(pmt::any_ref(msg));
d_internal_pvt_solver->glonass_gnav_almanac = *glonass_gnav_almanac;
if (d_enable_rx_clock_correction == true)
{
@ -1444,7 +1450,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
else if (msg_type_hash_code == d_beidou_dnav_ephemeris_sptr_type_hash_code)
{
// ### Beidou EPHEMERIS ###
const auto bds_dnav_eph = boost::any_cast<std::shared_ptr<Beidou_Dnav_Ephemeris>>(pmt::any_ref(msg));
const auto bds_dnav_eph = wht::any_cast<std::shared_ptr<Beidou_Dnav_Ephemeris>>(pmt::any_ref(msg));
DLOG(INFO) << "Ephemeris record has arrived from SAT ID "
<< bds_dnav_eph->PRN << " (Block "
<< bds_dnav_eph->satelliteBlock[bds_dnav_eph->PRN] << ")"
@ -1487,7 +1493,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
else if (msg_type_hash_code == d_beidou_dnav_iono_sptr_type_hash_code)
{
// ### BeiDou IONO ###
const auto bds_dnav_iono = boost::any_cast<std::shared_ptr<Beidou_Dnav_Iono>>(pmt::any_ref(msg));
const auto bds_dnav_iono = wht::any_cast<std::shared_ptr<Beidou_Dnav_Iono>>(pmt::any_ref(msg));
d_internal_pvt_solver->beidou_dnav_iono = *bds_dnav_iono;
if (d_enable_rx_clock_correction == true)
{
@ -1498,7 +1504,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
else if (msg_type_hash_code == d_beidou_dnav_utc_model_sptr_type_hash_code)
{
// ### BeiDou UTC MODEL ###
const auto bds_dnav_utc_model = boost::any_cast<std::shared_ptr<Beidou_Dnav_Utc_Model>>(pmt::any_ref(msg));
const auto bds_dnav_utc_model = wht::any_cast<std::shared_ptr<Beidou_Dnav_Utc_Model>>(pmt::any_ref(msg));
d_internal_pvt_solver->beidou_dnav_utc_model = *bds_dnav_utc_model;
if (d_enable_rx_clock_correction == true)
{
@ -1509,7 +1515,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
else if (msg_type_hash_code == d_beidou_dnav_almanac_sptr_type_hash_code)
{
// ### BeiDou ALMANAC ###
const auto bds_dnav_almanac = boost::any_cast<std::shared_ptr<Beidou_Dnav_Almanac>>(pmt::any_ref(msg));
const auto bds_dnav_almanac = wht::any_cast<std::shared_ptr<Beidou_Dnav_Almanac>>(pmt::any_ref(msg));
d_internal_pvt_solver->beidou_dnav_almanac_map[bds_dnav_almanac->PRN] = *bds_dnav_almanac;
if (d_enable_rx_clock_correction == true)
{
@ -1522,7 +1528,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
LOG(WARNING) << "msg_handler_telemetry unknown object type!";
}
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_telemetry Bad any_cast: " << e.what();
}
@ -1538,12 +1544,12 @@ void rtklib_pvt_gs::msg_handler_has_data(const pmt::pmt_t& msg) const
{
if (d_enable_has_messages)
{
const auto has_data = boost::any_cast<std::shared_ptr<Galileo_HAS_data>>(pmt::any_ref(msg));
const auto has_data = wht::any_cast<std::shared_ptr<Galileo_HAS_data>>(pmt::any_ref(msg));
d_has_simple_printer->print_message(has_data.get());
}
}
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_has_data Bad any_cast: " << e.what();
}

View File

@ -76,6 +76,16 @@ if(USE_BOOST_BIND_PLACEHOLDERS)
)
endif()
if(PMT_USES_BOOST_ANY)
target_compile_definitions(channel_libs
PRIVATE -DPMT_USES_BOOST_ANY=1
)
target_link_libraries(channel_libs
PRIVATE
Boost::headers
)
endif()
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(channel_libs

View File

@ -17,13 +17,20 @@
#include "channel_msg_receiver_cc.h"
#include <boost/any.hpp>
#include <glog/logging.h>
#include <gnuradio/gr_complex.h>
#include <gnuradio/io_signature.h>
#include <cstdint>
#include <utility>
#if PMT_USES_BOOST_ANY
#include <boost/any.hpp>
namespace wht = boost;
#else
#include <any>
namespace wht = std;
#endif
#if HAS_GENERIC_LAMBDA
#else
#include <boost/bind/bind.hpp>
@ -85,7 +92,7 @@ void channel_msg_receiver_cc::msg_handler_channel_events(const pmt::pmt_t& msg)
break;
}
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any cast: " << e.what();
}

View File

@ -69,6 +69,13 @@ if(USE_BOOST_BIND_PLACEHOLDERS)
)
endif()
if(PMT_USES_BOOST_ANY)
target_compile_definitions(obs_gr_blocks
PRIVATE
-DPMT_USES_BOOST_ANY=1
)
endif()
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(obs_gr_blocks

View File

@ -35,6 +35,14 @@
#include <limits> // for numeric_limits
#include <utility> // for move
#if PMT_USES_BOOST_ANY
#include <boost/any.hpp>
namespace wht = boost;
#else
#include <any>
namespace wht = std;
#endif
#if HAS_GENERIC_LAMBDA
#else
#include <boost/bind/bind.hpp>
@ -195,7 +203,7 @@ void hybrid_observables_gs::msg_handler_pvt_to_observables(const pmt::pmt_t &msg
{
if (pmt::any_ref(msg).type().hash_code() == d_double_type_hash_code)
{
const auto new_rx_clock_offset_s = boost::any_cast<double>(pmt::any_ref(msg));
const auto new_rx_clock_offset_s = wht::any_cast<double>(pmt::any_ref(msg));
d_T_rx_TOW_ms = d_T_rx_TOW_ms - static_cast<int>(round(new_rx_clock_offset_s * 1000.0));
// align the receiver clock to integer multiple of d_T_rx_step_ms
if (d_T_rx_TOW_ms % d_T_rx_step_ms)
@ -211,7 +219,7 @@ void hybrid_observables_gs::msg_handler_pvt_to_observables(const pmt::pmt_t &msg
LOG(INFO) << "Corrected new RX Time offset: " << static_cast<int>(round(new_rx_clock_offset_s * 1000.0)) << "[ms]";
}
}
catch (const boost::bad_any_cast &e)
catch (const wht::bad_any_cast &e)
{
LOG(WARNING) << "msg_handler_pvt_to_observables Bad any_cast: " << e.what();
}

View File

@ -150,6 +150,17 @@ if(has_span)
)
endif()
if(PMT_USES_BOOST_ANY)
target_compile_definitions(tracking_gr_blocks
PRIVATE
-DPMT_USES_BOOST_ANY=1
)
target_link_libraries(tracking_gr_blocks
PRIVATE
Boost::headers
)
endif()
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(tracking_gr_blocks

View File

@ -65,6 +65,13 @@
#include <boost/bind/bind.hpp>
#endif
#if PMT_USES_BOOST_ANY
#include <boost/any.hpp>
namespace wht = boost;
#else
#include <any>
namespace wht = std;
#endif
dll_pll_veml_tracking_sptr dll_pll_veml_make_tracking(const Dll_Pll_Conf &conf_)
{
@ -605,7 +612,7 @@ void dll_pll_veml_tracking::msg_handler_telemetry_to_trk(const pmt::pmt_t &msg)
{
if (pmt::any_ref(msg).type().hash_code() == int_type_hash_code)
{
const int tlm_event = boost::any_cast<int>(pmt::any_ref(msg));
const int tlm_event = wht::any_cast<int>(pmt::any_ref(msg));
if (tlm_event == 1)
{
DLOG(INFO) << "Telemetry fault received in ch " << this->d_channel;
@ -614,7 +621,7 @@ void dll_pll_veml_tracking::msg_handler_telemetry_to_trk(const pmt::pmt_t &msg)
}
}
}
catch (const boost::bad_any_cast &e)
catch (const wht::bad_any_cast &e)
{
LOG(WARNING) << "msg_handler_telemetry_to_trk Bad any_cast: " << e.what();
}

View File

@ -54,6 +54,13 @@
#include <boost/bind/bind.hpp>
#endif
#if PMT_USES_BOOST_ANY
#include <boost/any.hpp>
namespace wht = boost;
#else
#include <any>
namespace wht = std;
#endif
dll_pll_veml_tracking_fpga_sptr dll_pll_veml_make_tracking_fpga(const Dll_Pll_Conf_Fpga &conf_)
{
@ -469,7 +476,7 @@ void dll_pll_veml_tracking_fpga::msg_handler_telemetry_to_trk(const pmt::pmt_t &
{
if (pmt::any_ref(msg).type().hash_code() == int_type_hash_code)
{
const int tlm_event = boost::any_cast<int>(pmt::any_ref(msg));
const int tlm_event = wht::any_cast<int>(pmt::any_ref(msg));
if (tlm_event == 1)
{
DLOG(INFO) << "Telemetry fault received in ch " << this->d_channel;
@ -478,7 +485,7 @@ void dll_pll_veml_tracking_fpga::msg_handler_telemetry_to_trk(const pmt::pmt_t &
}
}
}
catch (const boost::bad_any_cast &e)
catch (const wht::bad_any_cast &e)
{
LOG(WARNING) << "msg_handler_telemetry_to_trk Bad any_cast: " << e.what();
}

View File

@ -142,6 +142,13 @@ if(USE_BOOST_ASIO_IO_CONTEXT)
)
endif()
if(PMT_USES_BOOST_ANY)
target_compile_definitions(core_libs
PRIVATE
-DPMT_USES_BOOST_ANY=1
)
endif()
# Do not apply clang-tidy fixes to protobuf generated headers
get_filename_component(PROTO_INCLUDE_HEADERS_DIR ${PROTO_HDRS} DIRECTORY)
target_include_directories(core_libs

View File

@ -17,7 +17,6 @@
#include "channel_status_msg_receiver.h"
#include <boost/any.hpp>
#include <glog/logging.h>
#include <gnuradio/gr_complex.h>
#include <gnuradio/io_signature.h>
@ -31,6 +30,13 @@
#include <boost/bind/bind.hpp>
#endif
#if PMT_USES_BOOST_ANY
#include <boost/any.hpp>
namespace wht = boost;
#else
#include <any>
namespace wht = std;
#endif
channel_status_msg_receiver_sptr channel_status_msg_receiver_make()
{
@ -64,7 +70,7 @@ void channel_status_msg_receiver::msg_handler_channel_status(const pmt::pmt_t& m
// ****************** Gnss_Synchro received ************************
if (msg_type_hash_code == typeid(std::shared_ptr<Gnss_Synchro>).hash_code())
{
const auto gnss_synchro_obj = boost::any_cast<std::shared_ptr<Gnss_Synchro>>(pmt::any_ref(msg));
const auto gnss_synchro_obj = wht::any_cast<std::shared_ptr<Gnss_Synchro>>(pmt::any_ref(msg));
if (gnss_synchro_obj->Flag_valid_pseudorange == true)
{
d_channel_status_map[gnss_synchro_obj->Channel_ID] = gnss_synchro_obj;
@ -84,7 +90,7 @@ void channel_status_msg_receiver::msg_handler_channel_status(const pmt::pmt_t& m
else if (msg_type_hash_code == typeid(std::shared_ptr<Monitor_Pvt>).hash_code())
{
// ***************** Monitor_Pvt received ******************
const auto monitor_pvt_obj = boost::any_cast<std::shared_ptr<Monitor_Pvt>>(pmt::any_ref(msg));
const auto monitor_pvt_obj = wht::any_cast<std::shared_ptr<Monitor_Pvt>>(pmt::any_ref(msg));
d_pvt_status = *monitor_pvt_obj.get();
// std::cout << "-------- \n" << '\n';
@ -96,7 +102,7 @@ void channel_status_msg_receiver::msg_handler_channel_status(const pmt::pmt_t& m
LOG(WARNING) << "channel_status_msg_receiver unknown object type!";
}
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "channel_status_msg_receiver Bad any_cast: " << e.what();
}

View File

@ -23,7 +23,6 @@
#include "galileo_has_page.h" // for Galileo_HAS_page
#include "gnss_sdr_make_unique.h" // for std::make_unique in C++11
#include "reed_solomon.h" // for ReedSolomon
#include <boost/any.hpp> // for boost::any_cast
#include <glog/logging.h> // for DLOG
#include <gnuradio/io_signature.h> // for gr::io_signature::make
#include <algorithm> // for std::find, std::count
@ -38,6 +37,13 @@
#include <boost/bind/bind.hpp>
#endif
#if PMT_USES_BOOST_ANY
#include <boost/any.hpp>
namespace wht = boost;
#else
#include <any>
namespace wht = std;
#endif
galileo_e6_has_msg_receiver_sptr galileo_e6_has_msg_receiver_make()
{
@ -106,7 +112,7 @@ void galileo_e6_has_msg_receiver::msg_handler_galileo_e6_has(const pmt::pmt_t& m
const size_t msg_type_hash_code = pmt::any_ref(msg).type().hash_code();
if (msg_type_hash_code == typeid(std::shared_ptr<Galileo_HAS_page>).hash_code())
{
const auto HAS_data_page = boost::any_cast<std::shared_ptr<Galileo_HAS_page>>(pmt::any_ref(msg));
const auto HAS_data_page = wht::any_cast<std::shared_ptr<Galileo_HAS_page>>(pmt::any_ref(msg));
DLOG(INFO) << "New HAS page received: "
<< "Status: " << static_cast<float>(HAS_data_page->has_status) << ", "
<< "MT: " << static_cast<float>(HAS_data_page->message_type) << ", "
@ -122,7 +128,7 @@ void galileo_e6_has_msg_receiver::msg_handler_galileo_e6_has(const pmt::pmt_t& m
LOG(WARNING) << "galileo_e6_has_msg_receiver received an unknown object type!";
}
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "galileo_e6_has_msg_receiver Bad any_cast: " << e.what();
}

View File

@ -17,7 +17,6 @@
#include "nav_message_monitor.h"
#include "gnss_sdr_make_unique.h"
#include <boost/any.hpp>
#include <glog/logging.h>
#include <gnuradio/io_signature.h>
#include <cstddef> // size_t
@ -28,6 +27,13 @@
#include <boost/bind/bind.hpp>
#endif
#if PMT_USES_BOOST_ANY
#include <boost/any.hpp>
namespace wht = boost;
#else
#include <any>
namespace wht = std;
#endif
nav_message_monitor_sptr nav_message_monitor_make(const std::vector<std::string>& addresses, uint16_t port)
{
@ -62,7 +68,7 @@ void nav_message_monitor::msg_handler_nav_message(const pmt::pmt_t& msg)
const size_t msg_type_hash_code = pmt::any_ref(msg).type().hash_code();
if (msg_type_hash_code == typeid(std::shared_ptr<Nav_Message_Packet>).hash_code())
{
const auto nav_message_packet = boost::any_cast<std::shared_ptr<Nav_Message_Packet>>(pmt::any_ref(msg));
const auto nav_message_packet = wht::any_cast<std::shared_ptr<Nav_Message_Packet>>(pmt::any_ref(msg));
nav_message_udp_sink_->write_nav_message(nav_message_packet);
}
else
@ -70,7 +76,7 @@ void nav_message_monitor::msg_handler_nav_message(const pmt::pmt_t& msg)
LOG(WARNING) << "nav_message_monitor received an unknown object type!";
}
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "nav_message_monitor Bad any_cast: " << e.what();
}

View File

@ -50,7 +50,6 @@ target_link_libraries(core_monitor
core_system_parameters
PRIVATE
Boost::serialization
Gnuradio::pmt
)
get_filename_component(PROTO_INCLUDE_HEADERS_DIR ${PROTO_HDRS} DIRECTORY)

View File

@ -187,6 +187,13 @@ else()
)
endif()
if(PMT_USES_BOOST_ANY)
target_compile_definitions(core_receiver
PRIVATE
-DPMT_USES_BOOST_ANY=1
)
endif()
# Fix for Boost Asio < 1.70
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (Boost_VERSION_STRING VERSION_LESS 1.70.0))

View File

@ -69,6 +69,12 @@
#include <boost/chrono.hpp> // for steady_clock
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
extern Concurrent_Map<Gps_Acq_Assist> global_gps_acq_assist_map;
extern Concurrent_Queue<Gps_Acq_Assist> global_gps_acq_assist_queue;
@ -280,7 +286,7 @@ void ControlThread::event_dispatcher(bool &valid_event, pmt::pmt_t &msg)
{
if (receiver_on_standby_ == false)
{
const auto new_event = boost::any_cast<channel_event_sptr>(pmt::any_ref(msg));
const auto new_event = wht::any_cast<channel_event_sptr>(pmt::any_ref(msg));
DLOG(INFO) << "New channel event rx from ch id: " << new_event->channel_id
<< " what: " << new_event->event_type;
flowgraph_->apply_action(new_event->channel_id, new_event->event_type);
@ -288,7 +294,7 @@ void ControlThread::event_dispatcher(bool &valid_event, pmt::pmt_t &msg)
}
else if (msg_type_hash_code == command_event_type_hash_code_)
{
const auto new_event = boost::any_cast<command_event_sptr>(pmt::any_ref(msg));
const auto new_event = wht::any_cast<command_event_sptr>(pmt::any_ref(msg));
DLOG(INFO) << "New command event rx from ch id: " << new_event->command_id
<< " what: " << new_event->event_type;

View File

@ -542,6 +542,11 @@ if(ENABLE_UNIT_TESTING)
PRIVATE -DGNURADIO_USES_STD_POINTERS=1
)
endif()
if(PMT_USES_BOOST_ANY)
target_compile_definitions(run_tests
PRIVATE -DPMT_USES_BOOST_ANY=1
)
endif()
if(ENABLE_UNIT_TESTING_EXTRA)
target_link_libraries(run_tests PRIVATE Gpstk::gpstk)
if(GPSTK_OLDER_THAN_8)
@ -1002,6 +1007,12 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA)
INTERFACE
${CMAKE_SOURCE_DIR}/src/tests/common-files
)
if(PMT_USES_BOOST_ANY)
target_compile_definitions(acq_test
PRIVATE
-DPMT_USES_BOOST_ANY=1
)
endif()
add_test(acq_test acq_test)
if(USE_GENERIC_LAMBDAS)
@ -1091,6 +1102,12 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA)
-DUSE_BOOST_BIND_PLACEHOLDERS=1
)
endif()
if(PMT_USES_BOOST_ANY)
target_compile_definitions(trk_test
PRIVATE
-DPMT_USES_BOOST_ANY=1
)
endif()
add_test(trk_test trk_test)

View File

@ -49,6 +49,11 @@
#include <boost/bind/bind.hpp>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
DEFINE_string(config_file_ptest, std::string(""), "File containing alternative configuration parameters for the acquisition performance test.");
DEFINE_string(acq_test_input_file, std::string(""), "File containing raw signal data, must be in int8_t format. The signal generator will not be used.");
@ -119,7 +124,7 @@ void AcqPerfTest_msg_rx::msg_handler_channel_events(const pmt::pmt_t msg)
rx_message = message;
channel_internal_queue.push(rx_message);
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;
@ -540,7 +545,8 @@ int AcquisitionPerformanceTest::configure_receiver(double cn0, float pfa, unsign
config->set_property("Acquisition.dump", "false");
}
std::string dump_file = path_str + std::string("/acquisition_") + std::to_string(cn0) + "_" + std::to_string(iter) + "_" + std::to_string(pfa);
// std::string dump_file = path_str + std::string("/acquisition_") + std::to_string(cn0) + "_" + std::to_string(iter) + "_" + std::to_string(pfa);
std::string dump_file = path_str + std::string("/acquisition_") + std::to_string(static_cast<int>(cn0)) + "_" + std::to_string(iter) + "_" + std::to_string(static_cast<int>(pfa * 1.0e5));
config->set_property("Acquisition.dump_filename", dump_file);
config->set_property("Acquisition.dump_channel", std::to_string(dump_channel));
config->set_property("Acquisition.blocking_on_standby", "true");
@ -719,7 +725,7 @@ void AcquisitionPerformanceTest::plot_results()
for (int k = 0; k < num_thresholds; k++)
{
Pd_i.push_back(Pd[i][k]);
Pfa_i.push_back(Pfa[i][k]);
Pfa_i.push_back(pfa_vector[k]);
}
g1.plot_xy(Pfa_i, Pd_i, "CN0 = " + std::to_string(static_cast<int>(cn0_vector[i])) + " dBHz");
}
@ -755,7 +761,7 @@ void AcquisitionPerformanceTest::plot_results()
for (int k = 0; k < num_thresholds; k++)
{
Pd_i_correct.push_back(Pd_correct[i][k]);
Pfa_i.push_back(Pfa[i][k]);
Pfa_i.push_back(pfa_vector[k]);
}
g2.plot_xy(Pfa_i, Pd_i_correct, "CN0 = " + std::to_string(static_cast<int>(cn0_vector[i])) + " dBHz");
}
@ -778,6 +784,7 @@ TEST_F(AcquisitionPerformanceTest, ROC)
if (fs::exists(path_str))
{
std::cout << "Deleting old files at " << path_str << " ...\n";
fs::remove_all(path_str);
}
errorlib::error_code ec;
@ -840,7 +847,7 @@ TEST_F(AcquisitionPerformanceTest, ROC)
run_receiver();
// count executions
std::string basename = path_str + std::string("/acquisition_") + std::to_string(it) + "_" + std::to_string(iter) + "_" + std::to_string(pfa_vector[pfa_iter]) + "_" + gnss_synchro.System + "_" + signal_id;
std::string basename = path_str + std::string("/acquisition_") + std::to_string(static_cast<int>(it)) + "_" + std::to_string(iter) + "_" + std::to_string(static_cast<int>(pfa_vector[pfa_iter] * 1e-5)) + "_" + gnss_synchro.System + "_" + signal_id;
int num_executions = count_executions(basename, observed_satellite);
// Read measured data
@ -983,7 +990,7 @@ TEST_F(AcquisitionPerformanceTest, ROC)
{
meas_Pd_.push_back(0.0);
}
std::cout << TEXT_BOLD_BLACK << "Probability of detection for channel=" << ch << ", CN0=" << it << " dBHz"
std::cout << TEXT_BOLD_BLUE << "Probability of detection for channel=" << ch << ", CN0=" << it << " dBHz"
<< ": " << (num_executions > 0 ? computed_Pd : 0.0) << TEXT_RESET << '\n';
}
if (num_clean_executions > 0)
@ -1000,7 +1007,7 @@ TEST_F(AcquisitionPerformanceTest, ROC)
}
double computed_Pd_correct = correctly_detected / static_cast<double>(num_clean_executions);
meas_Pd_correct_.push_back(computed_Pd_correct);
std::cout << TEXT_BOLD_BLACK << "Probability of correct detection for channel=" << ch << ", CN0=" << it << " dBHz"
std::cout << TEXT_BOLD_BLUE << "Probability of correct detection for channel=" << ch << ", CN0=" << it << " dBHz"
<< ": " << computed_Pd_correct << TEXT_RESET << '\n';
}
else
@ -1018,7 +1025,7 @@ TEST_F(AcquisitionPerformanceTest, ROC)
{
meas_Pfa_.push_back(0.0);
}
std::cout << TEXT_BOLD_BLACK << "Probability of false alarm for channel=" << ch << ", CN0=" << it << " dBHz"
std::cout << TEXT_BOLD_BLUE << "Probability of false alarm for channel=" << ch << ", CN0=" << it << " dBHz"
<< ": " << (num_executions > 0 ? computed_Pfa : 0.0) << TEXT_RESET << '\n';
}
}

View File

@ -50,6 +50,12 @@
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class BeidouB1iPcpsAcquisitionTest_msg_rx;
@ -84,7 +90,7 @@ void BeidouB1iPcpsAcquisitionTest_msg_rx::msg_handler_channel_events(const pmt::
int64_t message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (const boost::bad_any_cast &e)
catch (const wht::bad_any_cast &e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -50,6 +50,11 @@
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class BeidouB3iPcpsAcquisitionTest_msg_rx;
@ -84,7 +89,7 @@ void BeidouB3iPcpsAcquisitionTest_msg_rx::msg_handler_channel_events(const pmt::
int64_t message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (const boost::bad_any_cast &e)
catch (const wht::bad_any_cast &e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -44,6 +44,11 @@
#else
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
@ -82,7 +87,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_channe
rx_message = message;
channel_internal_queue.push(rx_message);
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -42,6 +42,11 @@
#else
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx;
@ -79,7 +84,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_channel_e
rx_message = message;
channel_internal_queue.push(rx_message);
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -52,6 +52,11 @@
#else
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx;
@ -89,7 +94,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::msg_handler_channel_event
rx_message = message;
channel_internal_queue.push(rx_message);
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -52,6 +52,12 @@
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx;
@ -86,7 +92,7 @@ void GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx::msg_handler_channel_events(co
int64_t message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -45,7 +45,11 @@
#else
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx;
@ -83,7 +87,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx::msg_handler_channel_eve
rx_message = message;
channel_internal_queue.push(rx_message);
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -47,6 +47,11 @@
#else
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
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");
@ -88,7 +93,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::msg_handler_
rx_message = message;
channel_internal_queue.push(rx_message);
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -46,6 +46,11 @@
#else
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx;
@ -83,7 +88,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_chann
rx_message = message;
channel_internal_queue.push(rx_message);
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -42,6 +42,11 @@
#else
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx;
@ -79,7 +84,7 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::msg_handler_channel_
rx_message = message;
channel_internal_queue.push(rx_message);
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -49,6 +49,12 @@
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class GalileoE5bPcpsAcquisitionTest_msg_rx;
@ -84,7 +90,7 @@ void GalileoE5bPcpsAcquisitionTest_msg_rx::msg_handler_channel_events(const pmt:
rx_message = message;
channel_internal_queue.push(rx_message);
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
std::cout << "msg_handler_telemetry Bad any cast!" << std::endl;
rx_message = 0;

View File

@ -49,6 +49,12 @@
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class GalileoE6PcpsAcquisitionTest_msg_rx;
@ -84,7 +90,7 @@ void GalileoE6PcpsAcquisitionTest_msg_rx::msg_handler_channel_events(const pmt::
rx_message = message;
channel_internal_queue.push(rx_message);
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
std::cout << "msg_handler_telemetry Bad any cast!" << std::endl;
rx_message = 0;

View File

@ -48,6 +48,11 @@
#else
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx;
@ -85,7 +90,7 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx::msg_handler_channel_events(c
rx_message = message;
channel_internal_queue.push(rx_message);
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -42,7 +42,11 @@
#else
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class GlonassL1CaPcpsAcquisitionTest_msg_rx;
@ -77,7 +81,7 @@ void GlonassL1CaPcpsAcquisitionTest_msg_rx::msg_handler_channel_events(const pmt
int64_t message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
std::cout << "msg_handler_telemetry Bad any cast!\n";
rx_message = 0;

View File

@ -46,6 +46,11 @@
#else
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class GlonassL2CaPcpsAcquisitionTest_msg_rx;
@ -83,7 +88,7 @@ void GlonassL2CaPcpsAcquisitionTest_msg_rx::msg_handler_channel_events(const pmt
rx_message = message;
channel_internal_queue.push(rx_message);
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -48,7 +48,11 @@
#else
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx;
@ -86,7 +90,7 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx::msg_handler_channel_events(const
rx_message = message;
channel_internal_queue.push(rx_message);
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -34,6 +34,7 @@
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <pmt/pmt.h>
#include <chrono>
#include <memory>
#include <utility>
@ -49,6 +50,11 @@
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class GpsL1CaPcpsAcquisitionTest_msg_rx;
@ -83,7 +89,7 @@ void GpsL1CaPcpsAcquisitionTest_msg_rx::msg_handler_channel_events(const pmt::pm
int64_t message = pmt::to_long(msg);
rx_message = message;
}
catch (const boost::bad_any_cast &e)
catch (const wht::bad_any_cast &e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -32,6 +32,7 @@
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/top_block.h>
#include <pmt/pmt.h>
#include <chrono>
#include <memory>
#include <thread>
@ -44,6 +45,11 @@
#else
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx;
@ -81,7 +87,7 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx::msg_handler_channel_events
rx_message = message;
channel_internal_queue.push(rx_message);
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -31,6 +31,7 @@
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <pmt/pmt.h>
#include <chrono>
#include <stdexcept>
#include <thread>
@ -44,6 +45,11 @@
#else
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
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");
@ -85,7 +91,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::msg_handler_channel_eve
rx_message = message;
channel_internal_queue.push(rx_message);
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -33,6 +33,7 @@
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <pmt/pmt.h>
#include <chrono>
#include <memory>
#include <thread>
@ -46,6 +47,11 @@
#else
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx;
@ -83,7 +89,7 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx::msg_handler_channel_events(c
rx_message = message;
channel_internal_queue.push(rx_message);
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -36,6 +36,7 @@
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <pmt/pmt.h>
#include <chrono>
#include <utility>
@ -50,6 +51,11 @@
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class GpsL2MPcpsAcquisitionTest_msg_rx;
@ -82,7 +88,7 @@ void GpsL2MPcpsAcquisitionTest_msg_rx::msg_handler_channel_events(const pmt::pmt
int64_t message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (const boost::bad_any_cast &e)
catch (const wht::bad_any_cast &e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -39,6 +39,7 @@ target_link_libraries(signal_processing_testing_lib
Armadillo::armadillo
Gflags::gflags
Gnuradio::runtime
Gnuradio::pmt
PRIVATE
Boost::headers
Matio::matio
@ -80,6 +81,12 @@ if(GNURADIO_USES_STD_POINTERS)
)
endif()
if(PMT_USES_BOOST_ANY)
target_compile_definitions(signal_processing_testing_lib
PRIVATE
-DPMT_USES_BOOST_ANY=1
)
endif()
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)

View File

@ -26,6 +26,14 @@
#include <boost/bind/bind.hpp>
#endif
#if PMT_USES_BOOST_ANY
#include <boost/any.hpp>
namespace wht = boost;
#else
#include <any>
namespace wht = std;
#endif
Acquisition_msg_rx_sptr Acquisition_msg_rx_make()
{
return Acquisition_msg_rx_sptr(new Acquisition_msg_rx());
@ -40,7 +48,7 @@ void Acquisition_msg_rx::msg_handler_channel_events(const pmt::pmt_t& msg)
rx_message = message;
top_block->stop(); // stop the flowgraph
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_acquisition Bad cast!\n";
rx_message = 0;

View File

@ -64,21 +64,29 @@
#include <gpstk/RinexUtilities.hpp>
#include <gtest/gtest.h>
#include <matio.h>
#include <pmt/pmt.h>
#include <chrono>
#include <cmath>
#include <exception>
#include <unistd.h>
#include <utility>
#if HAS_GENERIC_LAMBDA
#else
#include <boost/bind/bind.hpp>
#endif
#ifdef GR_GREATER_38
#include <gnuradio/filter/fir_filter_blk.h>
#else
#include <gnuradio/filter/fir_filter_ccf.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER FOR TRACKING MESSAGES #########
class HybridObservablesTest_msg_rx;
@ -114,7 +122,7 @@ void HybridObservablesTest_msg_rx::msg_handler_channel_events(const pmt::pmt_t m
int64_t message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;
@ -180,7 +188,7 @@ void HybridObservablesTest_tlm_msg_rx::msg_handler_channel_events(const pmt::pmt
int64_t message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -63,22 +63,30 @@
#include <gpstk/RinexUtilities.hpp>
#include <gtest/gtest.h>
#include <matio.h>
#include <pmt/pmt.h>
#include <chrono>
#include <cmath>
#include <exception>
#include <pthread.h>
#include <unistd.h>
#include <utility>
#if HAS_GENERIC_LAMBDA
#else
#include <boost/bind/bind.hpp>
#endif
#ifdef GR_GREATER_38
#include <gnuradio/filter/fir_filter_blk.h>
#else
#include <gnuradio/filter/fir_filter_ccf.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
class HybridObservablesTest_msg_rx_Fpga;
@ -112,7 +120,7 @@ void HybridObservablesTest_msg_rx_Fpga::msg_handler_channel_events(const pmt::pm
int64_t message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;
@ -175,7 +183,7 @@ void HybridObservablesTest_tlm_msg_rx_Fpga::msg_handler_channel_events(const pmt
int64_t message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -46,11 +46,18 @@
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/blocks/skiphead.h>
#include <gtest/gtest.h>
#include <pmt/pmt.h>
#if HAS_GENERIC_LAMBDA
#else
#include <boost/bind/bind.hpp>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER FOR TRACKING MESSAGES #########
class GpsL1CADllPllTelemetryDecoderTest_msg_rx;
@ -83,7 +90,7 @@ void GpsL1CADllPllTelemetryDecoderTest_msg_rx::msg_handler_channel_events(const
int64_t message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;
@ -143,7 +150,7 @@ void GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx::msg_handler_channel_events(co
int64_t message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -29,12 +29,18 @@
#include <gnuradio/blocks/skiphead.h>
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <pmt/pmt.h>
#include <chrono>
#include <utility>
#if HAS_GENERIC_LAMBDA
#else
#include <boost/bind/bind.hpp>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class GlonassL1CaDllPllCAidTrackingTest_msg_rx;
@ -67,7 +73,7 @@ void GlonassL1CaDllPllCAidTrackingTest_msg_rx::msg_handler_channel_events(const
int64_t message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -30,6 +30,7 @@
#include <gnuradio/blocks/skiphead.h>
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <pmt/pmt.h>
#include <chrono>
#include <utility>
#if HAS_GENERIC_LAMBDA
@ -41,7 +42,11 @@
#else
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class GlonassL1CaDllPllTrackingTest_msg_rx;
@ -74,7 +79,7 @@ void GlonassL1CaDllPllTrackingTest_msg_rx::msg_handler_channel_events(const pmt:
int64_t message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -37,6 +37,7 @@
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <matio.h>
#include <pmt/pmt.h>
#include <chrono>
#include <unistd.h>
#include <utility>
@ -53,6 +54,11 @@
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class GpsL1CADllPllTrackingTest_msg_rx;
@ -88,7 +94,7 @@ void GpsL1CADllPllTrackingTest_msg_rx::msg_handler_channel_events(const pmt::pmt
rx_message = message; // 3 -> loss of lock
// std::cout << "Received trk message: " << rx_message << '\n';
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -38,6 +38,7 @@
#include <gnuradio/blocks/skiphead.h>
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <pmt/pmt.h>
#include <chrono>
#include <cstdio> // FPGA read input file
#include <fcntl.h>
@ -53,6 +54,11 @@
#else
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
#define DMA_TRACK_TRANSFER_SIZE 2046 // DMA transfer size for tracking
#define MIN_SAMPLES_REMAINING 20000 // number of remaining samples in the DMA that causes the CPU to stop the flowgraph (it has to be a bit alrger than 2x max packet size)
@ -183,7 +189,7 @@ void GpsL1CADllPllTrackingTestFpga_msg_rx::msg_handler_channel_events(const pmt:
int64_t message = pmt::to_long(msg);
rx_message = message;
}
catch (const boost::bad_any_cast &e)
catch (const wht::bad_any_cast &e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -36,6 +36,7 @@
#include <gnuradio/blocks/skiphead.h>
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <pmt/pmt.h>
#include <chrono>
#include <unistd.h>
#include <utility>
@ -52,6 +53,11 @@
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
DEFINE_bool(plot_gps_l1_kf_tracking_test, false, "Plots results of GpsL1CAKfTrackingTest with gnuplot");
@ -90,7 +96,7 @@ void GpsL1CAKfTrackingTest_msg_rx::msg_handler_channel_events(const pmt::pmt_t m
long int message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -30,6 +30,7 @@
#include <gnuradio/blocks/skiphead.h>
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <pmt/pmt.h>
#include <chrono>
#include <utility>
#if HAS_GENERIC_LAMBDA
@ -41,7 +42,11 @@
#else
#include <gnuradio/analog/sig_source_c.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
class GpsL2MDllPllTrackingTest_msg_rx;
@ -76,7 +81,7 @@ void GpsL2MDllPllTrackingTest_msg_rx::msg_handler_channel_events(const pmt::pmt_
int64_t message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_channel_events Bad any_cast: " << e.what();
rx_message = 0;

View File

@ -68,6 +68,11 @@
#include <gnuradio/filter/fir_filter_ccf.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO TRACKING BLOCK MESSAGE RECEVER #########
class TrackingPullInTest_msg_rx;
@ -103,7 +108,7 @@ void TrackingPullInTest_msg_rx::msg_handler_channel_events(const pmt::pmt_t msg)
rx_message = message; // 3 -> loss of lock
// std::cout << "Received trk message: " << rx_message << '\n';
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_tracking Bad cast!";
rx_message = 0;

View File

@ -67,6 +67,11 @@
#include <gnuradio/filter/fir_filter_ccf.h>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
// ######## GNURADIO TRACKING BLOCK MESSAGE RECEVER #########
class TrackingPullInTest_msg_rx_Fpga;
@ -101,7 +106,7 @@ void TrackingPullInTest_msg_rx_Fpga::msg_handler_channel_events(const pmt::pmt_t
int64_t message = pmt::to_long(std::move(msg));
rx_message = message; // 3 -> loss of lock
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_tracking Bad cast!";
rx_message = 0;

View File

@ -95,6 +95,13 @@ if(USE_BOOST_BIND_PLACEHOLDERS)
)
endif()
if(PMT_USES_BOOST_ANY)
target_compile_definitions(front-end-cal
PRIVATE
-DPMT_USES_BOOST_ANY=1
)
endif()
if(ENABLE_STRIP)
set_target_properties(front-end-cal PROPERTIES LINK_FLAGS "-s")
endif()

View File

@ -74,6 +74,12 @@
#include <boost/bind/bind.hpp>
#endif
#if PMT_USES_BOOST_ANY
namespace wht = boost;
#else
namespace wht = std;
#endif
#if GFLAGS_OLD_NAMESPACE
namespace gflags
{
@ -129,7 +135,7 @@ void FrontEndCal_msg_rx::msg_handler_channel_events(const pmt::pmt_t& msg)
rx_message = message;
channel_internal_queue.push(rx_message);
}
catch (const boost::bad_any_cast& e)
catch (const wht::bad_any_cast& e)
{
LOG(WARNING) << "msg_handler_telemetry Bad any cast!\n";
rx_message = 0;