Skip to content

Commit f5138df

Browse files
committed
Update navigation_pos_estimator.c
1 parent 81b88e4 commit f5138df

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/main/navigation/navigation_pos_estimator.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,7 @@ static bool estimationCalculateCorrection_Z(estimationContext_t * ctx)
596596
else if (isBaroGroundValid) {
597597
// We might be experiencing air cushion effect during takeoff - use sonar or baro ground altitude to detect it
598598
if (isMulticopterThrottleAboveMidHover()) {
599+
// Disable ground effect detection at lift off when est alt and baro alt converge. Always disable if baro alt > 1m.
599600
isBaroGroundValid = fabsf(posEstimator.est.pos.z - posEstimator.baro.alt) > 20.0f && posEstimator.baro.alt < 100.0f;
600601
}
601602

@@ -605,6 +606,8 @@ static bool estimationCalculateCorrection_Z(estimationContext_t * ctx)
605606

606607
// Altitude
607608
float baroAltResidual = wBaro * ((isAirCushionEffectDetected ? baroGroundAlt : posEstimator.baro.alt) - posEstimator.est.pos.z);
609+
610+
// Disable alt pos correction at point of lift off if ground effect active
608611
if (isAirCushionEffectDetected && isMulticopterThrottleAboveMidHover()) {
609612
baroAltResidual = 0.0f;
610613
}

0 commit comments

Comments
 (0)