mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:49:12 +08:00
drivers/gps: publish secondary instance satellite_info if main instance is advertised
This commit is contained in:
@@ -1214,11 +1214,13 @@ GPS::publish()
|
|||||||
void
|
void
|
||||||
GPS::publishSatelliteInfo()
|
GPS::publishSatelliteInfo()
|
||||||
{
|
{
|
||||||
if (_instance == Instance::Main) {
|
if (_instance == Instance::Main || _is_gps_main_advertised.load()) {
|
||||||
if (_p_report_sat_info != nullptr) {
|
if (_p_report_sat_info != nullptr) {
|
||||||
_report_sat_info_pub.publish(*_p_report_sat_info);
|
_report_sat_info_pub.publish(*_p_report_sat_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_is_gps_main_advertised.store(true);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//we don't publish satellite info for the secondary gps
|
//we don't publish satellite info for the secondary gps
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user