From bcf7cac5d95e509ac5eccb26ccbe6c890df8c17c Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Tue, 17 Jan 2017 20:14:18 +1100 Subject: [PATCH] EKF: remove hardcoded limit on optical flow time delta Allow for up to 50% lost data. --- EKF/estimator_interface.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/EKF/estimator_interface.cpp b/EKF/estimator_interface.cpp index 9575788d48..fa6081c1e6 100644 --- a/EKF/estimator_interface.cpp +++ b/EKF/estimator_interface.cpp @@ -287,9 +287,10 @@ void EstimatorInterface::setOpticalFlowData(uint64_t time_usec, flow_message *fl // limit data rate to prevent data being lost if (time_usec - _time_last_optflow > _min_obs_interval_us) { - // check if enough integration time + // check if enough integration time and fail if integration time is less than 50% + // of min arrival interval because too much data is being lost float delta_time = 1e-6f * (float)flow->dt; - bool delta_time_good = (delta_time >= 0.05f); + bool delta_time_good = (delta_time >= 5e-7f * (float)_min_obs_interval_us); // check magnitude is within sensor limits float flow_rate_magnitude;