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
This commit is contained in:
Paul Riseborough 2015-04-28 07:02:23 +10:00 committed by Randy Mackay
parent c4c0f819b5
commit 2cba60c731
1 changed files with 2 additions and 2 deletions

View File

@ -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;