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

Commit

Permalink
EKF: Prevent timestamp jitter failing GPS data arrival check (#462)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
priseborough authored Jun 15, 2018
1 parent 4ae8242 commit 1a11068
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion EKF/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ void Ekf::controlGpsFusion()
_hvelInnovGate = fmaxf(_params.vel_innov_gate, 1.0f);
}

} else if (_control_status.flags.gps && (_time_last_imu - _time_last_gps > (uint64_t)10e6)) {
} else if (_control_status.flags.gps && (_imu_sample_delayed.time_us - _gps_sample_delayed.time_us > (uint64_t)10e6)) {
_control_status.flags.gps = false;
ECL_WARN("EKF GPS data stopped");
}
Expand Down

0 comments on commit 1a11068

Please sign in to comment.