MC land detector: If no position information is available, rely on the armed state exclusively to infer the landed condition.

This commit is contained in:
Lorenz Meier 2015-06-29 10:15:27 +02:00
parent 5982eaaf34
commit 9a36588361
1 changed files with 8 additions and 0 deletions

View File

@ -100,6 +100,14 @@ bool MulticopterLandDetector::update()
return true;
}
// return status based on armed state if no position lock is available
if (_vehicleGlobalPosition.timestamp == 0 ||
hrt_elapsed_time(&_vehicleGlobalPosition.timestamp) > 500000) {
// no position lock - not landed if armed
return !_arming.armed;
}
const uint64_t now = hrt_absolute_time();
// check if we are moving vertically