mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 19:43:34 +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:
@@ -173,7 +173,7 @@ void Ekf::fuseGpsVel()
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if (fuseVelPosHeight(gps_vel.innovation[i], gps_vel.innovation_variance[i], i)) {
|
||||
gps_vel.fused[i] = true;
|
||||
gps_vel.time_last_fuse[i] = _time_last_imu;
|
||||
gps_vel.time_last_fuse[i] = _imu_sample_delayed.time_us;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -184,7 +184,7 @@ void Ekf::fuseGpsVel()
|
||||
if (gps_vel.fusion_enabled[2] && !gps_vel.innovation_rejected[2]) {
|
||||
if (fuseVelPosHeight(gps_vel.innovation[2], gps_vel.innovation_variance[2], 2)) {
|
||||
gps_vel.fused[2] = true;
|
||||
gps_vel.time_last_fuse[2] = _time_last_imu;
|
||||
gps_vel.time_last_fuse[2] = _imu_sample_delayed.time_us;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -201,7 +201,7 @@ void Ekf::fuseGpsPos()
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if (fuseVelPosHeight(gps_pos.innovation[i], gps_pos.innovation_variance[i], 3 + i)) {
|
||||
gps_pos.fused[i] = true;
|
||||
gps_pos.time_last_fuse[i] = _time_last_imu;
|
||||
gps_pos.time_last_fuse[i] = _imu_sample_delayed.time_us;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -212,7 +212,7 @@ void Ekf::fuseGpsPos()
|
||||
if (gps_pos.fusion_enabled[2] && !gps_pos.innovation_rejected[2]) {
|
||||
if (fuseVelPosHeight(gps_pos.innovation[2], gps_pos.innovation_variance[2], 5)) {
|
||||
gps_pos.fused[2] = true;
|
||||
gps_pos.time_last_fuse[2] = _time_last_imu;
|
||||
gps_pos.time_last_fuse[2] = _imu_sample_delayed.time_us;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user