From d2afa1cac8a45d2012d0982b8800af00eb2a96b6 Mon Sep 17 00:00:00 2001 From: Julien Beraud Date: Tue, 17 Jan 2017 17:50:38 +0100 Subject: [PATCH] AP_AHRS_NavEKF: Push gyro bias for optical flow Push gyro bias for optical flow usage only if there is an optical flow declared in the HAL --- libraries/AP_AHRS/AP_AHRS_NavEKF.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/AP_AHRS/AP_AHRS_NavEKF.cpp b/libraries/AP_AHRS/AP_AHRS_NavEKF.cpp index ec6703a6bf..6a30355383 100644 --- a/libraries/AP_AHRS/AP_AHRS_NavEKF.cpp +++ b/libraries/AP_AHRS/AP_AHRS_NavEKF.cpp @@ -90,6 +90,12 @@ void AP_AHRS_NavEKF::update(void) // call AHRS_update hook if any AP_Module::call_hook_AHRS_update(*this); + + // push gyros if optical flow present + if (hal.opticalflow) { + Vector3f exported_gyro_bias = get_gyro_drift(); + hal.opticalflow->push_gyro_bias(exported_gyro_bias.x, exported_gyro_bias.y); + } } void AP_AHRS_NavEKF::update_DCM(void)