mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-04-14 23:03:14 +00:00
working on tests
This commit is contained in:
parent
296e6c47ab
commit
7b779bc703
@ -484,13 +484,15 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
}
|
||||
|
||||
acquisition->set_local_code();
|
||||
|
||||
//acquisition->set_state(1);
|
||||
start_queue();
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
top_block->run(); // Start threads and wait
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
stop_queue();
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
|
||||
@ -505,16 +507,7 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL.";
|
||||
}
|
||||
|
||||
#ifdef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.timed_join(boost::posix_time::seconds(1));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
#ifndef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
ch_thread.join();
|
||||
}
|
||||
}
|
||||
|
||||
@ -583,13 +576,13 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProb
|
||||
}
|
||||
|
||||
acquisition->set_local_code();
|
||||
|
||||
//acquisition->set_state(1);
|
||||
start_queue();
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
top_block->run(); // Start threads and wait
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
stop_queue();
|
||||
if (i == 0)
|
||||
{
|
||||
std::cout << "Estimated probability of detection = " << Pd << std::endl;
|
||||
@ -601,15 +594,7 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProb
|
||||
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;
|
||||
}
|
||||
#ifdef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.timed_join(boost::posix_time::seconds(1));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
#ifndef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
|
||||
ch_thread.join();
|
||||
}
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ protected:
|
||||
|
||||
gr::msg_queue::sptr queue;
|
||||
gr::top_block_sptr top_block;
|
||||
std::shared_ptr<AcquisitionInterface> acquisition;
|
||||
std::shared_ptr<GalileoE1PcpsAmbiguousAcquisition> acquisition;
|
||||
std::shared_ptr<GNSSBlockFactory> factory;
|
||||
std::shared_ptr<InMemoryConfiguration> config;
|
||||
Gnss_Synchro gnss_synchro;
|
||||
@ -365,7 +365,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, Instantiate)
|
||||
{
|
||||
config_1();
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
|
||||
acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
||||
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsAmbiguousAcquisition>(acq_);
|
||||
}
|
||||
|
||||
|
||||
@ -380,7 +380,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
config_1();
|
||||
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
|
||||
acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
||||
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsAmbiguousAcquisition>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
@ -407,7 +407,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
queue = gr::msg_queue::make(0);
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
|
||||
acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
||||
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsAmbiguousAcquisition>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
@ -464,13 +464,13 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
}
|
||||
|
||||
acquisition->set_local_code();
|
||||
|
||||
acquisition->set_state(1);
|
||||
start_queue();
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
top_block->run(); // Start threads and wait
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
stop_queue();
|
||||
if (i == 0)
|
||||
{
|
||||
EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
|
||||
@ -483,16 +483,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
{
|
||||
EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL.";
|
||||
}
|
||||
#ifdef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.timed_join(boost::posix_time::seconds(1));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
#ifndef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
ch_thread.join();
|
||||
}
|
||||
}
|
||||
|
||||
@ -504,7 +495,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProbabi
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
queue = gr::msg_queue::make(0);
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
|
||||
acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);
|
||||
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsAmbiguousAcquisition>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
@ -563,13 +554,15 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProbabi
|
||||
}
|
||||
|
||||
acquisition->set_local_code();
|
||||
|
||||
acquisition->set_state(1);
|
||||
start_queue();
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
top_block->run(); // Start threads and wait
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
stop_queue();
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
std::cout << "Estimated probability of detection = " << Pd << std::endl;
|
||||
@ -581,15 +574,6 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProbabi
|
||||
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;
|
||||
}
|
||||
#ifdef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.timed_join(boost::posix_time::seconds(1));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
#ifndef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
ch_thread.join();
|
||||
}
|
||||
}
|
||||
|
@ -175,13 +175,12 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ConnectAndRun)
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
gettimeofday(&tv, NULL);
|
||||
begin = tv.tv_sec*1000000 + tv.tv_usec;
|
||||
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;
|
||||
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(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ValidationOfResults)
|
||||
@ -194,7 +193,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ValidationOfResults)
|
||||
|
||||
init();
|
||||
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_);
|
||||
std::shared_ptr<GalileoE1PcpsAmbiguousAcquisition> acquisition = std::dynamic_pointer_cast<GalileoE1PcpsAmbiguousAcquisition>(acq_);
|
||||
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
@ -238,29 +237,23 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ValidationOfResults)
|
||||
start_queue();
|
||||
acquisition->init();
|
||||
acquisition->reset();
|
||||
acquisition->set_state(1);
|
||||
}) << "Failure starting acquisition" << std::endl;
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
gettimeofday(&tv, NULL);
|
||||
begin = tv.tv_sec*1000000 + tv.tv_usec;
|
||||
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;
|
||||
end = tv.tv_sec * 1000000 + tv.tv_usec;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
#ifdef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.timed_join(boost::posix_time::seconds(1));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
#ifndef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
stop_queue();
|
||||
|
||||
unsigned long int nsamples = gnss_synchro.Acq_samplestamp_samples;
|
||||
std::cout << "Acquired " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
|
||||
|
||||
EXPECT_EQ(0, message) << "Acquisition failure. Expected message: 0=ACQ STOP.";
|
||||
EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 0=ACQ STOP.";
|
||||
|
||||
ch_thread.join();
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
queue = gr::msg_queue::make(0);
|
||||
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_);
|
||||
std::shared_ptr<GalileoE1PcpsAmbiguousAcquisition> acquisition = std::dynamic_pointer_cast<GalileoE1PcpsAmbiguousAcquisition>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(gnss_synchro.Channel_ID);
|
||||
@ -222,6 +222,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)
|
||||
|
||||
acquisition->init();
|
||||
acquisition->reset();
|
||||
acquisition->set_state(1);
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
gettimeofday(&tv, NULL);
|
||||
@ -230,21 +231,11 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)
|
||||
gettimeofday(&tv, NULL);
|
||||
end = tv.tv_sec * 1000000 + tv.tv_usec;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
#ifdef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.timed_join(boost::posix_time::seconds(1));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
#ifndef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
stop_queue();
|
||||
|
||||
unsigned long int nsamples = gnss_synchro.Acq_samplestamp_samples;
|
||||
std::cout << "Acquired " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
|
||||
//EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
|
||||
EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
|
||||
|
||||
std::cout << "Delay: " << gnss_synchro.Acq_delay_samples << std::endl;
|
||||
std::cout << "Doppler: " << gnss_synchro.Acq_doppler_hz << std::endl;
|
||||
@ -255,5 +246,7 @@ 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";
|
||||
|
||||
ch_thread.join();
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ protected:
|
||||
|
||||
gr::msg_queue::sptr queue;
|
||||
gr::top_block_sptr top_block;
|
||||
std::shared_ptr<AcquisitionInterface> acquisition;
|
||||
std::shared_ptr<GalileoE1PcpsCccwsrAmbiguousAcquisition> acquisition;
|
||||
std::shared_ptr<GNSSBlockFactory> factory;
|
||||
std::shared_ptr<InMemoryConfiguration> config;
|
||||
Gnss_Synchro gnss_synchro;
|
||||
@ -364,7 +364,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, Instantiate)
|
||||
{
|
||||
config_1();
|
||||
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_);
|
||||
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsCccwsrAmbiguousAcquisition>(acq_);
|
||||
}
|
||||
|
||||
TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ConnectAndRun)
|
||||
@ -379,7 +379,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ConnectAndRun)
|
||||
queue = gr::msg_queue::make(0);
|
||||
|
||||
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_);
|
||||
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsCccwsrAmbiguousAcquisition>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
@ -406,7 +406,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults)
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
queue = gr::msg_queue::make(0);
|
||||
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_);
|
||||
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsCccwsrAmbiguousAcquisition>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
@ -463,15 +463,17 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults)
|
||||
gnss_synchro.PRN = 20; // This satellite is not visible
|
||||
}
|
||||
acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
acquisition->init();
|
||||
acquisition->reset();
|
||||
|
||||
acquisition->set_local_code();
|
||||
acquisition->reset();
|
||||
acquisition->set_state(1);
|
||||
start_queue();
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
top_block->run(); // Start threads and wait
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
stop_queue();
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
|
||||
@ -504,7 +506,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResultsProbabili
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
queue = gr::msg_queue::make(0);
|
||||
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_);
|
||||
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsCccwsrAmbiguousAcquisition>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
@ -566,14 +568,16 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResultsProbabili
|
||||
acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
acquisition->init();
|
||||
acquisition->reset();
|
||||
//acquisition->set_local_code();
|
||||
//acquisition->set_state(1);
|
||||
acquisition->set_local_code();
|
||||
acquisition->set_state(1);
|
||||
start_queue();
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
top_block->run(); // Start threads and wait
|
||||
}) << "Failure running the top_block."<< std::endl;
|
||||
|
||||
stop_queue();
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
std::cout << "Estimated probability of detection = " << Pd << std::endl;
|
||||
@ -585,16 +589,6 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResultsProbabili
|
||||
std::cout << "Probability of false alarm (satellite absent) = " << Pfa_a << std::endl;
|
||||
std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl;
|
||||
}
|
||||
#ifdef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.timed_join(boost::posix_time::seconds(1));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
#ifndef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
ch_thread.join();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -792,7 +792,10 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul
|
||||
gnss_synchro.PRN = 20; // This satellite is not visible
|
||||
}
|
||||
|
||||
acquisition->set_gnss_synchro(&gnss_synchro);
|
||||
acquisition->set_local_code();
|
||||
acquisition->reset();
|
||||
acquisition->set_state(1);
|
||||
start_queue();
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
|
@ -83,7 +83,7 @@ protected:
|
||||
|
||||
gr::msg_queue::sptr queue;
|
||||
gr::top_block_sptr top_block;
|
||||
std::shared_ptr<AcquisitionInterface> acquisition;
|
||||
std::shared_ptr<GalileoE1PcpsTongAmbiguousAcquisition> acquisition;
|
||||
std::shared_ptr<GNSSBlockFactory> factory;
|
||||
std::shared_ptr<InMemoryConfiguration> config;
|
||||
Gnss_Synchro gnss_synchro;
|
||||
@ -371,7 +371,7 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, Instantiate)
|
||||
{
|
||||
config_1();
|
||||
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_);
|
||||
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsTongAmbiguousAcquisition>(acq_);
|
||||
}
|
||||
|
||||
TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
@ -384,7 +384,7 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
queue = gr::msg_queue::make(0);
|
||||
config_1();
|
||||
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_);
|
||||
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsTongAmbiguousAcquisition>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->connect(top_block);
|
||||
@ -396,10 +396,10 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
|
||||
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;
|
||||
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;
|
||||
@ -411,7 +411,7 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
queue = gr::msg_queue::make(0);
|
||||
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_);
|
||||
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsTongAmbiguousAcquisition>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
@ -441,6 +441,7 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
acquisition->connect(top_block);
|
||||
}) << "Failure connecting acquisition to the top_block." << std::endl;
|
||||
|
||||
acquisition->reset();
|
||||
acquisition->init();
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
@ -457,7 +458,6 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
for (unsigned int i = 0; i < 2; i++)
|
||||
{
|
||||
init();
|
||||
acquisition->reset();
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
@ -467,42 +467,35 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
{
|
||||
gnss_synchro.PRN = 20; // This satellite is not visible
|
||||
}
|
||||
|
||||
acquisition->reset();
|
||||
acquisition->set_local_code();
|
||||
|
||||
acquisition->set_state(1);
|
||||
start_queue();
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
top_block->run(); // Start threads and wait
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
stop_queue();
|
||||
|
||||
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(0, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
|
||||
//EXPECT_EQ(0, 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(1, message) << "Acquisition failure. Expected message: 2=ACQ FAIL.";
|
||||
EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL.";
|
||||
//EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 2=ACQ FAIL.";
|
||||
}
|
||||
|
||||
#ifdef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.timed_join(boost::posix_time::seconds(1));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
#ifndef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
std::cout << "Delay: " << gnss_synchro.Acq_delay_samples << std::endl;
|
||||
std::cout << "Doppler: " << gnss_synchro.Acq_doppler_hz << std::endl;
|
||||
std::cout << "Doppler: " << gnss_synchro.Acq_doppler_hz << std::endl;
|
||||
ch_thread.join();
|
||||
}
|
||||
}
|
||||
|
||||
@ -512,7 +505,7 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsPro
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
queue = gr::msg_queue::make(0);
|
||||
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_);
|
||||
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsTongAmbiguousAcquisition>(acq_);
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_channel(1);
|
||||
@ -571,13 +564,15 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsPro
|
||||
}
|
||||
|
||||
acquisition->set_local_code();
|
||||
|
||||
acquisition->set_state(1);
|
||||
start_queue();
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
top_block->run(); // Start threads and wait
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
stop_queue();
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
std::cout << "Estimated probability of detection = " << Pd << std::endl;
|
||||
@ -589,15 +584,6 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsPro
|
||||
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;
|
||||
}
|
||||
#ifdef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.timed_join(boost::posix_time::seconds(1));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
#ifndef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
ch_thread.join();
|
||||
}
|
||||
}
|
||||
|
@ -709,16 +709,10 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ValidationOfSIM)
|
||||
EXPECT_NO_THROW( {
|
||||
top_block->run(); // Start threads and wait
|
||||
}) << "Failure running the top_block."<< std::endl;
|
||||
#ifdef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.timed_join(boost::posix_time::seconds(1));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
#ifndef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
|
||||
stop_queue();
|
||||
|
||||
ch_thread.join();
|
||||
//std::cout << gnss_synchro.Acq_delay_samples << "acq delay" <<std::endl;
|
||||
//std::cout << gnss_synchro.Acq_doppler_hz << "acq doppler" <<std::endl;
|
||||
//std::cout << gnss_synchro.Acq_samplestamp_samples << "acq samples" <<std::endl;
|
||||
|
@ -234,6 +234,8 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults)
|
||||
end = tv.tv_sec * 1000000 + tv.tv_usec;
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
stop_queue();
|
||||
|
||||
unsigned long int nsamples = gnss_synchro.Acq_samplestamp_samples;
|
||||
std::cout << "Acquired " << nsamples << " samples in " << (end - begin) << " microseconds" << std::endl;
|
||||
|
||||
@ -246,11 +248,5 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults)
|
||||
EXPECT_LE(doppler_error_hz, 666) << "Doppler error exceeds the expected value: 666 Hz = 2/(3*integration period)";
|
||||
EXPECT_LT(delay_error_chips, 0.5) << "Delay error exceeds the expected value: 0.5 chips";
|
||||
|
||||
#ifdef OLD_BOOST
|
||||
ch_thread.timed_join(boost::posix_time::seconds(1));
|
||||
#endif
|
||||
#ifndef OLD_BOOST
|
||||
ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50));
|
||||
#endif
|
||||
|
||||
ch_thread.join();
|
||||
}
|
||||
|
@ -466,6 +466,8 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
top_block->run(); // Start threads and wait
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
stop_queue();
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
EXPECT_EQ(1, message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS.";
|
||||
@ -479,16 +481,8 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
{
|
||||
EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL.";
|
||||
}
|
||||
#ifdef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.timed_join(boost::posix_time::seconds(1));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
#ifndef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
|
||||
ch_thread.join();
|
||||
}
|
||||
}
|
||||
|
||||
@ -563,6 +557,8 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
|
||||
top_block->run(); // Start threads and wait
|
||||
}) << "Failure running the top_block." << std::endl;
|
||||
|
||||
stop_queue();
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
std::cout << "Estimated probability of detection = " << Pd << std::endl;
|
||||
@ -574,15 +570,6 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
|
||||
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;
|
||||
}
|
||||
#ifdef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.timed_join(boost::posix_time::seconds(1));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
#ifndef OLD_BOOST
|
||||
ASSERT_NO_THROW( {
|
||||
ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50));
|
||||
}) << "Failure while waiting the queue to stop" << std::endl;
|
||||
#endif
|
||||
ch_thread.join();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user