mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 12:43:33 +08:00
ekf2: handle all time on delayed horizon (except for newest sample checks)
- a growing number of samples come into the backend with the time already delayed (sensor's interrupt setting timestamp sample) - if the incoming timestamp is already delayed then the new data checks (relative to latest IMU) can be slightly wrong - handle almost all timestamps and checks on delayed time horizon, except for explicit checks of new samples - isRecent() and isTimedOut() helpers use delayed time - add new isNewestSampleRecent() used for checking the incoming timestamp of the incoming (adjusted) data
This commit is contained in:
@@ -401,7 +401,7 @@ bool Ekf::fuseMag(const Vector3f &mag, estimator_aid_source_3d_s &aid_src_mag, b
|
||||
|
||||
if (is_fused) {
|
||||
aid_src_mag.fused[index] = true;
|
||||
aid_src_mag.time_last_fuse[index] = _time_last_imu;
|
||||
aid_src_mag.time_last_fuse[index] = _imu_sample_delayed.time_us;
|
||||
|
||||
} else {
|
||||
aid_src_mag.fused[index] = false;
|
||||
@@ -672,8 +672,8 @@ bool Ekf::fuseYaw(const float innovation, const float variance, estimator_aid_so
|
||||
// apply the state corrections
|
||||
fuse(Kfusion, aid_src_status.innovation);
|
||||
|
||||
_time_last_heading_fuse = _time_last_imu;
|
||||
aid_src_status.time_last_fuse = _time_last_imu;
|
||||
_time_last_heading_fuse = _imu_sample_delayed.time_us;
|
||||
aid_src_status.time_last_fuse = _imu_sample_delayed.time_us;
|
||||
aid_src_status.fused = true;
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user