mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 16:03:34 +08:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user