RTL - Skip descend state if no delay is set between descend and land

This commit is contained in:
bresch
2019-04-25 18:24:04 +02:00
committed by Lorenz Meier
parent 5763787840
commit 903deb7579
+8 -1
View File
@@ -309,7 +309,14 @@ RTL::advance_rtl()
break;
case RTL_STATE_RETURN:
_rtl_state = RTL_STATE_DESCEND;
// Descend to desired altitude if delay is set, directly land otherwise
if (_param_rtl_land_delay.get() < -DELAY_SIGMA || _param_rtl_land_delay.get() > DELAY_SIGMA) {
_rtl_state = RTL_STATE_DESCEND;
} else {
_rtl_state = RTL_STATE_LAND;
}
if (_navigator->get_vstatus()->is_vtol && !_navigator->get_vstatus()->is_rotary_wing) {
_rtl_state = RTL_STATE_TRANSITION_TO_MC;