ekf2: Ignore optical flow samples with too large integration time spans. Fixes #14165

Within ekf2, optical flow messages (amongst others) are fused to the state estimates. It might occur that optical flow sensors report unreliable and unrealistic spikes. In that case, the state estimator went crazy so far and just ignored optical flow values from that moment on.

The common thread for all these spikes seems to be a too high integration time span. Therefore, this fix adds a simple logic that ignores unrealistically high integration time spans. As a threshold, 1 second was chosen.

Reported-by: Dominik Natter <dominik.natter@gmail.com>
This commit is contained in:
dominiknatter 2020-06-29 18:00:29 +02:00 committed by GitHub
parent d360919789
commit d8831c5133
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -1061,7 +1061,8 @@ void Ekf2::Run()
flow.time_us = optical_flow.timestamp;
if (PX4_ISFINITE(optical_flow.pixel_flow_y_integral) &&
PX4_ISFINITE(optical_flow.pixel_flow_x_integral)) {
PX4_ISFINITE(optical_flow.pixel_flow_x_integral) &&
flow.dt < 1) {
_ekf.setOpticalFlowData(flow);
}