AP_InertialSensor: relax is_still() threshold for SITL.. which is pretty darn still all the time for Plane

This commit is contained in:
Tom Pittenger 2022-02-04 11:32:59 -08:00 committed by Tom Pittenger
parent 047b2d5578
commit 798f985ee5
1 changed files with 11 additions and 1 deletions

View File

@ -64,7 +64,17 @@ extern const AP_HAL::HAL& hal;
#else
#define DEFAULT_GYRO_FILTER 20
#define DEFAULT_ACCEL_FILTER 20
#define DEFAULT_STILL_THRESH 0.1f
#if APM_BUILD_TYPE(APM_BUILD_ArduPlane) && CONFIG_HAL_BOARD == HAL_BOARD_SITL
// In steady-state level flight on SITL Plane, especially while the motor is off, the INS system
// returns ins.is_still()==true. Baseline vibes while airborne are unrealistically low: around 0.07.
// A real aircraft would be experiencing micro turbulence and be rocking around a tiny bit. Therefore,
// for Plane SIM the vibe threshold needs to be a little lower. Since plane.is_flying() uses
// ins.is_still() during gps loss to detect if we're flying, we want to make sure we are not "perfectly"
// still in the air like we are on the ground.
#define DEFAULT_STILL_THRESH 0.05f
#else
#define DEFAULT_STILL_THRESH 0.1f
#endif
#endif
#if defined(STM32H7) || defined(STM32F7)