From fa55a5b0b6c55f03453c29d0bc4ff18aea1917bd Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 2 Jun 2022 21:51:06 +0200 Subject: [PATCH] Fix Galileo time when reading from XML ephemeris --- src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc | 9 +++++++++ src/core/libs/gnss_sdr_supl_client.cc | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc index b6efdeebc..1c46f3d92 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_gs.cc @@ -651,6 +651,11 @@ rtklib_pvt_gs::~rtklib_pvt_gs() { ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); boost::archive::xml_oarchive xml(ofs); + // Annotate as full GPS week number + for (auto& gal_eph_iter : d_internal_pvt_solver->galileo_ephemeris_map) + { + gal_eph_iter.second.WN += 1024; + } xml << boost::serialization::make_nvp("GNSS-SDR_gal_ephemeris_map", d_internal_pvt_solver->galileo_ephemeris_map); LOG(INFO) << "Saved Galileo E1 Ephemeris map data"; } @@ -2049,6 +2054,10 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item store_valid_observable = true; } } + if (std::string(in[i][epoch].Signal) == std::string("E6")) + { + store_valid_observable = true; + } if (store_valid_observable) { diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc index e079b0a9f..e2e9a3c73 100644 --- a/src/core/libs/gnss_sdr_supl_client.cc +++ b/src/core/libs/gnss_sdr_supl_client.cc @@ -414,6 +414,11 @@ bool Gnss_Sdr_Supl_Client::load_gal_ephemeris_xml(const std::string& file_name) gal_ephemeris_map.clear(); xml >> boost::serialization::make_nvp("GNSS-SDR_gal_ephemeris_map", this->gal_ephemeris_map); LOG(INFO) << "Loaded Ephemeris map data with " << this->gal_ephemeris_map.size() << " satellites"; + // Convert to full GPS week number + for (auto& gal_eph_iter : this->gal_ephemeris_map) + { + gal_eph_iter.second.WN -= 1024; + } } catch (std::exception& e) {