From c253badba4dfb52bc7e4a114d0f0646ccae320da Mon Sep 17 00:00:00 2001 From: bresch Date: Thu, 17 Dec 2020 11:19:45 +0100 Subject: [PATCH] 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. --- .../MulticopterHoverThrustEstimator.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/modules/mc_hover_thrust_estimator/MulticopterHoverThrustEstimator.cpp b/src/modules/mc_hover_thrust_estimator/MulticopterHoverThrustEstimator.cpp index 2b0bb94381..8f0ff4bc3f 100644 --- a/src/modules/mc_hover_thrust_estimator/MulticopterHoverThrustEstimator.cpp +++ b/src/modules/mc_hover_thrust_estimator/MulticopterHoverThrustEstimator.cpp @@ -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; } }