From 745b739ab7f07df904a9691417063bd72ab955a2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 2 Jan 2015 17:38:28 +1100 Subject: [PATCH] AP_InertialSensor: make calibrated() function fast enough to call in flight this will be used in plane to make AHRS SYS_STATUS unhealthy if a user tries to fly with EKF enabled without a full 3D accel cal. Note that it doesn't rely on using AP_Param load() to detect that a value has been set, as some users are first doing a 3D cal then later doing a 1D cal. In that case load() was returning true and would give a false positive --- .../AP_InertialSensor/AP_InertialSensor.cpp | 42 +++++++++++++++---- .../AP_InertialSensor/AP_InertialSensor.h | 6 +++ 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/libraries/AP_InertialSensor/AP_InertialSensor.cpp b/libraries/AP_InertialSensor/AP_InertialSensor.cpp index 9cf1e4412b..f53572ba7b 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor.cpp @@ -223,7 +223,8 @@ AP_InertialSensor::AP_InertialSensor() : _accel(), _gyro(), _board_orientation(ROTATION_NONE), - _hil_mode(false) + _hil_mode(false), + _have_3D_calibration(false) { AP_Param::setup_object_defaults(this, var_info); for (uint8_t i=0; i