1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-16 10:09:58 +00:00

Add GPS L2 acqusitition grid plot

and other small fixes
This commit is contained in:
Carles Fernandez 2017-10-29 12:26:06 +01:00
parent 396415b6f2
commit ee1285218e
7 changed files with 165 additions and 80 deletions

View File

@ -118,6 +118,8 @@ protected:
config = std::make_shared<InMemoryConfiguration>();
item_size = sizeof(gr_complex);
gnss_synchro = Gnss_Synchro();
doppler_max = 10000;
doppler_step = 250;
}
~GalileoE1PcpsAmbiguousAcquisitionTest()
@ -131,6 +133,8 @@ protected:
std::shared_ptr<InMemoryConfiguration> config;
Gnss_Synchro gnss_synchro;
size_t item_size;
unsigned int doppler_max;
unsigned int doppler_step;
};
@ -142,9 +146,9 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::init()
signal.copy(gnss_synchro.Signal, 2, 0);
gnss_synchro.PRN = 1;
config->set_property("Acquisition_1B.implementation", "Galileo_E1_PCPS_Ambiguous_Acquisition");
config->set_property("GNSS-SDR.internal_fs_sps", "4000000");
config->set_property("Acquisition_1B.item_type", "gr_complex");
config->set_property("Acquisition_1B.if", "0");
config->set_property("Acquisition_1B.coherent_integration_time_ms", "4");
if(FLAGS_plot_acq_grid == true)
{
@ -154,10 +158,10 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::init()
{
config->set_property("Acquisition_1B.dump", "false");
}
config->set_property("Acquisition_1B.implementation", "Galileo_E1_PCPS_Ambiguous_Acquisition");
config->set_property("Acquisition_1B.dump_filename", "./tmp-acq-gal1/acquisition.dat");
config->set_property("Acquisition_1B.threshold", "0.0001");
config->set_property("Acquisition_1B.doppler_max", "10000");
config->set_property("Acquisition_1B.doppler_step", "250");
config->set_property("Acquisition_1B.doppler_max", std::to_string(doppler_max));
config->set_property("Acquisition_1B.doppler_step", std::to_string(doppler_step));
config->set_property("Acquisition_1B.repeat_satellite", "false");
config->set_property("Acquisition_1B.cboc", "true");
}
@ -166,18 +170,17 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::init()
void GalileoE1PcpsAmbiguousAcquisitionTest::plot_grid()
{
//load the measured values
std::string basename = "./data/acquisition_E_1B";
std::string basename = "./tmp-acq-gal1/acquisition_E_1B";
unsigned int sat = static_cast<unsigned int>(gnss_synchro.PRN);
unsigned int doppler_max = 10000; // !!!
unsigned int doppler_step = 250; // !!
unsigned int samples_per_code = static_cast<unsigned int>(round(4000000 / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); // !!
acquisition_dump_reader acq_dump(basename, sat, doppler_max, doppler_step, samples_per_code);
if(!acq_dump.read_binary_acq()) std::cout << "Error reading files" << std::endl;
std::vector<int> doppler = acq_dump.doppler;
std::vector<unsigned int> samples = acq_dump.samples;
std::vector<std::vector<float> > mag = acq_dump.mag;
std::vector<int> * doppler = &acq_dump.doppler;
std::vector<unsigned int> * samples = &acq_dump.samples;
std::vector<std::vector<float> > * mag = &acq_dump.mag;
const std::string gnuplot_executable(FLAGS_gnuplot_executable);
if(gnuplot_executable.empty())
@ -188,7 +191,7 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::plot_grid()
}
else
{
std::cout << "Plotting the acquisition grid..." << std::endl;
std::cout << "Plotting the acquisition grid. This can take a while..." << std::endl;
try
{
boost::filesystem::path p(gnuplot_executable);
@ -201,7 +204,7 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::plot_grid()
g1.set_xlabel("Doppler [Hz]");
g1.set_ylabel("Sample");
//g1.cmd("set view 60, 105, 1, 1");
g1.plot_grid3d(doppler, samples, mag);
g1.plot_grid3d(*doppler, *samples, *mag);
g1.savetops("Galileo_E1_acq_grid");
g1.savetopdf("Galileo_E1_acq_grid");
@ -212,7 +215,7 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::plot_grid()
std::cout << ge.what() << std::endl;
}
}
std::string data_str = "./data";
std::string data_str = "./tmp-acq-gal1";
if (boost::filesystem::exists(data_str))
{
boost::filesystem::remove_all(data_str);
@ -268,7 +271,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)
if(FLAGS_plot_acq_grid == true)
{
std::string data_str = "./data";
std::string data_str = "./tmp-acq-gal1";
if (boost::filesystem::exists(data_str))
{
boost::filesystem::remove_all(data_str);
@ -297,11 +300,11 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)
}) << "Failure setting threshold.";
ASSERT_NO_THROW( {
acquisition->set_doppler_max(config->property("Acquisition_1B.doppler_max", 10000));
acquisition->set_doppler_max(config->property("Acquisition_1B.doppler_max", doppler_max));
}) << "Failure setting doppler_max.";
ASSERT_NO_THROW( {
acquisition->set_doppler_step(config->property("Acquisition_1B.doppler_step", 250));
acquisition->set_doppler_step(config->property("Acquisition_1B.doppler_step", doppler_step));
}) << "Failure setting doppler_step.";
ASSERT_NO_THROW( {

View File

@ -118,6 +118,8 @@ protected:
config = std::make_shared<InMemoryConfiguration>();
item_size = sizeof(gr_complex);
gnss_synchro = Gnss_Synchro();
doppler_max = 5000;
doppler_step = 100;
}
~GpsL1CaPcpsAcquisitionTest()
@ -131,6 +133,8 @@ protected:
std::shared_ptr<InMemoryConfiguration> config;
Gnss_Synchro gnss_synchro;
size_t item_size;
unsigned int doppler_max;
unsigned int doppler_step;
};
@ -153,9 +157,10 @@ void GpsL1CaPcpsAcquisitionTest::init()
{
config->set_property("Acquisition_1C.dump", "false");
}
config->set_property("Acquisition_1C.dump_filename", "./tmp-acq-gps1/acquisition.dat");
config->set_property("Acquisition_1C.threshold", "0.00001");
config->set_property("Acquisition_1C.doppler_max", "5000");
config->set_property("Acquisition_1C.doppler_step", "500");
config->set_property("Acquisition_1C.doppler_max", std::to_string(doppler_max));
config->set_property("Acquisition_1C.doppler_step", std::to_string(doppler_step));
config->set_property("Acquisition_1C.repeat_satellite", "false");
//config->set_property("Acquisition_1C.pfa", "0.0");
}
@ -164,18 +169,17 @@ void GpsL1CaPcpsAcquisitionTest::init()
void GpsL1CaPcpsAcquisitionTest::plot_grid()
{
//load the measured values
std::string basename = "./data/acquisition_G_1C";
std::string basename = "./tmp-acq-gps1/acquisition_G_1C";
unsigned int sat = static_cast<unsigned int>(gnss_synchro.PRN);
unsigned int doppler_max = 5000; // !!!
unsigned int doppler_step = 100; // !!
unsigned int samples_per_code = static_cast<unsigned int>(round(4000000 / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); // !!
unsigned int samples_per_code = static_cast<unsigned int>(round(4000000 / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); // !!
acquisition_dump_reader acq_dump(basename, sat, doppler_max, doppler_step, samples_per_code);
if(!acq_dump.read_binary_acq()) std::cout << "Error reading files" << std::endl;
std::vector<int> doppler = acq_dump.doppler;
std::vector<unsigned int> samples = acq_dump.samples;
std::vector<std::vector<float> > mag = acq_dump.mag;
std::vector<int> *doppler = &acq_dump.doppler;
std::vector<unsigned int> *samples = &acq_dump.samples;
std::vector<std::vector<float> > *mag = &acq_dump.mag;
const std::string gnuplot_executable(FLAGS_gnuplot_executable);
if(gnuplot_executable.empty())
@ -186,7 +190,7 @@ void GpsL1CaPcpsAcquisitionTest::plot_grid()
}
else
{
std::cout << "Plotting the acquisition grid..." << std::endl;
std::cout << "Plotting the acquisition grid. This can take a while..." << std::endl;
try
{
boost::filesystem::path p(gnuplot_executable);
@ -199,7 +203,7 @@ void GpsL1CaPcpsAcquisitionTest::plot_grid()
g1.set_xlabel("Doppler [Hz]");
g1.set_ylabel("Sample");
//g1.cmd("set view 60, 105, 1, 1");
g1.plot_grid3d(doppler, samples, mag);
g1.plot_grid3d(*doppler, *samples, *mag);
g1.savetops("GPS_L1_acq_grid");
g1.savetopdf("GPS_L1_acq_grid");
@ -210,7 +214,7 @@ void GpsL1CaPcpsAcquisitionTest::plot_grid()
std::cout << ge.what() << std::endl;
}
}
std::string data_str = "./data";
std::string data_str = "./tmp-acq-gps1";
if (boost::filesystem::exists(data_str))
{
boost::filesystem::remove_all(data_str);
@ -272,7 +276,7 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults)
if(FLAGS_plot_acq_grid == true)
{
std::string data_str = "./data";
std::string data_str = "./tmp-acq-gps1";
if (boost::filesystem::exists(data_str))
{
boost::filesystem::remove_all(data_str);
@ -296,11 +300,11 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults)
}) << "Failure setting threshold.";
ASSERT_NO_THROW( {
acquisition->set_doppler_max(5000);
acquisition->set_doppler_max(doppler_max);
}) << "Failure setting doppler_max.";
ASSERT_NO_THROW( {
acquisition->set_doppler_step(100);
acquisition->set_doppler_step(doppler_step);
}) << "Failure setting doppler_step.";
ASSERT_NO_THROW( {

View File

@ -34,6 +34,7 @@
#include <chrono>
#include <iostream>
#include <boost/filesystem.hpp>
#include <boost/make_shared.hpp>
#include <gnuradio/top_block.h>
#include <gnuradio/blocks/file_source.h>
@ -49,6 +50,9 @@
#include "in_memory_configuration.h"
#include "gnss_sdr_valve.h"
#include "gnss_synchro.h"
#include "gnuplot_i.h"
#include "test_flags.h"
#include "acquisition_dump_reader.h"
#include "gps_l2_m_pcps_acquisition.h"
#include "GPS_L2C.h"
@ -70,7 +74,6 @@ private:
public:
int rx_message;
~GpsL2MPcpsAcquisitionTest_msg_rx(); //!< Default destructor
};
GpsL2MPcpsAcquisitionTest_msg_rx_sptr GpsL2MPcpsAcquisitionTest_msg_rx_make()
@ -114,8 +117,10 @@ protected:
factory = std::make_shared<GNSSBlockFactory>();
config = std::make_shared<InMemoryConfiguration>();
item_size = sizeof(gr_complex);
sampling_freqeuncy_hz = 0;
sampling_frequency_hz = 5000000;
nsamples = 0;
doppler_max = 3000;
doppler_step = 125;
gnss_synchro = Gnss_Synchro();
}
@ -123,6 +128,7 @@ protected:
{}
void init();
void plot_grid();
gr::msg_queue::sptr queue;
gr::top_block_sptr top_block;
@ -130,8 +136,10 @@ protected:
std::shared_ptr<InMemoryConfiguration> config;
Gnss_Synchro gnss_synchro;
size_t item_size;
int sampling_freqeuncy_hz;
int sampling_frequency_hz;
int nsamples;
unsigned int doppler_max;
unsigned int doppler_step;
};
@ -140,24 +148,86 @@ void GpsL2MPcpsAcquisitionTest::init()
gnss_synchro.Channel_ID = 0;
gnss_synchro.System = 'G';
std::string signal = "2S";
//strncpy(gnss_synchro.Signal, signal.c_str(), 3);
std::memcpy(static_cast<void*>(gnss_synchro.Signal), signal.c_str(), 3); // copy string into synchro char array: 2 char + null
gnss_synchro.Signal[2] = 0; // make sure that string length is only two characters
gnss_synchro.PRN = 7;
sampling_freqeuncy_hz = 5000000;
nsamples = round(static_cast<double>(sampling_freqeuncy_hz) * GPS_L2_M_PERIOD) * 2;
config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(sampling_freqeuncy_hz));
nsamples = round(static_cast<double>(sampling_frequency_hz) * GPS_L2_M_PERIOD) * 2;
config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(sampling_frequency_hz));
config->set_property("Acquisition_2S.implementation", "GPS_L2_M_PCPS_Acquisition");
config->set_property("Acquisition_2S.item_type", "gr_complex");
config->set_property("Acquisition_2S.dump", "false");
if(FLAGS_plot_acq_grid == true)
{
config->set_property("Acquisition_2S.dump", "true");
}
else
{
config->set_property("Acquisition_2S.dump", "false");
}
config->set_property("Acquisition_2S.dump_filename", "./tmp-acq-gps2/acquisition.dat");
config->set_property("Acquisition_2S.threshold", "0.001");
config->set_property("Acquisition_2S.doppler_max", "5000");
config->set_property("Acquisition_2S.doppler_step", "100");
config->set_property("Acquisition_2S.doppler_max", std::to_string(doppler_max));
config->set_property("Acquisition_2S.doppler_step", std::to_string(doppler_step));
config->set_property("Acquisition_2S.repeat_satellite", "false");
}
void GpsL2MPcpsAcquisitionTest::plot_grid()
{
//load the measured values
std::string basename = "./tmp-acq-gps2/acquisition_G_2S";
unsigned int sat = static_cast<unsigned int>(gnss_synchro.PRN);
unsigned int samples_per_code = static_cast<unsigned int>(floor(sampling_frequency_hz / (GPS_L2_M_CODE_RATE_HZ / GPS_L2_M_CODE_LENGTH_CHIPS)) - 1000); // !!
acquisition_dump_reader acq_dump(basename, sat, doppler_max, doppler_step, samples_per_code);
if(!acq_dump.read_binary_acq()) std::cout << "Error reading files" << std::endl;
std::vector<int> *doppler = &acq_dump.doppler;
std::vector<unsigned int> *samples = &acq_dump.samples;
std::vector<std::vector<float> > *mag = &acq_dump.mag;
const std::string gnuplot_executable(FLAGS_gnuplot_executable);
if(gnuplot_executable.empty())
{
std::cout << "WARNING: Although the flag plot_acq_grid has been set to TRUE," << std::endl;
std::cout << "gnuplot has not been found in your system." << std::endl;
std::cout << "Test results will not be plotted." << std::endl;
}
else
{
std::cout << "Plotting the acquisition grid. This can take a while..." << std::endl;
try
{
boost::filesystem::path p(gnuplot_executable);
boost::filesystem::path dir = p.parent_path();
std::string gnuplot_path = dir.native();
Gnuplot::set_GNUPlotPath(gnuplot_path);
Gnuplot g1("lines");
g1.set_title("GPS L2CM signal acquisition for satellite PRN #" + std::to_string(gnss_synchro.PRN));
g1.set_xlabel("Doppler [Hz]");
g1.set_ylabel("Sample");
//g1.cmd("set view 60, 105, 1, 1");
g1.plot_grid3d(*doppler, *samples, *mag);
g1.savetops("GPS_L2CM_acq_grid");
g1.savetopdf("GPS_L2CM_acq_grid");
g1.showonscreen();
}
catch (const GnuplotException & ge)
{
std::cout << ge.what() << std::endl;
}
}
std::string data_str = "./tmp-acq-gps2";
if (boost::filesystem::exists(data_str))
{
boost::filesystem::remove_all(data_str);
}
}
TEST_F(GpsL2MPcpsAcquisitionTest, Instantiate)
{
init();
@ -178,7 +248,7 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ConnectAndRun)
ASSERT_NO_THROW( {
acquisition->connect(top_block);
boost::shared_ptr<gr::analog::sig_source_c> source = gr::analog::sig_source_c::make(sampling_freqeuncy_hz, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0));
boost::shared_ptr<gr::analog::sig_source_c> source = gr::analog::sig_source_c::make(sampling_frequency_hz, gr::analog::GR_SIN_WAVE, 2000, 1, gr_complex(0));
boost::shared_ptr<gr::block> valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue);
top_block->connect(source, 0, valve, 0);
top_block->connect(valve, 0, acquisition->get_left_block(), 0);
@ -204,6 +274,17 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ValidationOfResults)
queue = gr::msg_queue::make(0);
double expected_delay_samples = 1;//2004;
double expected_doppler_hz = 1200;//3000;
if(FLAGS_plot_acq_grid == true)
{
std::string data_str = "./tmp-acq-gps2";
if (boost::filesystem::exists(data_str))
{
boost::filesystem::remove_all(data_str);
}
boost::filesystem::create_directory(data_str);
}
init();
std::shared_ptr<GpsL2MPcpsAcquisition> acquisition = std::make_shared<GpsL2MPcpsAcquisition>(config.get(), "Acquisition_2S", 1, 1);
boost::shared_ptr<GpsL2MPcpsAcquisitionTest_msg_rx> msg_rx = GpsL2MPcpsAcquisitionTest_msg_rx_make();
@ -221,11 +302,11 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ValidationOfResults)
}) << "Failure setting threshold.";
ASSERT_NO_THROW( {
acquisition->set_doppler_max(5000);
acquisition->set_doppler_max(doppler_max);
}) << "Failure setting doppler_max.";
ASSERT_NO_THROW( {
acquisition->set_doppler_step(10);
acquisition->set_doppler_step(doppler_step);
}) << "Failure setting doppler_step.";
ASSERT_NO_THROW( {
@ -262,7 +343,6 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ValidationOfResults)
elapsed_seconds = end - start;
}) << "Failure running the top_block.";
//unsigned long int Acq_samplestamp_samples = gnss_synchro.Acq_samplestamp_samples;
std::cout << "Acquisition process runtime duration: " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
std::cout << "gnss_synchro.Acq_doppler_hz = " << gnss_synchro.Acq_doppler_hz << " Hz" << std::endl;
@ -274,6 +354,11 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ValidationOfResults)
float 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: 666 Hz = 2/(3*integration period)";
EXPECT_LE(doppler_error_hz, 200) << "Doppler error exceeds the expected value: 2/(3*integration period)";
EXPECT_LT(delay_error_chips, 0.5) << "Delay error exceeds the expected value: 0.5 chips";
if(FLAGS_plot_acq_grid == true)
{
plot_grid();
}
}

View File

@ -1,7 +1,7 @@
/*!
* \file acquisition_dump_reader.cc
* \brief Helper file for unit testing
* \author Javier Arribas, 2017. jarribas(at)cttc.es
* \author Carles Fernandez-Prades, 2017. cfernandez(at)cttc.es
*
* -------------------------------------------------------------------------
*
@ -70,7 +70,7 @@ bool acquisition_dump_reader::read_binary_acq()
}
acquisition_dump_reader::acquisition_dump_reader(std::string & basename, unsigned int sat, unsigned int doppler_max, unsigned int doppler_step, unsigned int samples_per_code)
acquisition_dump_reader::acquisition_dump_reader(const std::string & basename, unsigned int sat, unsigned int doppler_max, unsigned int doppler_step, unsigned int samples_per_code)
{
d_basename = basename;
d_sat = sat;
@ -84,16 +84,13 @@ acquisition_dump_reader::acquisition_dump_reader(std::string & basename, unsigne
{
doppler.push_back(-static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index);
d_dump_filenames.push_back(d_basename + "_sat_" + std::to_string(d_sat) + "_doppler_" + std::to_string(doppler.at(doppler_index)) + ".dat");
std::ifstream ifs;
d_dump_files.push_back(std::move(ifs));
}
for (unsigned int k = 0; k < d_samples_per_code; k++)
{
samples.push_back(k);
}
for(int i = 0; i < d_num_doppler_bins; i++)
{
std::ifstream is;
d_dump_files.push_back(std::move(is));
}
}

View File

@ -1,7 +1,7 @@
/*!
* \file acquisition_dump_reader.h
* \brief Helper file for unit testing
* \author Javier Arribas, 2017. jarribas(at)cttc.es
* \author Carles Fernandez-Prades, 2017. cfernandez(at)cttc.es
*
* -------------------------------------------------------------------------
*
@ -39,7 +39,7 @@
class acquisition_dump_reader
{
public:
acquisition_dump_reader(std::string & basename, unsigned int sat, unsigned int doppler_max, unsigned int doppler_step, unsigned int samples_per_code);
acquisition_dump_reader(const std::string & basename, unsigned int sat, unsigned int doppler_max, unsigned int doppler_step, unsigned int samples_per_code);
~acquisition_dump_reader();
bool read_binary_acq();

View File

@ -379,9 +379,9 @@ void HybridObservablesTest::check_results_carrier_phase(
ASSERT_LT(error_var_ch1, 1e-2);
ASSERT_LT(max_error_ch1, 5e-2);
ASSERT_GT(min_error_ch1, -5e-2);
}
void HybridObservablesTest::check_results_code_psudorange(
arma::vec & true_ch0_dist_m,
arma::vec & true_ch1_dist_m,
@ -401,8 +401,6 @@ void HybridObservablesTest::check_results_code_psudorange(
arma::vec delta_true_dist_m = true_ch0_dist_interp-true_ch1_dist_interp;
arma::vec delta_measured_dist_m = measuded_ch0_Pseudorange_m-measuded_ch1_Pseudorange_m;
//2. RMSE
arma::vec err;
@ -467,7 +465,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
{
throw std::exception();
};
}) << "Failure opening true observables file" << std::endl;
}) << "Failure opening true observables file";
true_obs_file = std::string("./gps_l1_ca_obs_prn");
true_obs_file.append(std::to_string(test_satellite_PRN2));
@ -477,7 +475,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
{
throw std::exception();
};
}) << "Failure opening true observables file" << std::endl;
}) << "Failure opening true observables file";
top_block = gr::make_top_block("Telemetry_Decoder test");
std::shared_ptr<TrackingInterface> tracking_ch0 = std::make_shared<GpsL1CaDllPllTracking>(config.get(), "Tracking_1C", 1, 1);
@ -494,14 +492,14 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
{
throw std::exception();
};
})<< "Failure reading true observables file" << std::endl;
}) << "Failure reading true observables file";
ASSERT_NO_THROW({
if (true_obs_data_ch1.read_binary_obs() == false)
{
throw std::exception();
};
}) << "Failure reading true observables file" << std::endl;
}) << "Failure reading true observables file";
//restart the epoch counter
true_obs_data_ch0.restart();
@ -529,7 +527,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
tlm_ch0->set_satellite(Gnss_Satellite(std::string("GPS"),gnss_synchro_ch0.PRN));
tlm_ch1->set_satellite(Gnss_Satellite(std::string("GPS"),gnss_synchro_ch1.PRN));
}) << "Failure setting gnss_synchro." << std::endl;
}) << "Failure setting gnss_synchro.";
boost::shared_ptr<HybridObservablesTest_tlm_msg_rx> tlm_msg_rx_ch1 = HybridObservablesTest_tlm_msg_rx_make();
boost::shared_ptr<HybridObservablesTest_tlm_msg_rx> tlm_msg_rx_ch2 = HybridObservablesTest_tlm_msg_rx_make();
@ -540,17 +538,17 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
ASSERT_NO_THROW( {
tracking_ch0->set_channel(gnss_synchro_ch0.Channel_ID);
tracking_ch1->set_channel(gnss_synchro_ch1.Channel_ID);
}) << "Failure setting channel." << std::endl;
}) << "Failure setting channel.";
ASSERT_NO_THROW( {
tracking_ch0->set_gnss_synchro(&gnss_synchro_ch0);
tracking_ch1->set_gnss_synchro(&gnss_synchro_ch1);
}) << "Failure setting gnss_synchro." << std::endl;
}) << "Failure setting gnss_synchro.";
ASSERT_NO_THROW( {
tracking_ch0->connect(top_block);
tracking_ch1->connect(top_block);
}) << "Failure connecting tracking to the top_block." << std::endl;
}) << "Failure connecting tracking to the top_block.";
ASSERT_NO_THROW( {
std::string file = "./" + filename_raw_data;
@ -574,7 +572,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
top_block->connect(observables->get_right_block(), 0, sink_ch0, 0);
top_block->connect(observables->get_right_block(), 1, sink_ch1, 0);
}) << "Failure connecting the blocks." << std::endl;
}) << "Failure connecting the blocks.";
tracking_ch0->start_tracking();
tracking_ch1->start_tracking();
@ -584,7 +582,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
top_block->run(); // Start threads and wait
end = std::chrono::system_clock::now();
elapsed_seconds = end - start;
}) << "Failure running the top_block." << std::endl;
}) << "Failure running the top_block.";
//check results
//load the true values
@ -596,7 +594,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
{
throw std::exception();
};
}) << "Failure opening true observables file" << std::endl;
}) << "Failure opening true observables file";
long int nepoch = true_observables.num_epochs();
@ -637,7 +635,6 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
epoch_counter++;
}
});
//read measured values
@ -647,7 +644,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
{
throw std::exception();
};
}) << "Failure opening dump observables file" << std::endl;
}) << "Failure opening dump observables file";
nepoch = estimated_observables.num_epochs();
std::cout << "Measured observation epochs=" << nepoch << std::endl;

View File

@ -170,7 +170,6 @@ GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx::~GpsL1CADllPllTelemetryDecoderTest
class GpsL1CATelemetryDecoderTest: public ::testing::Test
{
public:
std::string generator_binary;
std::string p1;
@ -357,7 +356,7 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults)
{
throw std::exception();
};
}) << "Failure opening true observables file" << std::endl;
}) << "Failure opening true observables file";
top_block = gr::make_top_block("Telemetry_Decoder test");
std::shared_ptr<TrackingInterface> tracking = std::make_shared<GpsL1CaDllPllTracking>(config.get(), "Tracking_1C", 1, 1);
@ -371,7 +370,7 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults)
{
throw std::exception();
};
})<< "Failure reading true observables file" << std::endl;
}) << "Failure reading true observables file";
//restart the epoch counter
true_obs_data.restart();
@ -388,15 +387,15 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults)
ASSERT_NO_THROW( {
tracking->set_channel(gnss_synchro.Channel_ID);
}) << "Failure setting channel." << std::endl;
}) << "Failure setting channel.";
ASSERT_NO_THROW( {
tracking->set_gnss_synchro(&gnss_synchro);
}) << "Failure setting gnss_synchro." << std::endl;
}) << "Failure setting gnss_synchro.";
ASSERT_NO_THROW( {
tracking->connect(top_block);
}) << "Failure connecting tracking to the top_block." << std::endl;
}) << "Failure connecting tracking to the top_block.";
ASSERT_NO_THROW( {
std::string file = "./" + filename_raw_data;
@ -409,7 +408,7 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults)
top_block->connect(tracking->get_right_block(), 0, tlm->get_left_block(), 0);
top_block->connect(tlm->get_right_block(), 0, sink, 0);
top_block->msg_connect(tracking->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events"));
}) << "Failure connecting the blocks." << std::endl;
}) << "Failure connecting the blocks.";
tracking->start_tracking();
@ -418,7 +417,7 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults)
top_block->run(); // Start threads and wait
end = std::chrono::system_clock::now();
elapsed_seconds = end - start;
}) << "Failure running the top_block." << std::endl;
}) << "Failure running the top_block.";
//check results
//load the true values
@ -449,7 +448,7 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults)
{
throw std::exception();
};
}) << "Failure opening telemetry dump file" << std::endl;
}) << "Failure opening telemetry dump file";
nepoch = tlm_dump.num_epochs();
std::cout << "Measured observation epochs=" << nepoch << std::endl;