From 4fa793b3cd7c43feaa40508091496a1dbdec2470 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 13 Sep 2022 17:19:52 +0200 Subject: [PATCH] Add PVT.use_e6_for_pvt parameter, by default to true. If set to false, E6 observables are not injected in the PVT engine --- src/algorithms/PVT/adapters/rtklib_pvt.cc | 4 +++- .../PVT/gnuradio_blocks/rtklib_pvt_gs.cc | 9 +++++---- src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h | 1 + src/algorithms/PVT/libs/pvt_conf.cc | 2 +- src/algorithms/PVT/libs/pvt_conf.h | 3 ++- src/algorithms/PVT/libs/rtklib_solver.cc | 14 ++++++++------ src/algorithms/PVT/libs/rtklib_solver.h | 4 +++- 7 files changed, 23 insertions(+), 14 deletions(-) diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index ccc6bcfac..aa557d4a6 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -867,11 +867,13 @@ Rtklib_Pvt::Rtklib_Pvt(const ConfigurationInterface* configuration, // Set maximum clock offset allowed if pvt_output_parameters.enable_rx_clock_correction = false pvt_output_parameters.max_obs_block_rx_clock_offset_ms = configuration->property(role + ".max_clock_offset_ms", pvt_output_parameters.max_obs_block_rx_clock_offset_ms); - // Source timetag pvt_output_parameters.log_source_timetag = configuration->property(role + ".log_timetag", pvt_output_parameters.log_source_timetag); pvt_output_parameters.log_source_timetag_file = configuration->property(role + ".log_source_timetag_file", pvt_output_parameters.log_source_timetag_file); + // Use E6 for PVT + pvt_output_parameters.use_e6_for_pvt = configuration->property(role + ".use_e6_for_pvt", pvt_output_parameters.use_e6_for_pvt); + // make PVT object pvt_ = rtklib_make_pvt_gs(in_streams_, pvt_output_parameters, rtk); DLOG(INFO) << "pvt(" << pvt_->unique_id() << ")"; diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index b4c87afd9..61f141ee8 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -175,7 +175,8 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, d_show_local_time_zone(conf_.show_local_time_zone), d_enable_rx_clock_correction(conf_.enable_rx_clock_correction), d_an_printer_enabled(conf_.an_output_enabled), - d_log_timetag(conf_.log_source_timetag) + d_log_timetag(conf_.log_source_timetag), + d_use_e6_for_pvt(conf_.use_e6_for_pvt) { // Send feedback message to observables block with the receiver clock offset this->message_port_register_out(pmt::mp("pvt_to_observables")); @@ -530,21 +531,21 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels, { // setup two PVT solvers: internal solver for rx clock and user solver // user PVT solver - d_user_pvt_solver = std::make_shared(rtk, dump_ls_pvt_filename, d_type_of_rx, d_dump, d_dump_mat); + d_user_pvt_solver = std::make_shared(rtk, dump_ls_pvt_filename, d_type_of_rx, d_dump, d_dump_mat, d_use_e6_for_pvt); d_user_pvt_solver->set_averaging_depth(1); d_user_pvt_solver->set_pre_2009_file(conf_.pre_2009_file); // internal PVT solver, mainly used to estimate the receiver clock rtk_t internal_rtk = rtk; internal_rtk.opt.mode = PMODE_SINGLE; // use single positioning mode in internal PVT solver - d_internal_pvt_solver = std::make_shared(internal_rtk, dump_ls_pvt_filename, d_type_of_rx, false, false); + d_internal_pvt_solver = std::make_shared(internal_rtk, dump_ls_pvt_filename, d_type_of_rx, false, false, d_use_e6_for_pvt); d_internal_pvt_solver->set_averaging_depth(1); d_internal_pvt_solver->set_pre_2009_file(conf_.pre_2009_file); } else { // only one solver, customized by the user options - d_internal_pvt_solver = std::make_shared(rtk, dump_ls_pvt_filename, d_type_of_rx, d_dump, d_dump_mat); + d_internal_pvt_solver = std::make_shared(rtk, dump_ls_pvt_filename, d_type_of_rx, d_dump, d_dump_mat, d_use_e6_for_pvt); d_internal_pvt_solver->set_averaging_depth(1); d_internal_pvt_solver->set_pre_2009_file(conf_.pre_2009_file); d_user_pvt_solver = d_internal_pvt_solver; diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h index 61a00eb3d..cb8a2053b 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.h @@ -288,6 +288,7 @@ private: bool d_enable_has_messages; bool d_an_printer_enabled; bool d_log_timetag; + bool d_use_e6_for_pvt; }; diff --git a/src/algorithms/PVT/libs/pvt_conf.cc b/src/algorithms/PVT/libs/pvt_conf.cc index 16c325b0d..bf16f469e 100644 --- a/src/algorithms/PVT/libs/pvt_conf.cc +++ b/src/algorithms/PVT/libs/pvt_conf.cc @@ -59,6 +59,7 @@ Pvt_Conf::Pvt_Conf() kml_output_path = std::string("."); xml_output_path = std::string("."); rtcm_output_file_path = std::string("."); + log_source_timetag_file = "PVT_timetag.dat"; enable_rx_clock_correction = true; monitor_enabled = false; @@ -70,5 +71,4 @@ Pvt_Conf::Pvt_Conf() show_local_time_zone = false; log_source_timetag = false; - log_source_timetag_file = "PVT_timetag.dat"; } diff --git a/src/algorithms/PVT/libs/pvt_conf.h b/src/algorithms/PVT/libs/pvt_conf.h index 5ba9bf710..34852c9c8 100644 --- a/src/algorithms/PVT/libs/pvt_conf.h +++ b/src/algorithms/PVT/libs/pvt_conf.h @@ -48,6 +48,7 @@ public: std::string rtcm_output_file_path = std::string("."); std::string udp_addresses; std::string udp_eph_addresses; + std::string log_source_timetag_file; uint32_t type_of_receiver = 0; uint32_t observable_interval_ms = 20; @@ -90,7 +91,7 @@ public: bool dump = false; bool dump_mat = true; bool log_source_timetag; - std::string log_source_timetag_file; + bool use_e6_for_pvt = true; }; diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index f84b3506b..fe3a5bcd7 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -47,11 +47,13 @@ Rtklib_Solver::Rtklib_Solver(const rtk_t &rtk, const std::string &dump_filename, uint32_t type_of_rx, bool flag_dump_to_file, - bool flag_dump_to_mat) : d_dump_filename(dump_filename), - d_rtk(rtk), - d_type_of_rx(type_of_rx), - d_flag_dump_enabled(flag_dump_to_file), - d_flag_dump_mat_enabled(flag_dump_to_mat) + bool flag_dump_to_mat, + bool use_e6_for_pvt) : d_dump_filename(dump_filename), + d_rtk(rtk), + d_type_of_rx(type_of_rx), + d_flag_dump_enabled(flag_dump_to_file), + d_flag_dump_mat_enabled(flag_dump_to_mat), + d_use_e6_for_pvt(use_e6_for_pvt) { this->set_averaging_flag(false); @@ -585,7 +587,7 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN; } } - if (sig_ == "E6") + if (sig_ == "E6" && d_use_e6_for_pvt) { galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); if (galileo_ephemeris_iter != galileo_ephemeris_map.cend()) diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h index 2e7fc8010..22d20ba2f 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.h +++ b/src/algorithms/PVT/libs/rtklib_solver.h @@ -80,7 +80,8 @@ public: const std::string& dump_filename, uint32_t type_of_rx, bool flag_dump_to_file, - bool flag_dump_to_mat); + bool flag_dump_to_mat, + bool use_e6_for_pvt = true); ~Rtklib_Solver(); bool get_PVT(const std::map& gnss_observables_map, bool flag_averaging); @@ -133,6 +134,7 @@ private: uint32_t d_type_of_rx; bool d_flag_dump_enabled; bool d_flag_dump_mat_enabled; + bool d_use_e6_for_pvt; };