From 8019f067e6c85182b3c029efac5f89e823d2c734 Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Mon, 2 Oct 2023 10:23:58 +0200 Subject: [PATCH] Adding Galileo HAS status output to PVT monitor --- docs/protobuf/monitor_pvt.proto | 2 ++ src/algorithms/PVT/libs/monitor_pvt.h | 3 +++ src/algorithms/PVT/libs/rtklib_solver.cc | 10 ++++++++++ src/algorithms/PVT/libs/serdes_monitor_pvt.h | 2 ++ 4 files changed, 17 insertions(+) diff --git a/docs/protobuf/monitor_pvt.proto b/docs/protobuf/monitor_pvt.proto index f5037ce99..3e8e46df9 100644 --- a/docs/protobuf/monitor_pvt.proto +++ b/docs/protobuf/monitor_pvt.proto @@ -49,4 +49,6 @@ double vel_n = 32; // Velocity North component in the local frame, in m/s double vel_u = 33; // Velocity Up component in the local frame, in m/s double cog = 34; // Course Over Ground (cog) [deg] + +uint32 galhas_status = 35; // Galileo HAS status: 1- HAS messages decoded and applied, 0 - HAS not avaliable } diff --git a/src/algorithms/PVT/libs/monitor_pvt.h b/src/algorithms/PVT/libs/monitor_pvt.h index 8526a5191..97be9e0a4 100644 --- a/src/algorithms/PVT/libs/monitor_pvt.h +++ b/src/algorithms/PVT/libs/monitor_pvt.h @@ -72,6 +72,9 @@ public: // Course Over Ground (COG) [deg] double cog; + // Galileo HAS status: 1- HAS messages decoded and applied, 0 - HAS not avaliable + uint32_t galhas_status; + // NUMBER OF VALID SATS uint8_t valid_sats; // RTKLIB solution status diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 2f9f5d9e1..faf8af5f0 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -1688,6 +1688,16 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ // Course Over Ground (cog) [deg] d_monitor_pvt.cog = new_cog; + // Galileo HAS status: 1- HAS messages decoded and applied, 0 - HAS not avaliable + if (d_has_obs_corr_map.empty()) + { + d_monitor_pvt.galhas_status = 0; + } + else + { + d_monitor_pvt.galhas_status = 1; + } + const double clock_drift_ppm = pvt_sol.dtr[5] / SPEED_OF_LIGHT_M_S * 1e6; this->set_clock_drift_ppm(clock_drift_ppm); diff --git a/src/algorithms/PVT/libs/serdes_monitor_pvt.h b/src/algorithms/PVT/libs/serdes_monitor_pvt.h index 4eed61843..e03d06b72 100644 --- a/src/algorithms/PVT/libs/serdes_monitor_pvt.h +++ b/src/algorithms/PVT/libs/serdes_monitor_pvt.h @@ -117,6 +117,7 @@ public: monitor_.set_vel_n(monitor->vel_n); monitor_.set_vel_u(monitor->vel_u); monitor_.set_cog(monitor->cog); + monitor_.set_galhas_status(monitor->galhas_status); monitor_.SerializeToString(&data); return data; } @@ -159,6 +160,7 @@ public: monitor.vel_n = mon.vel_n(); monitor.vel_u = mon.vel_u(); monitor.cog = mon.cog(); + monitor.galhas_status = mon.galhas_status(); return monitor; }