Browse Source

AP_GPS: always send GPS2_RAW if 2nd GPS configured

this improves the display on the GCS when the GPS has not yet been
found. This is particularly important after a reboot, as otherwise the
GCS may display stale information from the previous boot
zr-v5.1
Andrew Tridgell 4 years ago committed by Peter Barker
parent
commit
e995a198bd
  1. 7
      libraries/AP_GPS/AP_GPS.cpp
  2. 3
      libraries/AP_GPS/AP_GPS.h

7
libraries/AP_GPS/AP_GPS.cpp

@ -665,9 +665,6 @@ found_gps: @@ -665,9 +665,6 @@ found_gps:
timing[instance].last_message_time_ms = now;
timing[instance].delta_time_ms = GPS_TIMEOUT_MS;
new_gps->broadcast_gps_type();
if (instance == 1) {
has_had_second_instance = true;
}
}
}
@ -1186,8 +1183,8 @@ void AP_GPS::send_mavlink_gps_raw(mavlink_channel_t chan) @@ -1186,8 +1183,8 @@ void AP_GPS::send_mavlink_gps_raw(mavlink_channel_t chan)
#if GPS_MAX_RECEIVERS > 1
void AP_GPS::send_mavlink_gps2_raw(mavlink_channel_t chan)
{
// always send the message once we've ever seen the GPS
if (!has_had_second_instance) {
// always send the message if 2nd GPS is configured
if (_type[1] == GPS_TYPE_NONE) {
return;
}

3
libraries/AP_GPS/AP_GPS.h

@ -659,9 +659,6 @@ private: @@ -659,9 +659,6 @@ private:
// used for flight testing with GPS yaw loss
bool _force_disable_gps_yaw;
// used to ensure we continue sending status messages if we ever detected the second GPS
bool has_had_second_instance;
};
namespace AP {

Loading…
Cancel
Save