HTE: remove dist_bottom validity check

Without range finder, the validity flag goes to false quite quickly and
if can be that a vehicle never starts HTE is the takeoff is too slow.
In this specific context of takeoff detection, since
the exact value is not important, we can safely ignore the validity flag.
This commit is contained in:
bresch 2020-12-17 11:19:45 +01:00 committed by Julian Kent
parent 690c1158ad
commit c253badba4

View File

@ -117,10 +117,13 @@ void MulticopterHoverThrustEstimator::Run()
if (_vehicle_local_position_sub.copy(&local_pos)) {
// This is only necessary because the landed
// flag of the land detector does not guarantee that
// the vehicle does not touch the ground anymore
// the vehicle does not touch the ground anymore.
// There is no check for the dist_bottom validity as
// this value is always good enough after takeoff for
// this use case.
// TODO: improve the landed flag
if (local_pos.dist_bottom_valid) {
if (!_landed && (local_pos.dist_bottom > 1.f)) {
if (!_landed) {
if (local_pos.dist_bottom > 1.f) {
_in_air = true;
}
}