mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-24 07:09:48 +08:00
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.
This commit is contained in:
@@ -820,7 +820,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) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user