From ac646d32e6f9e4ff687c1f7ec32597d40e702294 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Tue, 25 Oct 2022 00:02:02 +0200 Subject: [PATCH] MulticopterLandDetector: Apply threshold widening only when landed, not maybe landed --- src/modules/land_detector/MulticopterLandDetector.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/land_detector/MulticopterLandDetector.cpp b/src/modules/land_detector/MulticopterLandDetector.cpp index 28b739e557..20c0f38623 100644 --- a/src/modules/land_detector/MulticopterLandDetector.cpp +++ b/src/modules/land_detector/MulticopterLandDetector.cpp @@ -154,7 +154,7 @@ bool MulticopterLandDetector::_get_ground_contact_state() float vertical_velocity_threshold = _param_lndmc_z_vel_max.get(); - if (_maybe_landed_hysteresis.get_state()) { + if (_landed_hysteresis.get_state()) { vertical_velocity_threshold *= 2.5f; } @@ -266,9 +266,9 @@ bool MulticopterLandDetector::_get_maybe_landed_state() // Next look if vehicle is not rotating (do not consider yaw) float max_rotation_threshold = math::radians(_param_lndmc_rot_max.get()); - // Widen max rotation thresholds if either in maybe landed state, thus making it harder - // to trigger a false positive !maybe_landed e.g. due to propeller throttling up/down. - if (_maybe_landed_hysteresis.get_state()) { + // Widen max rotation thresholds if either in landed state, thus making it harder + // to trigger a false positive !landed e.g. due to propeller throttling up/down. + if (_landed_hysteresis.get_state()) { max_rotation_threshold *= 2.5f; }