From 4d10759699b0e20a0223b1049377b2a35c08fe47 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Tue, 17 May 2016 10:51:55 -0400 Subject: [PATCH] commander: use DESCEND mode and not LANDGPSFAIL Always use the DESCEND mode and not LANDGPSFAIL because LANDGPSFAIL will try to loiter for some time and then request termination instead of descending gently and trying to land. --- src/modules/commander/state_machine_helper.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/commander/state_machine_helper.cpp b/src/modules/commander/state_machine_helper.cpp index 8cfc38b109..8e266bf16a 100644 --- a/src/modules/commander/state_machine_helper.cpp +++ b/src/modules/commander/state_machine_helper.cpp @@ -665,7 +665,8 @@ bool set_nav_state(struct vehicle_status_s *status, struct commander_state_s *in } else if (status_flags->data_link_lost_cmd) { status->nav_state = vehicle_status_s::NAVIGATION_STATE_AUTO_RTGS; } else if (status_flags->gps_failure_cmd) { - status->nav_state = vehicle_status_s::NAVIGATION_STATE_AUTO_LANDGPSFAIL; + status->nav_state = vehicle_status_s::NAVIGATION_STATE_DESCEND; + status->failsafe = true; } else if (status_flags->rc_signal_lost_cmd) { status->nav_state = vehicle_status_s::NAVIGATION_STATE_AUTO_RCRECOVER; } else if (status_flags->vtol_transition_failure_cmd) { @@ -673,7 +674,8 @@ bool set_nav_state(struct vehicle_status_s *status, struct commander_state_s *in /* finished handling commands which have priority, now handle failures */ } else if (status_flags->gps_failure) { - status->nav_state = vehicle_status_s::NAVIGATION_STATE_AUTO_LANDGPSFAIL; + status->nav_state = vehicle_status_s::NAVIGATION_STATE_DESCEND; + status->failsafe = true; } else if (status->engine_failure) { status->nav_state = vehicle_status_s::NAVIGATION_STATE_AUTO_LANDENGFAIL; } else if (status_flags->vtol_transition_failure) {