From 5a2b26f931c324915cb1e4aefa397bda2f0269a3 Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Mon, 7 Jul 2025 16:09:15 +0200 Subject: [PATCH] FW land detector: only force to landed if launch detection is STATE_WAITING_FOR_LAUNCH (#25167) Signed-off-by: Silvan --- src/modules/land_detector/FixedwingLandDetector.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/land_detector/FixedwingLandDetector.cpp b/src/modules/land_detector/FixedwingLandDetector.cpp index f54514ce50..0ca1523115 100644 --- a/src/modules/land_detector/FixedwingLandDetector.cpp +++ b/src/modules/land_detector/FixedwingLandDetector.cpp @@ -64,9 +64,9 @@ bool FixedwingLandDetector::_get_landed_state() _launch_detection_status_sub.copy(&launch_detection_status); // force the landed state to stay landed if we're currently in the catapult/hand-launch launch process. Detect that we are in this state - // by checking if the last publication of launch_detection_status is less than 0.5s old, and we're not yet in the flying state. + // by checking if the last publication of launch_detection_status is less than 0.5s old, and we're still in the wait for launch state. if (_landed_hysteresis.get_state() && hrt_elapsed_time(&launch_detection_status.timestamp) < 500_ms - && launch_detection_status.launch_detection_state < launch_detection_status_s::STATE_FLYING) { + && launch_detection_status.launch_detection_state == launch_detection_status_s::STATE_WAITING_FOR_LAUNCH) { landDetected = true; } else if (hrt_elapsed_time(&_vehicle_local_position.timestamp) < 1_s) {