From 1a1bb2629d0efae29a85221486514dade5a614cb Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Wed, 23 Jun 2021 11:39:05 +0200 Subject: [PATCH] tiltrotor: add transition timeout (abort transition after VT_TRANS_TIMEOUT, Quadchute) Signed-off-by: Silvan Fuhrer --- src/modules/vtol_att_control/tiltrotor.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/modules/vtol_att_control/tiltrotor.cpp b/src/modules/vtol_att_control/tiltrotor.cpp index b5794c6a8f..1bab60fc96 100644 --- a/src/modules/vtol_att_control/tiltrotor.cpp +++ b/src/modules/vtol_att_control/tiltrotor.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (c) 2015 PX4 Development Team. All rights reserved. + * Copyright (c) 2015-2021 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -182,6 +182,14 @@ void Tiltrotor::update_vtol_state() _vtol_schedule.transition_start = hrt_absolute_time(); } + // check front transition timeout + if (_params->front_trans_timeout > FLT_EPSILON) { + if (time_since_trans_start > _params->front_trans_timeout) { + // transition timeout occured, abort transition + _attc->quadchute(VtolAttitudeControl::QuadchuteReason::TransitionTimeout); + } + } + break; }