mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 14:13: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:
@@ -99,8 +99,8 @@ void Ekf::resetFakePosFusion()
|
||||
resetHorizontalPositionToLastKnown();
|
||||
resetHorizontalVelocityToZero();
|
||||
|
||||
_aid_src_fake_pos.time_last_fuse[0] = _time_last_imu;
|
||||
_aid_src_fake_pos.time_last_fuse[1] = _time_last_imu;
|
||||
_aid_src_fake_pos.time_last_fuse[0] = _imu_sample_delayed.time_us;
|
||||
_aid_src_fake_pos.time_last_fuse[1] = _imu_sample_delayed.time_us;
|
||||
}
|
||||
|
||||
void Ekf::stopFakePosFusion()
|
||||
@@ -151,10 +151,10 @@ void Ekf::fuseFakePosition()
|
||||
if (fake_pos.fusion_enabled[i] && !fake_pos.innovation_rejected[i]) {
|
||||
if (fuseVelPosHeight(fake_pos.innovation[i], fake_pos.innovation_variance[i], 3 + i)) {
|
||||
fake_pos.fused[i] = true;
|
||||
fake_pos.time_last_fuse[i] = _time_last_imu;
|
||||
fake_pos.time_last_fuse[i] = _imu_sample_delayed.time_us;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fake_pos.timestamp_sample = _time_last_imu;
|
||||
fake_pos.timestamp_sample = _imu_sample_delayed.time_us;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user