From f2f4488594f21b83ed9d717a250fd61b93a356ca Mon Sep 17 00:00:00 2001 From: Thomas Stauber <48206725+ThomasRigi@users.noreply.github.com> Date: Mon, 19 Aug 2024 17:14:12 +0200 Subject: [PATCH] drivers/gps: publish secondary instance satellite_info if main instance is advertised --- src/drivers/gps/gps.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/drivers/gps/gps.cpp b/src/drivers/gps/gps.cpp index c1dd783be0..004be4cc8b 100644 --- a/src/drivers/gps/gps.cpp +++ b/src/drivers/gps/gps.cpp @@ -1214,11 +1214,13 @@ GPS::publish() void GPS::publishSatelliteInfo() { - if (_instance == Instance::Main) { + if (_instance == Instance::Main || _is_gps_main_advertised.load()) { if (_p_report_sat_info != nullptr) { _report_sat_info_pub.publish(*_p_report_sat_info); } + _is_gps_main_advertised.store(true); + } else { //we don't publish satellite info for the secondary gps }