mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-17 05:15:23 +03:00
build
This commit is contained in:
parent
1ed8d9481f
commit
16be85975a
7 changed files with 32 additions and 9 deletions
|
@ -695,13 +695,15 @@ bool isFixedWingLandingDetected(void)
|
|||
static timeMs_t fwLandingTimerStartAt;
|
||||
static int16_t fwLandSetRollDatum;
|
||||
static int16_t fwLandSetPitchDatum;
|
||||
const float sensitivity = navConfig()->general.land_detect_sensitivity / 5.0f;
|
||||
|
||||
timeMs_t currentTimeMs = millis();
|
||||
|
||||
// Check horizontal and vertical volocities are low (cm/s)
|
||||
bool velCondition = fabsf(navGetCurrentActualPositionAndVelocity()->vel.z) < 50.0f && posControl.actualState.velXY < 100.0f;
|
||||
// Check horizontal and vertical velocities are low (cm/s)
|
||||
bool velCondition = fabsf(navGetCurrentActualPositionAndVelocity()->vel.z) < (50.0f * sensitivity) &&
|
||||
posControl.actualState.velXY < (100.0f * sensitivity);
|
||||
// Check angular rates are low (degs/s)
|
||||
bool gyroCondition = averageAbsGyroRates() < 2.0f;
|
||||
bool gyroCondition = averageAbsGyroRates() < (2.0f * sensitivity);
|
||||
DEBUG_SET(DEBUG_LANDING, 2, velCondition);
|
||||
DEBUG_SET(DEBUG_LANDING, 3, gyroCondition);
|
||||
|
||||
|
@ -714,8 +716,9 @@ bool isFixedWingLandingDetected(void)
|
|||
fixAxisCheck = true;
|
||||
fwLandingTimerStartAt = currentTimeMs;
|
||||
} else {
|
||||
bool isRollAxisStatic = ABS(fwLandSetRollDatum - attitude.values.roll) < 5;
|
||||
bool isPitchAxisStatic = ABS(fwLandSetPitchDatum - attitude.values.pitch) < 5;
|
||||
const uint8_t angleLimit = 5 * sensitivity;
|
||||
bool isRollAxisStatic = ABS(fwLandSetRollDatum - attitude.values.roll) < angleLimit;
|
||||
bool isPitchAxisStatic = ABS(fwLandSetPitchDatum - attitude.values.pitch) < angleLimit;
|
||||
DEBUG_SET(DEBUG_LANDING, 6, isRollAxisStatic);
|
||||
DEBUG_SET(DEBUG_LANDING, 7, isPitchAxisStatic);
|
||||
if (isRollAxisStatic && isPitchAxisStatic) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue