mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-26 08:56:58 +00:00
Merge branch 'modern_factory' into next
This commit is contained in:
commit
5b5ab106c6
@ -266,6 +266,10 @@ std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GNSSBlockFacto
|
||||
* Returns the block with the required configuration and implementation
|
||||
*
|
||||
* PLEASE ADD YOUR NEW BLOCK HERE!!
|
||||
*
|
||||
* IMPORTANT NOTE: Acquisition, Tracking and telemetry blocks are only included here for testing purposes.
|
||||
* To be included in a channel they must be also be included in GetAcqBlock(), GetTrkBlock() and GetTlmBlock()
|
||||
* (see below)
|
||||
*/
|
||||
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
|
||||
std::shared_ptr<ConfigurationInterface> configuration,
|
||||
@ -559,8 +563,11 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
|
||||
|
||||
|
||||
/*
|
||||
* Not very elegant, Acq, Ttk and Tlm blocks must be added here, too.
|
||||
* To be fixed!
|
||||
*
|
||||
* PLEASE ADD YOUR NEW BLOCK HERE!!
|
||||
*
|
||||
* Not very elegant, Acq, Trk and Tlm blocks must be added here, too.
|
||||
* To be improved!
|
||||
*/
|
||||
|
||||
std::unique_ptr<AcquisitionInterface> GNSSBlockFactory::GetAcqBlock(
|
||||
|
@ -58,19 +58,26 @@ public:
|
||||
virtual ~GNSSBlockFactory();
|
||||
std::unique_ptr<GNSSBlockInterface> GetSignalSource(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
|
||||
std::unique_ptr<GNSSBlockInterface> GetSignalConditioner(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
|
||||
std::unique_ptr<GNSSBlockInterface> GetPVT(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
|
||||
std::unique_ptr<GNSSBlockInterface> GetObservables(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
|
||||
std::unique_ptr<GNSSBlockInterface> GetOutputFilter(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
|
||||
std::unique_ptr<GNSSBlockInterface> GetChannel(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
std::string acq, std::string trk, std::string tlm, int channel,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
|
||||
std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GetChannels(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
|
||||
/*
|
||||
* \brief Returns the block with the required configuration and implementation
|
||||
*/
|
||||
@ -78,17 +85,20 @@ public:
|
||||
std::string role, std::string implementation,
|
||||
unsigned int in_streams, unsigned int out_streams,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
|
||||
private:
|
||||
std::unique_ptr<AcquisitionInterface> GetAcqBlock(
|
||||
std::shared_ptr<ConfigurationInterface> configuration,
|
||||
std::string role,
|
||||
std::string implementation, unsigned int in_streams,
|
||||
unsigned int out_streams, boost::shared_ptr<gr::msg_queue> queue);
|
||||
|
||||
std::unique_ptr<TrackingInterface> GetTrkBlock(
|
||||
std::shared_ptr<ConfigurationInterface> configuration,
|
||||
std::string role,
|
||||
std::string implementation, unsigned int in_streams,
|
||||
unsigned int out_streams, boost::shared_ptr<gr::msg_queue> queue);
|
||||
|
||||
std::unique_ptr<TelemetryDecoderInterface> GetTlmBlock(
|
||||
std::shared_ptr<ConfigurationInterface> configuration,
|
||||
std::string role,
|
||||
|
@ -45,9 +45,9 @@
|
||||
#include "in_memory_configuration.h"
|
||||
#include "gnss_sdr_valve.h"
|
||||
#include "gnss_synchro.h"
|
||||
|
||||
#include "galileo_e1_dll_pll_veml_tracking.h"
|
||||
|
||||
|
||||
class GalileoE1DllPllVemlTrackingInternalTest: public ::testing::Test
|
||||
{
|
||||
protected:
|
||||
@ -55,47 +55,43 @@ protected:
|
||||
{
|
||||
queue = gr::msg_queue::make(0);
|
||||
top_block = gr::make_top_block("Tracking test");
|
||||
factory = new GNSSBlockFactory();
|
||||
config = new InMemoryConfiguration();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
item_size = sizeof(gr_complex);
|
||||
stop = false;
|
||||
message = 0;
|
||||
}
|
||||
|
||||
~GalileoE1DllPllVemlTrackingInternalTest()
|
||||
{
|
||||
delete factory;
|
||||
delete config;
|
||||
}
|
||||
{}
|
||||
|
||||
void init();
|
||||
|
||||
gr::msg_queue::sptr queue;
|
||||
gr::top_block_sptr top_block;
|
||||
GNSSBlockFactory* factory;
|
||||
InMemoryConfiguration* config;
|
||||
std::shared_ptr<GNSSBlockFactory> factory;
|
||||
std::shared_ptr<InMemoryConfiguration> config;
|
||||
Gnss_Synchro gnss_synchro;
|
||||
size_t item_size;
|
||||
concurrent_queue<int> channel_internal_queue;
|
||||
bool stop;
|
||||
int message;
|
||||
boost::thread ch_thread;
|
||||
};
|
||||
|
||||
|
||||
void GalileoE1DllPllVemlTrackingInternalTest::init()
|
||||
{
|
||||
gnss_synchro.Channel_ID=0;
|
||||
gnss_synchro.Channel_ID = 0;
|
||||
gnss_synchro.System = 'E';
|
||||
std::string signal = "1B";
|
||||
signal.copy(gnss_synchro.Signal,2,0);
|
||||
gnss_synchro.PRN=11;
|
||||
signal.copy(gnss_synchro.Signal, 2, 0);
|
||||
gnss_synchro.PRN = 11;
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", "8000000");
|
||||
config->set_property("Tracking.item_type", "gr_complex");
|
||||
config->set_property("Tracking.dump", "true");
|
||||
config->set_property("Tracking.dump_filename", "../data/veml_tracking_ch_");
|
||||
config->set_property("Tracking.implementation", "Galileo_E1_DLL_PLL_Tracking");
|
||||
config->set_property("Tracking.implementation", "Galileo_E1_DLL_PLL_VEML_Tracking");
|
||||
config->set_property("Tracking.early_late_space_chips", "0.15");
|
||||
config->set_property("Tracking.very_early_late_space_chips", "0.6");
|
||||
config->set_property("Tracking.pll_bw_hz", "30.0");
|
||||
@ -108,45 +104,62 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, Instantiate)
|
||||
{
|
||||
|
||||
init();
|
||||
GalileoE1DllPllVemlTracking *tracking = new GalileoE1DllPllVemlTracking(config, "Tracking", 1, 1, queue);
|
||||
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());
|
||||
delete tracking;
|
||||
}
|
||||
|
||||
//TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ConnectAndRun)
|
||||
//{
|
||||
// int fs_in = 8000000;
|
||||
// int nsamples = 80000000;
|
||||
// struct timeval tv;
|
||||
// long long int begin;
|
||||
// long long int end;
|
||||
//
|
||||
// init();
|
||||
// GalileoE1DllPllVemlTracking *tracking = new GalileoE1DllPllVemlTracking(config, "Tracking", 1, 1, queue);
|
||||
//
|
||||
// ASSERT_NO_THROW( {
|
||||
// tracking->connect(top_block);
|
||||
// gr_block_sptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0));
|
||||
// gr_block_sptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue);
|
||||
// gr_null_sink_sptr sink = gr_make_null_sink(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;
|
||||
//
|
||||
// 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 he top_block."<< std::endl;
|
||||
//
|
||||
// delete tracking;
|
||||
// std::cout << "Processed " << nsamples << " samples in " << (end-begin) << " microseconds" << std::endl;
|
||||
//
|
||||
//}
|
||||
|
||||
TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ConnectAndRun)
|
||||
{
|
||||
int fs_in = 8000000;
|
||||
int nsamples = 80000000;
|
||||
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_E1_DLL_PLL_VEML_Tracking", 1, 1, queue);
|
||||
std::shared_ptr<GalileoE1DllPllVemlTracking> tracking = std::dynamic_pointer_cast<GalileoE1DllPllVemlTracking>(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(GalileoE1DllPllVemlTrackingInternalTest, ValidationOfResults)
|
||||
{
|
||||
@ -158,29 +171,32 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ValidationOfResults)
|
||||
int num_samples = 80000000; // 8 Msps
|
||||
unsigned int skiphead_sps = 8000000; // 8 Msps
|
||||
init();
|
||||
GalileoE1DllPllVemlTracking *tracking = new GalileoE1DllPllVemlTracking(config, "Tracking", 1, 1, queue);
|
||||
|
||||
// gnss_synchro.Acq_delay_samples=1753; // 4 Msps
|
||||
// gnss_synchro.Acq_doppler_hz=-9500; // 4 Msps
|
||||
// Example using smart pointers and the block factory
|
||||
std::shared_ptr<GNSSBlockInterface> trk_ = factory->GetBlock(config, "Tracking", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1, queue);
|
||||
std::shared_ptr<TrackingInterface> tracking = std::dynamic_pointer_cast<TrackingInterface>(trk_);
|
||||
|
||||
// gnss_synchro.Acq_delay_samples = 1753; // 4 Msps
|
||||
// gnss_synchro.Acq_doppler_hz = -9500; // 4 Msps
|
||||
gnss_synchro.Acq_delay_samples = 17256; // 8 Msps
|
||||
gnss_synchro.Acq_doppler_hz = -8750; // 8 Msps
|
||||
gnss_synchro.Acq_samplestamp_samples = 0;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
tracking->set_channel(gnss_synchro.Channel_ID);
|
||||
}) << "Failure setting channel."<< std::endl;
|
||||
}) << "Failure setting channel." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
tracking->set_gnss_synchro(&gnss_synchro);
|
||||
}) << "Failure setting gnss_synchro."<< std::endl;
|
||||
}) << "Failure setting gnss_synchro." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
tracking->set_channel_queue(&channel_internal_queue);
|
||||
}) << "Failure setting channel_internal_queue."<< std::endl;
|
||||
}) << "Failure setting channel_internal_queue." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
tracking->connect(top_block);
|
||||
}) << "Failure connecting tracking to the top_block."<< std::endl;
|
||||
}) << "Failure connecting tracking to the top_block." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
std::string path = std::string(TEST_PATH);
|
||||
@ -194,8 +210,7 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ValidationOfResults)
|
||||
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;
|
||||
|
||||
}) << "Failure connecting the blocks of tracking test." << std::endl;
|
||||
|
||||
tracking->start_tracking();
|
||||
|
||||
@ -205,9 +220,7 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ValidationOfResults)
|
||||
top_block->run(); // Start threads and wait
|
||||
gettimeofday(&tv, NULL);
|
||||
end = tv.tv_sec *1000000 + tv.tv_usec;
|
||||
}) << "Failure running he top_block."<< std::endl;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
std::cout << "Tracked " << num_samples << " samples in " << (end-begin) << " microseconds" << std::endl;
|
||||
|
||||
delete tracking;
|
||||
std::cout << "Tracked " << num_samples << " samples in " << (end - begin) << " microseconds" << std::endl;
|
||||
}
|
||||
|
@ -61,11 +61,11 @@ protected:
|
||||
item_size = sizeof(gr_complex);
|
||||
stop = false;
|
||||
message = 0;
|
||||
factory = std::make_shared<GNSSBlockFactory>();
|
||||
}
|
||||
|
||||
~GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test()
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
void init();
|
||||
void config_1();
|
||||
@ -77,8 +77,9 @@ protected:
|
||||
|
||||
gr::msg_queue::sptr queue;
|
||||
gr::top_block_sptr top_block;
|
||||
GalileoE1Pcps8msAmbiguousAcquisition *acquisition;
|
||||
InMemoryConfiguration* config;
|
||||
std::shared_ptr<GalileoE1Pcps8msAmbiguousAcquisition> acquisition;
|
||||
std::shared_ptr<GNSSBlockFactory> factory;
|
||||
std::shared_ptr<InMemoryConfiguration> config;
|
||||
Gnss_Synchro gnss_synchro;
|
||||
size_t item_size;
|
||||
concurrent_queue<int> channel_internal_queue;
|
||||
@ -129,7 +130,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_1()
|
||||
gnss_synchro.Channel_ID = 0;
|
||||
gnss_synchro.System = 'E';
|
||||
std::string signal = "1C";
|
||||
signal.copy(gnss_synchro.Signal,2,0);
|
||||
signal.copy(gnss_synchro.Signal, 2, 0);
|
||||
|
||||
integration_time_ms = 8;
|
||||
fs_in = 4e6;
|
||||
@ -141,7 +142,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_1()
|
||||
|
||||
num_of_realizations = 1;
|
||||
|
||||
config = new InMemoryConfiguration();
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
|
||||
@ -154,10 +155,8 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_1()
|
||||
config->set_property("SignalSource.system_0", "E");
|
||||
config->set_property("SignalSource.PRN_0", "10");
|
||||
config->set_property("SignalSource.CN0_dB_0", "44");
|
||||
config->set_property("SignalSource.doppler_Hz_0",
|
||||
std::to_string(expected_doppler_hz));
|
||||
config->set_property("SignalSource.delay_chips_0",
|
||||
std::to_string(expected_delay_chips));
|
||||
config->set_property("SignalSource.doppler_Hz_0", std::to_string(expected_doppler_hz));
|
||||
config->set_property("SignalSource.delay_chips_0", std::to_string(expected_delay_chips));
|
||||
|
||||
config->set_property("SignalSource.noise_flag", "false");
|
||||
config->set_property("SignalSource.data_flag", "false");
|
||||
@ -184,8 +183,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_1()
|
||||
|
||||
config->set_property("Acquisition.item_type", "gr_complex");
|
||||
config->set_property("Acquisition.if", "0");
|
||||
config->set_property("Acquisition.coherent_integration_time_ms",
|
||||
std::to_string(integration_time_ms));
|
||||
config->set_property("Acquisition.coherent_integration_time_ms", std::to_string(integration_time_ms));
|
||||
config->set_property("Acquisition.max_dwells", "1");
|
||||
config->set_property("Acquisition.implementation", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition");
|
||||
config->set_property("Acquisition.threshold", "0.2");
|
||||
@ -199,7 +197,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_2()
|
||||
gnss_synchro.Channel_ID = 0;
|
||||
gnss_synchro.System = 'E';
|
||||
std::string signal = "1C";
|
||||
signal.copy(gnss_synchro.Signal,2,0);
|
||||
signal.copy(gnss_synchro.Signal, 2, 0);
|
||||
|
||||
integration_time_ms = 8;
|
||||
fs_in = 4e6;
|
||||
@ -211,7 +209,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_2()
|
||||
|
||||
num_of_realizations = 100;
|
||||
|
||||
config = new InMemoryConfiguration();
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
|
||||
@ -224,10 +222,8 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_2()
|
||||
config->set_property("SignalSource.system_0", "E");
|
||||
config->set_property("SignalSource.PRN_0", "10");
|
||||
config->set_property("SignalSource.CN0_dB_0", "44");
|
||||
config->set_property("SignalSource.doppler_Hz_0",
|
||||
std::to_string(expected_doppler_hz));
|
||||
config->set_property("SignalSource.delay_chips_0",
|
||||
std::to_string(expected_delay_chips));
|
||||
config->set_property("SignalSource.doppler_Hz_0", std::to_string(expected_doppler_hz));
|
||||
config->set_property("SignalSource.delay_chips_0", std::to_string(expected_delay_chips));
|
||||
|
||||
config->set_property("SignalSource.system_1", "E");
|
||||
config->set_property("SignalSource.PRN_1", "15");
|
||||
@ -272,8 +268,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_2()
|
||||
|
||||
config->set_property("Acquisition.item_type", "gr_complex");
|
||||
config->set_property("Acquisition.if", "0");
|
||||
config->set_property("Acquisition.coherent_integration_time_ms",
|
||||
std::to_string(integration_time_ms));
|
||||
config->set_property("Acquisition.coherent_integration_time_ms", std::to_string(integration_time_ms));
|
||||
config->set_property("Acquisition.max_dwells", "1");
|
||||
config->set_property("Acquisition.implementation", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition");
|
||||
config->set_property("Acquisition.pfa", "0.1");
|
||||
@ -355,8 +350,6 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::process_message()
|
||||
|
||||
stop_queue();
|
||||
top_block->stop();
|
||||
|
||||
//std::cout << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -368,9 +361,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::stop_queue()
|
||||
TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, Instantiate)
|
||||
{
|
||||
config_1();
|
||||
acquisition = new GalileoE1Pcps8msAmbiguousAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
delete acquisition;
|
||||
delete config;
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 1, queue);
|
||||
}
|
||||
|
||||
TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
@ -382,7 +373,32 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
|
||||
config_1();
|
||||
|
||||
acquisition = new GalileoE1Pcps8msAmbiguousAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 1, queue);
|
||||
acquisition = std::dynamic_pointer_cast<GalileoE1Pcps8msAmbiguousAcquisition>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
}) << "Failure setting channel." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
}) << "Failure setting gnss_synchro." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel_queue(&channel_internal_queue);
|
||||
}) << "Failure setting channel_internal_queue." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000));
|
||||
}) << "Failure setting doppler_max." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_step(config->property("Acquisition.doppler_step", 500));
|
||||
}) << "Failure setting doppler_step." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 0.0));
|
||||
}) << "Failure setting threshold." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
@ -390,7 +406,7 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
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);
|
||||
}) << "Failure connecting the blocks of acquisition test."<< std::endl;
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
gettimeofday(&tv, NULL);
|
||||
@ -398,60 +414,58 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
top_block->run(); // Start threads and wait
|
||||
gettimeofday(&tv, NULL);
|
||||
end = tv.tv_sec *1e6 + tv.tv_usec;
|
||||
}) << "Failure running he top_block."<< std::endl;
|
||||
}) << "Failure running he top_block." << std::endl;
|
||||
|
||||
std::cout << "Processed " << nsamples << " samples in " << (end-begin) << " microseconds" << std::endl;
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
std::cout << "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
|
||||
}
|
||||
|
||||
TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
{
|
||||
config_1();
|
||||
|
||||
acquisition = new GalileoE1Pcps8msAmbiguousAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 1, queue);
|
||||
acquisition = std::dynamic_pointer_cast<GalileoE1Pcps8msAmbiguousAcquisition>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
}) << "Failure setting channel."<< std::endl;
|
||||
}) << "Failure setting channel." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
}) << "Failure setting gnss_synchro."<< std::endl;
|
||||
}) << "Failure setting gnss_synchro." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel_queue(&channel_internal_queue);
|
||||
}) << "Failure setting channel_internal_queue."<< std::endl;
|
||||
}) << "Failure setting channel_internal_queue." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000));
|
||||
}) << "Failure setting doppler_max."<< std::endl;
|
||||
}) << "Failure setting doppler_max." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_step(config->property("Acquisition.doppler_step", 500));
|
||||
}) << "Failure setting doppler_step."<< std::endl;
|
||||
}) << "Failure setting doppler_step." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 0.0));
|
||||
}) << "Failure setting threshold."<< std::endl;
|
||||
}) << "Failure setting threshold." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
}) << "Failure connecting acquisition to the top_block."<< std::endl;
|
||||
}) << "Failure connecting acquisition to the top_block." << std::endl;
|
||||
|
||||
acquisition->init();
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
boost::shared_ptr<GenSignalSource> signal_source;
|
||||
SignalGenerator* signal_generator = new SignalGenerator(config, "SignalSource", 0, 1, queue);
|
||||
FirFilter* filter = new FirFilter(config, "InputFilter", 1, 1, queue);
|
||||
signal_source.reset(new GenSignalSource(config, signal_generator, filter, "SignalSource", queue));
|
||||
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);
|
||||
top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0);
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
|
||||
// i = 0 --> sallite in acquisition is visible
|
||||
// i = 0 --> satellite in acquisition is visible
|
||||
// i = 1 --> satellite in acquisition is not visible
|
||||
for (unsigned int i = 0; i < 2; i++)
|
||||
{
|
||||
@ -472,80 +486,77 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
top_block->run(); // Start threads and wait
|
||||
}) << "Failure running the top_block."<< std::endl;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
|
||||
if (message == 1)
|
||||
{
|
||||
EXPECT_EQ((unsigned int)1, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
|
||||
}
|
||||
{
|
||||
EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
|
||||
if (message == 1)
|
||||
{
|
||||
EXPECT_EQ((unsigned int)1, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else if (i == 1)
|
||||
{
|
||||
EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL.";
|
||||
}
|
||||
{
|
||||
EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL.";
|
||||
}
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.timed_join(boost::posix_time::seconds(1));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
|
||||
}
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
}
|
||||
|
||||
TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
|
||||
{
|
||||
config_2();
|
||||
|
||||
acquisition = new GalileoE1Pcps8msAmbiguousAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 1, queue);
|
||||
acquisition = std::dynamic_pointer_cast<GalileoE1Pcps8msAmbiguousAcquisition>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
}) << "Failure setting channel."<< std::endl;
|
||||
}) << "Failure setting channel." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
}) << "Failure setting gnss_synchro."<< std::endl;
|
||||
}) << "Failure setting gnss_synchro." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel_queue(&channel_internal_queue);
|
||||
}) << "Failure setting channel_internal_queue."<< std::endl;
|
||||
}) << "Failure setting channel_internal_queue." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000));
|
||||
}) << "Failure setting doppler_max."<< std::endl;
|
||||
}) << "Failure setting doppler_max." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_step(config->property("Acquisition.doppler_step", 500));
|
||||
}) << "Failure setting doppler_step."<< std::endl;
|
||||
}) << "Failure setting doppler_step." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 0.0));
|
||||
}) << "Failure setting threshold."<< std::endl;
|
||||
}) << "Failure setting threshold." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
}) << "Failure connecting acquisition to the top_block."<< std::endl;
|
||||
}) << "Failure connecting acquisition to the top_block." << std::endl;
|
||||
|
||||
acquisition->init();
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
boost::shared_ptr<GenSignalSource> signal_source;
|
||||
SignalGenerator* signal_generator = new SignalGenerator(config, "SignalSource", 0, 1, queue);
|
||||
FirFilter* filter = new FirFilter(config, "InputFilter", 1, 1, queue);
|
||||
signal_source.reset(new GenSignalSource(config, signal_generator, filter, "SignalSource", queue));
|
||||
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);
|
||||
top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0);
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
|
||||
std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl;
|
||||
|
||||
// i = 0 --> sallite in acquisition is visible (prob of detection and prob of detection with wrong estimation)
|
||||
// i = 0 --> satellite in acquisition is visible (prob of detection and prob of detection with wrong estimation)
|
||||
// i = 1 --> satellite in acquisition is not visible (prob of false detection)
|
||||
for (unsigned int i = 0; i < 2; i++)
|
||||
{
|
||||
@ -569,22 +580,19 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProb
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
std::cout << "Estimated probability of detection = " << Pd << std::endl;
|
||||
std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl;
|
||||
std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl;
|
||||
}
|
||||
{
|
||||
std::cout << "Estimated probability of detection = " << Pd << std::endl;
|
||||
std::cout << "Estimated probability of false alarm (satellite present) = " << Pfa_p << std::endl;
|
||||
std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl;
|
||||
}
|
||||
else if (i == 1)
|
||||
{
|
||||
std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl;
|
||||
std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl;
|
||||
}
|
||||
{
|
||||
std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl;
|
||||
std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl;
|
||||
}
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.timed_join(boost::posix_time::seconds(1));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
|
||||
}
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
}
|
||||
|
@ -59,6 +59,7 @@ protected:
|
||||
{
|
||||
queue = gr::msg_queue::make(0);
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
factory = std::make_shared<GNSSBlockFactory>();
|
||||
item_size = sizeof(gr_complex);
|
||||
stop = false;
|
||||
message = 0;
|
||||
@ -78,8 +79,9 @@ protected:
|
||||
|
||||
gr::msg_queue::sptr queue;
|
||||
gr::top_block_sptr top_block;
|
||||
GalileoE1PcpsAmbiguousAcquisition *acquisition;
|
||||
InMemoryConfiguration* config;
|
||||
std::shared_ptr<AcquisitionInterface> acquisition;
|
||||
std::shared_ptr<GNSSBlockFactory> factory;
|
||||
std::shared_ptr<InMemoryConfiguration> config;
|
||||
Gnss_Synchro gnss_synchro;
|
||||
size_t item_size;
|
||||
concurrent_queue<int> channel_internal_queue;
|
||||
@ -143,7 +145,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::config_1()
|
||||
|
||||
num_of_realizations = 1;
|
||||
|
||||
config = new InMemoryConfiguration();
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
|
||||
@ -214,7 +216,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::config_2()
|
||||
|
||||
num_of_realizations = 100;
|
||||
|
||||
config = new InMemoryConfiguration();
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
|
||||
@ -364,9 +366,8 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::stop_queue()
|
||||
TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, Instantiate)
|
||||
{
|
||||
config_1();
|
||||
acquisition = new GalileoE1PcpsAmbiguousAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
delete acquisition;
|
||||
delete config;
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
|
||||
acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
||||
}
|
||||
|
||||
|
||||
@ -379,7 +380,8 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
|
||||
config_1();
|
||||
|
||||
acquisition = new GalileoE1PcpsAmbiguousAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
|
||||
acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
@ -395,43 +397,41 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
top_block->run(); // Start threads and wait
|
||||
gettimeofday(&tv, NULL);
|
||||
end = tv.tv_sec*1e6 + tv.tv_usec;
|
||||
}) << "Failure running the top_block."<< std::endl;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
std::cout << "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
}
|
||||
|
||||
TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
{
|
||||
config_1();
|
||||
|
||||
acquisition = new GalileoE1PcpsAmbiguousAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
|
||||
acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
}) << "Failure setting channel."<< std::endl;
|
||||
}) << "Failure setting channel." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
}) << "Failure setting gnss_synchro."<< std::endl;
|
||||
}) << "Failure setting gnss_synchro." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel_queue(&channel_internal_queue);
|
||||
}) << "Failure setting channel_internal_queue."<< std::endl;
|
||||
}) << "Failure setting channel_internal_queue." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000));
|
||||
}) << "Failure setting doppler_max."<< std::endl;
|
||||
}) << "Failure setting doppler_max." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_step(config->property("Acquisition.doppler_step", 500));
|
||||
}) << "Failure setting doppler_step."<< std::endl;
|
||||
}) << "Failure setting doppler_step." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 0.0));
|
||||
}) << "Failure setting threshold."<< std::endl;
|
||||
}) << "Failure setting threshold." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
@ -441,9 +441,9 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
boost::shared_ptr<GenSignalSource> signal_source;
|
||||
SignalGenerator* signal_generator = new SignalGenerator(config, "SignalSource", 0, 1, queue);
|
||||
FirFilter* filter = new FirFilter(config, "InputFilter", 1, 1, queue);
|
||||
signal_source.reset(new GenSignalSource(config, signal_generator, filter, "SignalSource", queue));
|
||||
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);
|
||||
top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0);
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
@ -469,7 +469,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
top_block->run(); // Start threads and wait
|
||||
}) << "Failure running the top_block."<< std::endl;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
@ -484,9 +484,6 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL.";
|
||||
}
|
||||
}
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
}
|
||||
|
||||
|
||||
@ -495,50 +492,51 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProbabi
|
||||
{
|
||||
config_2();
|
||||
|
||||
acquisition = new GalileoE1PcpsAmbiguousAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
|
||||
acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
}) << "Failure setting channel."<< std::endl;
|
||||
}) << "Failure setting channel." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
}) << "Failure setting gnss_synchro."<< std::endl;
|
||||
}) << "Failure setting gnss_synchro." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel_queue(&channel_internal_queue);
|
||||
}) << "Failure setting channel_internal_queue."<< std::endl;
|
||||
}) << "Failure setting channel_internal_queue." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000));
|
||||
}) << "Failure setting doppler_max."<< std::endl;
|
||||
}) << "Failure setting doppler_max." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_step(config->property("Acquisition.doppler_step", 500));
|
||||
}) << "Failure setting doppler_step."<< std::endl;
|
||||
}) << "Failure setting doppler_step." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 0.0));
|
||||
}) << "Failure setting threshold."<< std::endl;
|
||||
}) << "Failure setting threshold." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
}) << "Failure connecting acquisition to the top_block."<< std::endl;
|
||||
}) << "Failure connecting acquisition to the top_block." << std::endl;
|
||||
|
||||
acquisition->init();
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
boost::shared_ptr<GenSignalSource> signal_source;
|
||||
SignalGenerator* signal_generator = new SignalGenerator(config, "SignalSource", 0, 1, queue);
|
||||
FirFilter* filter = new FirFilter(config, "InputFilter", 1, 1, queue);
|
||||
signal_source.reset(new GenSignalSource(config, signal_generator, filter, "SignalSource", queue));
|
||||
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);
|
||||
top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0);
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
|
||||
std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl;
|
||||
|
||||
// i = 0 --> sallite in acquisition is visible (prob of detection and prob of detection with wrong estimation)
|
||||
// i = 0 --> satellite in acquisition is visible (prob of detection and prob of detection with wrong estimation)
|
||||
// i = 1 --> satellite in acquisition is not visible (prob of false detection)
|
||||
for (unsigned int i = 0; i < 2; i++)
|
||||
{
|
||||
@ -573,7 +571,4 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProbabi
|
||||
std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
}
|
||||
|
@ -66,18 +66,15 @@ protected:
|
||||
{
|
||||
queue = gr::msg_queue::make(0);
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
factory = new GNSSBlockFactory();
|
||||
config = new InMemoryConfiguration();
|
||||
factory = std::make_shared<GNSSBlockFactory>();
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
item_size = sizeof(gr_complex);
|
||||
stop = false;
|
||||
message = 0;
|
||||
}
|
||||
|
||||
~GalileoE1PcpsAmbiguousAcquisitionGSoCTest()
|
||||
{
|
||||
delete factory;
|
||||
delete config;
|
||||
}
|
||||
{}
|
||||
|
||||
void init();
|
||||
void start_queue();
|
||||
@ -86,8 +83,8 @@ protected:
|
||||
|
||||
gr::msg_queue::sptr queue;
|
||||
gr::top_block_sptr top_block;
|
||||
GNSSBlockFactory* factory;
|
||||
InMemoryConfiguration* config;
|
||||
std::shared_ptr<GNSSBlockFactory> factory;
|
||||
std::shared_ptr<InMemoryConfiguration> config;
|
||||
Gnss_Synchro gnss_synchro;
|
||||
size_t item_size;
|
||||
concurrent_queue<int> channel_internal_queue;
|
||||
@ -98,7 +95,6 @@ protected:
|
||||
|
||||
void GalileoE1PcpsAmbiguousAcquisitionGSoCTest::init()
|
||||
{
|
||||
|
||||
gnss_synchro.Channel_ID = 0;
|
||||
gnss_synchro.System = 'E';
|
||||
std::string signal = "1C";
|
||||
@ -150,14 +146,10 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoCTest::stop_queue()
|
||||
|
||||
TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, Instantiate)
|
||||
{
|
||||
|
||||
init();
|
||||
|
||||
GalileoE1PcpsAmbiguousAcquisition *acquisition = new GalileoE1PcpsAmbiguousAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<AcquisitionInterface> acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
||||
EXPECT_STREQ("Galileo_E1_PCPS_Ambiguous_Acquisition", acquisition->implementation().c_str());
|
||||
|
||||
delete acquisition;
|
||||
|
||||
}
|
||||
|
||||
TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ConnectAndRun)
|
||||
@ -169,7 +161,8 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ConnectAndRun)
|
||||
long long int end = 0;
|
||||
|
||||
init();
|
||||
GalileoE1PcpsAmbiguousAcquisition *acquisition = new GalileoE1PcpsAmbiguousAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<AcquisitionInterface> acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
@ -177,7 +170,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ConnectAndRun)
|
||||
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);
|
||||
}) << "Failure connecting the blocks of acquisition test."<< std::endl;
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
gettimeofday(&tv, NULL);
|
||||
@ -185,9 +178,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ConnectAndRun)
|
||||
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;
|
||||
|
||||
delete acquisition;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
std::cout << "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
|
||||
|
||||
}
|
||||
@ -199,7 +190,8 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ValidationOfResults)
|
||||
long long int end = 0;
|
||||
|
||||
init();
|
||||
std::unique_ptr<GalileoE1PcpsAmbiguousAcquisition> acquisition(new GalileoE1PcpsAmbiguousAcquisition(config, "Acquisition", 1, 1, queue));
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<AcquisitionInterface> acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
||||
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
@ -208,7 +200,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ValidationOfResults)
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
}) << "Failure setting gnss_synchro."<< std::endl;
|
||||
}) << "Failure setting gnss_synchro." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel_queue(&channel_internal_queue);
|
||||
@ -219,13 +211,11 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ValidationOfResults)
|
||||
}) << "Failure setting threshold." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_max(config->property("Acquisition.doppler_max",
|
||||
10000));
|
||||
acquisition->set_doppler_max(config->property("Acquisition.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.doppler_step", 500));
|
||||
}) << "Failure setting doppler_step." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
@ -252,7 +242,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ValidationOfResults)
|
||||
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;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.timed_join(boost::posix_time::seconds(1));
|
||||
|
@ -56,18 +56,15 @@ protected:
|
||||
{
|
||||
queue = gr::msg_queue::make(0);
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
factory = new GNSSBlockFactory();
|
||||
config = new InMemoryConfiguration();
|
||||
factory = std::make_shared<GNSSBlockFactory>();
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
item_size = sizeof(gr_complex);
|
||||
stop = false;
|
||||
message = 0;
|
||||
}
|
||||
|
||||
~GalileoE1PcpsAmbiguousAcquisitionTest()
|
||||
{
|
||||
delete factory;
|
||||
delete config;
|
||||
}
|
||||
{}
|
||||
|
||||
void init();
|
||||
void start_queue();
|
||||
@ -76,8 +73,8 @@ protected:
|
||||
|
||||
gr::msg_queue::sptr queue;
|
||||
gr::top_block_sptr top_block;
|
||||
GNSSBlockFactory* factory;
|
||||
InMemoryConfiguration* config;
|
||||
std::shared_ptr<GNSSBlockFactory> factory;
|
||||
std::shared_ptr<InMemoryConfiguration> config;
|
||||
Gnss_Synchro gnss_synchro;
|
||||
size_t item_size;
|
||||
concurrent_queue<int> channel_internal_queue;
|
||||
@ -101,9 +98,9 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::init()
|
||||
config->set_property("Acquisition.coherent_integration_time_ms", "4");
|
||||
config->set_property("Acquisition.dump", "false");
|
||||
config->set_property("Acquisition.implementation", "Galileo_E1_PCPS_Ambiguous_Acquisition");
|
||||
config->set_property("Acquisition.threshold", "0.00001");
|
||||
config->set_property("Acquisition.doppler_max", "7000");
|
||||
config->set_property("Acquisition.doppler_step", "125");
|
||||
config->set_property("Acquisition.threshold", "0.0");
|
||||
config->set_property("Acquisition.doppler_max", "10000");
|
||||
config->set_property("Acquisition.doppler_step", "500");
|
||||
config->set_property("Acquisition.repeat_satellite", "false");
|
||||
config->set_property("Acquisition1.cboc", "true");
|
||||
}
|
||||
@ -134,8 +131,8 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::stop_queue()
|
||||
TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, Instantiate)
|
||||
{
|
||||
init();
|
||||
GalileoE1PcpsAmbiguousAcquisition *acquisition = new GalileoE1PcpsAmbiguousAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
delete acquisition;
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<AcquisitionInterface> acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
||||
}
|
||||
|
||||
|
||||
@ -148,7 +145,8 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ConnectAndRun)
|
||||
long long int end = 0;
|
||||
|
||||
init();
|
||||
GalileoE1PcpsAmbiguousAcquisition *acquisition = new GalileoE1PcpsAmbiguousAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<AcquisitionInterface> acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
@ -164,13 +162,11 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ConnectAndRun)
|
||||
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;
|
||||
|
||||
delete acquisition;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
std::cout << "Processed " << nsamples << " samples in " << (end-begin) << " microseconds" << std::endl;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)
|
||||
{
|
||||
struct timeval tv;
|
||||
@ -179,11 +175,12 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)
|
||||
double expected_delay_samples = 2920; //18250;
|
||||
double expected_doppler_hz = -632;
|
||||
init();
|
||||
GalileoE1PcpsAmbiguousAcquisition *acquisition = new GalileoE1PcpsAmbiguousAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<AcquisitionInterface> acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(gnss_synchro.Channel_ID);
|
||||
}) << "Failure setting channel."<< std::endl;
|
||||
}) << "Failure setting channel." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
@ -194,11 +191,11 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)
|
||||
}) << "Failure setting channel_internal_queue." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 0.00001));
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 0.0));
|
||||
}) << "Failure setting threshold." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000));
|
||||
acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 20000));
|
||||
}) << "Failure setting doppler_max." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
@ -230,7 +227,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)
|
||||
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;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
//ASSERT_NO_THROW( {
|
||||
// ch_thread.timed_join(boost::posix_time::seconds(1));
|
||||
@ -249,6 +246,5 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)
|
||||
|
||||
EXPECT_LE(doppler_error_hz, 166) << "Doppler error exceeds the expected value: 166 Hz = 2/(3*integration period)";
|
||||
EXPECT_LT(delay_error_chips, 0.175) << "Delay error exceeds the expected value: 0.175 chips";
|
||||
|
||||
delete acquisition;
|
||||
}
|
||||
*/
|
||||
|
@ -33,6 +33,7 @@
|
||||
|
||||
#include <ctime>
|
||||
#include <iostream>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <gnuradio/top_block.h>
|
||||
#include <gnuradio/blocks/file_source.h>
|
||||
#include <gnuradio/analog/sig_source_waveform.h>
|
||||
@ -47,7 +48,6 @@
|
||||
#include "signal_generator_c.h"
|
||||
#include "fir_filter.h"
|
||||
#include "gen_signal_source.h"
|
||||
#include "boost/shared_ptr.hpp"
|
||||
#include "gnss_sdr_valve.h"
|
||||
|
||||
|
||||
@ -59,6 +59,7 @@ protected:
|
||||
{
|
||||
queue = gr::msg_queue::make(0);
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
factory = std::make_shared<GNSSBlockFactory>();
|
||||
item_size = sizeof(gr_complex);
|
||||
stop = false;
|
||||
message = 0;
|
||||
@ -78,8 +79,9 @@ protected:
|
||||
|
||||
gr::msg_queue::sptr queue;
|
||||
gr::top_block_sptr top_block;
|
||||
GalileoE1PcpsCccwsrAmbiguousAcquisition *acquisition;
|
||||
InMemoryConfiguration* config;
|
||||
std::shared_ptr<AcquisitionInterface> acquisition;
|
||||
std::shared_ptr<GNSSBlockFactory> factory;
|
||||
std::shared_ptr<InMemoryConfiguration> config;
|
||||
Gnss_Synchro gnss_synchro;
|
||||
size_t item_size;
|
||||
concurrent_queue<int> channel_internal_queue;
|
||||
@ -142,7 +144,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::config_1()
|
||||
|
||||
num_of_realizations = 1;
|
||||
|
||||
config = new InMemoryConfiguration();
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
|
||||
@ -200,7 +202,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::config_2()
|
||||
gnss_synchro.Channel_ID = 0;
|
||||
gnss_synchro.System = 'E';
|
||||
std::string signal = "1C";
|
||||
signal.copy(gnss_synchro.Signal,2,0);
|
||||
signal.copy(gnss_synchro.Signal, 2, 0);
|
||||
|
||||
integration_time_ms = 4;
|
||||
fs_in = 4e6;
|
||||
@ -212,7 +214,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::config_2()
|
||||
|
||||
num_of_realizations = 100;
|
||||
|
||||
config = new InMemoryConfiguration();
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
|
||||
@ -363,9 +365,8 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::stop_queue()
|
||||
TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, Instantiate)
|
||||
{
|
||||
config_1();
|
||||
acquisition = new GalileoE1PcpsCccwsrAmbiguousAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
delete acquisition;
|
||||
delete config;
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 1, queue);
|
||||
acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
||||
}
|
||||
|
||||
TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ConnectAndRun)
|
||||
@ -377,7 +378,8 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ConnectAndRun)
|
||||
|
||||
config_1();
|
||||
|
||||
acquisition = new GalileoE1PcpsCccwsrAmbiguousAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 1, queue);
|
||||
acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
@ -393,19 +395,17 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ConnectAndRun)
|
||||
top_block->run(); // Start threads and wait
|
||||
gettimeofday(&tv, NULL);
|
||||
end = tv.tv_sec *1e6 + tv.tv_usec;
|
||||
}) << "Failure running he top_block."<< std::endl;
|
||||
}) << "Failure running the top_block."<< std::endl;
|
||||
|
||||
std::cout << "Processed " << nsamples << " samples in " << (end-begin) << " microseconds" << std::endl;
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
std::cout << "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
|
||||
}
|
||||
|
||||
TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults)
|
||||
{
|
||||
config_1();
|
||||
|
||||
acquisition = new GalileoE1PcpsCccwsrAmbiguousAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 1, queue);
|
||||
acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
@ -428,7 +428,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults)
|
||||
}) << "Failure setting doppler_step."<< std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 0.0));
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 0.00001));
|
||||
}) << "Failure setting threshold."<< std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
@ -439,9 +439,9 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults)
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
boost::shared_ptr<GenSignalSource> signal_source;
|
||||
SignalGenerator* signal_generator = new SignalGenerator(config, "SignalSource", 0, 1, queue);
|
||||
FirFilter* filter = new FirFilter(config, "InputFilter", 1, 1, queue);
|
||||
signal_source.reset(new GenSignalSource(config, signal_generator, filter, "SignalSource", queue));
|
||||
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);
|
||||
top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0);
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
@ -482,16 +482,14 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults)
|
||||
EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL.";
|
||||
}
|
||||
}
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
}
|
||||
|
||||
TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResultsProbabilities)
|
||||
{
|
||||
config_2();
|
||||
|
||||
acquisition = new GalileoE1PcpsCccwsrAmbiguousAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 1, queue);
|
||||
acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
@ -525,16 +523,16 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResultsProbabili
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
boost::shared_ptr<GenSignalSource> signal_source;
|
||||
SignalGenerator* signal_generator = new SignalGenerator(config, "SignalSource", 0, 1, queue);
|
||||
FirFilter* filter = new FirFilter(config, "InputFilter", 1, 1, queue);
|
||||
signal_source.reset(new GenSignalSource(config, signal_generator, filter, "SignalSource", queue));
|
||||
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);
|
||||
top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0);
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
|
||||
std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl;
|
||||
|
||||
// i = 0 --> sallite in acquisition is visible (prob of detection and prob of detection with wrong estimation)
|
||||
// i = 0 --> satellite in acquisition is visible (prob of detection and prob of detection with wrong estimation)
|
||||
// i = 1 --> satellite in acquisition is not visible (prob of false detection)
|
||||
for (unsigned int i = 0; i < 2; i++)
|
||||
{
|
||||
@ -569,7 +567,4 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResultsProbabili
|
||||
std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
}
|
||||
|
@ -35,6 +35,7 @@
|
||||
|
||||
#include <ctime>
|
||||
#include <iostream>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <gnuradio/top_block.h>
|
||||
#include <gnuradio/blocks/file_source.h>
|
||||
#include <gnuradio/analog/sig_source_waveform.h>
|
||||
@ -52,7 +53,7 @@
|
||||
#include "fir_filter.h"
|
||||
#include "gen_signal_source.h"
|
||||
#include "gnss_sdr_valve.h"
|
||||
#include "boost/shared_ptr.hpp"
|
||||
|
||||
|
||||
|
||||
class GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test: public ::testing::Test
|
||||
@ -62,6 +63,7 @@ protected:
|
||||
{
|
||||
queue = gr::msg_queue::make(0);
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
factory = std::make_shared<GNSSBlockFactory>();
|
||||
item_size = sizeof(gr_complex);
|
||||
stop = false;
|
||||
message = 0;
|
||||
@ -81,8 +83,9 @@ protected:
|
||||
|
||||
gr::msg_queue::sptr queue;
|
||||
gr::top_block_sptr top_block;
|
||||
GalileoE1PcpsTongAmbiguousAcquisition *acquisition;
|
||||
InMemoryConfiguration* config;
|
||||
std::shared_ptr<AcquisitionInterface> acquisition;
|
||||
std::shared_ptr<GNSSBlockFactory> factory;
|
||||
std::shared_ptr<InMemoryConfiguration> config;
|
||||
Gnss_Synchro gnss_synchro;
|
||||
size_t item_size;
|
||||
concurrent_queue<int> channel_internal_queue;
|
||||
@ -133,7 +136,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::config_1()
|
||||
gnss_synchro.Channel_ID = 0;
|
||||
gnss_synchro.System = 'E';
|
||||
std::string signal = "1C";
|
||||
signal.copy(gnss_synchro.Signal,2,0);
|
||||
signal.copy(gnss_synchro.Signal, 2, 0);
|
||||
|
||||
integration_time_ms = 4;
|
||||
fs_in = 4e6;
|
||||
@ -145,7 +148,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::config_1()
|
||||
|
||||
num_of_realizations = 1;
|
||||
|
||||
config = new InMemoryConfiguration();
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
|
||||
@ -204,7 +207,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::config_2()
|
||||
gnss_synchro.Channel_ID = 0;
|
||||
gnss_synchro.System = 'E';
|
||||
std::string signal = "1C";
|
||||
signal.copy(gnss_synchro.Signal,2,0);
|
||||
signal.copy(gnss_synchro.Signal, 2, 0);
|
||||
|
||||
integration_time_ms = 4;
|
||||
fs_in = 4e6;
|
||||
@ -216,7 +219,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::config_2()
|
||||
|
||||
num_of_realizations = 100;
|
||||
|
||||
config = new InMemoryConfiguration();
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
|
||||
@ -312,7 +315,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::wait_message()
|
||||
gettimeofday(&tv, NULL);
|
||||
end = tv.tv_sec *1e6 + tv.tv_usec;
|
||||
|
||||
mean_acq_time_us += (end-begin);
|
||||
mean_acq_time_us += (end - begin);
|
||||
|
||||
process_message();
|
||||
}
|
||||
@ -367,9 +370,8 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::stop_queue()
|
||||
TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, Instantiate)
|
||||
{
|
||||
config_1();
|
||||
acquisition = new GalileoE1PcpsTongAmbiguousAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
delete acquisition;
|
||||
delete config;
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 1, queue);
|
||||
acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
||||
}
|
||||
|
||||
TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
@ -380,7 +382,8 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
long long int end = 0;
|
||||
|
||||
config_1();
|
||||
acquisition = new GalileoE1PcpsTongAmbiguousAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 1, queue);
|
||||
acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
@ -388,7 +391,7 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
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);
|
||||
}) << "Failure connecting the blocks of acquisition test."<< std::endl;
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
gettimeofday(&tv, NULL);
|
||||
@ -396,43 +399,41 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
top_block->run(); // Start threads and wait
|
||||
gettimeofday(&tv, NULL);
|
||||
end = tv.tv_sec *1e6 + tv.tv_usec;
|
||||
}) << "Failure running the top_block."<< std::endl;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
std::cout << "Processed " << nsamples << " samples in " << (end-begin) << " microseconds" << std::endl;
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
}
|
||||
|
||||
TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
{
|
||||
config_1();
|
||||
|
||||
acquisition = new GalileoE1PcpsTongAmbiguousAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 1, queue);
|
||||
acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
}) << "Failure setting channel."<< std::endl;
|
||||
}) << "Failure setting channel." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
}) << "Failure setting gnss_synchro."<< std::endl;
|
||||
}) << "Failure setting gnss_synchro." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel_queue(&channel_internal_queue);
|
||||
}) << "Failure setting channel_internal_queue."<< std::endl;
|
||||
}) << "Failure setting channel_internal_queue." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000));
|
||||
}) << "Failure setting doppler_max."<< std::endl;
|
||||
}) << "Failure setting doppler_max." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_step(config->property("Acquisition.doppler_step", 500));
|
||||
}) << "Failure setting doppler_step."<< std::endl;
|
||||
}) << "Failure setting doppler_step." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 0.000001));
|
||||
}) << "Failure setting threshold."<< std::endl;
|
||||
}) << "Failure setting threshold." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
@ -442,9 +443,9 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
boost::shared_ptr<GenSignalSource> signal_source;
|
||||
SignalGenerator* signal_generator = new SignalGenerator(config, "SignalSource", 0, 1, queue);
|
||||
FirFilter* filter = new FirFilter(config, "InputFilter", 1, 1, queue);
|
||||
signal_source.reset(new GenSignalSource(config, signal_generator, filter, "SignalSource", queue));
|
||||
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);
|
||||
top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0);
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
@ -470,7 +471,7 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
top_block->run(); // Start threads and wait
|
||||
}) << "Failure running the top_block."<< std::endl;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
@ -485,59 +486,57 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL.";
|
||||
}
|
||||
}
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
}
|
||||
|
||||
TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
|
||||
{
|
||||
config_2();
|
||||
|
||||
acquisition = new GalileoE1PcpsTongAmbiguousAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 1, queue);
|
||||
acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
}) << "Failure setting channel."<< std::endl;
|
||||
}) << "Failure setting channel." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
}) << "Failure setting gnss_synchro."<< std::endl;
|
||||
}) << "Failure setting gnss_synchro." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel_queue(&channel_internal_queue);
|
||||
}) << "Failure setting channel_internal_queue."<< std::endl;
|
||||
}) << "Failure setting channel_internal_queue." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000));
|
||||
}) << "Failure setting doppler_max."<< std::endl;
|
||||
}) << "Failure setting doppler_max." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_step(config->property("Acquisition.doppler_step", 500));
|
||||
}) << "Failure setting doppler_step."<< std::endl;
|
||||
}) << "Failure setting doppler_step." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 0.00028));
|
||||
}) << "Failure setting threshold."<< std::endl;
|
||||
}) << "Failure setting threshold." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
}) << "Failure connecting acquisition to the top_block."<< std::endl;
|
||||
}) << "Failure connecting acquisition to the top_block." << std::endl;
|
||||
|
||||
acquisition->init();
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
boost::shared_ptr<GenSignalSource> signal_source;
|
||||
SignalGenerator* signal_generator = new SignalGenerator(config, "SignalSource", 0, 1, queue);
|
||||
FirFilter* filter = new FirFilter(config, "InputFilter", 1, 1, queue);
|
||||
signal_source.reset(new GenSignalSource(config, signal_generator, filter, "SignalSource", queue));
|
||||
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);
|
||||
top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0);
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
|
||||
std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl;
|
||||
|
||||
// i = 0 --> sallite in acquisition is visible (prob of detection and prob of detection with wrong estimation)
|
||||
// i = 0 --> satellite in acquisition is visible (prob of detection and prob of detection with wrong estimation)
|
||||
// i = 1 --> satellite in acquisition is not visible (prob of false detection)
|
||||
for (unsigned int i = 0; i < 2; i++)
|
||||
{
|
||||
@ -575,7 +574,4 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsPro
|
||||
ch_thread.timed_join(boost::posix_time::seconds(1));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
}
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ protected:
|
||||
gr::msg_queue::sptr queue;
|
||||
gr::top_block_sptr top_block;
|
||||
GpsL1CaPcpsAcquisition *acquisition;
|
||||
InMemoryConfiguration* config;
|
||||
std::shared_ptr<InMemoryConfiguration> config;
|
||||
Gnss_Synchro gnss_synchro;
|
||||
size_t item_size;
|
||||
concurrent_queue<int> channel_internal_queue;
|
||||
@ -143,7 +143,7 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::config_1()
|
||||
|
||||
num_of_realizations = 1;
|
||||
|
||||
config = new InMemoryConfiguration();
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
|
||||
@ -212,7 +212,7 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::config_2()
|
||||
|
||||
num_of_realizations = 100;
|
||||
|
||||
config = new InMemoryConfiguration();
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
|
||||
@ -342,7 +342,7 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::process_message()
|
||||
|
||||
Pd = (double)correct_estimation_counter / (double)num_of_realizations;
|
||||
Pfa_a = (double)detection_counter / (double)num_of_realizations;
|
||||
Pfa_p = (double)(detection_counter-correct_estimation_counter) / (double)num_of_realizations;
|
||||
Pfa_p = (double)(detection_counter - correct_estimation_counter) / (double)num_of_realizations;
|
||||
|
||||
mean_acq_time_us /= num_of_realizations;
|
||||
|
||||
@ -359,9 +359,8 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::stop_queue()
|
||||
TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, Instantiate)
|
||||
{
|
||||
config_1();
|
||||
acquisition = new GpsL1CaPcpsAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
acquisition = new GpsL1CaPcpsAcquisition(config.get(), "Acquisition", 1, 1, queue);
|
||||
delete acquisition;
|
||||
delete config;
|
||||
}
|
||||
|
||||
TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
@ -372,7 +371,7 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
long long int end = 0;
|
||||
|
||||
config_1();
|
||||
acquisition = new GpsL1CaPcpsAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
acquisition = new GpsL1CaPcpsAcquisition(config.get(), "Acquisition", 1, 1, queue);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
@ -390,17 +389,16 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
end = tv.tv_sec *1e6 + tv.tv_usec;
|
||||
}) << "Failure running the top_block."<< std::endl;
|
||||
|
||||
std::cout << "Processed " << nsamples << " samples in " << (end-begin) << " microseconds" << std::endl;
|
||||
std::cout << "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
}
|
||||
|
||||
TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
{
|
||||
config_1();
|
||||
|
||||
acquisition = new GpsL1CaPcpsAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
acquisition = new GpsL1CaPcpsAcquisition(config.get(), "Acquisition", 1, 1, queue);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
@ -434,14 +432,14 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
boost::shared_ptr<GenSignalSource> signal_source;
|
||||
SignalGenerator* signal_generator = new SignalGenerator(config, "SignalSource", 0, 1, queue);
|
||||
FirFilter* filter = new FirFilter(config, "InputFilter", 1, 1, queue);
|
||||
signal_source.reset(new GenSignalSource(config, signal_generator, filter, "SignalSource", queue));
|
||||
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);
|
||||
top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0);
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
|
||||
// i = 0 --> sallite in acquisition is visible
|
||||
// i = 0 --> satellite in acquisition is visible
|
||||
// i = 1 --> satellite in acquisition is not visible
|
||||
for (unsigned int i = 0; i < 2; i++)
|
||||
{
|
||||
@ -480,14 +478,13 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
}
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
}
|
||||
|
||||
TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
|
||||
{
|
||||
config_2();
|
||||
|
||||
acquisition = new GpsL1CaPcpsAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
acquisition = new GpsL1CaPcpsAcquisition(config.get(), "Acquisition", 1, 1, queue);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
@ -521,16 +518,16 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
boost::shared_ptr<GenSignalSource> signal_source;
|
||||
SignalGenerator* signal_generator = new SignalGenerator(config, "SignalSource", 0, 1, queue);
|
||||
FirFilter* filter = new FirFilter(config, "InputFilter", 1, 1, queue);
|
||||
signal_source.reset(new GenSignalSource(config, signal_generator, filter, "SignalSource", queue));
|
||||
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);
|
||||
top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0);
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
|
||||
std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl;
|
||||
|
||||
// i = 0 --> sallite in acquisition is visible (prob of detection and prob of detection with wrong estimation)
|
||||
// i = 0 --> satellite in acquisition is visible (prob of detection and prob of detection with wrong estimation)
|
||||
// i = 1 --> satellite in acquisition is not visible (prob of false detection)
|
||||
for (unsigned int i = 0; i < 2; i++)
|
||||
{
|
||||
@ -551,7 +548,7 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
top_block->run(); // Start threads and wait
|
||||
}) << "Failure running he top_block."<< std::endl;
|
||||
}) << "Failure running the top_block."<< std::endl;
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
@ -566,5 +563,4 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
|
||||
}
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
}
|
||||
|
@ -55,18 +55,15 @@ protected:
|
||||
{
|
||||
queue = gr::msg_queue::make(0);
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
factory = new GNSSBlockFactory();
|
||||
config = new InMemoryConfiguration();
|
||||
factory = std::make_shared<GNSSBlockFactory>();
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
item_size = sizeof(gr_complex);
|
||||
stop = false;
|
||||
message = 0;
|
||||
}
|
||||
|
||||
~GpsL1CaPcpsAcquisitionTest()
|
||||
{
|
||||
delete factory;
|
||||
delete config;
|
||||
}
|
||||
{}
|
||||
|
||||
void init();
|
||||
void start_queue();
|
||||
@ -75,8 +72,8 @@ protected:
|
||||
|
||||
gr::msg_queue::sptr queue;
|
||||
gr::top_block_sptr top_block;
|
||||
GNSSBlockFactory* factory;
|
||||
InMemoryConfiguration* config;
|
||||
std::shared_ptr<GNSSBlockFactory> factory;
|
||||
std::shared_ptr<InMemoryConfiguration> config;
|
||||
Gnss_Synchro gnss_synchro;
|
||||
size_t item_size;
|
||||
concurrent_queue<int> channel_internal_queue;
|
||||
@ -134,8 +131,7 @@ void GpsL1CaPcpsAcquisitionTest::stop_queue()
|
||||
TEST_F(GpsL1CaPcpsAcquisitionTest, Instantiate)
|
||||
{
|
||||
init();
|
||||
GpsL1CaPcpsAcquisition *acquisition = new GpsL1CaPcpsAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
delete acquisition;
|
||||
std::shared_ptr<GpsL1CaPcpsAcquisition> acquisition = std::make_shared<GpsL1CaPcpsAcquisition>(config.get(), "Acquisition", 1, 1, queue);
|
||||
}
|
||||
|
||||
TEST_F(GpsL1CaPcpsAcquisitionTest, ConnectAndRun)
|
||||
@ -147,7 +143,7 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ConnectAndRun)
|
||||
long long int end = 0;
|
||||
|
||||
init();
|
||||
GpsL1CaPcpsAcquisition *acquisition = new GpsL1CaPcpsAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<GpsL1CaPcpsAcquisition> acquisition = std::make_shared<GpsL1CaPcpsAcquisition>(config.get(), "Acquisition", 1, 1, queue);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
@ -155,7 +151,7 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ConnectAndRun)
|
||||
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);
|
||||
}) << "Failure connecting the blocks of acquisition test."<< std::endl;
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
gettimeofday(&tv, NULL);
|
||||
@ -163,11 +159,9 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ConnectAndRun)
|
||||
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;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
delete acquisition;
|
||||
std::cout << "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
|
||||
|
||||
}
|
||||
|
||||
TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults)
|
||||
@ -178,7 +172,7 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults)
|
||||
double expected_delay_samples = 127;
|
||||
double expected_doppler_hz = -2400;
|
||||
init();
|
||||
GpsL1CaPcpsAcquisition *acquisition = new GpsL1CaPcpsAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
std::shared_ptr<GpsL1CaPcpsAcquisition> acquisition = std::make_shared<GpsL1CaPcpsAcquisition>(config.get(), "Acquisition", 1, 1, queue);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
@ -214,7 +208,7 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults)
|
||||
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);
|
||||
top_block->connect(file_source, 0, acquisition->get_left_block(), 0);
|
||||
}) << "Failure connecting the blocks of acquisition test."<< std::endl;
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
|
||||
start_queue();
|
||||
|
||||
@ -227,7 +221,7 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults)
|
||||
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;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
ch_thread.timed_join(boost::posix_time::seconds(1));
|
||||
|
||||
@ -245,7 +239,4 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults)
|
||||
|
||||
EXPECT_LE(doppler_error_hz, 333) << "Doppler error exceeds the expected value: 333 Hz = 2/(3*integration period)";
|
||||
EXPECT_LT(delay_error_chips, 0.5) << "Delay error exceeds the expected value: 0.5 chips";
|
||||
|
||||
delete acquisition;
|
||||
|
||||
}
|
||||
|
@ -83,8 +83,8 @@ protected:
|
||||
|
||||
gr::msg_queue::sptr queue;
|
||||
gr::top_block_sptr top_block;
|
||||
GpsL1CaPcpsMultithreadAcquisition *acquisition;
|
||||
InMemoryConfiguration* config;
|
||||
std::shared_ptr<GpsL1CaPcpsMultithreadAcquisition> acquisition;
|
||||
std::shared_ptr<InMemoryConfiguration> config;
|
||||
Gnss_Synchro gnss_synchro;
|
||||
size_t item_size;
|
||||
concurrent_queue<int> channel_internal_queue;
|
||||
@ -147,7 +147,7 @@ void GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test::config_1()
|
||||
|
||||
num_of_realizations = 1;
|
||||
|
||||
config = new InMemoryConfiguration();
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
|
||||
@ -216,7 +216,7 @@ void GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test::config_2()
|
||||
|
||||
num_of_realizations = 100;
|
||||
|
||||
config = new InMemoryConfiguration();
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
|
||||
@ -365,9 +365,7 @@ void GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test::stop_queue()
|
||||
TEST_F(GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test, Instantiate)
|
||||
{
|
||||
config_1();
|
||||
acquisition = new GpsL1CaPcpsMultithreadAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
delete acquisition;
|
||||
delete config;
|
||||
acquisition = std::make_shared<GpsL1CaPcpsMultithreadAcquisition>(config.get(), "Acquisition", 1, 1, queue);
|
||||
}
|
||||
|
||||
TEST_F(GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
@ -378,7 +376,7 @@ TEST_F(GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
long long int end = 0;
|
||||
|
||||
config_1();
|
||||
acquisition = new GpsL1CaPcpsMultithreadAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
acquisition = std::make_shared<GpsL1CaPcpsMultithreadAcquisition>(config.get(), "Acquisition", 1, 1, queue);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
@ -386,7 +384,7 @@ TEST_F(GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
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);
|
||||
}) << "Failure connecting the blocks of acquisition test."<< std::endl;
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
gettimeofday(&tv, NULL);
|
||||
@ -394,60 +392,57 @@ TEST_F(GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
top_block->run(); // Start threads and wait
|
||||
gettimeofday(&tv, NULL);
|
||||
end = tv.tv_sec *1e6 + tv.tv_usec;
|
||||
}) << "Failure running the top_block."<< std::endl;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
std::cout << "Processed " << nsamples << " samples in " << (end-begin) << " microseconds" << std::endl;
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
std::cout << "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
|
||||
}
|
||||
|
||||
TEST_F(GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
{
|
||||
config_1();
|
||||
|
||||
acquisition = new GpsL1CaPcpsMultithreadAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
acquisition = std::make_shared<GpsL1CaPcpsMultithreadAcquisition>(config.get(), "Acquisition", 1, 1, queue);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
}) << "Failure setting channel."<< std::endl;
|
||||
}) << "Failure setting channel." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
}) << "Failure setting gnss_synchro."<< std::endl;
|
||||
}) << "Failure setting gnss_synchro." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel_queue(&channel_internal_queue);
|
||||
}) << "Failure setting channel_internal_queue."<< std::endl;
|
||||
}) << "Failure setting channel_internal_queue." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000));
|
||||
}) << "Failure setting doppler_max."<< std::endl;
|
||||
}) << "Failure setting doppler_max." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_step(config->property("Acquisition.doppler_step", 500));
|
||||
}) << "Failure setting doppler_step."<< std::endl;
|
||||
}) << "Failure setting doppler_step." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 0.0));
|
||||
}) << "Failure setting threshold."<< std::endl;
|
||||
}) << "Failure setting threshold." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
}) << "Failure connecting acquisition to the top_block."<< std::endl;
|
||||
}) << "Failure connecting acquisition to the top_block." << std::endl;
|
||||
|
||||
acquisition->init();
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
boost::shared_ptr<GenSignalSource> signal_source;
|
||||
SignalGenerator* signal_generator = new SignalGenerator(config, "SignalSource", 0, 1, queue);
|
||||
FirFilter* filter = new FirFilter(config, "InputFilter", 1, 1, queue);
|
||||
signal_source.reset(new GenSignalSource(config, signal_generator, filter, "SignalSource", queue));
|
||||
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);
|
||||
top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0);
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
|
||||
// i = 0 --> sallite in acquisition is visible
|
||||
// i = 0 --> satellite in acquisition is visible
|
||||
// i = 1 --> satellite in acquisition is not visible
|
||||
for (unsigned int i = 0; i < 2; i++)
|
||||
{
|
||||
@ -468,7 +463,7 @@ TEST_F(GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
top_block->run(); // Start threads and wait
|
||||
}) << "Failure running he top_block."<< std::endl;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
@ -484,59 +479,56 @@ TEST_F(GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL.";
|
||||
}
|
||||
}
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
}
|
||||
|
||||
TEST_F(GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
|
||||
{
|
||||
config_2();
|
||||
|
||||
acquisition = new GpsL1CaPcpsMultithreadAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
acquisition = std::make_shared<GpsL1CaPcpsMultithreadAcquisition>(config.get(), "Acquisition", 1, 1, queue);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
}) << "Failure setting channel."<< std::endl;
|
||||
}) << "Failure setting channel." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
}) << "Failure setting gnss_synchro."<< std::endl;
|
||||
}) << "Failure setting gnss_synchro." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel_queue(&channel_internal_queue);
|
||||
}) << "Failure setting channel_internal_queue."<< std::endl;
|
||||
}) << "Failure setting channel_internal_queue." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000));
|
||||
}) << "Failure setting doppler_max."<< std::endl;
|
||||
}) << "Failure setting doppler_max." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_step(config->property("Acquisition.doppler_step", 500));
|
||||
}) << "Failure setting doppler_step."<< std::endl;
|
||||
}) << "Failure setting doppler_step." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 0.0));
|
||||
}) << "Failure setting threshold."<< std::endl;
|
||||
}) << "Failure setting threshold." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
}) << "Failure connecting acquisition to the top_block."<< std::endl;
|
||||
}) << "Failure connecting acquisition to the top_block." << std::endl;
|
||||
|
||||
acquisition->init();
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
boost::shared_ptr<GenSignalSource> signal_source;
|
||||
SignalGenerator* signal_generator = new SignalGenerator(config, "SignalSource", 0, 1, queue);
|
||||
FirFilter* filter = new FirFilter(config, "InputFilter", 1, 1, queue);
|
||||
signal_source.reset(new GenSignalSource(config, signal_generator, filter, "SignalSource", queue));
|
||||
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);
|
||||
top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0);
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
|
||||
std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl;
|
||||
|
||||
// i = 0 --> sallite in acquisition is visible (prob of detection and prob of detection with wrong estimation)
|
||||
// i = 0 --> satellite in acquisition is visible (prob of detection and prob of detection with wrong estimation)
|
||||
// i = 1 --> satellite in acquisition is not visible (prob of false detection)
|
||||
for (unsigned int i = 0; i < 2; i++)
|
||||
{
|
||||
@ -572,6 +564,4 @@ TEST_F(GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test, ValidationOfResultsProbabi
|
||||
}
|
||||
}
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
}
|
||||
|
@ -77,8 +77,8 @@ protected:
|
||||
|
||||
gr::msg_queue::sptr queue;
|
||||
gr::top_block_sptr top_block;
|
||||
GpsL1CaPcpsOpenClAcquisition *acquisition;
|
||||
InMemoryConfiguration* config;
|
||||
std::shared_ptr<GpsL1CaPcpsOpenClAcquisition> acquisition;
|
||||
std::shared_ptr<InMemoryConfiguration> config;
|
||||
Gnss_Synchro gnss_synchro;
|
||||
size_t item_size;
|
||||
concurrent_queue<int> channel_internal_queue;
|
||||
@ -141,7 +141,7 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::config_1()
|
||||
|
||||
num_of_realizations = 1;
|
||||
|
||||
config = new InMemoryConfiguration();
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
|
||||
@ -210,7 +210,7 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::config_2()
|
||||
|
||||
num_of_realizations = 10; // Change here the number of realizations
|
||||
|
||||
config = new InMemoryConfiguration();
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
|
||||
@ -359,9 +359,7 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::stop_queue()
|
||||
TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, Instantiate)
|
||||
{
|
||||
config_1();
|
||||
acquisition = new GpsL1CaPcpsOpenClAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
delete acquisition;
|
||||
delete config;
|
||||
acquisition = std::make_shared<GpsL1CaPcpsOpenClAcquisition>(config.get(), "Acquisition", 1, 1, queue);
|
||||
}
|
||||
|
||||
TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
@ -372,7 +370,7 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
long long int end = 0;
|
||||
|
||||
config_1();
|
||||
acquisition = new GpsL1CaPcpsOpenClAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
acquisition = std::make_shared<GpsL1CaPcpsOpenClAcquisition>(config.get(), "Acquisition", 1, 1, queue);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
@ -380,63 +378,60 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
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);
|
||||
}) << "Failure connecting the blocks of acquisition test."<< std::endl;
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
gettimeofday(&tv, NULL);
|
||||
begin = tv.tv_sec *1e6 + tv.tv_usec;
|
||||
begin = tv.tv_sec * 1e6 + tv.tv_usec;
|
||||
top_block->run(); // Start threads and wait
|
||||
gettimeofday(&tv, NULL);
|
||||
end = tv.tv_sec *1e6 + tv.tv_usec;
|
||||
}) << "Failure running the top_block."<< std::endl;
|
||||
end = tv.tv_sec * 1e6 + tv.tv_usec;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
std::cout << "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
}
|
||||
|
||||
TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
{
|
||||
config_1();
|
||||
|
||||
acquisition = new GpsL1CaPcpsOpenClAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
acquisition = std::make_shared<GpsL1CaPcpsOpenClAcquisition>(config.get(), "Acquisition", 1, 1, queue);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
}) << "Failure setting channel."<< std::endl;
|
||||
}) << "Failure setting channel." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
}) << "Failure setting gnss_synchro."<< std::endl;
|
||||
}) << "Failure setting gnss_synchro." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel_queue(&channel_internal_queue);
|
||||
}) << "Failure setting channel_internal_queue."<< std::endl;
|
||||
}) << "Failure setting channel_internal_queue." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000));
|
||||
}) << "Failure setting doppler_max."<< std::endl;
|
||||
}) << "Failure setting doppler_max." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_step(config->property("Acquisition.doppler_step", 500));
|
||||
}) << "Failure setting doppler_step."<< std::endl;
|
||||
}) << "Failure setting doppler_step." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 0.0));
|
||||
}) << "Failure setting threshold."<< std::endl;
|
||||
}) << "Failure setting threshold." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
}) << "Failure connecting acquisition to the top_block."<< std::endl;
|
||||
}) << "Failure connecting acquisition to the top_block." << std::endl;
|
||||
|
||||
acquisition->init();
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
boost::shared_ptr<GenSignalSource> signal_source;
|
||||
SignalGenerator* signal_generator = new SignalGenerator(config, "SignalSource", 0, 1, queue);
|
||||
FirFilter* filter = new FirFilter(config, "InputFilter", 1, 1, queue);
|
||||
signal_source.reset(new GenSignalSource(config, signal_generator, filter, "SignalSource", queue));
|
||||
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);
|
||||
top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0);
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
@ -462,7 +457,7 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
top_block->run(); // Start threads and wait
|
||||
}) << "Failure running the top_block."<< std::endl;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
@ -478,52 +473,49 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL.";
|
||||
}
|
||||
}
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
}
|
||||
|
||||
TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
|
||||
{
|
||||
config_2();
|
||||
|
||||
acquisition = new GpsL1CaPcpsOpenClAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
acquisition = std::make_shared<GpsL1CaPcpsOpenClAcquisition>(config.get(), "Acquisition", 1, 1, queue);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
}) << "Failure setting channel."<< std::endl;
|
||||
}) << "Failure setting channel." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
}) << "Failure setting gnss_synchro."<< std::endl;
|
||||
}) << "Failure setting gnss_synchro." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel_queue(&channel_internal_queue);
|
||||
}) << "Failure setting channel_internal_queue."<< std::endl;
|
||||
}) << "Failure setting channel_internal_queue." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000));
|
||||
}) << "Failure setting doppler_max."<< std::endl;
|
||||
}) << "Failure setting doppler_max." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_step(config->property("Acquisition.doppler_step", 500));
|
||||
}) << "Failure setting doppler_step."<< std::endl;
|
||||
}) << "Failure setting doppler_step." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 0.0));
|
||||
}) << "Failure setting threshold."<< std::endl;
|
||||
}) << "Failure setting threshold." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
}) << "Failure connecting acquisition to the top_block."<< std::endl;
|
||||
}) << "Failure connecting acquisition to the top_block." << std::endl;
|
||||
|
||||
acquisition->init();
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
boost::shared_ptr<GenSignalSource> signal_source;
|
||||
SignalGenerator* signal_generator = new SignalGenerator(config, "SignalSource", 0, 1, queue);
|
||||
FirFilter* filter = new FirFilter(config, "InputFilter", 1, 1, queue);
|
||||
signal_source.reset(new GenSignalSource(config, signal_generator, filter, "SignalSource", queue));
|
||||
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);
|
||||
top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0);
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
@ -551,7 +543,7 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResultsProbabilitie
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
top_block->run(); // Start threads and wait
|
||||
}) << "Failure running the top_block."<< std::endl;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
@ -565,7 +557,4 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResultsProbabilitie
|
||||
std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
}
|
||||
|
@ -80,8 +80,8 @@ protected:
|
||||
|
||||
gr::msg_queue::sptr queue;
|
||||
gr::top_block_sptr top_block;
|
||||
GpsL1CaPcpsTongAcquisition *acquisition;
|
||||
InMemoryConfiguration* config;
|
||||
std::shared_ptr<GpsL1CaPcpsTongAcquisition> acquisition;
|
||||
std::shared_ptr<InMemoryConfiguration> config;
|
||||
Gnss_Synchro gnss_synchro;
|
||||
size_t item_size;
|
||||
concurrent_queue<int> channel_internal_queue;
|
||||
@ -144,7 +144,7 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::config_1()
|
||||
|
||||
num_of_realizations = 1;
|
||||
|
||||
config = new InMemoryConfiguration();
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
|
||||
@ -213,7 +213,7 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::config_2()
|
||||
|
||||
num_of_realizations = 100;
|
||||
|
||||
config = new InMemoryConfiguration();
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
|
||||
@ -362,9 +362,7 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::stop_queue()
|
||||
TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, Instantiate)
|
||||
{
|
||||
config_1();
|
||||
acquisition = new GpsL1CaPcpsTongAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
delete acquisition;
|
||||
delete config;
|
||||
acquisition = std::make_shared<GpsL1CaPcpsTongAcquisition>(config.get(), "Acquisition", 1, 1, queue);
|
||||
}
|
||||
|
||||
TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
@ -375,7 +373,7 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
long long int end = 0;
|
||||
|
||||
config_1();
|
||||
acquisition = new GpsL1CaPcpsTongAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
acquisition = std::make_shared<GpsL1CaPcpsTongAcquisition>(config.get(), "Acquisition", 1, 1, queue);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
@ -394,39 +392,37 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
std::cout << "Processed " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
|
||||
delete acquisition;
|
||||
delete config;
|
||||
}
|
||||
|
||||
TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
{
|
||||
config_1();
|
||||
|
||||
acquisition = new GpsL1CaPcpsTongAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
acquisition = std::make_shared<GpsL1CaPcpsTongAcquisition>(config.get(), "Acquisition", 1, 1, queue);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
}) << "Failure setting channel."<< std::endl;
|
||||
}) << "Failure setting channel." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
}) << "Failure setting gnss_synchro."<< std::endl;
|
||||
}) << "Failure setting gnss_synchro." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel_queue(&channel_internal_queue);
|
||||
}) << "Failure setting channel_internal_queue."<< std::endl;
|
||||
}) << "Failure setting channel_internal_queue." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000));
|
||||
}) << "Failure setting doppler_max."<< std::endl;
|
||||
}) << "Failure setting doppler_max." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_step(config->property("Acquisition.doppler_step", 500));
|
||||
}) << "Failure setting doppler_step."<< std::endl;
|
||||
}) << "Failure setting doppler_step." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 0.0));
|
||||
}) << "Failure setting threshold."<< std::endl;
|
||||
}) << "Failure setting threshold." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
@ -436,14 +432,14 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
boost::shared_ptr<GenSignalSource> signal_source;
|
||||
SignalGenerator* signal_generator = new SignalGenerator(config, "SignalSource", 0, 1, queue);
|
||||
FirFilter* filter = new FirFilter(config, "InputFilter", 1, 1, queue);
|
||||
signal_source.reset(new GenSignalSource(config, signal_generator, filter, "SignalSource", queue));
|
||||
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);
|
||||
top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0);
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
|
||||
// i = 0 --> sallite in acquisition is visible
|
||||
// i = 0 --> satellite in acquisition is visible
|
||||
// i = 1 --> satellite in acquisition is not visible
|
||||
for (unsigned int i = 0; i < 2; i++)
|
||||
{
|
||||
@ -464,7 +460,7 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
top_block->run(); // Start threads and wait
|
||||
}) << "Failure running the top_block."<< std::endl;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
@ -480,59 +476,56 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL.";
|
||||
}
|
||||
}
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
}
|
||||
|
||||
TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
|
||||
{
|
||||
config_2();
|
||||
|
||||
acquisition = new GpsL1CaPcpsTongAcquisition(config, "Acquisition", 1, 1, queue);
|
||||
acquisition = std::make_shared<GpsL1CaPcpsTongAcquisition>(config.get(), "Acquisition", 1, 1, queue);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
}) << "Failure setting channel."<< std::endl;
|
||||
}) << "Failure setting channel." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
}) << "Failure setting gnss_synchro."<< std::endl;
|
||||
}) << "Failure setting gnss_synchro." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel_queue(&channel_internal_queue);
|
||||
}) << "Failure setting channel_internal_queue."<< std::endl;
|
||||
}) << "Failure setting channel_internal_queue." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_max(config->property("Acquisition.doppler_max", 10000));
|
||||
}) << "Failure setting doppler_max."<< std::endl;
|
||||
}) << "Failure setting doppler_max." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_doppler_step(config->property("Acquisition.doppler_step", 500));
|
||||
}) << "Failure setting doppler_step."<< std::endl;
|
||||
}) << "Failure setting doppler_step." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_threshold(config->property("Acquisition.threshold", 0.0));
|
||||
}) << "Failure setting threshold."<< std::endl;
|
||||
}) << "Failure setting threshold." << std::endl;
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
}) << "Failure connecting acquisition to the top_block."<< std::endl;
|
||||
}) << "Failure connecting acquisition to the top_block." << std::endl;
|
||||
|
||||
acquisition->init();
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
boost::shared_ptr<GenSignalSource> signal_source;
|
||||
SignalGenerator* signal_generator = new SignalGenerator(config, "SignalSource", 0, 1, queue);
|
||||
FirFilter* filter = new FirFilter(config, "InputFilter", 1, 1, queue);
|
||||
signal_source.reset(new GenSignalSource(config, signal_generator, filter, "SignalSource", queue));
|
||||
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);
|
||||
top_block->connect(signal_source->get_right_block(), 0, acquisition->get_left_block(), 0);
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
|
||||
std::cout << "Probability of false alarm (target) = " << 0.1 << std::endl;
|
||||
|
||||
// i = 0 --> sallite in acquisition is visible (prob of detection and prob of detection with wrong estimation)
|
||||
// i = 0 --> satellite in acquisition is visible (prob of detection and prob of detection with wrong estimation)
|
||||
// i = 1 --> satellite in acquisition is not visible (prob of false detection)
|
||||
for (unsigned int i = 0; i < 2; i++)
|
||||
{
|
||||
@ -553,7 +546,7 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
top_block->run(); // Start threads and wait
|
||||
}) << "Failure running the top_block."<< std::endl;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
@ -567,7 +560,4 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
|
||||
std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
delete acquisition;
|
||||
delete config;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* \file string_converter_test.cc
|
||||
* \brief This file implements unit tests for the valve custom block.
|
||||
* \brief This file implements unit tests for the StringConverter class.
|
||||
* \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
|
||||
* Carles Fernandez-Prades, 2012. cfernandez(at)cttc.es
|
||||
*
|
||||
@ -17,7 +17,7 @@
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* at your option) any later version.
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@ -36,17 +36,16 @@
|
||||
|
||||
TEST(String_Converter_Test, StringToBool)
|
||||
{
|
||||
StringConverter* converter;
|
||||
converter = new StringConverter();
|
||||
std::unique_ptr<StringConverter> converter(new StringConverter());
|
||||
bool conversion_result = converter->convert("false", true);
|
||||
bool expected_false = false;
|
||||
EXPECT_EQ(expected_false, conversion_result);
|
||||
delete converter;
|
||||
}
|
||||
|
||||
|
||||
TEST(String_Converter_Test, StringToSizeT)
|
||||
{
|
||||
// Example using a raw pointer
|
||||
StringConverter* converter;
|
||||
converter = new StringConverter();
|
||||
size_t conversion_result = converter->convert("8", 1);
|
||||
@ -60,12 +59,10 @@ TEST(String_Converter_Test, StringToSizeT)
|
||||
|
||||
TEST(String_Converter_Test, StringToBoolFail)
|
||||
{
|
||||
StringConverter* converter;
|
||||
converter = new StringConverter();
|
||||
std::unique_ptr<StringConverter> converter(new StringConverter());
|
||||
bool conversion_result = converter->convert("lse", true);
|
||||
bool expected_true = true;
|
||||
EXPECT_EQ(expected_true, conversion_result);
|
||||
delete converter;
|
||||
}
|
||||
|
||||
|
||||
@ -73,10 +70,8 @@ TEST(String_Converter_Test, StringToBoolFail)
|
||||
|
||||
TEST(String_Converter_Test, StringToSizeTFail)
|
||||
{
|
||||
StringConverter* converter;
|
||||
converter = new StringConverter();
|
||||
std::unique_ptr<StringConverter> converter(new StringConverter());
|
||||
size_t conversion_result = converter->convert("false", 1);
|
||||
unsigned int expected1 = 1;
|
||||
EXPECT_EQ(expected1, conversion_result);
|
||||
delete converter;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user