From f1ab7cc8802d2a2c5281cd3dbb87d3091382a380 Mon Sep 17 00:00:00 2001 From: Andreas Antener Date: Mon, 17 Aug 2015 15:35:05 +0200 Subject: [PATCH] wait until back transition time has passed --- src/modules/vtol_att_control/standard.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/modules/vtol_att_control/standard.cpp b/src/modules/vtol_att_control/standard.cpp index 1d9d7b1155..8725647849 100644 --- a/src/modules/vtol_att_control/standard.cpp +++ b/src/modules/vtol_att_control/standard.cpp @@ -128,8 +128,11 @@ void Standard::update_vtol_state() _mc_yaw_weight = 1.0f; } else if (_vtol_schedule.flight_mode == TRANSITION_TO_MC) { - // keep transitioning to mc mode - _vtol_schedule.flight_mode = MC_MODE; + // transition to MC mode if transition time has passed + if (hrt_elapsed_time(&_vtol_schedule.transition_start) > + (_params_standard.back_trans_dur * 1000000.0f)) { + _vtol_schedule.flight_mode = MC_MODE; + } } // the pusher motor should never be powered when in or transitioning to mc mode