mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-13 11:40:33 +00:00
Always initialize elapsed_seconds
It was causing warnings in GCC. Some code style applied.
This commit is contained in:
parent
eb53c36594
commit
02ea8acbfd
@ -42,7 +42,6 @@ GeoJSON_Printer::GeoJSON_Printer()
|
||||
}
|
||||
|
||||
|
||||
|
||||
GeoJSON_Printer::~GeoJSON_Printer ()
|
||||
{
|
||||
GeoJSON_Printer::close_file();
|
||||
@ -51,7 +50,7 @@ GeoJSON_Printer::~GeoJSON_Printer ()
|
||||
|
||||
bool GeoJSON_Printer::set_headers(std::string filename, bool time_tag_name)
|
||||
{
|
||||
boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time(); //::local_sec_clock::local_time(zone);
|
||||
boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time();
|
||||
tm timeinfo = boost::posix_time::to_tm(pt);
|
||||
|
||||
if (time_tag_name)
|
||||
@ -129,7 +128,6 @@ bool GeoJSON_Printer::set_headers(std::string filename, bool time_tag_name)
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool GeoJSON_Printer::print_position(const std::shared_ptr<Pvt_Solution>& position, bool print_average_values)
|
||||
{
|
||||
double latitude;
|
||||
@ -172,7 +170,6 @@ bool GeoJSON_Printer::print_position(const std::shared_ptr<Pvt_Solution>& positi
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool GeoJSON_Printer::close_file()
|
||||
{
|
||||
if (geojson_file.is_open())
|
||||
|
@ -155,8 +155,8 @@ int main(int argc, char** argv)
|
||||
end = std::chrono::system_clock::now();
|
||||
std::chrono::duration<double> elapsed_seconds = end - start;
|
||||
|
||||
std::cout << "Total GNSS-SDR run time "
|
||||
<< elapsed_seconds.count()
|
||||
std::cout << "Total GNSS-SDR run time: "
|
||||
<< elapsed_seconds.count()
|
||||
<< " [seconds]" << std::endl;
|
||||
|
||||
google::ShutDownCommandLineFlags();
|
||||
|
@ -29,6 +29,7 @@
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <chrono>
|
||||
#include <cmath>
|
||||
#include <fstream>
|
||||
#include <numeric>
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/msg.h>
|
||||
#include <thread>
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
#include <gflags/gflags.h>
|
||||
#include <glog/logging.h>
|
||||
#include <gtest/gtest.h>
|
||||
@ -301,40 +302,38 @@ void TfttGpsL1CATest::print_TTFF_report(const std::vector<double> & ttff_v, std:
|
||||
std::string filename = "ttff_report";
|
||||
std::string filename_;
|
||||
|
||||
time_t rawtime;
|
||||
struct tm * timeinfo;
|
||||
time ( &rawtime );
|
||||
timeinfo = localtime ( &rawtime );
|
||||
boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time();
|
||||
tm timeinfo = boost::posix_time::to_tm(pt);
|
||||
|
||||
std::stringstream strm0;
|
||||
const int year = timeinfo->tm_year - 100;
|
||||
const int year = timeinfo.tm_year - 100;
|
||||
strm0 << year;
|
||||
const int month = timeinfo->tm_mon + 1;
|
||||
const int month = timeinfo.tm_mon + 1;
|
||||
if(month < 10)
|
||||
{
|
||||
strm0 << "0";
|
||||
}
|
||||
strm0 << month;
|
||||
const int day = timeinfo->tm_mday;
|
||||
const int day = timeinfo.tm_mday;
|
||||
if(day < 10)
|
||||
{
|
||||
strm0 << "0";
|
||||
}
|
||||
strm0 << day << "_";
|
||||
const int hour = timeinfo->tm_hour;
|
||||
const int hour = timeinfo.tm_hour;
|
||||
if(hour < 10)
|
||||
{
|
||||
strm0 << "0";
|
||||
}
|
||||
strm0 << hour;
|
||||
const int min = timeinfo->tm_min;
|
||||
const int min = timeinfo.tm_min;
|
||||
|
||||
if(min < 10)
|
||||
{
|
||||
strm0 << "0";
|
||||
}
|
||||
strm0 << min;
|
||||
const int sec = timeinfo->tm_sec;
|
||||
const int sec = timeinfo.tm_sec;
|
||||
if(sec < 10)
|
||||
{
|
||||
strm0 << "0";
|
||||
|
@ -165,6 +165,7 @@ protected:
|
||||
double Pfa_a;
|
||||
};
|
||||
|
||||
|
||||
void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::init()
|
||||
{
|
||||
message = 0;
|
||||
@ -180,6 +181,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::init()
|
||||
Pfa_a = 0;
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_1()
|
||||
{
|
||||
gnss_synchro.Channel_ID = 0;
|
||||
@ -247,6 +249,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_1()
|
||||
config->set_property("Acquisition.dump", "false");
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_2()
|
||||
{
|
||||
gnss_synchro.Channel_ID = 0;
|
||||
@ -332,12 +335,14 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_2()
|
||||
config->set_property("Acquisition.dump", "false");
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::start_queue()
|
||||
{
|
||||
stop = false;
|
||||
ch_thread = boost::thread(&GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::wait_message, this);
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::wait_message()
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
@ -366,6 +371,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::wait_message()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::process_message()
|
||||
{
|
||||
if (message == 1)
|
||||
@ -405,22 +411,25 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::process_message()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::stop_queue()
|
||||
{
|
||||
stop = true;
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, Instantiate)
|
||||
{
|
||||
config_1();
|
||||
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 1);
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
{
|
||||
int nsamples = floor(fs_in*integration_time_ms*1e-3);
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
|
||||
config_1();
|
||||
queue = gr::msg_queue::make(0);
|
||||
@ -469,6 +478,7 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
{
|
||||
config_1();
|
||||
@ -558,6 +568,7 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
|
||||
{
|
||||
config_2();
|
||||
|
@ -355,7 +355,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::start_queue()
|
||||
void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::wait_message()
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
|
||||
while (!stop)
|
||||
{
|
||||
@ -433,7 +433,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
{
|
||||
int nsamples = floor(fs_in*integration_time_ms*1e-3);
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
queue = gr::msg_queue::make(0);
|
||||
config_1();
|
||||
|
@ -149,6 +149,7 @@ protected:
|
||||
boost::thread ch_thread;
|
||||
};
|
||||
|
||||
|
||||
void GalileoE1PcpsAmbiguousAcquisitionGSoCTest::init()
|
||||
{
|
||||
gnss_synchro.Channel_ID = 0;
|
||||
@ -170,6 +171,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoCTest::init()
|
||||
config->set_property("Acquisition0.cboc", "true");
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1PcpsAmbiguousAcquisitionGSoCTest::start_queue()
|
||||
{
|
||||
ch_thread = boost::thread(&GalileoE1PcpsAmbiguousAcquisitionGSoCTest::wait_message, this);
|
||||
@ -193,13 +195,13 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoCTest::wait_message()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1PcpsAmbiguousAcquisitionGSoCTest::stop_queue()
|
||||
{
|
||||
stop = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, Instantiate)
|
||||
{
|
||||
init();
|
||||
@ -208,12 +210,13 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, Instantiate)
|
||||
EXPECT_STREQ("Galileo_E1_PCPS_Ambiguous_Acquisition", acquisition->implementation().c_str());
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ConnectAndRun)
|
||||
{
|
||||
int fs_in = 4000000;
|
||||
int nsamples = 4*fs_in;
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
queue = gr::msg_queue::make(0);
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
|
||||
@ -240,10 +243,11 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ConnectAndRun)
|
||||
std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ValidationOfResults)
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
queue = gr::msg_queue::make(0);
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
|
||||
|
@ -166,7 +166,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ConnectAndRun)
|
||||
int fs_in = 4000000;
|
||||
int nsamples = 4*fs_in;
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
init();
|
||||
@ -196,7 +196,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ConnectAndRun)
|
||||
TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
|
||||
double expected_delay_samples = 2920; //18250;
|
||||
double expected_doppler_hz = -632;
|
||||
|
@ -167,6 +167,7 @@ protected:
|
||||
double Pfa_a;
|
||||
};
|
||||
|
||||
|
||||
void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::init()
|
||||
{
|
||||
message = 0;
|
||||
@ -182,6 +183,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::init()
|
||||
Pfa_a = 0;
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::config_1()
|
||||
{
|
||||
gnss_synchro.Channel_ID = 0;
|
||||
@ -252,6 +254,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::config_1()
|
||||
config->set_property("Acquisition.dump", "false");
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::config_2()
|
||||
{
|
||||
gnss_synchro.Channel_ID = 0;
|
||||
@ -340,6 +343,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::config_2()
|
||||
config->set_property("Acquisition.dump", "false");
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::start_queue()
|
||||
{
|
||||
stop = false;
|
||||
@ -350,7 +354,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::start_queue()
|
||||
void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::wait_message()
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
|
||||
while (!stop)
|
||||
{
|
||||
@ -369,6 +373,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::wait_message()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::process_message()
|
||||
{
|
||||
if (message == 1)
|
||||
@ -410,11 +415,13 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::process_message()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::stop_queue()
|
||||
{
|
||||
stop = true;
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, Instantiate)
|
||||
{
|
||||
config_1();
|
||||
@ -422,11 +429,12 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, Instantiate)
|
||||
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsCccwsrAmbiguousAcquisition>(acq_);
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ConnectAndRun)
|
||||
{
|
||||
int nsamples = floor(fs_in*integration_time_ms*1e-3);
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
|
||||
config_1();
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
@ -455,6 +463,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ConnectAndRun)
|
||||
std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults)
|
||||
{
|
||||
config_1();
|
||||
@ -553,6 +562,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResultsProbabilities)
|
||||
{
|
||||
config_2();
|
||||
|
@ -467,7 +467,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::start_queue()
|
||||
void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::wait_message()
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> begin, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
|
||||
while (!stop)
|
||||
{
|
||||
@ -557,7 +557,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ConnectAndRun)
|
||||
LOG(INFO) << "**Start connect and run test";
|
||||
int nsamples = floor(fs_in*integration_time_ms*1e-3);
|
||||
std::chrono::time_point<std::chrono::system_clock> begin, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
queue = gr::msg_queue::make(0);
|
||||
|
||||
|
@ -360,7 +360,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::start_queue()
|
||||
void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::wait_message()
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
|
||||
while (!stop)
|
||||
{
|
||||
@ -440,7 +440,7 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
{
|
||||
int nsamples = floor(fs_in*integration_time_ms*1e-3);
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
queue = gr::msg_queue::make(0);
|
||||
config_1();
|
||||
|
@ -476,7 +476,7 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::start_queue()
|
||||
void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::wait_message()
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
|
||||
while (!stop)
|
||||
{
|
||||
@ -581,7 +581,7 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ConnectAndRun)
|
||||
//int nsamples = floor(5*fs_in*integration_time_ms*1e-3);
|
||||
int nsamples = 21000*3;
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
acquisition = std::make_shared<GalileoE5aNoncoherentIQAcquisitionCaf>(config.get(), "Acquisition", 1, 1);
|
||||
boost::shared_ptr<GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx> msg_rx = GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_make(channel_internal_queue);
|
||||
queue = gr::msg_queue::make(0);
|
||||
@ -761,7 +761,6 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ValidationOfSIM)
|
||||
//std::cout << gnss_synchro.Acq_delay_samples << "acq delay" <<std::endl;
|
||||
EXPECT_EQ((unsigned int) 1, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
|
||||
}
|
||||
|
||||
}
|
||||
else if (i == 1)
|
||||
{
|
||||
|
@ -257,6 +257,7 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::config_1()
|
||||
config->set_property("Acquisition.dump", "false");
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsAcquisitionGSoC2013Test::config_2()
|
||||
{
|
||||
gnss_synchro.Channel_ID = 0;
|
||||
@ -344,16 +345,18 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::config_2()
|
||||
config->set_property("Acquisition.dump", "false");
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsAcquisitionGSoC2013Test::start_queue()
|
||||
{
|
||||
stop = false;
|
||||
ch_thread = boost::thread(&GpsL1CaPcpsAcquisitionGSoC2013Test::wait_message, this);
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsAcquisitionGSoC2013Test::wait_message()
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
|
||||
while (!stop)
|
||||
{
|
||||
@ -372,6 +375,7 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::wait_message()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsAcquisitionGSoC2013Test::process_message()
|
||||
{
|
||||
if (message == 1)
|
||||
@ -411,11 +415,13 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::process_message()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsAcquisitionGSoC2013Test::stop_queue()
|
||||
{
|
||||
stop = true;
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, Instantiate)
|
||||
{
|
||||
config_1();
|
||||
@ -423,11 +429,12 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, Instantiate)
|
||||
delete acquisition;
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
{
|
||||
int nsamples = floor(fs_in*integration_time_ms*1e-3);
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
queue = gr::msg_queue::make(0);
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
|
||||
@ -456,6 +463,7 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
delete acquisition;
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
{
|
||||
config_1();
|
||||
@ -552,6 +560,7 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
delete acquisition;
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
|
||||
{
|
||||
config_2();
|
||||
|
@ -163,7 +163,7 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ConnectAndRun)
|
||||
int fs_in = 4000000;
|
||||
int nsamples = 4000;
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
@ -195,7 +195,7 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ConnectAndRun)
|
||||
TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults)
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
|
||||
double expected_delay_samples = 524;
|
||||
|
@ -51,18 +51,17 @@
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#define DMA_ACQ_TRANSFER_SIZE 2046 // DMA transfer size for the acquisition
|
||||
#define RX_SIGNAL_MAX_VALUE 127 // 2^7 - 1 for 8-bit signed values
|
||||
#define NTIMES_CYCLE_THROUGH_RX_SAMPLES_FILE 50 // number of times we cycle through the file containing the received samples
|
||||
#define ONE_SECOND 1000000 // one second in microseconds
|
||||
#define FLOAT_SIZE (sizeof(float)) // size of the float variable in characters
|
||||
#define DMA_ACQ_TRANSFER_SIZE 2046 // DMA transfer size for the acquisition
|
||||
#define RX_SIGNAL_MAX_VALUE 127 // 2^7 - 1 for 8-bit signed values
|
||||
#define NTIMES_CYCLE_THROUGH_RX_SAMPLES_FILE 50 // number of times we cycle through the file containing the received samples
|
||||
#define ONE_SECOND 1000000 // one second in microseconds
|
||||
#define FLOAT_SIZE (sizeof(float)) // size of the float variable in characters
|
||||
|
||||
// thread that reads the file containing the received samples, scales the samples to the dynamic range of the fixed point values, sends
|
||||
// the samples to the DMA and finally it stops the top block
|
||||
void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block,
|
||||
const char * file_name)
|
||||
{
|
||||
|
||||
FILE *rx_signal_file; // file descriptor
|
||||
int file_length; // length of the file containing the received samples
|
||||
int dma_descr; // DMA descriptor
|
||||
@ -106,7 +105,6 @@ void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block,
|
||||
{
|
||||
max = (pointer_float[0]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// go back to the beginning of the file containing the received samples
|
||||
@ -132,26 +130,20 @@ void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block,
|
||||
|
||||
for (int k = 0; k < NTIMES_CYCLE_THROUGH_RX_SAMPLES_FILE; k++)
|
||||
{
|
||||
|
||||
fseek(rx_signal_file, 0, SEEK_SET);
|
||||
|
||||
int transfer_size;
|
||||
int num_transferred_samples = 0;
|
||||
while (num_transferred_samples < (int) (file_length / FLOAT_SIZE))
|
||||
{
|
||||
if (((file_length / FLOAT_SIZE) - num_transferred_samples)
|
||||
> DMA_ACQ_TRANSFER_SIZE)
|
||||
if (((file_length / FLOAT_SIZE) - num_transferred_samples) > DMA_ACQ_TRANSFER_SIZE)
|
||||
{
|
||||
|
||||
transfer_size = DMA_ACQ_TRANSFER_SIZE;
|
||||
num_transferred_samples = num_transferred_samples
|
||||
+ DMA_ACQ_TRANSFER_SIZE;
|
||||
|
||||
num_transferred_samples = num_transferred_samples + DMA_ACQ_TRANSFER_SIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
transfer_size = file_length / FLOAT_SIZE
|
||||
- num_transferred_samples;
|
||||
transfer_size = file_length / FLOAT_SIZE - num_transferred_samples;
|
||||
num_transferred_samples = file_length / FLOAT_SIZE;
|
||||
}
|
||||
|
||||
@ -160,16 +152,12 @@ void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block,
|
||||
fread(buffer_float, FLOAT_SIZE, 1, rx_signal_file);
|
||||
|
||||
// specify (float) (int) for a quantization maximizing the dynamic range
|
||||
buffer_DMA[t] = (signed char) ((pointer_float[0]
|
||||
* (RX_SIGNAL_MAX_VALUE - 1)) / max);
|
||||
|
||||
buffer_DMA[t] = (signed char) ((pointer_float[0] * (RX_SIGNAL_MAX_VALUE - 1)) / max);
|
||||
}
|
||||
|
||||
//send_acquisition_gps_input_samples(buffer_DMA, transfer_size, dma_descr);
|
||||
assert(
|
||||
transfer_size == write(dma_descr, &buffer_DMA[0], transfer_size));
|
||||
assert(transfer_size == write(dma_descr, &buffer_DMA[0], transfer_size));
|
||||
}
|
||||
|
||||
}
|
||||
fclose(rx_signal_file);
|
||||
free(buffer_float);
|
||||
@ -179,9 +167,9 @@ void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block,
|
||||
// when all the samples are sent stop the top block
|
||||
|
||||
top_block->stop();
|
||||
|
||||
}
|
||||
|
||||
|
||||
// ######## GNURADIO BLOCK MESSAGE RECEVER #########
|
||||
class GpsL1CaPcpsAcquisitionTestFpga_msg_rx;
|
||||
|
||||
@ -200,12 +188,14 @@ public:
|
||||
~GpsL1CaPcpsAcquisitionTestFpga_msg_rx(); //!< Default destructor
|
||||
};
|
||||
|
||||
|
||||
GpsL1CaPcpsAcquisitionTest_msg_fpga_rx_sptr GpsL1CaPcpsAcquisitionTestFpga_msg_rx_make()
|
||||
{
|
||||
return GpsL1CaPcpsAcquisitionTest_msg_fpga_rx_sptr(
|
||||
new GpsL1CaPcpsAcquisitionTestFpga_msg_rx());
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsAcquisitionTestFpga_msg_rx::msg_handler_events(pmt::pmt_t msg)
|
||||
{
|
||||
try
|
||||
@ -220,6 +210,7 @@ void GpsL1CaPcpsAcquisitionTestFpga_msg_rx::msg_handler_events(pmt::pmt_t msg)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GpsL1CaPcpsAcquisitionTestFpga_msg_rx::GpsL1CaPcpsAcquisitionTestFpga_msg_rx() :
|
||||
gr::block("GpsL1CaPcpsAcquisitionTestFpga_msg_rx",
|
||||
gr::io_signature::make(0, 0, 0),
|
||||
@ -227,15 +218,14 @@ GpsL1CaPcpsAcquisitionTestFpga_msg_rx::GpsL1CaPcpsAcquisitionTestFpga_msg_rx() :
|
||||
{
|
||||
this->message_port_register_in(pmt::mp("events"));
|
||||
this->set_msg_handler(pmt::mp("events"),
|
||||
boost::bind(
|
||||
&GpsL1CaPcpsAcquisitionTestFpga_msg_rx::msg_handler_events,
|
||||
this, _1));
|
||||
boost::bind( &GpsL1CaPcpsAcquisitionTestFpga_msg_rx::msg_handler_events, this, _1));
|
||||
rx_message = 0;
|
||||
}
|
||||
|
||||
|
||||
GpsL1CaPcpsAcquisitionTestFpga_msg_rx::~GpsL1CaPcpsAcquisitionTestFpga_msg_rx()
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
class GpsL1CaPcpsAcquisitionTestFpga : public ::testing::Test
|
||||
{
|
||||
@ -249,8 +239,7 @@ protected:
|
||||
}
|
||||
|
||||
~GpsL1CaPcpsAcquisitionTestFpga()
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
void init();
|
||||
|
||||
@ -261,6 +250,7 @@ protected:
|
||||
size_t item_size;
|
||||
};
|
||||
|
||||
|
||||
void GpsL1CaPcpsAcquisitionTestFpga::init()
|
||||
{
|
||||
gnss_synchro.Channel_ID = 0;
|
||||
@ -282,7 +272,6 @@ void GpsL1CaPcpsAcquisitionTestFpga::init()
|
||||
config->set_property("Acquisition.pfa", "0.0");
|
||||
config->set_property("Acquisition.select_queue_Fpga", "0");
|
||||
config->set_property("Acquisition.devicename", "/dev/uio0");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -290,15 +279,14 @@ TEST_F(GpsL1CaPcpsAcquisitionTestFpga, Instantiate)
|
||||
{
|
||||
init();
|
||||
boost::shared_ptr<GpsL1CaPcpsAcquisitionFpga> acquisition =
|
||||
boost::make_shared<GpsL1CaPcpsAcquisitionFpga>(config.get(),
|
||||
"Acquisition", 0, 1);
|
||||
boost::make_shared<GpsL1CaPcpsAcquisitionFpga>(config.get(), "Acquisition", 0, 1);
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GpsL1CaPcpsAcquisitionTestFpga, ValidationOfResults)
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
|
||||
double expected_delay_samples = 524;
|
||||
|
@ -284,16 +284,18 @@ void GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test::config_2()
|
||||
config->set_property("Acquisition.dump", "false");
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test::start_queue()
|
||||
{
|
||||
stop = false;
|
||||
ch_thread = boost::thread(&GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test::wait_message, this);
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test::wait_message()
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
|
||||
while (!stop)
|
||||
{
|
||||
@ -312,6 +314,7 @@ void GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test::wait_message()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test::process_message()
|
||||
{
|
||||
if (message == 1)
|
||||
@ -353,22 +356,25 @@ void GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test::process_message()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test::stop_queue()
|
||||
{
|
||||
stop = true;
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test, Instantiate)
|
||||
{
|
||||
config_1();
|
||||
acquisition = std::make_shared<GpsL1CaPcpsMultithreadAcquisition>(config.get(), "Acquisition", 1, 1);
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
{
|
||||
int nsamples = floor(fs_in*integration_time_ms*1e-3);
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
queue = gr::msg_queue::make(0);
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
|
||||
@ -393,6 +399,7 @@ TEST_F(GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
{
|
||||
config_1();
|
||||
@ -475,6 +482,7 @@ TEST_F(GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
|
||||
{
|
||||
config_2();
|
||||
@ -555,5 +563,4 @@ TEST_F(GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test, ValidationOfResultsProbabi
|
||||
// std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -167,6 +167,7 @@ protected:
|
||||
double Pfa_a;
|
||||
};
|
||||
|
||||
|
||||
void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::init()
|
||||
{
|
||||
message = 0;
|
||||
@ -182,6 +183,7 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::init()
|
||||
Pfa_a = 0;
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::config_1()
|
||||
{
|
||||
gnss_synchro.Channel_ID = 0;
|
||||
@ -251,6 +253,7 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::config_1()
|
||||
config->set_property("Acquisition.dump", "false");
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::config_2()
|
||||
{
|
||||
gnss_synchro.Channel_ID = 0;
|
||||
@ -338,16 +341,18 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::config_2()
|
||||
config->set_property("Acquisition.dump", "false");
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::start_queue()
|
||||
{
|
||||
stop = false;
|
||||
ch_thread = boost::thread(&GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::wait_message, this);
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::wait_message()
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
|
||||
while (!stop)
|
||||
{
|
||||
@ -366,6 +371,7 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::wait_message()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::process_message()
|
||||
{
|
||||
if (message == 1)
|
||||
@ -407,22 +413,25 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::process_message()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::stop_queue()
|
||||
{
|
||||
stop = true;
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, Instantiate)
|
||||
{
|
||||
config_1();
|
||||
acquisition = std::make_shared<GpsL1CaPcpsOpenClAcquisition>(config.get(), "Acquisition", 1, 1);
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
{
|
||||
int nsamples = floor(fs_in*integration_time_ms*1e-3);
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
|
||||
config_1();
|
||||
acquisition = std::make_shared<GpsL1CaPcpsOpenClAcquisition>(config.get(), "Acquisition", 1, 1);
|
||||
@ -447,6 +456,7 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
{
|
||||
config_1();
|
||||
@ -529,6 +539,7 @@ TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GpsL1CaPcpsOpenClAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
|
||||
{
|
||||
config_2();
|
||||
|
@ -108,14 +108,13 @@ GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::GpsL1CaPcpsQuickSyncAcquisit
|
||||
rx_message = 0;
|
||||
}
|
||||
|
||||
|
||||
GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::~GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx()
|
||||
{}
|
||||
|
||||
|
||||
// ###########################################################
|
||||
|
||||
|
||||
|
||||
class GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test: public ::testing::Test
|
||||
{
|
||||
protected:
|
||||
@ -361,6 +360,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_2()
|
||||
config->set_property("Acquisition.dump", "false");
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_3()
|
||||
{
|
||||
gnss_synchro.Channel_ID = 0;
|
||||
@ -463,7 +463,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::start_queue()
|
||||
void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::wait_message()
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
|
||||
while (!stop)
|
||||
{
|
||||
@ -482,9 +482,9 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::wait_message()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::process_message()
|
||||
{
|
||||
|
||||
if (message == 1)
|
||||
{
|
||||
detection_counter++;
|
||||
@ -540,11 +540,12 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, Instantiate)
|
||||
acquisition = std::make_shared<GpsL1CaPcpsQuickSyncAcquisition>(config.get(), "Acquisition", 1, 1);
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ConnectAndRun)
|
||||
{
|
||||
int nsamples = floor(fs_in * integration_time_ms * 1e-3);
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
queue = gr::msg_queue::make(0);
|
||||
boost::shared_ptr<GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx> msg_rx = GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue);
|
||||
@ -569,11 +570,9 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ConnectAndRun)
|
||||
}) << "Failure running the top_block."<< std::endl;
|
||||
|
||||
std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResults)
|
||||
{
|
||||
config_1();
|
||||
@ -652,11 +651,9 @@ TEST_F(GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test, ValidationOfResults)
|
||||
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)
|
||||
{
|
||||
|
@ -167,6 +167,7 @@ protected:
|
||||
double Pfa_a = 0.0;
|
||||
};
|
||||
|
||||
|
||||
void GpsL1CaPcpsTongAcquisitionGSoC2013Test::init()
|
||||
{
|
||||
message = 0;
|
||||
@ -182,6 +183,7 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::init()
|
||||
Pfa_a = 0;
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsTongAcquisitionGSoC2013Test::config_1()
|
||||
{
|
||||
gnss_synchro.Channel_ID = 0;
|
||||
@ -251,6 +253,7 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::config_1()
|
||||
config->set_property("Acquisition.dump", "false");
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsTongAcquisitionGSoC2013Test::config_2()
|
||||
{
|
||||
gnss_synchro.Channel_ID = 0;
|
||||
@ -338,16 +341,18 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::config_2()
|
||||
config->set_property("Acquisition.dump", "false");
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsTongAcquisitionGSoC2013Test::start_queue()
|
||||
{
|
||||
stop = false;
|
||||
ch_thread = boost::thread(&GpsL1CaPcpsTongAcquisitionGSoC2013Test::wait_message, this);
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsTongAcquisitionGSoC2013Test::wait_message()
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
|
||||
while (!stop)
|
||||
{
|
||||
@ -365,6 +370,7 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::wait_message()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsTongAcquisitionGSoC2013Test::process_message()
|
||||
{
|
||||
if (message == 1)
|
||||
@ -406,22 +412,25 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::process_message()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsTongAcquisitionGSoC2013Test::stop_queue()
|
||||
{
|
||||
stop = true;
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, Instantiate)
|
||||
{
|
||||
config_1();
|
||||
acquisition = std::make_shared<GpsL1CaPcpsTongAcquisition>(config.get(), "Acquisition", 1, 1);
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
{
|
||||
int nsamples = floor(fs_in*integration_time_ms*1e-3);
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
queue = gr::msg_queue::make(0);
|
||||
|
||||
@ -448,6 +457,7 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ConnectAndRun)
|
||||
std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
{
|
||||
config_1();
|
||||
@ -526,7 +536,6 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
{
|
||||
EXPECT_EQ((unsigned int)1, correct_estimation_counter) << "Acquisition failure. Incorrect parameters estimation.";
|
||||
}
|
||||
|
||||
}
|
||||
else if (i == 1)
|
||||
{
|
||||
@ -537,6 +546,7 @@ TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResults)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GpsL1CaPcpsTongAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
|
||||
{
|
||||
config_2();
|
||||
|
@ -167,10 +167,11 @@ TEST_F(GpsL2MPcpsAcquisitionTest, Instantiate)
|
||||
std::shared_ptr<GpsL2MPcpsAcquisition> acquisition = std::make_shared<GpsL2MPcpsAcquisition>(config.get(), "Acquisition", 1, 1);
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GpsL2MPcpsAcquisitionTest, ConnectAndRun)
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
queue = gr::msg_queue::make(0);
|
||||
|
||||
@ -197,10 +198,11 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ConnectAndRun)
|
||||
std::cout << "Processed " << nsamples << " samples in " << elapsed_seconds.count() * 1e6 << " microseconds" << std::endl;
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GpsL2MPcpsAcquisitionTest, ValidationOfResults)
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
top_block = gr::make_top_block("Acquisition test");
|
||||
queue = gr::msg_queue::make(0);
|
||||
double expected_delay_samples = 1;//2004;
|
||||
@ -250,7 +252,6 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ValidationOfResults)
|
||||
top_block->msg_connect(acquisition->get_right_block(), pmt::mp("events"), msg_rx, pmt::mp("events"));
|
||||
}) << "Failure connecting the blocks of acquisition test." << std::endl;
|
||||
|
||||
|
||||
ASSERT_NO_THROW( {
|
||||
acquisition->set_local_code();
|
||||
acquisition->set_state(1); // Ensure that acquisition starts at the first sample
|
||||
@ -278,5 +279,4 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ValidationOfResults)
|
||||
|
||||
EXPECT_LE(doppler_error_hz, 200) << "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";
|
||||
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ TEST_F(FirFilterTest, ConnectAndRun)
|
||||
{
|
||||
int fs_in = 4000000;
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
top_block = gr::make_top_block("Fir filter test");
|
||||
|
||||
init();
|
||||
@ -207,7 +207,7 @@ TEST_F(FirFilterTest, ConnectAndRun)
|
||||
TEST_F(FirFilterTest, ConnectAndRunGrcomplex)
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
top_block = gr::make_top_block("Fir filter test");
|
||||
|
||||
init();
|
||||
@ -248,7 +248,7 @@ TEST_F(FirFilterTest, ConnectAndRunGrcomplex)
|
||||
TEST_F(FirFilterTest, ConnectAndRunCshorts)
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
top_block = gr::make_top_block("Fir filter test");
|
||||
|
||||
init();
|
||||
@ -293,7 +293,7 @@ TEST_F(FirFilterTest, ConnectAndRunCshorts)
|
||||
TEST_F(FirFilterTest, ConnectAndRunCbytes)
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
top_block = gr::make_top_block("Fir filter test");
|
||||
|
||||
init();
|
||||
@ -337,7 +337,7 @@ TEST_F(FirFilterTest, ConnectAndRunCbytes)
|
||||
TEST_F(FirFilterTest, ConnectAndRunCbyteGrcomplex)
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
top_block = gr::make_top_block("Fir filter test");
|
||||
|
||||
init();
|
||||
|
@ -450,7 +450,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
|
||||
}
|
||||
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
|
||||
configure_receiver();
|
||||
|
||||
|
@ -48,7 +48,7 @@ TEST(DirectResamplerConditionerCcTest, InstantiationAndRunTest)
|
||||
double fs_in = 8000000.0; // Input sampling frequency in Hz
|
||||
double fs_out = 4000000.0; // sampling freuqncy of the resampled signal in Hz
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
int nsamples = 1000000; //Number of samples to be computed
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
gr::top_block_sptr top_block = gr::make_top_block("direct_resampler_conditioner_cc_test");
|
||||
|
@ -342,7 +342,7 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults)
|
||||
}
|
||||
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
|
||||
configure_receiver();
|
||||
|
||||
|
@ -50,20 +50,20 @@ void run_correlator_cpu(cpu_multicorrelator* correlator,
|
||||
int correlation_size)
|
||||
{
|
||||
for(int k = 0; k < FLAGS_cpu_multicorrelator_iterations_test; k++)
|
||||
{
|
||||
correlator->Carrier_wipeoff_multicorrelator_resampler(d_rem_carrier_phase_rad,
|
||||
d_carrier_phase_step_rad,
|
||||
d_code_phase_step_chips,
|
||||
d_rem_code_phase_chips,
|
||||
correlation_size);
|
||||
}
|
||||
{
|
||||
correlator->Carrier_wipeoff_multicorrelator_resampler(d_rem_carrier_phase_rad,
|
||||
d_carrier_phase_step_rad,
|
||||
d_code_phase_step_chips,
|
||||
d_rem_code_phase_chips,
|
||||
correlation_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TEST(CpuMulticorrelatorTest, MeasureExecutionTime)
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
int max_threads = FLAGS_cpu_multicorrelator_max_threads_test;
|
||||
std::vector<std::thread> thread_pool;
|
||||
cpu_multicorrelator* correlator_pool[max_threads];
|
||||
|
@ -98,10 +98,8 @@ void GalileoE1DllPllVemlTrackingInternalTest::init()
|
||||
}
|
||||
|
||||
|
||||
|
||||
TEST_F(GalileoE1DllPllVemlTrackingInternalTest, Instantiate)
|
||||
{
|
||||
|
||||
init();
|
||||
auto tracking = factory->GetBlock(config, "Tracking", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1);
|
||||
EXPECT_STREQ("Galileo_E1_DLL_PLL_VEML_Tracking", tracking->implementation().c_str());
|
||||
@ -113,7 +111,7 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ConnectAndRun)
|
||||
int fs_in = 8000000;
|
||||
int nsamples = 40000000;
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
init();
|
||||
queue = gr::msg_queue::make(0);
|
||||
top_block = gr::make_top_block("Tracking test");
|
||||
@ -154,11 +152,10 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ConnectAndRun)
|
||||
}
|
||||
|
||||
|
||||
|
||||
TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ValidationOfResults)
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
// int num_samples = 40000000; // 4 Msps
|
||||
// unsigned int skiphead_sps = 24000000; // 4 Msps
|
||||
int num_samples = 80000000; // 8 Msps
|
||||
|
@ -99,10 +99,11 @@ void GalileoE5aTrackingTest::init()
|
||||
config->set_property("Tracking_Galileo.ti_ms", "1");
|
||||
}
|
||||
|
||||
|
||||
TEST_F(GalileoE5aTrackingTest, ValidationOfResults)
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
int fs_in = 32000000;
|
||||
int nsamples = 32000000*5;
|
||||
init();
|
||||
|
@ -31,7 +31,6 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <chrono>
|
||||
#include <iostream>
|
||||
#include <unistd.h>
|
||||
#include <armadillo>
|
||||
@ -75,11 +74,13 @@ public:
|
||||
~GpsL1CADllPllTrackingTest_msg_rx(); //!< Default destructor
|
||||
};
|
||||
|
||||
|
||||
GpsL1CADllPllTrackingTest_msg_rx_sptr GpsL1CADllPllTrackingTest_msg_rx_make()
|
||||
{
|
||||
return GpsL1CADllPllTrackingTest_msg_rx_sptr(new GpsL1CADllPllTrackingTest_msg_rx());
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CADllPllTrackingTest_msg_rx::msg_handler_events(pmt::pmt_t msg)
|
||||
{
|
||||
try
|
||||
@ -94,6 +95,7 @@ void GpsL1CADllPllTrackingTest_msg_rx::msg_handler_events(pmt::pmt_t msg)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GpsL1CADllPllTrackingTest_msg_rx::GpsL1CADllPllTrackingTest_msg_rx() :
|
||||
gr::block("GpsL1CADllPllTrackingTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0))
|
||||
{
|
||||
@ -102,16 +104,15 @@ GpsL1CADllPllTrackingTest_msg_rx::GpsL1CADllPllTrackingTest_msg_rx() :
|
||||
rx_message = 0;
|
||||
}
|
||||
|
||||
|
||||
GpsL1CADllPllTrackingTest_msg_rx::~GpsL1CADllPllTrackingTest_msg_rx()
|
||||
{}
|
||||
|
||||
|
||||
// ###########################################################
|
||||
|
||||
|
||||
class GpsL1CADllPllTrackingTest: public ::testing::Test
|
||||
{
|
||||
|
||||
public:
|
||||
std::string generator_binary;
|
||||
std::string p1;
|
||||
@ -352,10 +353,10 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
|
||||
configure_generator();
|
||||
|
||||
// Generate signal raw signal samples and observations RINEX file
|
||||
if (FLAGS_disable_generator==false)
|
||||
{
|
||||
generate_signal();
|
||||
}
|
||||
if (FLAGS_disable_generator == false)
|
||||
{
|
||||
generate_signal();
|
||||
}
|
||||
|
||||
struct timeval tv;
|
||||
long long int begin = 0;
|
||||
@ -425,7 +426,6 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
|
||||
|
||||
tracking->start_tracking();
|
||||
|
||||
|
||||
EXPECT_NO_THROW( {
|
||||
gettimeofday(&tv, NULL);
|
||||
begin = tv.tv_sec * 1000000 + tv.tv_usec;
|
||||
|
@ -448,7 +448,7 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga)
|
||||
//generate_signal();
|
||||
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
|
||||
configure_receiver();
|
||||
|
||||
|
@ -70,11 +70,13 @@ public:
|
||||
|
||||
};
|
||||
|
||||
|
||||
GpsL2MDllPllTrackingTest_msg_rx_sptr GpsL2MDllPllTrackingTest_msg_rx_make()
|
||||
{
|
||||
return GpsL2MDllPllTrackingTest_msg_rx_sptr(new GpsL2MDllPllTrackingTest_msg_rx());
|
||||
}
|
||||
|
||||
|
||||
void GpsL2MDllPllTrackingTest_msg_rx::msg_handler_events(pmt::pmt_t msg)
|
||||
{
|
||||
try
|
||||
@ -89,6 +91,7 @@ void GpsL2MDllPllTrackingTest_msg_rx::msg_handler_events(pmt::pmt_t msg)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GpsL2MDllPllTrackingTest_msg_rx::GpsL2MDllPllTrackingTest_msg_rx() :
|
||||
gr::block("GpsL2MDllPllTrackingTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0))
|
||||
{
|
||||
@ -97,13 +100,13 @@ GpsL2MDllPllTrackingTest_msg_rx::GpsL2MDllPllTrackingTest_msg_rx() :
|
||||
rx_message = 0;
|
||||
}
|
||||
|
||||
|
||||
GpsL2MDllPllTrackingTest_msg_rx::~GpsL2MDllPllTrackingTest_msg_rx()
|
||||
{}
|
||||
|
||||
|
||||
// ###########################################################
|
||||
|
||||
|
||||
class GpsL2MDllPllTrackingTest: public ::testing::Test
|
||||
{
|
||||
protected:
|
||||
@ -152,7 +155,7 @@ void GpsL2MDllPllTrackingTest::init()
|
||||
TEST_F(GpsL2MDllPllTrackingTest, ValidationOfResults)
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
int fs_in = 5000000;
|
||||
int nsamples = fs_in*9;
|
||||
|
||||
|
@ -66,7 +66,7 @@ void run_correlator_gpu(cuda_multicorrelator* correlator,
|
||||
TEST(GpuMulticorrelatorTest, MeasureExecutionTime)
|
||||
{
|
||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||
std::chrono::duration<double> elapsed_seconds;
|
||||
std::chrono::duration<double> elapsed_seconds(0);
|
||||
int max_threads = FLAGS_gpu_multicorrelator_max_threads_test;
|
||||
std::vector<std::thread> thread_pool;
|
||||
cuda_multicorrelator* correlator_pool[max_threads];
|
||||
|
Loading…
Reference in New Issue
Block a user