AP_NavEKF2: add height constraint during takeoff

This commit is contained in:
Jonathan Challinger 2016-03-30 21:00:45 -07:00 committed by Andrew Tridgell
parent 4bb46af861
commit 3382e09580
1 changed files with 5 additions and 0 deletions

View File

@ -684,6 +684,11 @@ void NavEKF2_core::selectHeightForFusion()
if (getTakeoffExpected() || getTouchdownExpected()) {
posDownObsNoise *= frontend->gndEffectBaroScaler;
}
// If we are in takeoff mode, the height measurement is limited to be no less than the measurement at start of takeoff
// This prevents negative baro disturbances due to copter downwash corrupting the EKF altitude during initial ascent
if (motorsArmed && getTakeoffExpected()) {
hgtMea = MAX(hgtMea, meaHgtAtTakeOff);
}
} else {
fuseHgtData = false;
}