ekf2: add simple zero velocity update when vehicle at rest (#19149)

- further decreases initial tilt alignment time (now down to 2.5 seconds if still) and improves initial bias estimates
This commit is contained in:
Daniel Agar
2022-03-12 12:56:31 -05:00
committed by GitHub
parent 3d54d25867
commit a430f0ccae
21 changed files with 683 additions and 503 deletions
@@ -153,8 +153,11 @@ void SensorSimulator::runMicroseconds(uint32_t duration)
updateSensors();
if (update_imu) {
if (_imu.moving()) {
_ekf->set_vehicle_at_rest(false);
}
// Update at IMU rate
_ekf->set_vehicle_at_rest(!_imu.moving());
_ekf->update();
}
}
@@ -194,7 +197,10 @@ void SensorSimulator::runReplayMicroseconds(uint32_t duration)
updateSensors();
if (update_imu) {
_ekf->set_vehicle_at_rest(!_imu.moving());
if (_imu.moving()) {
_ekf->set_vehicle_at_rest(false);
}
_ekf->update();
}
}
@@ -318,7 +324,10 @@ void SensorSimulator::runTrajectoryMicroseconds(uint32_t duration)
updateSensors();
if (update_imu) {
_ekf->set_vehicle_at_rest(!_imu.moving());
if (_imu.moving()) {
_ekf->set_vehicle_at_rest(false);
}
_ekf->update();
}
}