From caef6acdd4fba6973ab7795e64dbc25b152498a7 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 24 Nov 2023 22:04:24 +0100 Subject: [PATCH] Adjust number of decimal places displayed in terminal --- docs/CHANGELOG.md | 5 +++++ .../PVT/gnuradio_blocks/rtklib_pvt_gs.cc | 17 ++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 162df725f..dadd11630 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -71,6 +71,11 @@ All notable changes to GNSS-SDR will be documented in this file. - The estimated CN0 value is now printed in the terminal when navigation data is succesfully decoded. - Fixed GPS navigation message satellite validation. +- Latitude and longitude are now reported in the terminal with six decimal + places (the sixth decimal place worths up to 0.11 m), instead of the + overkilling nine (the ninth decimal place worths up to 110 microns). + Similarly, height in meters is now reported with two decimal places instead of + three, and velocity in m/s also with two decimal places instead of three. ## [GNSS-SDR v0.0.18](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.18) - 2023-04-06 diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index ca63c6f31..7c14b6350 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -2403,22 +2403,17 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item std::cout << TEXT_BOLD_GREEN << "Position at " << time_solution << UTC_solution_str - << " using " << d_user_pvt_solver->get_num_valid_observations() - << std::fixed << std::setprecision(9) - << " observations is Lat = " << d_user_pvt_solver->get_latitude() << " [deg], Long = " << d_user_pvt_solver->get_longitude() - << std::fixed << std::setprecision(3) - << " [deg], Height = " << d_user_pvt_solver->get_height() << " [m]" << TEXT_RESET << '\n'; - - std::cout << std::setprecision(ss); + << " using " << d_user_pvt_solver->get_num_valid_observations() << " observations is Lat = " + << std::fixed << std::setprecision(6) << d_user_pvt_solver->get_latitude() + << " [deg], Long = " << d_user_pvt_solver->get_longitude() << " [deg], Height = " + << std::fixed << std::setprecision(2) << d_user_pvt_solver->get_height() << std::setprecision(ss) << " [m]" << TEXT_RESET << std::endl; DLOG(INFO) << "RX clock offset: " << d_user_pvt_solver->get_time_offset_s() << "[s]"; std::cout << TEXT_BOLD_GREEN - << "Velocity: " << std::fixed << std::setprecision(3) + << "Velocity: " << std::fixed << std::setprecision(2) << "East: " << d_user_pvt_solver->get_rx_vel()[0] << " [m/s], North: " << d_user_pvt_solver->get_rx_vel()[1] - << " [m/s], Up = " << d_user_pvt_solver->get_rx_vel()[2] << " [m/s]" << TEXT_RESET << '\n'; - - std::cout << std::setprecision(ss); + << " [m/s], Up = " << d_user_pvt_solver->get_rx_vel()[2] << std::setprecision(ss) << " [m/s]" << TEXT_RESET << std::endl; DLOG(INFO) << "RX clock drift: " << d_user_pvt_solver->get_clock_drift_ppm() << " [ppm]"; // boost::posix_time::ptime p_time;