AP_NavEKF2: Fix bug preventing pre-takeoff reference measurements

This commit is contained in:
Paul Riseborough 2015-10-15 21:54:45 +11:00 committed by Andrew Tridgell
parent 71c399674a
commit 4e928bf294

View File

@ -351,7 +351,7 @@ void NavEKF2_core::detectFlight()
prevInFlight = inFlight;
// Store vehicle height and range prior to takeoff for use in post takeoff checks
if (!onGround && !prevOnGround) {
if (onGround && prevOnGround) {
// store vertical position at start of flight to use as a reference for ground relative checks
posDownAtTakeoff = stateStruct.position.z;
// store the range finder measurement which will be used as a reference to detect when we have taken off