From 5934ad75133a230ce881d0dedf9636a1c5aef21c Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Fri, 6 Dec 2019 11:03:41 +0100 Subject: [PATCH] navigator: fix VTOL RTL corner case This fixes a corner case for VTOL RTL with RTL_TYPE 1. RTL_TYPE 1 means that the VTOL skips all waypoints on RTL and jumps to the land waypoint at the end. During a mission in fixedwing mode it will continue to fly in fixedwing mode and then do a transition before landing. However, if RTL is engaged right at the moment of the front transition, the transition waypoint is not inserted and the VTOL will try to land in fixedwing mode at the mission land location. This corner case is fixed in this patch by also considering the "transition after takeoff" state. --- src/modules/navigator/mission.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/navigator/mission.cpp b/src/modules/navigator/mission.cpp index bfd494f6c9..79ffc101b6 100644 --- a/src/modules/navigator/mission.cpp +++ b/src/modules/navigator/mission.cpp @@ -804,7 +804,7 @@ Mission::set_mission_items() /* move to land wp as fixed wing */ if (_mission_item.nav_cmd == NAV_CMD_VTOL_LAND - && _work_item_type == WORK_ITEM_TYPE_DEFAULT + && (_work_item_type == WORK_ITEM_TYPE_DEFAULT || _work_item_type == WORK_ITEM_TYPE_TRANSITON_AFTER_TAKEOFF) && new_work_item_type == WORK_ITEM_TYPE_DEFAULT && !_navigator->get_land_detected()->landed) {