ekf2: move flow fusion activation from AID_MASK to OF_CTRL

This commit is contained in:
bresch
2023-04-28 22:31:17 -04:00
committed by Daniel Agar
parent 39c2f95669
commit 2a2e43b620
7 changed files with 45 additions and 8 deletions
@@ -158,7 +158,7 @@ void Ekf::controlOpticalFlowFusion(const imuSample &imu_delayed)
// Handle cases where we are using optical flow but we should not use it anymore
if (_control_status.flags.opt_flow) {
if (!(_params.fusion_mode & SensorFusionMask::USE_OPT_FLOW)
if (!(_params.flow_ctrl == 1)
|| inhibit_flow_use) {
stopFlowFusion();
@@ -167,7 +167,7 @@ void Ekf::controlOpticalFlowFusion(const imuSample &imu_delayed)
}
// optical flow fusion mode selection logic
if ((_params.fusion_mode & SensorFusionMask::USE_OPT_FLOW) // optical flow has been selected by the user
if ((_params.flow_ctrl == 1) // optical flow has been selected by the user
&& !_control_status.flags.opt_flow // we are not yet using flow data
&& !inhibit_flow_use) {