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;