From 6459a4de9d1def218a1037b44d481d5b3889c180 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Fri, 15 Dec 2017 14:45:50 +0900 Subject: [PATCH] Rover: gyro health check uses initialised flag We should not be relying on the notify flags as a way to pass info around the system. Rover's initialised flag is equivalent and more appropriate. --- APMrover2/sensors.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APMrover2/sensors.cpp b/APMrover2/sensors.cpp index ff61ca0f38..c6b3c83a69 100644 --- a/APMrover2/sensors.cpp +++ b/APMrover2/sensors.cpp @@ -362,7 +362,7 @@ void Rover::update_sensor_status_flags(void) control_sensors_health &= ~MAV_SYS_STATUS_LOGGING; } - if (AP_Notify::flags.initialising) { + if (!initialised || ins.calibrating()) { // while initialising the gyros and accels are not enabled control_sensors_enabled &= ~(MAV_SYS_STATUS_SENSOR_3D_GYRO | MAV_SYS_STATUS_SENSOR_3D_ACCEL); control_sensors_health &= ~(MAV_SYS_STATUS_SENSOR_3D_GYRO | MAV_SYS_STATUS_SENSOR_3D_ACCEL);