From 91127d51c0e94341b469f4b8e1db0bbbadfe71b5 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 8 Jun 2016 10:23:00 +0200 Subject: [PATCH] commander: stay in failsafe even when landed If the failsafe state is ended when landed, we would switch back to POSCTL and therefore take off again, however, all we want is stay on ground and wait for the auto disarm. --- src/modules/commander/state_machine_helper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/commander/state_machine_helper.cpp b/src/modules/commander/state_machine_helper.cpp index 0acc38a5bf..c334e2b381 100644 --- a/src/modules/commander/state_machine_helper.cpp +++ b/src/modules/commander/state_machine_helper.cpp @@ -651,7 +651,7 @@ bool set_nav_state(struct vehicle_status_s *status, struct commander_state_s *in { const bool rc_lost = rc_loss_enabled && (status->rc_signal_lost || status_flags->rc_signal_lost_cmd); - if (rc_lost && armed && !landed) { + if (rc_lost && armed) { status->failsafe = true; if (status_flags->condition_global_position_valid && @@ -671,7 +671,7 @@ bool set_nav_state(struct vehicle_status_s *status, struct commander_state_s *in } /* As long as there is RC, we can fallback to ALTCTL, or STAB. */ - } else if (status_flags->gps_failure && armed && !landed) { + } else if (status_flags->gps_failure && armed) { status->failsafe = true; if (status_flags->condition_local_altitude_valid) {