mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-16 12:12:57 +00:00
Now the Time-To-First-Fix test accepts a configuration file as a parameter
$ ttff --config_file_ttff=./my_configuration_file.conf
This commit is contained in:
commit
45545f7fb0
@ -59,7 +59,7 @@ DEFINE_int32(max_measurement_duration, 90, "Maximum time waiting for a position
|
|||||||
DEFINE_int32(num_measurements, 2, "Number of measurements");
|
DEFINE_int32(num_measurements, 2, "Number of measurements");
|
||||||
DEFINE_string(device_address, "192.168.40.2", "USRP device IP address");
|
DEFINE_string(device_address, "192.168.40.2", "USRP device IP address");
|
||||||
DEFINE_string(subdevice, "A:0", "USRP subdevice");
|
DEFINE_string(subdevice, "A:0", "USRP subdevice");
|
||||||
|
DEFINE_string(config_file_ttff, std::string(""), "File containing the configuration parameters for the TTFF test.");
|
||||||
|
|
||||||
// For GPS NAVIGATION (L1)
|
// For GPS NAVIGATION (L1)
|
||||||
concurrent_queue<Gps_Acq_Assist> global_gps_acq_assist_queue;
|
concurrent_queue<Gps_Acq_Assist> global_gps_acq_assist_queue;
|
||||||
@ -238,10 +238,17 @@ void TTFF_GPS_L1_CA_Test::config_1()
|
|||||||
|
|
||||||
void TTFF_GPS_L1_CA_Test::config_2()
|
void TTFF_GPS_L1_CA_Test::config_2()
|
||||||
{
|
{
|
||||||
std::string path = std::string(TEST_PATH);
|
if(FLAGS_config_file_ttff.empty())
|
||||||
std::string filename = path + "../../conf/gnss-sdr_GPS_L1_USRP_X300_realtime.conf";
|
{
|
||||||
config2 = std::make_shared<FileConfiguration>(filename);
|
std::string path = std::string(TEST_PATH);
|
||||||
config2->set_property("SignalSource.samples", std::to_string(FLAGS_fs_in * FLAGS_max_measurement_duration));
|
std::string filename = path + "../../conf/gnss-sdr_GPS_L1_USRP_X300_realtime.conf";
|
||||||
|
config2 = std::make_shared<FileConfiguration>(filename);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
config2 = std::make_shared<FileConfiguration>(FLAGS_config_file_ttff);
|
||||||
|
}
|
||||||
|
config2->set_property("SignalSource.samples", std::to_string(FLAGS_fs_in * FLAGS_max_measurement_duration));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -470,7 +477,15 @@ TEST_F(TTFF_GPS_L1_CA_Test, ColdStart)
|
|||||||
for(int n = 0; n < FLAGS_num_measurements; n++)
|
for(int n = 0; n < FLAGS_num_measurements; n++)
|
||||||
{
|
{
|
||||||
// Create a new ControlThread object with a smart pointer
|
// Create a new ControlThread object with a smart pointer
|
||||||
std::unique_ptr<ControlThread> control_thread(new ControlThread(config));
|
std::shared_ptr<ControlThread> control_thread;
|
||||||
|
if(FLAGS_config_file_ttff.empty())
|
||||||
|
{
|
||||||
|
control_thread = std::make_shared<ControlThread>(config);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
control_thread = std::make_shared<ControlThread>(config2);
|
||||||
|
}
|
||||||
|
|
||||||
// record startup time
|
// record startup time
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
@ -516,7 +531,14 @@ TEST_F(TTFF_GPS_L1_CA_Test, ColdStart)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Print TTFF report
|
// Print TTFF report
|
||||||
print_TTFF_report(TTFF_v, config);
|
if(FLAGS_config_file_ttff.empty())
|
||||||
|
{
|
||||||
|
print_TTFF_report(TTFF_v, config);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print_TTFF_report(TTFF_v, config2);
|
||||||
|
}
|
||||||
std::this_thread::sleep_until(std::chrono::system_clock::now() + std::chrono::seconds(5)); //let the USRP some time to rest before the next test
|
std::this_thread::sleep_until(std::chrono::system_clock::now() + std::chrono::seconds(5)); //let the USRP some time to rest before the next test
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -531,11 +553,24 @@ TEST_F(TTFF_GPS_L1_CA_Test, HotStart)
|
|||||||
config->set_property("GNSS-SDR.SUPL_gps_enabled", "true");
|
config->set_property("GNSS-SDR.SUPL_gps_enabled", "true");
|
||||||
config->set_property("GNSS-SDR.SUPL_read_gps_assistance_xml", "true");
|
config->set_property("GNSS-SDR.SUPL_read_gps_assistance_xml", "true");
|
||||||
|
|
||||||
|
config_2();
|
||||||
|
// Ensure Hot Start
|
||||||
|
config2->set_property("GNSS-SDR.SUPL_gps_enabled", "true");
|
||||||
|
config2->set_property("GNSS-SDR.SUPL_read_gps_assistance_xml", "true");
|
||||||
|
config2->set_property("PVT.flag_rtcm_server", "false");
|
||||||
|
|
||||||
for(int n = 0; n < FLAGS_num_measurements; n++)
|
for(int n = 0; n < FLAGS_num_measurements; n++)
|
||||||
{
|
{
|
||||||
// Create a new ControlThread object with a smart pointer
|
// Create a new ControlThread object with a smart pointer
|
||||||
std::unique_ptr<ControlThread> control_thread(new ControlThread(config));
|
std::shared_ptr<ControlThread> control_thread;
|
||||||
|
if(FLAGS_config_file_ttff.empty())
|
||||||
|
{
|
||||||
|
control_thread = std::make_shared<ControlThread>(config);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
control_thread = std::make_shared<ControlThread>(config2);
|
||||||
|
}
|
||||||
// record startup time
|
// record startup time
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
gettimeofday(&tv, NULL);
|
gettimeofday(&tv, NULL);
|
||||||
@ -580,7 +615,14 @@ TEST_F(TTFF_GPS_L1_CA_Test, HotStart)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Print TTFF report
|
// Print TTFF report
|
||||||
print_TTFF_report(TTFF_v, config);
|
if(FLAGS_config_file_ttff.empty())
|
||||||
|
{
|
||||||
|
print_TTFF_report(TTFF_v, config);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print_TTFF_report(TTFF_v, config2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -613,7 +655,7 @@ int main(int argc, char **argv)
|
|||||||
int msgflg = IPC_CREAT | 0666;
|
int msgflg = IPC_CREAT | 0666;
|
||||||
if ((sysv_msqid = msgget(sysv_msg_key, msgflg )) == -1)
|
if ((sysv_msqid = msgget(sysv_msg_key, msgflg )) == -1)
|
||||||
{
|
{
|
||||||
std::cout<<"GNSS-SDR can not create message queues!" << std::endl;
|
std::cout << "GNSS-SDR can not create message queues!" << std::endl;
|
||||||
throw new std::exception();
|
throw new std::exception();
|
||||||
}
|
}
|
||||||
ttff_msgbuf msg;
|
ttff_msgbuf msg;
|
||||||
|
Loading…
Reference in New Issue
Block a user