mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 10:46:33 +08:00
rtl: for fixed wing (also vtol) make the descend state of RTL use type
NAV_CMD_LOITER_TO_ALT - this allows vtol to track the loiter circle during the transition instead of trying to fly to the landing position Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
@@ -342,7 +342,13 @@ void RTL::set_rtl_item()
|
||||
}
|
||||
|
||||
case RTL_STATE_DESCEND: {
|
||||
_mission_item.nav_cmd = NAV_CMD_WAYPOINT;
|
||||
if (_navigator->get_vstatus()->vehicle_type == vehicle_status_s::VEHICLE_TYPE_FIXED_WING) {
|
||||
_mission_item.nav_cmd = NAV_CMD_LOITER_TO_ALT;
|
||||
|
||||
} else {
|
||||
_mission_item.nav_cmd = NAV_CMD_WAYPOINT;
|
||||
}
|
||||
|
||||
_mission_item.lat = _destination.lat;
|
||||
_mission_item.lon = _destination.lon;
|
||||
_mission_item.altitude = loiter_altitude;
|
||||
|
||||
Reference in New Issue
Block a user