1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-23 08:15:26 +03:00
This commit is contained in:
breadoven 2023-01-27 21:39:23 +00:00
parent bb79ad8f02
commit 4a7a2a75b6
2 changed files with 11 additions and 5 deletions

View file

@ -736,9 +736,12 @@ bool isFixedWingLandingDetected(void)
DEBUG_SET(DEBUG_LANDING, 6, isRollAxisStatic);
DEBUG_SET(DEBUG_LANDING, 7, isPitchAxisStatic);
if (isRollAxisStatic && isPitchAxisStatic) {
// Probably landed, low horizontal and vertical velocities and no axis rotation in Roll and Pitch
timeMs_t safetyTimeDelay = 1000 + navConfig()->general.auto_disarm_delay;
return currentTimeMs - fwLandingTimerStartAt > safetyTimeDelay; // check conditions stable for 1s + optional extra delay
/* Probably landed, low horizontal and vertical velocities and no axis rotation in Roll and Pitch
* Conditions need to be held for fixed safety time + optional extra delay.
* Fixed time increased if velocities invalid to provide extra safety margin against false triggers */
const uint16_t safetyTime = posControl.flags.estAltStatus == EST_NONE || posControl.flags.estVelStatus == EST_NONE ? 5000 : 1000;
timeMs_t safetyTimeDelay = safetyTime + navConfig()->general.auto_disarm_delay;
return currentTimeMs - fwLandingTimerStartAt > safetyTimeDelay;
} else {
fixAxisCheck = false;
}