Plane: move setting of GPS SYS_STATUS bits up to base class

This commit is contained in:
Peter Barker 2019-11-08 17:59:42 +11:00 committed by Andrew Tridgell
parent d63788a09f
commit 3547e74991
2 changed files with 5 additions and 8 deletions

View File

@ -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;

View File

@ -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;
}
};