From 580cd143b8b78cc890511c2e78845fb477467610 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 8 Jan 2021 11:45:27 +1100 Subject: [PATCH] AP_AccelCal: added active() method --- libraries/AP_AccelCal/AP_AccelCal.cpp | 6 ++++++ libraries/AP_AccelCal/AP_AccelCal.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/libraries/AP_AccelCal/AP_AccelCal.cpp b/libraries/AP_AccelCal/AP_AccelCal.cpp index 19c61141b2..01f5bcbc07 100644 --- a/libraries/AP_AccelCal/AP_AccelCal.cpp +++ b/libraries/AP_AccelCal/AP_AccelCal.cpp @@ -382,3 +382,9 @@ bool AP_AccelCal::gcs_vehicle_position(float position) return false; } + +// true if we are in a calibration process +bool AP_AccelCal::active(void) const +{ + return _status == ACCEL_CAL_WAITING_FOR_ORIENTATION || _status == ACCEL_CAL_COLLECTING_SAMPLE; +} diff --git a/libraries/AP_AccelCal/AP_AccelCal.h b/libraries/AP_AccelCal/AP_AccelCal.h index 44dbc5b8c8..0a2ad0cf98 100644 --- a/libraries/AP_AccelCal/AP_AccelCal.h +++ b/libraries/AP_AccelCal/AP_AccelCal.h @@ -36,6 +36,9 @@ public: void handleMessage(const mavlink_message_t &msg); + // true if we are in a calibration process + bool active(void) const; + private: GCS_MAVLINK *_gcs; bool _use_gcs_snoop;