1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-30 00:43:15 +00:00

Fixing warnings

This commit is contained in:
Carles Fernandez 2014-09-08 15:43:47 +02:00
parent aedeea0004
commit e0280584a9
5 changed files with 31 additions and 150 deletions

View File

@ -66,5 +66,5 @@ TEST(FileSignalSource, InstantiateFileNotExists)
config->set_property("Test.item_type", "gr_complex");
config->set_property("Test.repeat", "false");
EXPECT_THROW(auto uptr(new FileSignalSource(config.get(), "Test", 1, 1, queue)), std::exception);
EXPECT_THROW({auto uptr = std::make_shared<FileSignalSource>(config.get(), "Test", 1, 1, queue);}, std::exception);
}

View File

@ -129,5 +129,5 @@ TEST_F(Fir_Filter_Test, ConnectAndRun)
gettimeofday(&tv, NULL);
end = tv.tv_sec *1000000 + tv.tv_usec;
}) << "Failure running the top_block." << std::endl;
//std::cout << "Filtered " << nsamples << " samples in " << (end-begin) << " microseconds" << std::endl;
std::cout << "Filtered " << nsamples << " samples in " << (end-begin) << " microseconds" << std::endl;
}

View File

@ -55,7 +55,7 @@ protected:
{
queue = gr::msg_queue::make(0);
top_block = gr::make_top_block("Tracking test");
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
factory = std::make_shared<GNSSBlockFactory>();
config = std::make_shared<InMemoryConfiguration>();
item_size = sizeof(gr_complex);
stop = false;
@ -114,8 +114,8 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ConnectAndRun)
int fs_in = 8000000;
int nsamples = 80000000;
struct timeval tv;
long long int begin;
long long int end;
long long int begin = 0;
long long int end = 0;
init();
// Example using smart pointers and the block factory

View File

@ -61,7 +61,6 @@ protected:
{
queue = gr::msg_queue::make(0);
top_block = gr::make_top_block("Acquisition test");
item_size = sizeof(gr_complex);
stop = false;
message = 0;
@ -83,7 +82,7 @@ protected:
gr::msg_queue::sptr queue;
gr::top_block_sptr top_block;
//std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
GalileoE5aNoncoherentIQAcquisitionCaf *acquisition;
std::shared_ptr<GalileoE5aNoncoherentIQAcquisitionCaf> acquisition;
std::shared_ptr<InMemoryConfiguration> config;
Gnss_Synchro gnss_synchro;
@ -456,8 +455,8 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::process_message()
{
if (message == 1)
{
double delay_error_chips;
double doppler_error_hz;
double delay_error_chips = 0.0;
double doppler_error_hz = 0.0;
switch (sat)
{
case 0:
@ -612,8 +611,9 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ValidationOfSIM)
config_1();
//int nsamples = floor(fs_in*integration_time_ms*1e-3);
acquisition = new GalileoE5aNoncoherentIQAcquisitionCaf(config.get(), "Acquisition", 1, 1, queue);
unsigned int skiphead_sps = 28000+32000; // 32 Msps
acquisition = std::make_shared<GalileoE5aNoncoherentIQAcquisitionCaf>(config.get(), "Acquisition_Galileo", 1, 1, queue);
//unsigned int skiphead_sps = 28000+32000; // 32 Msps
// unsigned int skiphead_sps = 0;
// unsigned int skiphead_sps = 84000;
@ -630,15 +630,15 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ValidationOfSIM)
}) << "Failure setting channel_internal_queue."<< std::endl;
ASSERT_NO_THROW( {
acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000));
acquisition->set_doppler_max(config->property("Acquisition_Galileo.doppler_max", 10000));
}) << "Failure setting doppler_max."<< std::endl;
ASSERT_NO_THROW( {
acquisition->set_doppler_step(config->property("Acquisition.doppler_step", 500));
acquisition->set_doppler_step(config->property("Acquisition_Galileo.doppler_step", 500));
}) << "Failure setting doppler_step."<< std::endl;
ASSERT_NO_THROW( {
acquisition->set_threshold(config->property("Acquisition.threshold", 0.0));
acquisition->set_threshold(config->property("Acquisition_Galileo.threshold", 0.0));
}) << "Failure setting threshold."<< std::endl;
ASSERT_NO_THROW( {
@ -649,28 +649,14 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ValidationOfSIM)
// USING SIGNAL GENERATOR
ASSERT_NO_THROW( {
//std::string filename_ = "../data/Tiered_sink.dat";
//boost::shared_ptr<gr::blocks::file_sink> file_sink_;
boost::shared_ptr<GenSignalSource> signal_source;
SignalGenerator* signal_generator = new SignalGenerator(config.get(), "SignalSource", 0, 1, queue);
FirFilter* filter = new FirFilter(config.get(), "InputFilter", 1, 1, queue);
signal_source.reset(new GenSignalSource(config.get(), signal_generator, filter, "SignalSource", queue));
signal_source->connect(top_block);
//
//signal_generator->connect(top_block);
//
//file_sink_=gr::blocks::file_sink::make(sizeof(gr_complex), filename_.c_str());
top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0);
//top_block->connect(signal_source->get_right_block(), 0, file_sink_, 0);
//
//top_block->connect(signal_generator->get_right_block(), 0, acquisition->get_left_block(), 0);
//top_block->connect(signal_generator->get_right_block(), 0, file_sink_, 0);
//
}) << "Failure connecting the blocks of acquisition test." << std::endl;
}) << "Failure connecting the blocks of acquisition test." << std::endl;
// USING SIGNAL FROM FILE SOURCE
/*
@ -734,7 +720,7 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ValidationOfSIM)
EXPECT_NO_THROW( {
top_block->run(); // Start threads and wait
}) << "Failure running he top_block."<< std::endl;
}) << "Failure running the top_block."<< std::endl;
std::cout << gnss_synchro.Acq_delay_samples << "acq delay" <<std::endl;
std::cout << gnss_synchro.Acq_doppler_hz << "acq doppler" <<std::endl;
@ -754,9 +740,6 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ValidationOfSIM)
// EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL.";
// }
}
// free(acquisition);
delete acquisition;
}
/*

View File

@ -55,7 +55,7 @@ protected:
{
queue = gr::msg_queue::make(0);
top_block = gr::make_top_block("Tracking test");
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
factory = std::make_shared<GNSSBlockFactory>();
config = std::make_shared<InMemoryConfiguration>();
item_size = sizeof(gr_complex);
stop = false;
@ -86,100 +86,27 @@ void GalileoE5aTrackingTest::init()
std::string signal = "5Q";
signal.copy(gnss_synchro.Signal, 2, 0);
config->set_property("GNSS-SDR.internal_fs_hz", "32000000");
config->set_property("Tracking.item_type", "gr_complex");
config->set_property("Tracking.dump", "true");
config->set_property("Tracking.dump_filename", "../data/e5a_tracking_ch_");
config->set_property("Tracking.implementation", "Galileo_E5a_DLL_PLL_Tracking");
config->set_property("Tracking.early_late_space_chips", "0.5");
config->set_property("Tracking_Galileo.item_type", "gr_complex");
config->set_property("Tracking_Galileo.dump", "true");
config->set_property("Tracking_Galileo.dump_filename", "../data/e5a_tracking_ch_");
config->set_property("Tracking_Galileo.implementation", "Galileo_E5a_DLL_PLL_Tracking");
config->set_property("Tracking_Galileo.early_late_space_chips", "0.5");
config->set_property("Tracking.pll_bw_hz_init","20.0");
// config->set_property("Tracking.pll_bw_hz_init","5.0");
config->set_property("Tracking.dll_bw_hz_init","2.0");
config->set_property("Tracking.pll_bw_hz", "5");
config->set_property("Tracking.dll_bw_hz", "2");
config->set_property("Tracking.ti_ms","1");
// config->set_property("Tracking.pll_bw_hz", "5");
// config->set_property("Tracking.dll_bw_hz", "2");
// config->set_property("Tracking.ti_ms","1");
//config->set_property("Tracking.fll_bw_hz", "10.0");
config->set_property("Tracking_Galileo.pll_bw_hz_init","20.0");
config->set_property("Tracking_Galileo.ti_ms", "1");
config->set_property("Tracking_Galileo.dll_bw_hz_init","2.0");
config->set_property("Tracking_Galileo.pll_bw_hz", "5");
config->set_property("Tracking_Galileo.dll_bw_hz", "2");
}
/*
TEST_F(GalileoE5aTrackingTest, InstantiateTrack)
{
init();
auto tracking = factory->GetBlock(config, "Tracking", "Galileo_E5a_DLL_PLL_Tracking", 1, 1, queue);
EXPECT_STREQ("Galileo_E5a_DLL_PLL_Tracking", tracking->implementation().c_str());
// auto tracking = factory->GetBlock(config, "Tracking", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1, queue);
// EXPECT_STREQ("Galileo_E1_DLL_PLL_VEML_Tracking", tracking->implementation().c_str());
}*/
/*
TEST_F(GalileoE5aTrackingTest, ConnectAndRun)
{
int fs_in = 21000000;
int nsamples = 21000000;
struct timeval tv;
long long int begin;
long long int end;
init();
// Example using smart pointers and the block factory
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(config, "Tracking", "Galileo_E5a_DLL_PLL_Tracking", 1, 1, queue);
std::shared_ptr<GalileoE5aDllPllTracking> tracking = std::dynamic_pointer_cast<GalileoE5aDllPllTracking>(trk_);
ASSERT_NO_THROW( {
tracking->set_channel(gnss_synchro.Channel_ID);
}) << "Failure setting channel." << std::endl;
ASSERT_NO_THROW( {
tracking->set_gnss_synchro(&gnss_synchro);
}) << "Failure setting gnss_synchro." << std::endl;
ASSERT_NO_THROW( {
tracking->set_channel_queue(&channel_internal_queue);
}) << "Failure setting channel_internal_queue." << std::endl;
ASSERT_NO_THROW( {
tracking->connect(top_block);
gr::analog::sig_source_c::sptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0));
boost::shared_ptr<gr::block> valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue);
gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(Gnss_Synchro));
top_block->connect(source, 0, valve, 0);
top_block->connect(valve, 0, tracking->get_left_block(), 0);
top_block->connect(tracking->get_right_block(), 0, sink, 0);
}) << "Failure connecting the blocks of tracking test." << std::endl;
tracking->start_tracking();
EXPECT_NO_THROW( {
gettimeofday(&tv, NULL);
begin = tv.tv_sec *1000000 + tv.tv_usec;
top_block->run(); //Start threads and wait
gettimeofday(&tv, NULL);
end = tv.tv_sec *1000000 + tv.tv_usec;
}) << "Failure running the top_block." << std::endl;
std::cout << "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
}
*/
TEST_F(GalileoE5aTrackingTest, ValidationOfResults)
{
struct timeval tv;
long long int begin = 0;
long long int end = 0;
int fs_in = 3200000000;
int nsamples = 3200000000*1.5;
//int num_samples = 320000000*1.5; // 32 Msps
//unsigned int skiphead_sps = 98000; // 1 Msample
unsigned int skiphead_sps = 0; // 1 Msampl
// unsigned int skiphead_sps = 104191; // 1 Msampl
int fs_in = 32000000;
int nsamples = 32000000*1.5;
init();
// Example using smart pointers and the block factory
@ -187,23 +114,11 @@ TEST_F(GalileoE5aTrackingTest, ValidationOfResults)
std::shared_ptr<TrackingInterface> tracking = std::dynamic_pointer_cast<TrackingInterface>(trk_);
//REAL
gnss_synchro.Acq_delay_samples = 15579+1; // 32 Msps
gnss_synchro.Acq_delay_samples = 10; // 32 Msps
// gnss_synchro.Acq_doppler_hz = 3500; // 32 Msps
gnss_synchro.Acq_doppler_hz = 3750; // 500 Hz resolution
gnss_synchro.Acq_doppler_hz = 2000; // 500 Hz resolution
// gnss_synchro.Acq_samplestamp_samples = 98000;
gnss_synchro.Acq_samplestamp_samples = 0;
//SIM
// gnss_synchro.Acq_delay_samples = 14001+1; // 32 Msps
// //gnss_synchro.Acq_doppler_hz = 2750; // 32 Msps (real 2800)
//// gnss_synchro.Acq_doppler_hz = 2800; // 32 Msps (real 2800)
// gnss_synchro.Acq_doppler_hz = 0; // 32 Msps (real 2800)
//// gnss_synchro.Acq_samplestamp_samples = 98000;
// gnss_synchro.Acq_samplestamp_samples = 0;
//SIM2
// gnss_synchro.Acq_delay_samples = 5810; // 32 Msps
// gnss_synchro.Acq_doppler_hz = 2800;
// gnss_synchro.Acq_samplestamp_samples = 0;
ASSERT_NO_THROW( {
tracking->set_channel(gnss_synchro.Channel_ID);
@ -229,23 +144,6 @@ TEST_F(GalileoE5aTrackingTest, ValidationOfResults)
top_block->connect(valve, 0, tracking->get_left_block(), 0);
top_block->connect(tracking->get_right_block(), 0, sink, 0);
/** std::string file = "/home/marc/E5a_acquisitions/32MS_complex.dat";
//std::string file = "/home/marc/E5a_acquisitions/sim_32M_sec94_PRN11_long.dat";
//std::string file = "/home/marc/E5a_acquisitions/sim_32M_sec94_PRN11_long_0dopp.dat";
gnss_synchro.PRN = 19;//real
//gnss_synchro.PRN = 11;//sim
const char * file_name = file.c_str();
gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex),file_name,false);
gr::blocks::skiphead::sptr skip_head = gr::blocks::skiphead::make(sizeof(gr_complex), skiphead_sps);
boost::shared_ptr<gr::block> valve = gnss_sdr_make_valve(sizeof(gr_complex), num_samples, queue);
gr::blocks::null_sink::sptr sink = gr::blocks::null_sink::make(sizeof(Gnss_Synchro));
top_block->connect(file_source, 0, skip_head, 0);
top_block->connect(skip_head, 0, valve, 0);
top_block->connect(valve, 0, tracking->get_left_block(), 0);
top_block->connect(tracking->get_right_block(), 0, sink, 0);*/
}) << "Failure connecting the blocks of tracking test." << std::endl;
tracking->start_tracking();