From 2945ce7c87dec6f5976c664628ee36771442411d Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Thu, 20 Jan 2022 18:43:46 +0300 Subject: [PATCH] ekf2: fuse optical flow when magnetometer is disabled Co-authored-by: bresch --- src/modules/ekf2/EKF/control.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/ekf2/EKF/control.cpp b/src/modules/ekf2/EKF/control.cpp index 225335046b..f0a405aab6 100644 --- a/src/modules/ekf2/EKF/control.cpp +++ b/src/modules/ekf2/EKF/control.cpp @@ -470,7 +470,7 @@ void Ekf::controlOpticalFlowFusion() && !_control_status.flags.opt_flow // we are not yet using flow data && !_inhibit_flow_use) { // If the heading is valid and use is not inhibited , start using optical flow aiding - if (_control_status.flags.yaw_align) { + if (_control_status.flags.yaw_align || _params.mag_fusion_type == MAG_FUSE_TYPE_NONE) { // set the flag and reset the fusion timeout _control_status.flags.opt_flow = true; _time_last_of_fuse = _time_last_imu;