Browse Source

AP_NavEKF: fixed static const bug

mission-4.1.18
Andrew Tridgell 9 years ago
parent
commit
d24f6f4050
  1. 4
      libraries/AP_NavEKF/AP_NavEKF_core.cpp

4
libraries/AP_NavEKF/AP_NavEKF_core.cpp

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

Loading…
Cancel
Save