File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments