mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-27 21:40:35 +08:00
sensor_simulator: update EKF at IMU rate
This is how it is also done in ekf2_main. Otherwise, this leads to multiple integration of the same IMU data due to asynchronous sensor updates triggering a prediction step between IMU updates. Fix unit tests that broke because of this fix
This commit is contained in:
committed by
Mathieu Bresciani
parent
59183f70ba
commit
6126c190b2
@@ -146,9 +146,13 @@ void SensorSimulator::runMicroseconds(uint32_t duration)
|
||||
|
||||
for(;_time < start_time + (uint64_t)duration; _time+=1000)
|
||||
{
|
||||
bool update_imu = _imu.should_send(_time);
|
||||
updateSensors();
|
||||
|
||||
_ekf->update();
|
||||
if (update_imu) {
|
||||
// Update at IMU rate
|
||||
_ekf->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user