1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-10-30 22:56:22 +00:00
This commit is contained in:
Carles Fernandez 2023-11-20 16:59:22 +01:00
commit ab81fdaca9
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
21 changed files with 38 additions and 33 deletions

View File

@ -31,6 +31,11 @@ All notable changes to GNSS-SDR will be documented in this file.
- `geohash`, an
[encoded geographic location](https://en.wikipedia.org/wiki/Geohash).
### Improvements in Maintainability
- Removed useless casts and shadowed variables, improving source code
readability.
### Improvements in Portability:
- Updated local `cpu_features` library to v0.9.0.

View File

@ -11309,7 +11309,6 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga
it++)
{
lineObs.clear();
const auto satsys_gal = satelliteSystem.find("Galileo");
if (satsys_gal != satelliteSystem.cend())
{
lineObs += satsys_gal->second;

View File

@ -24,7 +24,7 @@
uint32_t gps_l2c_m_shift(uint32_t x)
{
return static_cast<uint32_t>((x >> 1U) xor ((x & 1U) * 0445112474U));
return ((x >> 1U) xor ((x & 1U) * 0445112474U));
}

View File

@ -210,7 +210,7 @@ void gps_l5i_code_gen_complex_sampled(own::span<std::complex<float>> dest, uint3
// === Digitizing ==================================================
// --- Make index array to read L5 code values ---------------------
codeValueIndex = static_cast<int32_t>(std::ceil(ts * static_cast<float>(i + 1.0F) / tc)) - 1;
codeValueIndex = static_cast<int32_t>(std::ceil(ts * (i + 1.0F) / tc)) - 1;
// --- Make the digitized version of the L5I code ------------------
if (i == samplesPerCode - 1)
@ -282,7 +282,7 @@ void gps_l5q_code_gen_complex_sampled(own::span<std::complex<float>> dest, uint3
// === Digitizing ==================================================
// --- Make index array to read L5 code values ---------------------
codeValueIndex = static_cast<int32_t>(std::ceil(ts * static_cast<float>(i + 1.0F) / tc)) - 1;
codeValueIndex = static_cast<int32_t>(std::ceil(ts * (i + 1.0F) / tc)) - 1;
// --- Make the digitized version of the L5Q code ------------------
if (i == samplesPerCode - 1)

View File

@ -43,7 +43,7 @@ ZmqSignalSource::ZmqSignalSource(const ConfigurationInterface* configuration,
{
LOG(INFO) << "Connecting to ZMQ pub at " << endpoint;
// work around gnuradio interface const-deficiency
d_source_block = gr::zeromq::sub_source::make(d_item_size, vlen, endpoint.data(), timeout_ms, pass_tags, hwm);
d_source_block = gr::zeromq::sub_source::make(d_item_size, vlen, const_cast<char*>(endpoint.data()), timeout_ms, pass_tags, hwm);
// work around another bug. GNU Radio passes tags through the ZMQ block
// unconditionally if pass_tags is true, but that flag controls protocol more

View File

@ -423,8 +423,9 @@ int Viterbi_Decoder_Sbas::parity_counter(int symbol, int length)
// prev helper class
Viterbi_Decoder_Sbas::Prev::Prev(int states, int t) : num_states(states),
t(t),
Viterbi_Decoder_Sbas::Prev::Prev(int states,
int tt) : num_states(states),
t(tt),
refcount(1)
{
state = std::vector<int>(num_states);

View File

@ -56,7 +56,7 @@ private:
{
public:
int num_states;
Prev(int states, int t);
Prev(int states, int tt);
Prev(const Prev& prev);
Prev& operator=(const Prev& other);
~Prev();

View File

@ -602,10 +602,10 @@ float Galileo_HAS_data::get_code_bias_m(const std::string& signal, int PRN) cons
if (!code_bias.empty() && !targeted_system.empty())
{
std::vector<std::string> systems = this->get_systems_string();
auto Nsys = systems.size();
auto Nsys_ = systems.size();
auto nsys_index = std::distance(systems.cbegin(), std::find(systems.cbegin(), systems.cend(), targeted_system));
if (static_cast<size_t>(nsys_index) < Nsys)
if (static_cast<size_t>(nsys_index) < Nsys_)
{
std::vector<std::string> signals = get_signals_in_mask(static_cast<uint8_t>(nsys_index));
auto sig_index = std::distance(signals.cbegin(), std::find(signals.cbegin(), signals.cend(), signal));
@ -678,10 +678,10 @@ float Galileo_HAS_data::get_phase_bias_cycle(const std::string& signal, int PRN)
if (!phase_bias.empty() && !targeted_system.empty())
{
std::vector<std::string> systems = this->get_systems_string();
auto Nsys = systems.size();
auto Nsys_ = systems.size();
auto nsys_index = std::distance(systems.cbegin(), std::find(systems.cbegin(), systems.cend(), targeted_system));
if (static_cast<size_t>(nsys_index) < Nsys)
if (static_cast<size_t>(nsys_index) < Nsys_)
{
std::vector<std::string> signals = get_signals_in_mask(static_cast<uint8_t>(nsys_index));
auto sig_index = std::distance(signals.cbegin(), std::find(signals.cbegin(), signals.cend(), signal));

View File

@ -32,7 +32,7 @@ TEST(ComplexCarrierTest, StandardComplexImplementation)
auto* output = new std::complex<float>[FLAGS_size_carrier_test];
const double _f = 2000.0;
const double _fs = 2000000.0;
const auto phase_step = static_cast<double>((TWO_PI * _f) / _fs);
const auto phase_step = (TWO_PI * _f) / _fs;
double phase = 0.0;
std::chrono::time_point<std::chrono::system_clock> start, end;
@ -72,7 +72,7 @@ TEST(ComplexCarrierTest, C11ComplexImplementation)
std::vector<std::complex<float>> output(FLAGS_size_carrier_test);
const double _f = 2000.0;
const double _fs = 2000000.0;
const auto phase_step = static_cast<double>((TWO_PI * _f) / _fs);
const auto phase_step = (TWO_PI * _f) / _fs;
double phase = 0.0;
std::chrono::time_point<std::chrono::system_clock> start, end;

View File

@ -387,7 +387,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::process_message()
detection_counter++;
// The term -5 is here to correct the additional delay introduced by the FIR filter
double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - (static_cast<double>(gnss_synchro.Acq_delay_samples) - 5) * 1023.0 / static_cast<double>(fs_in * 1e-3));
double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - (static_cast<double>(gnss_synchro.Acq_delay_samples) - 5) * 1023.0 / (fs_in * 1e-3));
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
mse_delay += std::pow(delay_error_chips, 2);

View File

@ -387,7 +387,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::process_message()
detection_counter++;
// The term -5 is here to correct the additional delay introduced by the FIR filter
double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) * 1023.0 / (static_cast<double>(fs_in) * 1e-3));
double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - (gnss_synchro.Acq_delay_samples - 5) * 1023.0 / (static_cast<double>(fs_in) * 1e-3));
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
mse_delay += std::pow(delay_error_chips, 2);

View File

@ -501,7 +501,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::process_message()
detection_counter++;
// The term -5 is here to correct the additional delay introduced by the FIR filter
double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) * 1023.0 / (static_cast<double>(fs_in) * 1e-3));
double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - (gnss_synchro.Acq_delay_samples - 5) * 1023.0 / (static_cast<double>(fs_in) * 1e-3));
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
mse_delay += std::pow(delay_error_chips, 2);

View File

@ -389,7 +389,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::process_message()
detection_counter++;
// The term -5 is here to correct the additional delay introduced by the FIR filter
double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) * 1023.0 / (static_cast<double>(fs_in) * 1e-3));
double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - (gnss_synchro.Acq_delay_samples - 5) * 1023.0 / (static_cast<double>(fs_in) * 1e-3));
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
mse_delay += std::pow(delay_error_chips, 2);

View File

@ -467,19 +467,19 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::process_message()
switch (sat)
{
case 0:
delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) * 10230.0 / (static_cast<double>(fs_in) * 1e-3));
delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - (gnss_synchro.Acq_delay_samples - 5) * 10230.0 / (static_cast<double>(fs_in) * 1e-3));
doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
break;
case 1:
delay_error_chips = std::abs(static_cast<double>(expected_delay_chips1) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) * 10230.0 / (static_cast<double>(fs_in) * 1e-3));
delay_error_chips = std::abs(static_cast<double>(expected_delay_chips1) - (gnss_synchro.Acq_delay_samples - 5) * 10230.0 / (static_cast<double>(fs_in) * 1e-3));
doppler_error_hz = std::abs(expected_doppler_hz1 - gnss_synchro.Acq_doppler_hz);
break;
case 2:
delay_error_chips = std::abs(static_cast<double>(expected_delay_chips2) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) * 10230.0 / (static_cast<double>(fs_in) * 1e-3));
delay_error_chips = std::abs(static_cast<double>(expected_delay_chips2) - (gnss_synchro.Acq_delay_samples - 5) * 10230.0 / (static_cast<double>(fs_in) * 1e-3));
doppler_error_hz = std::abs(expected_doppler_hz2 - gnss_synchro.Acq_doppler_hz);
break;
case 3:
delay_error_chips = std::abs(static_cast<double>(expected_delay_chips3) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) * 10230.0 / (static_cast<double>(fs_in) * 1e-3));
delay_error_chips = std::abs(static_cast<double>(expected_delay_chips3) - (gnss_synchro.Acq_delay_samples - 5) * 10230.0 / (static_cast<double>(fs_in) * 1e-3));
doppler_error_hz = std::abs(expected_doppler_hz3 - gnss_synchro.Acq_doppler_hz);
break;
default: // case 3

View File

@ -264,7 +264,7 @@ void GalileoE5bPcpsAcquisitionTest::process_message()
{
if (message == 1)
{
double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) * 10230.0 / (static_cast<double>(fs_in) * 1e-3));
double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - (gnss_synchro.Acq_delay_samples - 5) * 10230.0 / (static_cast<double>(fs_in) * 1e-3));
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
// The term -5 is here to correct the additional delay introduced by the FIR filter
/*

View File

@ -264,7 +264,7 @@ void GalileoE6PcpsAcquisitionTest::process_message()
{
if (message == 1)
{
double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) * GALILEO_E6_B_CODE_LENGTH_CHIPS / (static_cast<double>(fs_in) * 1e-3));
double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - (gnss_synchro.Acq_delay_samples - 5) * GALILEO_E6_B_CODE_LENGTH_CHIPS / (static_cast<double>(fs_in) * 1e-3));
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
// The term -5 is here to correct the additional delay introduced by the FIR filter
/*

View File

@ -388,7 +388,7 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::process_message()
detection_counter++;
// The term -5 is here to correct the additional delay introduced by the FIR filter
double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) * 1023.0 / (static_cast<double>(fs_in) * 1e-3));
double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - (gnss_synchro.Acq_delay_samples - 5) * 1023.0 / (static_cast<double>(fs_in) * 1e-3));
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
mse_delay += std::pow(delay_error_chips, 2);

View File

@ -388,7 +388,7 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::process_message()
detection_counter++;
// The term -5 is here to correct the additional delay introduced by the FIR filter
double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) * 1023.0 / (static_cast<double>(fs_in) * 1e-3));
double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - (gnss_synchro.Acq_delay_samples - 5) * 1023.0 / (static_cast<double>(fs_in) * 1e-3));
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
mse_delay += std::pow(delay_error_chips, 2);

View File

@ -490,7 +490,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::process_message()
detection_counter++;
// The term -5 is here to correct the additional delay introduced by the FIR filter
double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) * 1023.0 / (static_cast<double>(fs_in) * 1e-3));
double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - (gnss_synchro.Acq_delay_samples - 5) * 1023.0 / (static_cast<double>(fs_in) * 1e-3));
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
mse_delay += std::pow(delay_error_chips, 2);

View File

@ -382,7 +382,7 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::process_message()
detection_counter++;
// The term -5 is here to correct the additional delay introduced by the FIR filter
double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - static_cast<double>(gnss_synchro.Acq_delay_samples - 5) * 1023.0 / (static_cast<double>(fs_in) * 1e-3));
double delay_error_chips = std::abs(static_cast<double>(expected_delay_chips) - (gnss_synchro.Acq_delay_samples - 5) * 1023.0 / (static_cast<double>(fs_in) * 1e-3));
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
mse_delay += std::pow(delay_error_chips, 2);

View File

@ -347,9 +347,9 @@ TEST_F(DataTypeAdapter, IshortToComplexValidationOfResults)
{
while (ifs.read(reinterpret_cast<char*>(&iSample), sizeof(gr_complex)))
{
EXPECT_EQ(input_data_shorts.at(i), static_cast<int16_t>(iSample.real()));
EXPECT_EQ(input_data_shorts.at(i), iSample.real());
i++;
EXPECT_EQ(input_data_shorts.at(i), static_cast<int16_t>(iSample.imag()));
EXPECT_EQ(input_data_shorts.at(i), iSample.imag());
i++;
}
}
@ -373,9 +373,9 @@ TEST_F(DataTypeAdapter, IshortToCshortValidationOfResults)
{
while (ifs.read(reinterpret_cast<char*>(&iSample), sizeof(lv_16sc_t)))
{
EXPECT_EQ(input_data_shorts.at(i), static_cast<int16_t>(iSample.real()));
EXPECT_EQ(input_data_shorts.at(i), iSample.real());
i++;
EXPECT_EQ(input_data_shorts.at(i), static_cast<int16_t>(iSample.imag()));
EXPECT_EQ(input_data_shorts.at(i), iSample.imag());
i++;
}
}