mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 09: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:
@@ -196,8 +196,8 @@ void Ekf::fuseGpsYaw()
|
||||
_aid_src_gnss_yaw.fused = is_fused;
|
||||
|
||||
if (is_fused) {
|
||||
_time_last_heading_fuse = _time_last_imu;
|
||||
_aid_src_gnss_yaw.time_last_fuse = _time_last_imu;
|
||||
_time_last_heading_fuse = _imu_sample_delayed.time_us;
|
||||
_aid_src_gnss_yaw.time_last_fuse = _imu_sample_delayed.time_us;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ bool Ekf::resetYawToGps()
|
||||
const float yaw_variance = sq(fmaxf(_params.gps_heading_noise, 1.e-2f));
|
||||
resetQuatStateYaw(measured_yaw, yaw_variance, true);
|
||||
|
||||
_aid_src_gnss_yaw.time_last_fuse = _time_last_imu;
|
||||
_aid_src_gnss_yaw.time_last_fuse = _imu_sample_delayed.time_us;
|
||||
_gnss_yaw_signed_test_ratio_lpf.reset(0.f);
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user