Fix runtime error if GNU Radio was built with -D_GLIBCXX_ASSERTIONS. Fixes #677

This commit is contained in:
Carles Fernandez 2022-12-04 00:11:42 +01:00
parent c504b16568
commit 6a2ac9eac6
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
13 changed files with 67 additions and 14 deletions

View File

@ -163,6 +163,13 @@ if(PMT_USES_BOOST_ANY)
)
endif()
if(GNURADIO_IS_38_OR_GREATER)
target_compile_definitions(tracking_gr_blocks
PRIVATE
-DGNURADIO_GREATER_THAN_38=1
)
endif()
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(tracking_gr_blocks

View File

@ -126,12 +126,16 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_)
d_acc_carrier_phase_initialized(false),
d_Flag_PLL_180_deg_phase_locked(false)
{
#if GNURADIO_GREATER_THAN_38
this->set_relative_rate(1, static_cast<uint64_t>(d_trk_parameters.vector_length));
#else
this->set_relative_rate(1.0 / static_cast<double>(d_trk_parameters.vector_length));
#endif
// prevent telemetry symbols accumulation in output buffers
this->set_max_noutput_items(1);
// Telemetry bit synchronization message port input
this->message_port_register_out(pmt::mp("events"));
this->set_relative_rate(1.0 / static_cast<double>(d_trk_parameters.vector_length));
// Telemetry message port input
this->message_port_register_in(pmt::mp("telemetry_to_trk"));

View File

@ -126,12 +126,16 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga &
d_sc_demodulate_enabled(false),
d_Flag_PLL_180_deg_phase_locked(false)
{
#if GNURADIO_GREATER_THAN_38
this->set_relative_rate(1, static_cast<uint64_t>(d_trk_parameters.vector_length));
#else
this->set_relative_rate(1.0 / static_cast<double>(d_trk_parameters.vector_length));
#endif
// prevent telemetry symbols accumulation in output buffers
this->set_max_noutput_items(1);
// Telemetry bit synchronization message port input
this->message_port_register_out(pmt::mp("events"));
this->set_relative_rate(1.0 / static_cast<double>(d_trk_parameters.vector_length));
// Telemetry message port input
this->message_port_register_in(pmt::mp("telemetry_to_trk"));

View File

@ -117,8 +117,12 @@ Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc(
d_pull_in(false),
d_dump_filename(dump_filename)
{
#if GNURADIO_GREATER_THAN_38
this->set_relative_rate(1, static_cast<uint64_t>(vector_length));
#else
this->set_relative_rate(1.0 / static_cast<double>(vector_length));
#endif
this->message_port_register_out(pmt::mp("events"));
this->set_relative_rate(1.0 / vector_length);
// Telemetry message port input
this->message_port_register_in(pmt::mp("telemetry_to_trk"));

View File

@ -192,8 +192,11 @@ glonass_l1_ca_dll_pll_c_aid_tracking_cc::glonass_l1_ca_dll_pll_c_aid_tracking_cc
d_Prompt_buffer = volk_gnsssdr::vector<gr_complex>(FLAGS_cn0_samples);
systemName["R"] = std::string("Glonass");
set_relative_rate(1.0 / static_cast<double>(d_vector_length));
#if GNURADIO_GREATER_THAN_38
this->set_relative_rate(1, static_cast<uint64_t>(d_vector_length));
#else
this->set_relative_rate(1.0 / static_cast<double>(d_vector_length));
#endif
// set_min_output_buffer((int64_t)300);
}

View File

@ -190,7 +190,11 @@ glonass_l1_ca_dll_pll_c_aid_tracking_sc::glonass_l1_ca_dll_pll_c_aid_tracking_sc
systemName["R"] = std::string("Glonass");
set_relative_rate(1.0 / static_cast<double>(d_vector_length));
#if GNURADIO_GREATER_THAN_38
this->set_relative_rate(1, static_cast<uint64_t>(d_vector_length));
#else
this->set_relative_rate(1.0 / static_cast<double>(d_vector_length));
#endif
// set_min_output_buffer((int64_t)300);
}

View File

@ -137,8 +137,11 @@ Glonass_L1_Ca_Dll_Pll_Tracking_cc::Glonass_L1_Ca_Dll_Pll_Tracking_cc(
d_Prompt_buffer = volk_gnsssdr::vector<gr_complex>(FLAGS_cn0_samples);
systemName["R"] = std::string("Glonass");
set_relative_rate(1.0 / static_cast<double>(d_vector_length));
#if GNURADIO_GREATER_THAN_38
this->set_relative_rate(1, static_cast<uint64_t>(d_vector_length));
#else
this->set_relative_rate(1.0 / static_cast<double>(d_vector_length));
#endif
}

View File

@ -189,7 +189,11 @@ glonass_l2_ca_dll_pll_c_aid_tracking_cc::glonass_l2_ca_dll_pll_c_aid_tracking_cc
systemName["R"] = std::string("Glonass");
set_relative_rate(1.0 / static_cast<double>(d_vector_length));
#if GNURADIO_GREATER_THAN_38
this->set_relative_rate(1, static_cast<uint64_t>(d_vector_length));
#else
this->set_relative_rate(1.0 / static_cast<double>(d_vector_length));
#endif
// set_min_output_buffer((int64_t)300);
}

View File

@ -187,7 +187,11 @@ glonass_l2_ca_dll_pll_c_aid_tracking_sc::glonass_l2_ca_dll_pll_c_aid_tracking_sc
systemName["R"] = std::string("Glonass");
set_relative_rate(1.0 / static_cast<double>(d_vector_length));
#if GNURADIO_GREATER_THAN_38
this->set_relative_rate(1, static_cast<uint64_t>(d_vector_length));
#else
this->set_relative_rate(1.0 / static_cast<double>(d_vector_length));
#endif
// set_min_output_buffer((int64_t)300);
}

View File

@ -139,7 +139,11 @@ Glonass_L2_Ca_Dll_Pll_Tracking_cc::Glonass_L2_Ca_Dll_Pll_Tracking_cc(
systemName["R"] = std::string("Glonass");
set_relative_rate(1.0 / static_cast<double>(d_vector_length));
#if GNURADIO_GREATER_THAN_38
this->set_relative_rate(1, static_cast<uint64_t>(d_vector_length));
#else
this->set_relative_rate(1.0 / static_cast<double>(d_vector_length));
#endif
}

View File

@ -135,7 +135,11 @@ Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc(
systemName["G"] = std::string("GPS");
systemName["S"] = std::string("SBAS");
set_relative_rate(1.0 / (static_cast<double>(d_vector_length) * 2.0));
#if GNURADIO_GREATER_THAN_38
this->set_relative_rate(1, static_cast<uint64_t>(d_vector_length * 2));
#else
this->set_relative_rate(1.0 / static_cast<double>(d_vector_length * 2));
#endif
d_acquisition_gnss_synchro = 0;
d_channel = 0;

View File

@ -159,7 +159,11 @@ Gps_L1_Ca_Gaussian_Tracking_cc::Gps_L1_Ca_Gaussian_Tracking_cc(
systemName["G"] = std::string("GPS");
systemName["S"] = std::string("SBAS");
set_relative_rate(1.0 / static_cast<double>(d_vector_length));
#if GNURADIO_GREATER_THAN_38
this->set_relative_rate(1, static_cast<uint64_t>(d_vector_length));
#else
this->set_relative_rate(1.0 / static_cast<double>(d_vector_length));
#endif
// Kalman filter initialization (receiver initialization)

View File

@ -131,12 +131,16 @@ kf_tracking::kf_tracking(const Kf_Conf &conf_)
d_dump_mat(d_trk_parameters.dump_mat && d_dump),
d_acc_carrier_phase_initialized(false)
{
#if GNURADIO_GREATER_THAN_38
this->set_relative_rate(1, static_cast<uint64_t>(d_trk_parameters.vector_length));
#else
this->set_relative_rate(1.0 / static_cast<double>(d_trk_parameters.vector_length));
#endif
// prevent telemetry symbols accumulation in output buffers
this->set_max_noutput_items(1);
// Telemetry bit synchronization message port input
this->message_port_register_out(pmt::mp("events"));
this->set_relative_rate(1.0 / static_cast<double>(d_trk_parameters.vector_length));
// Telemetry message port input
this->message_port_register_in(pmt::mp("telemetry_to_trk"));