From aad48407c21f056550de343a5b0da1c02feb65b9 Mon Sep 17 00:00:00 2001 From: Kabir Mohammed Date: Sun, 2 May 2021 16:56:21 -0400 Subject: [PATCH] EKF: increase allowed difference between flow and gyro ODRs In the normal and lowlight mode for the PAW3902/3 sensor, the ODR is 66Hz, while in super lowlight mode it is 50Hz. The IMU ODR vs flow ODR mismatch threshold was too conservative for the 66Hz ODR, since https://github.com/PX4/PX4-ECL/pull/928. The EKF would keep waiting for the data to line up and never fuse measurements. --- EKF/control.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EKF/control.cpp b/EKF/control.cpp index 2a696ee78b..069b098041 100644 --- a/EKF/control.cpp +++ b/EKF/control.cpp @@ -361,8 +361,8 @@ void Ekf::controlOpticalFlowFusion() const bool is_magnitude_good = !_flow_sample_delayed.flow_xy_rad.longerThan(_flow_sample_delayed.dt * _flow_max_rate); const bool is_tilt_good = (_R_to_earth(2, 2) > _params.range_cos_max_tilt); - const float delta_time_min = fmaxf(0.8f * _delta_time_of, 0.001f); - const float delta_time_max = fminf(1.2f * _delta_time_of, 0.2f); + const float delta_time_min = fmaxf(0.7f * _delta_time_of, 0.001f); + const float delta_time_max = fminf(1.3f * _delta_time_of, 0.2f); const bool is_delta_time_good = _flow_sample_delayed.dt >= delta_time_min && _flow_sample_delayed.dt <= delta_time_max; const bool is_body_rate_comp_available = calcOptFlowBodyRateComp();