Browse Source

AP_NavEKF: Decouple takeoff ground effect compensation from arm transtion

Thsi fixes a potential bug where the vehicle could land at a lower location without disarming and re-enter ground effect takeoff mode wiht a baro height floor above the current altitude, causing unpredictable height gain
master
Paul Riseborough 10 years ago committed by Randy Mackay
parent
commit
2cba60c731
  1. 4
      libraries/AP_NavEKF/AP_NavEKF.cpp

4
libraries/AP_NavEKF/AP_NavEKF.cpp

@ -4177,8 +4177,8 @@ void NavEKF::readHgtData() @@ -4177,8 +4177,8 @@ void NavEKF::readHgtData()
// filtered baro data used to provide a reference for takeoff
// it is is reset to last height measurement on disarming in performArmingChecks()
if (!vehicleArmed || !getTakeoffExpected()) {
static const float gndHgtFiltTC = 1.0f;
if (!getTakeoffExpected()) {
static const float gndHgtFiltTC = 0.5f;
static const float dtBaro = msecHgtAvg*1.0e-3f;
float alpha = constrain_float(dtBaro / (dtBaro+gndHgtFiltTC),0.0f,1.0f);
meaHgtAtTakeOff += (hgtMea-meaHgtAtTakeOff)*alpha;

Loading…
Cancel
Save