mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2026-04-28 01:31:25 +00:00
Improve reporting of TTFF
This commit is contained in:
@@ -2423,20 +2423,32 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
|
||||
|
||||
if (d_first_fix == true)
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss << "First position fix at ";
|
||||
if (d_show_local_time_zone)
|
||||
{
|
||||
const boost::posix_time::ptime time_first_solution = d_user_pvt_solver->get_position_UTC_time() + d_utc_diff_time;
|
||||
std::cout << "First position fix at " << time_first_solution << d_local_time_str;
|
||||
ss << time_first_solution << d_local_time_str;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "First position fix at " << d_user_pvt_solver->get_position_UTC_time() << " UTC";
|
||||
ss << d_user_pvt_solver->get_position_UTC_time() << " UTC";
|
||||
}
|
||||
std::cout << " is Lat = " << d_user_pvt_solver->get_latitude() << " [deg], Long = " << d_user_pvt_solver->get_longitude()
|
||||
<< " [deg], Height= " << d_user_pvt_solver->get_height() << " [m]\n";
|
||||
ss << " is Lat = " << d_user_pvt_solver->get_latitude()
|
||||
<< " [deg], Long = " << d_user_pvt_solver->get_longitude()
|
||||
<< " [deg], Height = " << d_user_pvt_solver->get_height()
|
||||
<< " [m], with GDOP = " << d_user_pvt_solver->get_gdop();
|
||||
std::cout << ss.str() << std::endl;
|
||||
d_end = std::chrono::system_clock::now();
|
||||
std::chrono::duration<double> elapsed_seconds = d_end - d_start;
|
||||
double ttff = elapsed_seconds.count();
|
||||
ss << "\nTime to First Fix: " << ttff << " [s] (wall clock)\n";
|
||||
if (d_nmea_output_file_enabled)
|
||||
{
|
||||
ss << "\nFirst NMEA message: " << d_nmea_printer->get_GPGGA(d_user_pvt_solver.get());
|
||||
}
|
||||
LOG(INFO) << ss.str();
|
||||
|
||||
send_ttff_msg(ttff);
|
||||
d_first_fix = false;
|
||||
}
|
||||
|
||||
@@ -438,3 +438,23 @@ std::string Nmea_Printer::get_GPGGA() const
|
||||
return sentence_str.str();
|
||||
// $GPGGA,104427.591,5920.7009,N,01803.2938,E,1,05,3.3,78.2,M,23.2,M,0.0,0000*4A
|
||||
}
|
||||
|
||||
|
||||
std::string Nmea_Printer::get_GPGGA(const Rtklib_Solver* const pvt_data) const
|
||||
{
|
||||
std::stringstream sentence_str;
|
||||
std::array<unsigned char, 1024> buff{};
|
||||
outnmea_gga(buff.data(), &pvt_data->pvt_sol);
|
||||
sentence_str << buff.data();
|
||||
return sentence_str.str();
|
||||
}
|
||||
|
||||
|
||||
std::string Nmea_Printer::get_GPGSA(const Rtklib_Solver* const pvt_data) const
|
||||
{
|
||||
std::stringstream sentence_str;
|
||||
std::array<unsigned char, 1024> buff{};
|
||||
outnmea_gsa(buff.data(), &pvt_data->pvt_sol, pvt_data->pvt_ssat.data());
|
||||
sentence_str << buff.data();
|
||||
return sentence_str.str();
|
||||
}
|
||||
@@ -59,6 +59,16 @@ public:
|
||||
*/
|
||||
bool Print_Nmea_Line(const Rtklib_Solver* const pvt_data);
|
||||
|
||||
/*!
|
||||
* \brief Returns GPGGA message (fix data)
|
||||
*/
|
||||
std::string get_GPGGA(const Rtklib_Solver* const pvt_data) const;
|
||||
|
||||
/*!
|
||||
* \brief Returns GPGSA message (overall satellite reception data)
|
||||
*/
|
||||
std::string get_GPGSA(const Rtklib_Solver* const pvt_data) const;
|
||||
|
||||
private:
|
||||
int init_serial(const std::string& serial_device); // serial port control
|
||||
void close_serial() const;
|
||||
|
||||
Reference in New Issue
Block a user