FW land detector: only force to landed if launch detection is STATE_WAITING_FOR_LAUNCH (#25167)

Signed-off-by: Silvan <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer
2025-07-07 16:09:15 +02:00
committed by GitHub
parent dcde7b47d1
commit 5a2b26f931
@@ -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) {