From b6dbb8f464f35d699963b4dd2a1f25c8e60c6bf5 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 22 Jun 2019 11:26:30 +1000 Subject: [PATCH] GCS_MAVLink: always show AHRS healthy with EKF type 10 this fixes an issue noticed by Marco with xplane --- libraries/GCS_MAVLink/GCS.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libraries/GCS_MAVLink/GCS.cpp b/libraries/GCS_MAVLink/GCS.cpp index 9d1c9a0546..d7b84c847f 100644 --- a/libraries/GCS_MAVLink/GCS.cpp +++ b/libraries/GCS_MAVLink/GCS.cpp @@ -169,5 +169,13 @@ void GCS::update_sensor_status_flags() } control_sensors_health |= MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS; +#if CONFIG_HAL_BOARD == HAL_BOARD_SITL + if (ahrs.get_ekf_type() == 10) { + // always show EKF type 10 as healthy. This prevents spurious error + // messages in xplane and other simulators that use EKF type 10 + control_sensors_health |= MAV_SYS_STATUS_AHRS | MAV_SYS_STATUS_SENSOR_GPS | MAV_SYS_STATUS_SENSOR_3D_ACCEL | MAV_SYS_STATUS_SENSOR_3D_GYRO; + } +#endif + update_vehicle_sensor_status_flags(); }