mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-23 00:04:02 -04:00
AP_NavEKF2: Fix bug preventing pre-takeoff reference measurements
This commit is contained in:
parent
71c399674a
commit
4e928bf294
@ -351,7 +351,7 @@ void NavEKF2_core::detectFlight()
|
|||||||
prevInFlight = inFlight;
|
prevInFlight = inFlight;
|
||||||
|
|
||||||
// Store vehicle height and range prior to takeoff for use in post takeoff checks
|
// 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
|
// store vertical position at start of flight to use as a reference for ground relative checks
|
||||||
posDownAtTakeoff = stateStruct.position.z;
|
posDownAtTakeoff = stateStruct.position.z;
|
||||||
// store the range finder measurement which will be used as a reference to detect when we have taken off
|
// store the range finder measurement which will be used as a reference to detect when we have taken off
|
||||||
|
Loading…
Reference in New Issue
Block a user