From 99952f62753fd3d108b455696b9d88704b2114a9 Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Tue, 3 Oct 2023 12:41:22 +0200 Subject: [PATCH] Adding PVT flag to enable or disable the log INFO position geohash output --- docs/CHANGELOG.md | 3 ++- src/algorithms/PVT/adapters/rtklib_pvt.cc | 3 +++ .../PVT/gnuradio_blocks/rtklib_pvt_gs.cc | 16 ++++++++++------ .../PVT/gnuradio_blocks/rtklib_pvt_gs.h | 1 + src/algorithms/PVT/libs/pvt_conf.h | 1 + 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index c56d240b6..bdf31d228 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -15,7 +15,8 @@ All notable changes to GNSS-SDR will be documented in this file. ## [Unreleased](https://github.com/gnss-sdr/gnss-sdr/tree/next) ### Improvements in Interoperability: - +- Added a new PVT configuration boolean flag (`flag_geohash_log_out`) that enables or disables the + Position Geohash tag output in INFO log files. Set to `false` by default. - New fields have been added to the custom output stream defined by `monitor_pvt.proto`: `utc_time` (a [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) datetime string), velocity diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index 9bf6174ab..a831ea2b2 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -74,6 +74,9 @@ Rtklib_Pvt::Rtklib_Pvt(const ConfigurationInterface* configuration, // display rate pvt_output_parameters.display_rate_ms = bc::lcm(pvt_output_parameters.output_rate_ms, configuration->property(role + ".display_rate_ms", 500)); + // log options + pvt_output_parameters.flag_geohash_log_out = configuration->property(role + ".flag_geohash_log_out", false); + // PVT KF settings pvt_output_parameters.enable_pvt_kf = configuration->property(role + ".enable_pvt_kf", false); pvt_output_parameters.measures_ecef_pos_sd_m = configuration->property(role + ".kf_measures_ecef_pos_sd_m", 1.0); diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index f39ff0867..b692fbea8 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -179,7 +179,8 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, d_an_printer_enabled(conf_.an_output_enabled), d_log_timetag(conf_.log_source_timetag), d_use_has_corrections(conf_.use_has_corrections), - d_use_unhealthy_sats(conf_.use_unhealthy_sats) + d_use_unhealthy_sats(conf_.use_unhealthy_sats), + d_flag_geohash_log_out(conf_.flag_geohash_log_out) { // Send feedback message to observables block with the receiver clock offset this->message_port_register_out(pmt::mp("pvt_to_observables")); @@ -2427,14 +2428,17 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item // p_time += boost::posix_time::microseconds(round(rtklib_utc_time.sec * 1e6)); // std::cout << TEXT_MAGENTA << "Observable RX time (GPST) " << boost::posix_time::to_simple_string(p_time) << TEXT_RESET << '\n'; - LOG(INFO) << "Position at " << boost::posix_time::to_simple_string(d_user_pvt_solver->get_position_UTC_time()) - << " UTC using " << d_user_pvt_solver->get_num_valid_observations() << " observations 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]"; - LOG(INFO) << "geohash=" << d_geohash->encode(d_user_pvt_solver->get_latitude(), d_user_pvt_solver->get_longitude()); - /* std::cout << "Dilution of Precision at " << boost::posix_time::to_simple_string(d_user_pvt_solver->get_position_UTC_time()) + if (d_flag_geohash_log_out == true) + { + LOG(INFO) << "Position at " << boost::posix_time::to_simple_string(d_user_pvt_solver->get_position_UTC_time()) + << " UTC using " << d_user_pvt_solver->get_num_valid_observations() << " observations 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]"; + LOG(INFO) << "geohash=" << d_geohash->encode(d_user_pvt_solver->get_latitude(), d_user_pvt_solver->get_longitude()); + /* std::cout << "Dilution of Precision at " << boost::posix_time::to_simple_string(d_user_pvt_solver->get_position_UTC_time()) << " UTC using "<< d_user_pvt_solver->get_num_valid_observations() <<" observations is HDOP = " << d_user_pvt_solver->get_hdop() << " VDOP = " << d_user_pvt_solver->get_vdop() << " GDOP = " << d_user_pvt_solver->get_gdop() << '\n'; */ + } } // PVT MONITOR diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h index 83d1f830d..f6ad8b117 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h @@ -278,6 +278,7 @@ private: bool d_log_timetag; bool d_use_has_corrections; bool d_use_unhealthy_sats; + bool d_flag_geohash_log_out; }; diff --git a/src/algorithms/PVT/libs/pvt_conf.h b/src/algorithms/PVT/libs/pvt_conf.h index bf4a3501a..ce4c8d7ac 100644 --- a/src/algorithms/PVT/libs/pvt_conf.h +++ b/src/algorithms/PVT/libs/pvt_conf.h @@ -70,6 +70,7 @@ public: uint16_t rtcm_tcp_port = 0; uint16_t rtcm_station_id = 0; + bool flag_geohash_log_out = false; bool flag_nmea_tty_port = false; bool flag_rtcm_server = false; bool flag_rtcm_tty_port = false;