From c6e4926d4e0498231051be47ed9e58ce4c628d39 Mon Sep 17 00:00:00 2001 From: Andreas Antener Date: Mon, 15 Aug 2016 08:56:03 +0200 Subject: [PATCH] prevent instant transition to fixed-wing while already in back transition, prevents unsafe flying state --- src/modules/vtol_att_control/standard.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modules/vtol_att_control/standard.cpp b/src/modules/vtol_att_control/standard.cpp index 6e52d4f8d4..443e9916a9 100644 --- a/src/modules/vtol_att_control/standard.cpp +++ b/src/modules/vtol_att_control/standard.cpp @@ -180,8 +180,10 @@ void Standard::update_vtol_state() } else { // the transition to fw mode switch is on - if (_vtol_schedule.flight_mode == MC_MODE) { + if (_vtol_schedule.flight_mode == MC_MODE || _vtol_schedule.flight_mode == TRANSITION_TO_MC) { // start transition to fw mode + /* NOTE: The failsafe transition to fixed-wing was removed because it can result in an + * unsafe flying state. */ _vtol_schedule.flight_mode = TRANSITION_TO_FW; _vtol_schedule.transition_start = hrt_absolute_time(); @@ -207,9 +209,6 @@ void Standard::update_vtol_state() _trans_finished_ts = hrt_absolute_time(); } - } else if (_vtol_schedule.flight_mode == TRANSITION_TO_MC) { - // transitioning to mc mode & transition switch on - failsafe back into fw mode - _vtol_schedule.flight_mode = FW_MODE; } }