From d44cf14178045126aef931b1f607982244c61dba Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Mon, 16 Mar 2015 14:29:11 -0700 Subject: [PATCH] AP_AHRS : Publish EKF learned compass offsets --- libraries/AP_AHRS/AP_AHRS_NavEKF.cpp | 8 ++++++++ libraries/AP_AHRS/AP_AHRS_NavEKF.h | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/libraries/AP_AHRS/AP_AHRS_NavEKF.cpp b/libraries/AP_AHRS/AP_AHRS_NavEKF.cpp index 5b70f6ac56..af6f2773a6 100644 --- a/libraries/AP_AHRS/AP_AHRS_NavEKF.cpp +++ b/libraries/AP_AHRS/AP_AHRS_NavEKF.cpp @@ -344,5 +344,13 @@ void AP_AHRS_NavEKF::getEkfControlLimits(float &ekfGndSpdLimit, float &ekfNavVel EKF.getEkfControlLimits(ekfGndSpdLimit,ekfNavVelGainScaler); } +// get compass offset estimates +// true if offsets are valid +bool AP_AHRS_NavEKF::getMagOffsets(Vector3f &magOffsets) +{ + bool status = EKF.getMagOffsets(magOffsets); + return status; +} + #endif // AP_AHRS_NAVEKF_AVAILABLE diff --git a/libraries/AP_AHRS/AP_AHRS_NavEKF.h b/libraries/AP_AHRS/AP_AHRS_NavEKF.h index d7a2982777..28cd22e6ea 100644 --- a/libraries/AP_AHRS/AP_AHRS_NavEKF.h +++ b/libraries/AP_AHRS/AP_AHRS_NavEKF.h @@ -120,6 +120,10 @@ public: // true if the AHRS has completed initialisation bool initialised(void) const; + // get compass offset estimates + // true if offsets are valid + bool getMagOffsets(Vector3f &magOffsets); + private: bool using_EKF(void) const;