ekf2: EKF vehicle_at_rest always require some rotation in addition to vibration metrics

This commit is contained in:
Daniel Agar 2021-10-14 10:32:41 -04:00
parent 33954a904f
commit 4cf8eb8226
1 changed files with 2 additions and 3 deletions

View File

@ -87,9 +87,8 @@ bool EstimatorInterface::checkIfVehicleAtRest(float dt, const imuSample &imu)
{
// detect if the vehicle is not moving when on ground
if (!_control_status.flags.in_air) {
if ((_vibe_metrics(1) * 4.0E4f > _params.is_moving_scaler)
|| (_vibe_metrics(2) * 2.1E2f > _params.is_moving_scaler)
|| ((imu.delta_ang.norm() / dt) > 0.05f * _params.is_moving_scaler)) {
if (((_vibe_metrics(1) * 4.0e4f > _params.is_moving_scaler) || (_vibe_metrics(2) * 2.1e2f > _params.is_moving_scaler))
&& ((imu.delta_ang.norm() / dt) > 0.05f * _params.is_moving_scaler)) {
_time_last_move_detect_us = imu.time_us;
}