From 3547e74991da3998b83b5d8db278b1798d298be2 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 8 Nov 2019 17:59:42 +1100 Subject: [PATCH] Plane: move setting of GPS SYS_STATUS bits up to base class --- ArduPlane/GCS_Plane.cpp | 8 -------- ArduPlane/GCS_Plane.h | 5 +++++ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/ArduPlane/GCS_Plane.cpp b/ArduPlane/GCS_Plane.cpp index 9fb6a665e9..b513b1d087 100644 --- a/ArduPlane/GCS_Plane.cpp +++ b/ArduPlane/GCS_Plane.cpp @@ -8,11 +8,6 @@ void GCS_Plane::update_vehicle_sensor_status_flags(void) if (airspeed && airspeed->enabled()) { control_sensors_present |= MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE; } - const AP_GPS &gps = AP::gps(); - if (gps.status() > AP_GPS::NO_GPS) { - control_sensors_present |= MAV_SYS_STATUS_SENSOR_GPS; - control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_GPS; - } #if OPTFLOW == ENABLED const OpticalFlow *optflow = AP::opticalflow(); if (optflow && optflow->enabled()) { @@ -106,9 +101,6 @@ void GCS_Plane::update_vehicle_sensor_status_flags(void) control_sensors_health |= MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION; } - if (gps.status() >= AP_GPS::GPS_OK_FIX_3D && gps.is_healthy()) { - control_sensors_health |= MAV_SYS_STATUS_SENSOR_GPS; - } #if OPTFLOW == ENABLED if (optflow && optflow->healthy()) { control_sensors_health |= MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW; diff --git a/ArduPlane/GCS_Plane.h b/ArduPlane/GCS_Plane.h index 3e47988d94..64e87c9f0d 100644 --- a/ArduPlane/GCS_Plane.h +++ b/ArduPlane/GCS_Plane.h @@ -35,4 +35,9 @@ protected: AP_HAL::UARTDriver &uart) override { return new GCS_MAVLINK_Plane(params, uart); } + + AP_GPS::GPS_Status min_status_for_gps_healthy() const override { + // NO_FIX simply excludes NO_GPS + return AP_GPS::GPS_OK_FIX_3D; + } };