1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-13 19:50:34 +00:00

Add receiver runtime to position_test report

This commit is contained in:
Carles Fernandez 2019-10-27 13:12:06 +01:00
parent e0ef72eb75
commit b40fc39aaf
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -101,6 +101,9 @@ private:
std::shared_ptr<InMemoryConfiguration> config;
std::shared_ptr<FileConfiguration> config_f;
std::string generated_kml_file;
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
};
@ -353,6 +356,7 @@ int PositionSystemTest::run_receiver()
control_thread = std::make_shared<ControlThread>(config_f);
}
start = std::chrono::system_clock::now();
// start receiver
try
{
@ -366,7 +370,7 @@ int PositionSystemTest::run_receiver()
{
std::cout << "STD exception: " << ex.what();
}
end = std::chrono::system_clock::now();
// Get the name of the KML file generated by the receiver
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
FILE* fp;
@ -561,6 +565,8 @@ void PositionSystemTest::check_results()
double static_2D_error_m = sqrt(pow(arma::mean(error_east_m), 2.0) + pow(arma::mean(error_north_m), 2.0));
double static_3D_error_m = sqrt(pow(arma::mean(error_east_m), 2.0) + pow(arma::mean(error_north_m), 2.0) + pow(arma::mean(error_up_m), 2.0));
std::chrono::duration<double> elapsed_seconds = end - start;
std::stringstream stm;
std::ofstream position_test_file;
if (!FLAGS_config_file_ptest.empty())
@ -588,6 +594,9 @@ void PositionSystemTest::check_results()
stm << "90% SAS = " << 0.833 * (sigma_E_2_precision + sigma_N_2_precision + sigma_U_2_precision) << " [m]" << std::endl;
stm << "MRSE = " << sqrt(sigma_E_2_precision + sigma_N_2_precision + sigma_U_2_precision) << " [m]" << std::endl;
stm << "SEP = " << 0.51 * (sigma_E_2_precision + sigma_N_2_precision + sigma_U_2_precision) << " [m]" << std::endl;
stm << std::endl;
stm << "Receiver runtime: " << elapsed_seconds.count() << " [seconds]" << std::endl;
std::cout << stm.rdbuf();
std::string output_filename = "position_test_output_" + PositionSystemTest::generated_kml_file.erase(PositionSystemTest::generated_kml_file.length() - 3, 3) + "txt";