1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 12:10:34 +00:00
This commit is contained in:
Carles Fernandez 2019-02-11 18:38:59 +01:00
commit 3c07a8670c
18 changed files with 197 additions and 208 deletions

View File

@ -55,7 +55,7 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
double default_seconds_to_skip = 0.0;
size_t header_size = 0;
samples_ = configuration->property(role + ".samples", 0ULL);
samples_ = configuration->property(role + ".samples", 0);
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0LL);
filename_ = configuration->property(role + ".filename", default_filename);

View File

@ -50,7 +50,7 @@ LabsatSignalSource::LabsatSignalSource(ConfigurationInterface* configuration,
int channel_selector = configuration->property(role + ".selected_channel", 1);
std::string default_filename = "./example_capture.LS3";
samples_ = configuration->property(role + ".samples", 0ULL);
samples_ = configuration->property(role + ".samples", 0);
filename_ = configuration->property(role + ".filename", default_filename);
if (item_type_ == "gr_complex")

View File

@ -53,8 +53,8 @@ NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration,
std::string default_item_type = "byte";
std::string default_dump_filename = "../data/my_capture_dump.dat";
samples_ = configuration->property(role + ".samples", 0ULL);
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0LL);
samples_ = configuration->property(role + ".samples", 0);
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0);
filename_ = configuration->property(role + ".filename", default_filename);
// override value with commandline flag, if present

View File

@ -57,7 +57,7 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration,
std::string empty = "";
std::string default_dump_file = "./data/signal_source.dat";
std::string default_item_type = "gr_complex";
samples_ = configuration->property(role + ".samples", 0ULL);
samples_ = configuration->property(role + ".samples", 0);
dump_ = configuration->property(role + ".dump", false);
dump_filename_ = configuration->property(role + ".dump_filename",
default_dump_file);

View File

@ -52,8 +52,8 @@ SpirFileSignalSource::SpirFileSignalSource(ConfigurationInterface* configuration
std::string default_item_type = "int";
std::string default_dump_filename = "../data/my_capture_dump.dat";
samples_ = configuration->property(role + ".samples", 0ULL);
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0LL);
samples_ = configuration->property(role + ".samples", 0);
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0);
filename_ = configuration->property(role + ".filename", default_filename);
// override value with commandline flag, if present

View File

@ -49,8 +49,8 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface*
std::string default_dump_filename = "../data/my_capture_dump.dat";
item_type_ = "int";
samples_ = configuration->property(role + ".samples", 0ULL);
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0LL);
samples_ = configuration->property(role + ".samples", 0);
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0);
filename_ = configuration->property(role + ".filename", default_filename);
repeat_ = configuration->property(role + ".repeat", false);
dump_ = configuration->property(role + ".dump", false);

View File

@ -77,7 +77,7 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration,
if (RF_channels_ == 1)
{
// Single RF channel UHD operation (backward compatible config file format)
samples_.push_back(configuration->property(role + ".samples", 0ULL));
samples_.push_back(configuration->property(role + ".samples", 0));
dump_.push_back(configuration->property(role + ".dump", false));
dump_filename_.push_back(configuration->property(role + ".dump_filename", default_dump_file));
@ -92,7 +92,7 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration,
for (int i = 0; i < RF_channels_; i++)
{
// Single RF channel UHD operation (backward compatible config file format)
samples_.push_back(configuration->property(role + ".samples" + std::to_string(i), 0ULL));
samples_.push_back(configuration->property(role + ".samples" + std::to_string(i), 0));
dump_.push_back(configuration->property(role + ".dump" + std::to_string(i), false));
dump_filename_.push_back(configuration->property(role + ".dump_filename" + std::to_string(i), default_dump_file));

View File

@ -861,7 +861,7 @@ Gnuplot &Gnuplot::plot_xy_err(const X &x,
const E &dy,
const std::string &title)
{
if (x.size() == 0 || y.size() == 0 || dy.size() == 0)
if (x.empty() || y.empty() || dy.empty())
{
throw GnuplotException("std::vectors too small");
return *this;

View File

@ -52,6 +52,7 @@
#include <gnuradio/blocks/interleaved_char_to_complex.h>
#include <gnuradio/blocks/skiphead.h>
#include <gnuradio/top_block.h>
#include <utility>
DEFINE_string(config_file_ptest, std::string(""), "File containing alternative configuration parameters for the acquisition performance test.");
@ -120,7 +121,7 @@ void AcqPerfTest_msg_rx::msg_handler_events(pmt::pmt_t msg)
{
try
{
int64_t message = pmt::to_long(msg);
int64_t message = pmt::to_long(std::move(msg));
rx_message = message;
channel_internal_queue.push(rx_message);
}
@ -141,8 +142,7 @@ AcqPerfTest_msg_rx::AcqPerfTest_msg_rx(concurrent_queue<int>& queue) : gr::block
AcqPerfTest_msg_rx::~AcqPerfTest_msg_rx()
{
}
= default;
// -----------------------------------------
@ -173,21 +173,21 @@ protected:
cn0_vector = {0.0};
}
if (implementation.compare("GPS_L1_CA_PCPS_Acquisition") == 0)
if (implementation == "GPS_L1_CA_PCPS_Acquisition")
{
signal_id = "1C";
system_id = 'G';
coherent_integration_time_ms = FLAGS_acq_test_coherent_time_ms;
min_integration_ms = 1;
}
else if (implementation.compare("GPS_L1_CA_PCPS_Acquisition_Fine_Doppler") == 0)
else if (implementation == "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler")
{
signal_id = "1C";
system_id = 'G';
coherent_integration_time_ms = FLAGS_acq_test_coherent_time_ms;
min_integration_ms = 1;
}
else if (implementation.compare("Galileo_E1_PCPS_Ambiguous_Acquisition") == 0)
else if (implementation == "Galileo_E1_PCPS_Ambiguous_Acquisition")
{
signal_id = "1B";
system_id = 'E';
@ -201,21 +201,21 @@ protected:
coherent_integration_time_ms = FLAGS_acq_test_coherent_time_ms;
}
}
else if (implementation.compare("GLONASS_L1_CA_PCPS_Acquisition") == 0)
else if (implementation == "GLONASS_L1_CA_PCPS_Acquisition")
{
signal_id = "1G";
system_id = 'R';
coherent_integration_time_ms = FLAGS_acq_test_coherent_time_ms;
min_integration_ms = 1;
}
else if (implementation.compare("GLONASS_L2_CA_PCPS_Acquisition") == 0)
else if (implementation == "GLONASS_L2_CA_PCPS_Acquisition")
{
signal_id = "2G";
system_id = 'R';
coherent_integration_time_ms = FLAGS_acq_test_coherent_time_ms;
min_integration_ms = 1;
}
else if (implementation.compare("GPS_L2_M_PCPS_Acquisition") == 0)
else if (implementation == "GPS_L2_M_PCPS_Acquisition")
{
signal_id = "2S";
system_id = 'G';
@ -229,14 +229,14 @@ protected:
}
min_integration_ms = 20;
}
else if (implementation.compare("Galileo_E5a_Pcps_Acquisition") == 0)
else if (implementation == "Galileo_E5a_Pcps_Acquisition")
{
signal_id = "5X";
system_id = 'E';
coherent_integration_time_ms = FLAGS_acq_test_coherent_time_ms;
min_integration_ms = 1;
}
else if (implementation.compare("GPS_L5i_PCPS_Acquisition") == 0)
else if (implementation == "GPS_L5i_PCPS_Acquisition")
{
signal_id = "L5";
system_id = 'G';
@ -265,7 +265,7 @@ protected:
}
else
{
float aux = static_cast<float>(FLAGS_acq_test_threshold_init);
auto aux = static_cast<float>(FLAGS_acq_test_threshold_init);
pfa_vector.push_back(aux);
aux = aux + static_cast<float>(FLAGS_acq_test_threshold_step);
while (aux <= static_cast<float>(FLAGS_acq_test_threshold_final))
@ -296,8 +296,7 @@ protected:
}
~AcquisitionPerformanceTest()
{
}
= default;
std::vector<double> cn0_vector;
std::vector<float> pfa_vector;
@ -450,7 +449,7 @@ int AcquisitionPerformanceTest::generate_signal()
pid_t wait_result;
int child_status;
std::cout << "Generating signal for " << p6 << "..." << std::endl;
char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], &p6[0], NULL};
char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], &p6[0], nullptr};
int pid;
if ((pid = fork()) == -1)
@ -539,12 +538,12 @@ int AcquisitionPerformanceTest::configure_receiver(double cn0, float pfa, unsign
config->set_property("Acquisition.dump_channel", std::to_string(dump_channel));
config->set_property("Acquisition.blocking_on_standby", "true");
config_f = 0;
config_f = nullptr;
}
else
{
config_f = std::make_shared<FileConfiguration>(FLAGS_config_file_ptest);
config = 0;
config = nullptr;
}
return 0;
}
@ -576,35 +575,35 @@ int AcquisitionPerformanceTest::run_receiver()
int nsamples = floor(config->property("GNSS-SDR.internal_fs_sps", 2000000) * generated_signal_duration_s);
boost::shared_ptr<gr::block> valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue);
if (implementation.compare("GPS_L1_CA_PCPS_Acquisition") == 0)
if (implementation == "GPS_L1_CA_PCPS_Acquisition")
{
acquisition = std::make_shared<GpsL1CaPcpsAcquisition>(config.get(), "Acquisition", 1, 0);
}
else if (implementation.compare("GPS_L1_CA_PCPS_Acquisition_Fine_Doppler") == 0)
else if (implementation == "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler")
{
acquisition = std::make_shared<GpsL1CaPcpsAcquisitionFineDoppler>(config.get(), "Acquisition", 1, 0);
}
else if (implementation.compare("Galileo_E1_PCPS_Ambiguous_Acquisition") == 0)
else if (implementation == "Galileo_E1_PCPS_Ambiguous_Acquisition")
{
acquisition = std::make_shared<GalileoE1PcpsAmbiguousAcquisition>(config.get(), "Acquisition", 1, 0);
}
else if (implementation.compare("GLONASS_L1_CA_PCPS_Acquisition") == 0)
else if (implementation == "GLONASS_L1_CA_PCPS_Acquisition")
{
acquisition = std::make_shared<GlonassL1CaPcpsAcquisition>(config.get(), "Acquisition", 1, 0);
}
else if (implementation.compare("GLONASS_L2_CA_PCPS_Acquisition") == 0)
else if (implementation == "GLONASS_L2_CA_PCPS_Acquisition")
{
acquisition = std::make_shared<GlonassL2CaPcpsAcquisition>(config.get(), "Acquisition", 1, 0);
}
else if (implementation.compare("GPS_L2_M_PCPS_Acquisition") == 0)
else if (implementation == "GPS_L2_M_PCPS_Acquisition")
{
acquisition = std::make_shared<GpsL2MPcpsAcquisition>(config.get(), "Acquisition", 1, 0);
}
else if (implementation.compare("Galileo_E5a_Pcps_Acquisition") == 0)
else if (implementation == "Galileo_E5a_Pcps_Acquisition")
{
acquisition = std::make_shared<GalileoE5aPcpsAcquisition>(config.get(), "Acquisition", 1, 0);
}
else if (implementation.compare("GPS_L5i_PCPS_Acquisition") == 0)
else if (implementation == "GPS_L5i_PCPS_Acquisition")
{
acquisition = std::make_shared<GpsL5iPcpsAcquisition>(config.get(), "Acquisition", 1, 0);
}
@ -649,12 +648,12 @@ int AcquisitionPerformanceTest::count_executions(const std::string& basename, un
char buffer[1024];
fp = popen(&argum2[0], "r");
int num_executions = 1;
if (fp == NULL)
if (fp == nullptr)
{
std::cout << "Failed to run command: " << argum2 << std::endl;
return 0;
}
while (fgets(buffer, sizeof(buffer), fp) != NULL)
while (fgets(buffer, sizeof(buffer), fp) != nullptr)
{
std::string aux = std::string(buffer);
EXPECT_EQ(aux.empty(), false);
@ -682,7 +681,7 @@ void AcquisitionPerformanceTest::plot_results()
{
boost::filesystem::path p(gnuplot_executable);
boost::filesystem::path dir = p.parent_path();
std::string gnuplot_path = dir.native();
const std::string& gnuplot_path = dir.native();
Gnuplot::set_GNUPlotPath(gnuplot_path);
Gnuplot g1("linespoints");
@ -696,7 +695,7 @@ void AcquisitionPerformanceTest::plot_results()
}
g1.cmd("set font \"Times,18\"");
g1.set_title("Receiver Operating Characteristic for GPS L1 C/A acquisition");
g1.cmd("set label 1 \"" + std::string("Coherent integration time: ") + std::to_string(config->property("Acquisition.coherent_integration_time_ms", 1)) + " ms, Non-coherent integrations: " + std::to_string(config->property("Acquisition.max_dwells", 1)) + " \" at screen 0.12, 0.83 font \"Times,16\"");
g1.cmd("set label 1 \"" + std::string("Coherent integration time: ") + std::to_string(config->property("Acquisition.coherent_integration_time_ms", 1)) + " ms, Non-coherent integrations: " + std::to_string(config->property("Acquisition.max_dwells", 1)) + R"( " at screen 0.12, 0.83 font "Times,16")");
g1.cmd("set logscale x");
g1.cmd("set yrange [0:1]");
g1.cmd("set xrange[0.0001:1]");
@ -732,7 +731,7 @@ void AcquisitionPerformanceTest::plot_results()
}
g2.cmd("set font \"Times,18\"");
g2.set_title("Receiver Operating Characteristic for GPS L1 C/A valid acquisition");
g2.cmd("set label 1 \"" + std::string("Coherent integration time: ") + std::to_string(config->property("Acquisition.coherent_integration_time_ms", 1)) + " ms, Non-coherent integrations: " + std::to_string(config->property("Acquisition.max_dwells", 1)) + " \" at screen 0.12, 0.83 font \"Times,16\"");
g2.cmd("set label 1 \"" + std::string("Coherent integration time: ") + std::to_string(config->property("Acquisition.coherent_integration_time_ms", 1)) + " ms, Non-coherent integrations: " + std::to_string(config->property("Acquisition.max_dwells", 1)) + R"( " at screen 0.12, 0.83 font "Times,16")");
g2.cmd("set logscale x");
g2.cmd("set yrange [0:1]");
g2.cmd("set xrange[0.0001:1]");
@ -778,13 +777,13 @@ TEST_F(AcquisitionPerformanceTest, ROC)
ASSERT_TRUE(boost::filesystem::create_directory(path_str, ec)) << "Could not create the " << path_str << " folder.";
unsigned int cn0_index = 0;
for (std::vector<double>::const_iterator it = cn0_vector.cbegin(); it != cn0_vector.cend(); ++it)
for (double it : cn0_vector)
{
std::vector<double> meas_Pd_;
std::vector<double> meas_Pd_correct_;
std::vector<double> meas_Pfa_;
if (FLAGS_acq_test_input_file.empty()) std::cout << "Execution for CN0 = " << *it << " dB-Hz" << std::endl;
if (FLAGS_acq_test_input_file.empty()) std::cout << "Execution for CN0 = " << it << " dB-Hz" << std::endl;
// Do N_iterations of the experiment
for (int pfa_iter = 0; pfa_iter < static_cast<int>(pfa_vector.size()); pfa_iter++)
@ -799,7 +798,7 @@ TEST_F(AcquisitionPerformanceTest, ROC)
}
// Configure the signal generator
if (FLAGS_acq_test_input_file.empty()) configure_generator(*it);
if (FLAGS_acq_test_input_file.empty()) configure_generator(it);
for (int iter = 0; iter < N_iterations; iter++)
{
@ -819,13 +818,13 @@ TEST_F(AcquisitionPerformanceTest, ROC)
init();
// Configure the receiver
configure_receiver(*it, pfa_vector[pfa_iter], iter);
configure_receiver(it, pfa_vector[pfa_iter], iter);
// Run it
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(it) + "_" + std::to_string(iter) + "_" + std::to_string(pfa_vector[pfa_iter]) + "_" + gnss_synchro.System + "_" + signal_id;
int num_executions = count_executions(basename, observed_satellite);
// Read measured data
@ -968,7 +967,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_BLACK << "Probability of detection for channel=" << ch << ", CN0=" << it << " dBHz"
<< ": " << (num_executions > 0 ? computed_Pd : 0.0) << TEXT_RESET << std::endl;
}
if (num_clean_executions > 0)
@ -985,7 +984,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_BLACK << "Probability of correct detection for channel=" << ch << ", CN0=" << it << " dBHz"
<< ": " << computed_Pd_correct << TEXT_RESET << std::endl;
}
else
@ -1003,7 +1002,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_BLACK << "Probability of false alarm for channel=" << ch << ", CN0=" << it << " dBHz"
<< ": " << (num_executions > 0 ? computed_Pfa : 0.0) << TEXT_RESET << std::endl;
}
}
@ -1014,14 +1013,14 @@ TEST_F(AcquisitionPerformanceTest, ROC)
float sum_pd = static_cast<float>(std::accumulate(meas_Pd_.begin(), meas_Pd_.end(), 0.0));
float sum_pd_correct = static_cast<float>(std::accumulate(meas_Pd_correct_.begin(), meas_Pd_correct_.end(), 0.0));
float sum_pfa = static_cast<float>(std::accumulate(meas_Pfa_.begin(), meas_Pfa_.end(), 0.0));
if (meas_Pd_.size() > 0 and meas_Pfa_.size() > 0)
if (!meas_Pd_.empty() and !meas_Pfa_.empty())
{
Pd[cn0_index][pfa_iter] = sum_pd / static_cast<float>(meas_Pd_.size());
Pfa[cn0_index][pfa_iter] = sum_pfa / static_cast<float>(meas_Pfa_.size());
}
else
{
if (meas_Pd_.size() > 0)
if (!meas_Pd_.empty())
{
Pd[cn0_index][pfa_iter] = sum_pd / static_cast<float>(meas_Pd_.size());
}
@ -1029,7 +1028,7 @@ TEST_F(AcquisitionPerformanceTest, ROC)
{
Pd[cn0_index][pfa_iter] = 0.0;
}
if (meas_Pfa_.size() > 0)
if (!meas_Pfa_.empty())
{
Pfa[cn0_index][pfa_iter] = sum_pfa / static_cast<float>(meas_Pfa_.size());
}
@ -1038,7 +1037,7 @@ TEST_F(AcquisitionPerformanceTest, ROC)
Pfa[cn0_index][pfa_iter] = 0.0;
}
}
if (meas_Pd_correct_.size() > 0)
if (!meas_Pd_correct_.empty())
{
Pd_correct[cn0_index][pfa_iter] = sum_pd_correct / static_cast<float>(meas_Pd_correct_.size());
}
@ -1055,9 +1054,9 @@ TEST_F(AcquisitionPerformanceTest, ROC)
// Compute results
unsigned int aux_index = 0;
for (std::vector<double>::const_iterator it = cn0_vector.cbegin(); it != cn0_vector.cend(); ++it)
for (double it : cn0_vector)
{
std::cout << "Results for CN0 = " << *it << " dBHz:" << std::endl;
std::cout << "Results for CN0 = " << it << " dBHz:" << std::endl;
std::cout << "Pd = ";
for (int pfa_iter = 0; pfa_iter < num_thresholds; pfa_iter++)
{

View File

@ -37,6 +37,7 @@
#include <gnuradio/top_block.h>
#include <chrono>
#include <cstdlib>
#include <utility>
#ifdef GR_GREATER_38
#include <gnuradio/analog/sig_source.h>
#else
@ -84,7 +85,7 @@ void GlonassL1CaPcpsAcquisitionTest_msg_rx::msg_handler_events(pmt::pmt_t msg)
{
try
{
int64_t message = pmt::to_long(msg);
int64_t message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (boost::bad_any_cast& e)
@ -104,8 +105,7 @@ GlonassL1CaPcpsAcquisitionTest_msg_rx::GlonassL1CaPcpsAcquisitionTest_msg_rx() :
GlonassL1CaPcpsAcquisitionTest_msg_rx::~GlonassL1CaPcpsAcquisitionTest_msg_rx()
{
}
= default;
// ###########################################################
@ -122,8 +122,7 @@ protected:
}
~GlonassL1CaPcpsAcquisitionTest()
{
}
= default;
void init();

View File

@ -37,6 +37,7 @@
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/top_block.h>
#include <chrono>
#include <utility>
#ifdef GR_GREATER_38
#include <gnuradio/analog/sig_source.h>
#else
@ -87,7 +88,7 @@ void GpsL2MPcpsAcquisitionTest_msg_rx::msg_handler_events(pmt::pmt_t msg)
{
try
{
int64_t message = pmt::to_long(msg);
int64_t message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (boost::bad_any_cast &e)
@ -105,8 +106,7 @@ GpsL2MPcpsAcquisitionTest_msg_rx::GpsL2MPcpsAcquisitionTest_msg_rx() : gr::block
}
GpsL2MPcpsAcquisitionTest_msg_rx::~GpsL2MPcpsAcquisitionTest_msg_rx()
{
}
= default;
// ###########################################################
@ -127,8 +127,7 @@ protected:
}
~GpsL2MPcpsAcquisitionTest()
{
}
= default;
void init();
void plot_grid();
@ -181,9 +180,9 @@ void GpsL2MPcpsAcquisitionTest::plot_grid()
{
//load the measured values
std::string basename = "./tmp-acq-gps2/acquisition_test_G_2S";
unsigned int sat = static_cast<unsigned int>(gnss_synchro.PRN);
auto sat = static_cast<unsigned int>(gnss_synchro.PRN);
unsigned int samples_per_code = static_cast<unsigned int>(floor(static_cast<double>(sampling_frequency_hz) / (GPS_L2_M_CODE_RATE_HZ / static_cast<double>(GPS_L2_M_CODE_LENGTH_CHIPS))));
auto samples_per_code = static_cast<unsigned int>(floor(static_cast<double>(sampling_frequency_hz) / (GPS_L2_M_CODE_RATE_HZ / static_cast<double>(GPS_L2_M_CODE_LENGTH_CHIPS))));
acquisition_dump_reader acq_dump(basename, sat, doppler_max, doppler_step, samples_per_code, 1);
if (!acq_dump.read_binary_acq()) std::cout << "Error reading files" << std::endl;
@ -205,7 +204,7 @@ void GpsL2MPcpsAcquisitionTest::plot_grid()
{
boost::filesystem::path p(gnuplot_executable);
boost::filesystem::path dir = p.parent_path();
std::string gnuplot_path = dir.native();
const std::string& gnuplot_path = dir.native();
Gnuplot::set_GNUPlotPath(gnuplot_path);
Gnuplot g1("impulses");
@ -362,7 +361,7 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ValidationOfResults)
ASSERT_EQ(1, msg_rx->rx_message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
double delay_error_samples = std::abs(expected_delay_samples - gnss_synchro.Acq_delay_samples);
float delay_error_chips = static_cast<float>(delay_error_samples * 1023 / 4000);
auto delay_error_chips = static_cast<float>(delay_error_samples * 1023 / 4000);
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
EXPECT_LE(doppler_error_hz, 200) << "Doppler error exceeds the expected value: 2/(3*integration period)";

View File

@ -80,6 +80,7 @@
#include <chrono>
#include <exception>
#include <unistd.h>
#include <utility>
#ifdef GR_GREATER_38
#include <gnuradio/filter/fir_filter_blk.h>
#else
@ -115,7 +116,7 @@ void HybridObservablesTest_msg_rx::msg_handler_events(pmt::pmt_t msg)
{
try
{
int64_t message = pmt::to_long(msg);
int64_t message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (boost::bad_any_cast& e)
@ -133,8 +134,7 @@ HybridObservablesTest_msg_rx::HybridObservablesTest_msg_rx() : gr::block("Hybrid
}
HybridObservablesTest_msg_rx::~HybridObservablesTest_msg_rx()
{
}
= default;
// ###########################################################
@ -168,7 +168,7 @@ void HybridObservablesTest_tlm_msg_rx::msg_handler_events(pmt::pmt_t msg)
{
try
{
int64_t message = pmt::to_long(msg);
int64_t message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (boost::bad_any_cast& e)
@ -186,8 +186,7 @@ HybridObservablesTest_tlm_msg_rx::HybridObservablesTest_tlm_msg_rx() : gr::block
}
HybridObservablesTest_tlm_msg_rx::~HybridObservablesTest_tlm_msg_rx()
{
}
= default;
// ###########################################################
@ -229,7 +228,7 @@ public:
arma::mat& true_ch0,
arma::vec& true_tow_s,
arma::mat& measured_ch0,
std::string data_title);
const std::string& data_title);
void check_results_carrier_phase_double_diff(
arma::mat& true_ch0,
arma::mat& true_ch1,
@ -237,11 +236,11 @@ public:
arma::vec& true_tow_ch1_s,
arma::mat& measured_ch0,
arma::mat& measured_ch1,
std::string data_title);
const std::string& data_title);
void check_results_carrier_doppler(arma::mat& true_ch0,
arma::vec& true_tow_s,
arma::mat& measured_ch0,
std::string data_title);
const std::string& data_title);
void check_results_carrier_doppler_double_diff(
arma::mat& true_ch0,
arma::mat& true_ch1,
@ -249,7 +248,7 @@ public:
arma::vec& true_tow_ch1_s,
arma::mat& measured_ch0,
arma::mat& measured_ch1,
std::string data_title);
const std::string& data_title);
void check_results_code_pseudorange(
arma::mat& true_ch0,
arma::mat& true_ch1,
@ -257,13 +256,13 @@ public:
arma::vec& true_tow_ch1_s,
arma::mat& measured_ch0,
arma::mat& measured_ch1,
std::string data_title);
const std::string& data_title);
void check_results_duplicated_satellite(
arma::mat& measured_sat1,
arma::mat& measured_sat2,
int ch_id,
std::string data_title);
const std::string& data_title);
HybridObservablesTest()
{
@ -280,8 +279,7 @@ public:
}
~HybridObservablesTest()
{
}
= default;
bool ReadRinexObs(std::vector<arma::mat>* obs_vec, Gnss_Synchro gnss);
@ -328,7 +326,7 @@ int HybridObservablesTest::generate_signal()
{
int child_status;
char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], NULL};
char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], nullptr};
int pid;
if ((pid = fork()) == -1)
@ -374,7 +372,7 @@ bool HybridObservablesTest::acquire_signal()
std::string System_and_Signal;
std::string signal;
//create the correspondign acquisition block according to the desired tracking signal
if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking") == 0)
if (implementation == "GPS_L1_CA_DLL_PLL_Tracking")
{
tmp_gnss_synchro.System = 'G';
signal = "1C";
@ -386,7 +384,7 @@ bool HybridObservablesTest::acquire_signal()
//acquisition = std::make_shared<GpsL1CaPcpsAcquisitionFineDoppler>(config.get(), "Acquisition", 1, 0);
acquisition = std::make_shared<GpsL1CaPcpsAcquisition>(config.get(), "Acquisition", 1, 0);
}
else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking") == 0)
else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking")
{
tmp_gnss_synchro.System = 'E';
signal = "1B";
@ -397,7 +395,7 @@ bool HybridObservablesTest::acquire_signal()
config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells));
acquisition = std::make_shared<GalileoE1PcpsAmbiguousAcquisition>(config.get(), "Acquisition", 1, 0);
}
else if (implementation.compare("GPS_L2_M_DLL_PLL_Tracking") == 0)
else if (implementation == "GPS_L2_M_DLL_PLL_Tracking")
{
tmp_gnss_synchro.System = 'G';
signal = "2S";
@ -408,7 +406,7 @@ bool HybridObservablesTest::acquire_signal()
config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells));
acquisition = std::make_shared<GpsL2MPcpsAcquisition>(config.get(), "Acquisition", 1, 0);
}
else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_b") == 0)
else if (implementation == "Galileo_E5a_DLL_PLL_Tracking_b")
{
tmp_gnss_synchro.System = 'E';
signal = "5X";
@ -424,7 +422,7 @@ bool HybridObservablesTest::acquire_signal()
acquisition = std::make_shared<GalileoE5aNoncoherentIQAcquisitionCaf>(config.get(), "Acquisition", 1, 0);
}
else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking") == 0)
else if (implementation == "Galileo_E5a_DLL_PLL_Tracking")
{
tmp_gnss_synchro.System = 'E';
signal = "5X";
@ -435,7 +433,7 @@ bool HybridObservablesTest::acquire_signal()
config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells));
acquisition = std::make_shared<GalileoE5aPcpsAcquisition>(config.get(), "Acquisition", 1, 0);
}
else if (implementation.compare("GPS_L5_DLL_PLL_Tracking") == 0)
else if (implementation == "GPS_L5_DLL_PLL_Tracking")
{
tmp_gnss_synchro.System = 'G';
signal = "L5";
@ -641,7 +639,7 @@ bool HybridObservablesTest::acquire_signal()
std::cout << "Total signal acquisition run time "
<< elapsed_seconds.count()
<< " [seconds]" << std::endl;
if (gnss_synchro_vec.size() > 0)
if (!gnss_synchro_vec.empty())
{
return true;
}
@ -684,7 +682,7 @@ void HybridObservablesTest::configure_receiver(
config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(baseband_sampling_freq));
std::string System_and_Signal;
if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking") == 0)
if (implementation == "GPS_L1_CA_DLL_PLL_Tracking")
{
gnss_synchro_master.System = 'G';
std::string signal = "1C";
@ -697,7 +695,7 @@ void HybridObservablesTest::configure_receiver(
config->set_property("TelemetryDecoder.implementation", "GPS_L1_CA_Telemetry_Decoder");
}
else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking") == 0)
else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking")
{
gnss_synchro_master.System = 'E';
std::string signal = "1B";
@ -713,7 +711,7 @@ void HybridObservablesTest::configure_receiver(
config->set_property("TelemetryDecoder.implementation", "Galileo_E1B_Telemetry_Decoder");
}
else if (implementation.compare("GPS_L2_M_DLL_PLL_Tracking") == 0)
else if (implementation == "GPS_L2_M_DLL_PLL_Tracking")
{
gnss_synchro_master.System = 'G';
std::string signal = "2S";
@ -726,7 +724,7 @@ void HybridObservablesTest::configure_receiver(
config->set_property("TelemetryDecoder.implementation", "GPS_L2C_Telemetry_Decoder");
}
else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking") == 0 or implementation.compare("Galileo_E5a_DLL_PLL_Tracking_b") == 0)
else if (implementation == "Galileo_E5a_DLL_PLL_Tracking" or implementation == "Galileo_E5a_DLL_PLL_Tracking_b")
{
gnss_synchro_master.System = 'E';
std::string signal = "5X";
@ -734,7 +732,7 @@ void HybridObservablesTest::configure_receiver(
const char* str = signal.c_str(); // get a C style null terminated string
std::memcpy(static_cast<void*>(gnss_synchro_master.Signal), str, 3); // copy string into synchro char array: 2 char + null
if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_b") == 0)
if (implementation == "Galileo_E5a_DLL_PLL_Tracking_b")
{
config->supersede_property("Tracking.implementation", std::string("Galileo_E5a_DLL_PLL_Tracking"));
}
@ -744,7 +742,7 @@ void HybridObservablesTest::configure_receiver(
config->set_property("TelemetryDecoder.implementation", "Galileo_E5a_Telemetry_Decoder");
}
else if (implementation.compare("GPS_L5_DLL_PLL_Tracking") == 0)
else if (implementation == "GPS_L5_DLL_PLL_Tracking")
{
gnss_synchro_master.System = 'G';
std::string signal = "L5";
@ -784,7 +782,7 @@ void HybridObservablesTest::check_results_carrier_phase(
arma::mat& true_ch0,
arma::vec& true_tow_s,
arma::mat& measured_ch0,
std::string data_title)
const std::string& data_title)
{
//1. True value interpolation to match the measurement times
@ -865,7 +863,7 @@ void HybridObservablesTest::check_results_carrier_phase_double_diff(
arma::vec& true_tow_ch1_s,
arma::mat& measured_ch0,
arma::mat& measured_ch1,
std::string data_title)
const std::string& data_title)
{
//1. True value interpolation to match the measurement times
@ -956,7 +954,7 @@ void HybridObservablesTest::check_results_carrier_doppler_double_diff(
arma::vec& true_tow_ch1_s,
arma::mat& measured_ch0,
arma::mat& measured_ch1,
std::string data_title)
const std::string& data_title)
{
//1. True value interpolation to match the measurement times
@ -1044,7 +1042,7 @@ void HybridObservablesTest::check_results_carrier_doppler(
arma::mat& true_ch0,
arma::vec& true_tow_s,
arma::mat& measured_ch0,
std::string data_title)
const std::string& data_title)
{
//1. True value interpolation to match the measurement times
@ -1122,7 +1120,7 @@ void HybridObservablesTest::check_results_duplicated_satellite(
arma::mat& measured_sat1,
arma::mat& measured_sat2,
int ch_id,
std::string data_title)
const std::string& data_title)
{
//1. True value interpolation to match the measurement times
@ -1377,8 +1375,8 @@ bool HybridObservablesTest::save_mat_xy(std::vector<double>& x, std::vector<doub
matvar_t* matvar;
filename.append(".mat");
std::cout << "save_mat_xy write " << filename << std::endl;
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT5);
if (reinterpret_cast<int64_t*>(matfp) != NULL)
matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT5);
if (reinterpret_cast<int64_t*>(matfp) != nullptr)
{
size_t dims[2] = {1, x.size()};
matvar = Mat_VarCreate("x", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, &x[0], 0);
@ -1410,7 +1408,7 @@ void HybridObservablesTest::check_results_code_pseudorange(
arma::vec& true_tow_ch1_s,
arma::mat& measured_ch0,
arma::mat& measured_ch1,
std::string data_title)
const std::string& data_title)
{
//1. True value interpolation to match the measurement times
@ -1534,7 +1532,7 @@ bool HybridObservablesTest::ReadRinexObs(std::vector<arma::mat>* obs_vec, Gnss_S
gpstk::CommonTime time = r_ref_data.time;
double sow(static_cast<gpstk::GPSWeekSecond>(time).sow);
gpstk::Rinex3ObsData::DataMap::iterator pointer = r_ref_data.obs.find(prn);
auto pointer = r_ref_data.obs.find(prn);
if (pointer == r_ref_data.obs.end())
{
// PRN not present; do nothing
@ -1679,7 +1677,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
FLAGS_high_dyn);
for (unsigned int n = 0; n < gnss_synchro_vec.size(); n++)
for (auto & n : gnss_synchro_vec)
{
//setup the signal synchronization, simulating an acquisition
if (!FLAGS_enable_external_signal_file)
@ -1689,9 +1687,9 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
std::vector<std::shared_ptr<tracking_true_obs_reader>> true_reader_vec;
//read true data from the generator logs
true_reader_vec.push_back(std::make_shared<tracking_true_obs_reader>());
std::cout << "Loading true observable data for PRN " << gnss_synchro_vec.at(n).PRN << std::endl;
std::cout << "Loading true observable data for PRN " << n.PRN << std::endl;
std::string true_obs_file = std::string("./gps_l1_ca_obs_prn");
true_obs_file.append(std::to_string(gnss_synchro_vec.at(n).PRN));
true_obs_file.append(std::to_string(n.PRN));
true_obs_file.append(".dat");
ASSERT_NO_THROW({
if (true_reader_vec.back()->open_obs_file(true_obs_file) == false)
@ -1713,17 +1711,17 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
std::cout << "Initial Doppler [Hz]=" << true_reader_vec.back()->doppler_l1_hz << " Initial code delay [Chips]="
<< true_reader_vec.back()->prn_delay_chips << std::endl;
gnss_synchro_vec.at(n).Acq_delay_samples = (GPS_L1_CA_CODE_LENGTH_CHIPS - true_reader_vec.back()->prn_delay_chips / GPS_L1_CA_CODE_LENGTH_CHIPS) * baseband_sampling_freq * GPS_L1_CA_CODE_PERIOD;
gnss_synchro_vec.at(n).Acq_doppler_hz = true_reader_vec.back()->doppler_l1_hz;
gnss_synchro_vec.at(n).Acq_samplestamp_samples = 0;
n.Acq_delay_samples = (GPS_L1_CA_CODE_LENGTH_CHIPS - true_reader_vec.back()->prn_delay_chips / GPS_L1_CA_CODE_LENGTH_CHIPS) * baseband_sampling_freq * GPS_L1_CA_CODE_PERIOD;
n.Acq_doppler_hz = true_reader_vec.back()->doppler_l1_hz;
n.Acq_samplestamp_samples = 0;
}
else
{
//based on the signal acquisition process
std::cout << "Estimated Initial Doppler " << gnss_synchro_vec.at(n).Acq_doppler_hz
<< " [Hz], estimated Initial code delay " << gnss_synchro_vec.at(n).Acq_delay_samples << " [Samples]"
<< " Acquisition SampleStamp is " << gnss_synchro_vec.at(n).Acq_samplestamp_samples << std::endl;
gnss_synchro_vec.at(n).Acq_samplestamp_samples = 0;
std::cout << "Estimated Initial Doppler " << n.Acq_doppler_hz
<< " [Hz], estimated Initial code delay " << n.Acq_delay_samples << " [Samples]"
<< " Acquisition SampleStamp is " << n.Acq_samplestamp_samples << std::endl;
n.Acq_samplestamp_samples = 0;
}
}
@ -1777,10 +1775,10 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
//Observables
std::shared_ptr<ObservablesInterface> observables(new HybridObservables(config.get(), "Observables", tracking_ch_vec.size() + 1, tracking_ch_vec.size()));
for (unsigned int n = 0; n < tracking_ch_vec.size(); n++)
for (auto & n : tracking_ch_vec)
{
ASSERT_NO_THROW({
tracking_ch_vec.at(n)->connect(top_block);
n->connect(top_block);
}) << "Failure connecting tracking to the top_block.";
}
@ -1817,9 +1815,9 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
file_source->seek(2 * FLAGS_skip_samples, 0); //skip head. ibyte, two bytes per complex sample
}) << "Failure connecting the blocks.";
for (unsigned int n = 0; n < tracking_ch_vec.size(); n++)
for (auto & n : tracking_ch_vec)
{
tracking_ch_vec.at(n)->start_tracking();
n->start_tracking();
}
EXPECT_NO_THROW({
@ -1844,7 +1842,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
}
}) << "Failure opening true observables file";
unsigned int nepoch = static_cast<unsigned int>(true_observables.num_epochs());
auto nepoch = static_cast<unsigned int>(true_observables.num_epochs());
std::cout << "True observation epochs = " << nepoch << std::endl;
@ -1892,7 +1890,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
}
}) << "Failure opening dump observables file";
unsigned int nepoch = static_cast<unsigned int>(estimated_observables.num_epochs());
auto nepoch = static_cast<unsigned int>(estimated_observables.num_epochs());
std::cout << "Measured observations epochs = " << nepoch << std::endl;
// Matrices for storing columnwise measured RX_time, TOW, Doppler, Carrier phase and Pseudorange
@ -1923,12 +1921,12 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
//Cut measurement tail zeros
arma::uvec index;
for (unsigned int n = 0; n < measured_obs_vec.size(); n++)
for (auto & n : measured_obs_vec)
{
index = arma::find(measured_obs_vec.at(n).col(0) > 0.0, 1, "last");
if ((index.size() > 0) and index(0) < (nepoch - 1))
index = arma::find(n.col(0) > 0.0, 1, "last");
if ((!index.empty()) and index(0) < (nepoch - 1))
{
measured_obs_vec.at(n).shed_rows(index(0) + 1, nepoch - 1);
n.shed_rows(index(0) + 1, nepoch - 1);
}
}
@ -1937,7 +1935,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
for (unsigned int n = 0; n < measured_obs_vec.size(); n++)
{
index = arma::find(measured_obs_vec.at(n).col(0) >= (measured_obs_vec.at(n)(0, 0) + initial_transitory_s), 1, "first");
if ((index.size() > 0) and (index(0) > 0))
if ((!index.empty()) and (index(0) > 0))
{
measured_obs_vec.at(n).shed_rows(0, index(0));
}
@ -1945,7 +1943,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
if (!FLAGS_duplicated_satellites_test)
{
index = arma::find(measured_obs_vec.at(n).col(0) >= true_obs_vec.at(n)(0, 0), 1, "first");
if ((index.size() > 0) and (index(0) > 0))
if ((!index.empty()) and (index(0) > 0))
{
measured_obs_vec.at(n).shed_rows(0, index(0));
}

View File

@ -58,11 +58,11 @@ rtk_t configure_rtklib_options()
int positioning_mode = -1;
std::string default_pos_mode("Single");
std::string positioning_mode_str = configuration->property(role + ".positioning_mode", default_pos_mode); /* (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h */
if (positioning_mode_str.compare("Single") == 0) positioning_mode = PMODE_SINGLE;
if (positioning_mode_str.compare("Static") == 0) positioning_mode = PMODE_STATIC;
if (positioning_mode_str.compare("Kinematic") == 0) positioning_mode = PMODE_KINEMA;
if (positioning_mode_str.compare("PPP_Static") == 0) positioning_mode = PMODE_PPP_STATIC;
if (positioning_mode_str.compare("PPP_Kinematic") == 0) positioning_mode = PMODE_PPP_KINEMA;
if (positioning_mode_str == "Single") positioning_mode = PMODE_SINGLE;
if (positioning_mode_str == "Static") positioning_mode = PMODE_STATIC;
if (positioning_mode_str == "Kinematic") positioning_mode = PMODE_KINEMA;
if (positioning_mode_str == "PPP_Static") positioning_mode = PMODE_PPP_STATIC;
if (positioning_mode_str == "PPP_Kinematic") positioning_mode = PMODE_PPP_KINEMA;
if (positioning_mode == -1)
{
@ -107,12 +107,12 @@ rtk_t configure_rtklib_options()
std::string default_iono_model("OFF");
std::string iono_model_str = configuration->property(role + ".iono_model", default_iono_model); /* (IONOOPT_XXX) see src/algorithms/libs/rtklib/rtklib.h */
int iono_model = -1;
if (iono_model_str.compare("OFF") == 0) iono_model = IONOOPT_OFF;
if (iono_model_str.compare("Broadcast") == 0) iono_model = IONOOPT_BRDC;
if (iono_model_str.compare("SBAS") == 0) iono_model = IONOOPT_SBAS;
if (iono_model_str.compare("Iono-Free-LC") == 0) iono_model = IONOOPT_IFLC;
if (iono_model_str.compare("Estimate_STEC") == 0) iono_model = IONOOPT_EST;
if (iono_model_str.compare("IONEX") == 0) iono_model = IONOOPT_TEC;
if (iono_model_str == "OFF") iono_model = IONOOPT_OFF;
if (iono_model_str == "Broadcast") iono_model = IONOOPT_BRDC;
if (iono_model_str == "SBAS") iono_model = IONOOPT_SBAS;
if (iono_model_str == "Iono-Free-LC") iono_model = IONOOPT_IFLC;
if (iono_model_str == "Estimate_STEC") iono_model = IONOOPT_EST;
if (iono_model_str == "IONEX") iono_model = IONOOPT_TEC;
if (iono_model == -1)
{
//warn user and set the default
@ -126,11 +126,11 @@ rtk_t configure_rtklib_options()
std::string default_trop_model("OFF");
int trop_model = -1;
std::string trop_model_str = configuration->property(role + ".trop_model", default_trop_model); /* (TROPOPT_XXX) see src/algorithms/libs/rtklib/rtklib.h */
if (trop_model_str.compare("OFF") == 0) trop_model = TROPOPT_OFF;
if (trop_model_str.compare("Saastamoinen") == 0) trop_model = TROPOPT_SAAS;
if (trop_model_str.compare("SBAS") == 0) trop_model = TROPOPT_SBAS;
if (trop_model_str.compare("Estimate_ZTD") == 0) trop_model = TROPOPT_EST;
if (trop_model_str.compare("Estimate_ZTD_Grad") == 0) trop_model = TROPOPT_ESTG;
if (trop_model_str == "OFF") trop_model = TROPOPT_OFF;
if (trop_model_str == "Saastamoinen") trop_model = TROPOPT_SAAS;
if (trop_model_str == "SBAS") trop_model = TROPOPT_SBAS;
if (trop_model_str == "Estimate_ZTD") trop_model = TROPOPT_EST;
if (trop_model_str == "Estimate_ZTD_Grad") trop_model = TROPOPT_ESTG;
if (trop_model == -1)
{
//warn user and set the default
@ -175,11 +175,11 @@ rtk_t configure_rtklib_options()
std::string default_gps_ar("Continuous");
std::string integer_ambiguity_resolution_gps_str = configuration->property(role + ".AR_GPS", default_gps_ar); /* Integer Ambiguity Resolution mode for GPS (0:off,1:continuous,2:instantaneous,3:fix and hold,4:ppp-ar) */
int integer_ambiguity_resolution_gps = -1;
if (integer_ambiguity_resolution_gps_str.compare("OFF") == 0) integer_ambiguity_resolution_gps = ARMODE_OFF;
if (integer_ambiguity_resolution_gps_str.compare("Continuous") == 0) integer_ambiguity_resolution_gps = ARMODE_CONT;
if (integer_ambiguity_resolution_gps_str.compare("Instantaneous") == 0) integer_ambiguity_resolution_gps = ARMODE_INST;
if (integer_ambiguity_resolution_gps_str.compare("Fix-and-Hold") == 0) integer_ambiguity_resolution_gps = ARMODE_FIXHOLD;
if (integer_ambiguity_resolution_gps_str.compare("PPP-AR") == 0) integer_ambiguity_resolution_gps = ARMODE_PPPAR;
if (integer_ambiguity_resolution_gps_str == "OFF") integer_ambiguity_resolution_gps = ARMODE_OFF;
if (integer_ambiguity_resolution_gps_str == "Continuous") integer_ambiguity_resolution_gps = ARMODE_CONT;
if (integer_ambiguity_resolution_gps_str == "Instantaneous") integer_ambiguity_resolution_gps = ARMODE_INST;
if (integer_ambiguity_resolution_gps_str == "Fix-and-Hold") integer_ambiguity_resolution_gps = ARMODE_FIXHOLD;
if (integer_ambiguity_resolution_gps_str == "PPP-AR") integer_ambiguity_resolution_gps = ARMODE_PPPAR;
if (integer_ambiguity_resolution_gps == -1)
{
//warn user and set the default

View File

@ -38,6 +38,7 @@
#include <exception>
#include <string>
#include <unistd.h>
#include <utility>
#ifdef GR_GREATER_38
#include <gnuradio/analog/sig_source.h>
#else
@ -91,7 +92,7 @@ void GpsL1CADllPllTelemetryDecoderTest_msg_rx::msg_handler_events(pmt::pmt_t msg
{
try
{
int64_t message = pmt::to_long(msg);
int64_t message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (boost::bad_any_cast& e)
@ -109,8 +110,7 @@ GpsL1CADllPllTelemetryDecoderTest_msg_rx::GpsL1CADllPllTelemetryDecoderTest_msg_
}
GpsL1CADllPllTelemetryDecoderTest_msg_rx::~GpsL1CADllPllTelemetryDecoderTest_msg_rx()
{
}
= default;
// ###########################################################
@ -144,7 +144,7 @@ void GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx::msg_handler_events(pmt::pmt_t
{
try
{
int64_t message = pmt::to_long(msg);
int64_t message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (boost::bad_any_cast& e)
@ -162,8 +162,7 @@ GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx::GpsL1CADllPllTelemetryDecoderTest_
}
GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx::~GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx()
{
}
= default;
// ###########################################################
@ -200,8 +199,7 @@ public:
}
~GpsL1CATelemetryDecoderTest()
{
}
= default;
void configure_receiver();
@ -238,7 +236,7 @@ int GpsL1CATelemetryDecoderTest::generate_signal()
{
int child_status;
char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], NULL};
char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], nullptr};
int pid;
if ((pid = fork()) == -1)

View File

@ -52,6 +52,7 @@
#include <matio.h>
#include <chrono>
#include <unistd.h>
#include <utility>
#include <vector>
#ifdef GR_GREATER_38
#include <gnuradio/analog/sig_source.h>
@ -89,7 +90,7 @@ void GpsL1CADllPllTrackingTest_msg_rx::msg_handler_events(pmt::pmt_t msg)
{
try
{
int64_t message = pmt::to_long(msg);
int64_t message = pmt::to_long(std::move(msg));
rx_message = message; //3 -> loss of lock
//std::cout << "Received trk message: " << rx_message << std::endl;
}
@ -110,8 +111,7 @@ GpsL1CADllPllTrackingTest_msg_rx::GpsL1CADllPllTrackingTest_msg_rx() : gr::block
GpsL1CADllPllTrackingTest_msg_rx::~GpsL1CADllPllTrackingTest_msg_rx()
{
}
= default;
// ###########################################################
@ -167,8 +167,7 @@ public:
}
~GpsL1CADllPllTrackingTest()
{
}
= default;
void configure_receiver(double PLL_wide_bw_hz,
double DLL_wide_bw_hz,
@ -210,7 +209,7 @@ int GpsL1CADllPllTrackingTest::generate_signal()
{
int child_status;
char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], &p6[0], NULL};
char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], &p6[0], nullptr};
int pid;
if ((pid = fork()) == -1)
@ -730,7 +729,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
double pull_in_offset_s = FLAGS_skip_trk_transitory_s;
arma::uvec initial_meas_point = arma::find(trk_timestamp_s >= (true_timestamp_s(0) + pull_in_offset_s), 1, "first");
if (initial_meas_point.size() > 0 and tracking_last_msg != 3)
if (!initial_meas_point.empty() and tracking_last_msg != 3)
{
trk_timestamp_s = trk_timestamp_s.subvec(initial_meas_point(0), trk_timestamp_s.size() - 1);
trk_acc_carrier_phase_cycles = trk_acc_carrier_phase_cycles.subvec(initial_meas_point(0), trk_acc_carrier_phase_cycles.size() - 1);
@ -750,9 +749,9 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
rmse_doppler.push_back(rmse);
code_phase_error_chips = check_results_codephase(true_timestamp_s, true_prn_delay_chips, trk_timestamp_s, trk_prn_delay_chips, mean_error, std_dev_error, rmse);
for (unsigned int ii = 0; ii < code_phase_error_chips.size(); ii++)
for (double code_phase_error_chip : code_phase_error_chips)
{
code_phase_error_meters.push_back(GPS_L1_CA_CHIP_PERIOD * code_phase_error_chips.at(ii) * GPS_C_m_s);
code_phase_error_meters.push_back(GPS_L1_CA_CHIP_PERIOD * code_phase_error_chip * GPS_C_m_s);
}
mean_code_phase_error.push_back(mean_error);
std_dev_code_phase_error.push_back(std_dev_error);
@ -821,9 +820,9 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
{
boost::filesystem::path p(gnuplot_executable);
boost::filesystem::path dir = p.parent_path();
std::string gnuplot_path = dir.native();
const std::string& gnuplot_path = dir.native();
Gnuplot::set_GNUPlotPath(gnuplot_path);
unsigned int decimate = static_cast<unsigned int>(FLAGS_plot_decimate);
auto decimate = static_cast<unsigned int>(FLAGS_plot_decimate);
if (FLAGS_plot_detail_level >= 2)
{
@ -1165,8 +1164,8 @@ bool GpsL1CADllPllTrackingTest::save_mat_xy(std::vector<double>& x, std::vector<
matvar_t* matvar;
filename.erase(filename.length() - 4, 4);
filename.append(".mat");
matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73);
if (reinterpret_cast<int64_t*>(matfp) != NULL)
matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73);
if (reinterpret_cast<int64_t*>(matfp) != nullptr)
{
size_t dims[2] = {1, x.size()};
matvar = Mat_VarCreate("x", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, &x[0], 0);

View File

@ -51,6 +51,7 @@
#include <gtest/gtest.h>
#include <chrono>
#include <unistd.h>
#include <utility>
#include <vector>
#ifdef GR_GREATER_38
#include <gnuradio/analog/sig_source.h>
@ -91,7 +92,7 @@ void GpsL1CAKfTrackingTest_msg_rx::msg_handler_events(pmt::pmt_t msg)
{
try
{
long int message = pmt::to_long(msg);
long int message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (boost::bad_any_cast& e)
@ -111,8 +112,7 @@ GpsL1CAKfTrackingTest_msg_rx::GpsL1CAKfTrackingTest_msg_rx() : gr::block("GpsL1C
GpsL1CAKfTrackingTest_msg_rx::~GpsL1CAKfTrackingTest_msg_rx()
{
}
= default;
// ###########################################################
@ -158,8 +158,7 @@ public:
}
~GpsL1CAKfTrackingTest()
{
}
= default;
void configure_receiver();
@ -196,7 +195,7 @@ int GpsL1CAKfTrackingTest::generate_signal()
{
int child_status;
char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], NULL};
char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], nullptr};
int pid;
if ((pid = fork()) == -1)
@ -528,7 +527,7 @@ TEST_F(GpsL1CAKfTrackingTest, ValidationOfResults)
{
boost::filesystem::path p(gnuplot_executable);
boost::filesystem::path dir = p.parent_path();
std::string gnuplot_path = dir.native();
const std::string& gnuplot_path = dir.native();
Gnuplot::set_GNUPlotPath(gnuplot_path);
std::vector<double> timevec;
@ -544,7 +543,7 @@ TEST_F(GpsL1CAKfTrackingTest, ValidationOfResults)
g1.set_xlabel("Time [s]");
g1.set_ylabel("Correlators' output");
g1.cmd("set key box opaque");
unsigned int decimate = static_cast<unsigned int>(FLAGS_plot_decimate);
auto decimate = static_cast<unsigned int>(FLAGS_plot_decimate);
g1.plot_xy(timevec, prompt, "Prompt", decimate);
g1.plot_xy(timevec, early, "Early", decimate);
g1.plot_xy(timevec, late, "Late", decimate);

View File

@ -46,6 +46,7 @@
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <chrono>
#include <utility>
#ifdef GR_GREATER_38
#include <gnuradio/analog/sig_source.h>
#else
@ -83,7 +84,7 @@ void GpsL2MDllPllTrackingTest_msg_rx::msg_handler_events(pmt::pmt_t msg)
{
try
{
int64_t message = pmt::to_long(msg);
int64_t message = pmt::to_long(std::move(msg));
rx_message = message;
}
catch (boost::bad_any_cast& e)
@ -103,8 +104,7 @@ GpsL2MDllPllTrackingTest_msg_rx::GpsL2MDllPllTrackingTest_msg_rx() : gr::block("
GpsL2MDllPllTrackingTest_msg_rx::~GpsL2MDllPllTrackingTest_msg_rx()
{
}
= default;
// ###########################################################
@ -121,8 +121,7 @@ protected:
}
~GpsL2MDllPllTrackingTest()
{
}
= default;
void init();

View File

@ -67,6 +67,7 @@
#include <gtest/gtest.h>
#include <chrono>
#include <cstdint>
#include <utility>
#include <vector>
#ifdef GR_GREATER_38
#include <gnuradio/filter/fir_filter_blk.h>
@ -105,7 +106,7 @@ void TrackingPullInTest_msg_rx::msg_handler_events(pmt::pmt_t msg)
{
try
{
int64_t message = pmt::to_long(msg);
int64_t message = pmt::to_long(std::move(msg));
rx_message = message; //3 -> loss of lock
//std::cout << "Received trk message: " << rx_message << std::endl;
}
@ -126,8 +127,7 @@ TrackingPullInTest_msg_rx::TrackingPullInTest_msg_rx() : gr::block("TrackingPull
TrackingPullInTest_msg_rx::~TrackingPullInTest_msg_rx()
{
}
= default;
// ###########################################################
@ -203,8 +203,7 @@ public:
}
~TrackingPullInTest()
{
}
= default;
void configure_receiver(double PLL_wide_bw_hz,
double DLL_wide_bw_hz,
@ -249,7 +248,7 @@ int TrackingPullInTest::generate_signal()
{
int child_status;
char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], &p6[0], NULL};
char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], &p6[0], nullptr};
int pid;
if ((pid = fork()) == -1)
@ -290,7 +289,7 @@ void TrackingPullInTest::configure_receiver(
config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(baseband_sampling_freq));
std::string System_and_Signal;
if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking") == 0)
if (implementation == "GPS_L1_CA_DLL_PLL_Tracking")
{
gnss_synchro.System = 'G';
std::string signal = "1C";
@ -299,7 +298,7 @@ void TrackingPullInTest::configure_receiver(
config->set_property("Tracking.early_late_space_chips", "0.5");
config->set_property("Tracking.early_late_space_narrow_chips", "0.5");
}
else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking") == 0)
else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking")
{
gnss_synchro.System = 'E';
std::string signal = "1B";
@ -311,7 +310,7 @@ void TrackingPullInTest::configure_receiver(
config->set_property("Tracking.very_early_late_space_narrow_chips", "0.6");
config->set_property("Tracking.track_pilot", "true");
}
else if (implementation.compare("GPS_L2_M_DLL_PLL_Tracking") == 0)
else if (implementation == "GPS_L2_M_DLL_PLL_Tracking")
{
gnss_synchro.System = 'G';
std::string signal = "2S";
@ -320,13 +319,13 @@ void TrackingPullInTest::configure_receiver(
config->set_property("Tracking.early_late_space_chips", "0.5");
config->set_property("Tracking.track_pilot", "true");
}
else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking") == 0 or implementation.compare("Galileo_E5a_DLL_PLL_Tracking_b") == 0)
else if (implementation == "Galileo_E5a_DLL_PLL_Tracking" or implementation == "Galileo_E5a_DLL_PLL_Tracking_b")
{
gnss_synchro.System = 'E';
std::string signal = "5X";
System_and_Signal = "Galileo E5a";
signal.copy(gnss_synchro.Signal, 2, 0);
if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_b") == 0)
if (implementation == "Galileo_E5a_DLL_PLL_Tracking_b")
{
config->supersede_property("Tracking.implementation", std::string("Galileo_E5a_DLL_PLL_Tracking"));
}
@ -334,7 +333,7 @@ void TrackingPullInTest::configure_receiver(
config->set_property("Tracking.track_pilot", "true");
config->set_property("Tracking.order", "2");
}
else if (implementation.compare("GPS_L5_DLL_PLL_Tracking") == 0)
else if (implementation == "GPS_L5_DLL_PLL_Tracking")
{
gnss_synchro.System = 'G';
std::string signal = "L5";
@ -394,7 +393,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID)
std::string System_and_Signal;
std::string signal;
//create the correspondign acquisition block according to the desired tracking signal
if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking") == 0)
if (implementation == "GPS_L1_CA_DLL_PLL_Tracking")
{
tmp_gnss_synchro.System = 'G';
signal = "1C";
@ -406,7 +405,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID)
//acquisition = std::make_shared<GpsL1CaPcpsAcquisitionFineDoppler>(config.get(), "Acquisition", 1, 0);
acquisition = std::make_shared<GpsL1CaPcpsAcquisition>(config.get(), "Acquisition", 1, 0);
}
else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking") == 0)
else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking")
{
tmp_gnss_synchro.System = 'E';
signal = "1B";
@ -417,7 +416,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID)
config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells));
acquisition = std::make_shared<GalileoE1PcpsAmbiguousAcquisition>(config.get(), "Acquisition", 1, 0);
}
else if (implementation.compare("GPS_L2_M_DLL_PLL_Tracking") == 0)
else if (implementation == "GPS_L2_M_DLL_PLL_Tracking")
{
tmp_gnss_synchro.System = 'G';
signal = "2S";
@ -428,7 +427,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID)
config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells));
acquisition = std::make_shared<GpsL2MPcpsAcquisition>(config.get(), "Acquisition", 1, 0);
}
else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_b") == 0)
else if (implementation == "Galileo_E5a_DLL_PLL_Tracking_b")
{
tmp_gnss_synchro.System = 'E';
signal = "5X";
@ -444,7 +443,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID)
acquisition = std::make_shared<GalileoE5aNoncoherentIQAcquisitionCaf>(config.get(), "Acquisition", 1, 0);
}
else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking") == 0)
else if (implementation == "Galileo_E5a_DLL_PLL_Tracking")
{
tmp_gnss_synchro.System = 'E';
signal = "5X";
@ -455,7 +454,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID)
config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells));
acquisition = std::make_shared<GalileoE5aPcpsAcquisition>(config.get(), "Acquisition", 1, 0);
}
else if (implementation.compare("GPS_L5_DLL_PLL_Tracking") == 0)
else if (implementation == "GPS_L5_DLL_PLL_Tracking")
{
tmp_gnss_synchro.System = 'G';
signal = "L5";
@ -870,7 +869,7 @@ TEST_F(TrackingPullInTest, ValidationOfResults)
std::cout << " Waiting for valve...\n";
//wait the valve message indicating the circulation of the amount of samples of the delay
gr::message::sptr queue_message = queue->delete_head();
if (queue_message != 0)
if (queue_message != nullptr)
{
control_messages_ = control_message_factory_->GetControlMessages(queue_message);
}
@ -965,9 +964,9 @@ TEST_F(TrackingPullInTest, ValidationOfResults)
{
boost::filesystem::path p(gnuplot_executable);
boost::filesystem::path dir = p.parent_path();
std::string gnuplot_path = dir.native();
const std::string& gnuplot_path = dir.native();
Gnuplot::set_GNUPlotPath(gnuplot_path);
unsigned int decimate = static_cast<unsigned int>(FLAGS_plot_decimate);
auto decimate = static_cast<unsigned int>(FLAGS_plot_decimate);
if (FLAGS_plot_detail_level >= 2 and FLAGS_show_plots)
{
@ -989,7 +988,7 @@ TEST_F(TrackingPullInTest, ValidationOfResults)
g1.plot_xy(trk_timestamp_s, prompt, "Prompt", decimate);
g1.plot_xy(trk_timestamp_s, early, "Early", decimate);
g1.plot_xy(trk_timestamp_s, late, "Late", decimate);
if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking") == 0)
if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking")
{
g1.plot_xy(trk_timestamp_s, v_early, "Very Early", decimate);
g1.plot_xy(trk_timestamp_s, v_late, "Very Late", decimate);
@ -1099,7 +1098,7 @@ TEST_F(TrackingPullInTest, ValidationOfResults)
{
g4.disablescreen();
}
g4.cmd("set palette defined ( 0 \"black\", 1 \"green\" )");
g4.cmd(R"(set palette defined ( 0 "black", 1 "green" ))");
g4.cmd("set key off");
g4.cmd("set view map");
std::string title;