Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

EKF: Fix timestamp comparison issue #462

Merged
merged 1 commit into from
Jun 15, 2018
Merged

EKF: Fix timestamp comparison issue #462

merged 1 commit into from
Jun 15, 2018

Conversation

priseborough
Copy link
Collaborator

@priseborough priseborough commented Jun 14, 2018

Minimum change fix to address PX4/PX4-Autopilot#9527

Replaces #461

This fixes a error condition that occurs if _time_last_gps is greater than _time_last_imu.

By checking time stamps at the fusion time horizon, we guarantee that this cannot happen because all observations must have a time stamp smaller or equal to _imu_sample_delayed.time_us before they are retrieved from the buffers.

There are other instances in code where this type of error could occur for other observation types. These will be addressed as part of a separate PR following a more thorough code review.

This fixes a error condition that occurs if _time_last_gps is greater than _time_last_imu.
By checking time stamps at the fusion time horizon, we guarantee that this cannot happen because all observations must have a time stamp smaller or equal to _imu_sample_delayed.time_us before they are retrieved from the buffers.
Copy link
Member

@bkueng bkueng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is enough to fix the GPS case, thanks @priseborough. So the problem exists at fewer places than I first thought.

For the other sensors: for mag, baro and airspeed I found no problem.
For range finder, there is one here:
https://github.com/PX4/ecl/blob/master/EKF/terrain_estimator.cpp#L210
And for vision there are also a couple that need to be checked.

@priseborough priseborough merged commit 1a11068 into master Jun 15, 2018
bkueng added a commit to PX4/PX4-Autopilot that referenced this pull request Jun 15, 2018
bkueng added a commit to PX4/PX4-Autopilot that referenced this pull request Jun 15, 2018
@priseborough priseborough deleted the pr-gpsLossFix branch June 18, 2018 00:35
CarlOlsson added a commit to CarlOlsson/ecl that referenced this pull request Apr 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants