Skip to content

Return Mode (Generic Vehicle)

The Return flight mode is used to fly a vehicle to safety on an unobstructed path to a safe destination, where it should land.

The following topics should be read first if you're using these vehicle types:

INFO

  • Mode is automatic - no user intervention is required to control the vehicle.
  • Mode requires a global 3d position estimate (from GPS or inferred from a local position).
    • Flying vehicles can't switch to this mode without global position.
    • Flying vehicles will failsafe if they lose the position estimate.
  • Mode requires home position is set.
  • Mode prevents arming (vehicle must be armed when switching to this mode).
  • RC control switches can be used to change flight modes on any vehicle.
  • RC stick movement in a multicopter (or VTOL in multicopter mode) will by default change the vehicle to Position mode unless handling a critical battery failsafe.
  • A VTOL will return as MC or FW based on its mode at the point the return mode was triggered. In MC mode it will respect multicopter parameters, such as the landing "cone". In FW mode it will respect fixed-wing parameters (ignore the cone), but unless using a mission landing, will transition to MC mode and land at the destination after loitering at the descent altitude.

Overview

PX4 provides several mechanisms for choosing a safe return path, destination and landing, including using home location, rally ("safe") points, mission paths, and landing sequences defined in a mission.

All vehicles nominally support all of these mechanisms, but not all of them make as much sense for particular vehicles. For example, a multicopter can land virtually anywhere, so it doesn't make sense for it to use a landing sequence except in rare cases. Similarly, a fixed-wing vehicle needs to fly a safe landing path: it can use the home location as a return point, but it won't try and land on it by default.

This topic covers all the possible return types that any vehicle might be configured to use — the vehicle-specific return mode topics cover the default/recommended return type and configuration for each vehicle.

The following sections explain how to configure the return type, minimum return altitude and landing/arrival behaviour.

Return Types (RTL_TYPE)

PX4 provides four alternative approaches for finding an unobstructed path to a safe destination and/or landing, which are set using the RTL_TYPE parameter.

At high level these are:

  • Home/rally point return (RTL_TYPE=0): Ascend to safe altitude and return via a direct path to the closest rally point or home location.
  • Mission landing/rally point return (RTL_TYPE=1): Ascend to a safe altitude, fly direct to the closest destination other than home: rally point or start of mission landing. If no mission landing or rally points are defined, return home via direct path.
  • Mission path return (RTL_TYPE=2): Use mission path and fast-continue to mission landing (if defined). If no mission landing defined, fast-reverse mission to home. If no mission defined, return direct to home (rally points are ignored).
  • Closest safe destination return (RTL_TYPE=3): Ascend to a safe altitude and return via direct path to closest destination: home, start of mission landing pattern, or rally point. If the destination is a mission landing pattern, follow the pattern to land.

More detailed explanations for each of the types are provided in the following sections.

Home/Rally Point Return Type (RTL_TYPE=0)

This is the default return type for a multicopter (see topic for more information).

In this return type the vehicle:

  • Ascends to a safe minimum return altitude (above any expected obstacles).
  • Flies via direct path to the home position or a rally point (whichever is closest)
  • On arrival descends to "descent altitude" and waits for a configurable time. This time may be used to deploy landing gear.
  • Lands or waits (this depends on landing parameters), By default an MC or VTOL in MC mode will land and a fixed-wing vehicle circles at the descent altitude. A VTOL in FW mode aligns its heading to the destination point, transitions to MC mode, and then lands.

INFO

If no rally points are defined, this is the same as a Return to Launch (RTL)/Return to Home (RTH).

Mission Landing/Rally Point Return Type (RTL_TYPE=1)

This is the default return type for a fixed-wing or VTOL vehicle (see topics for more information).

In this return type the vehicle:

  • Ascends to a safe minimum return altitude (above any expected obstacles) if needed. The vehicle maintains its initial altitude if that is higher than the minimum return altitude.
  • Flies via direct constant-altitude path to a rally point or the start of a mission landing pattern (whichever is closest). If no mission landing or rally points are defined the vehicle instead returns home via a direct path.
  • If the destination is a mission landing pattern it will follow the pattern to land.
  • If the destination is a rally point or home it will land or wait at descent altitude (depending on landing parameters). By default an MC or VTOL in MC mode will land, and a fixed-wing vehicle circles at the descent altitude. A VTOL in FW mode aligns its heading to the destination point, transitions to MC mode, and then lands.

INFO

Fixed wing vehicles commonly also set MIS_TKO_LAND_REQ to require a mission landing pattern.

Mission Path Return Type (RTL_TYPE=2)

This return type uses the mission (if defined) to provide a safe return path, and the mission landing pattern (if defined) to provide landing behaviour. If there is a mission but no mission landing pattern, the mission is flown in reverse. Rally points, if any, are ignored.

INFO

The behaviour is fairly complex because it depends on the flight mode, and whether a mission and mission landing are defined.

Mission with landing pattern:

  • Mission mode: Mission is continued in "fast-forward mode" (jumps, delay and any other non-position commands ignored, loiter and other position waypoints converted to simple waypoints) and then lands.
  • Auto mode other than mission mode:
    • Ascend to a safe minimum return altitude above any expected obstacles.
    • Fly directly to closest waypoint (for FW not a landing WP) and descend to waypoint altitude.
    • Continue mission in fast forward mode from that waypoint.
  • Manual modes:
    • Ascend to a safe minimum return altitude above any expected obstacles.
    • Fly directly to landing sequence position and descend to waypoint altitude
    • Land using mission landing pattern

Mission without landing pattern defined:

  • Mission mode:
    • Mission flown "fast-backward" (in reverse) starting from the previous waypoint
      • Jumps, delay and any other non-position commands ignored, loiter and other position waypoints converted to simple waypoints.
      • VTOL vehicles transition to FW mode (if needed) before flying the mission in reverse.
    • On reaching waypoint 1, the vehicle ascends to the minimum return altitude and flies to the home position (where it lands or waits).
  • Auto mode other than mission mode:
    • Fly directly to closest waypoint (for FW not a landing WP) and descend to waypoint altitude.
    • Continue the mission in reverse, exactly as though Return mode was triggered in mission mode (above)
  • Manual modes: Fly directly to home location and land.

If no mission is defined PX4 will fly directly to home location and land (rally points are ignored).

If the mission changes during return mode, then the behaviour is re-evaluated based on the new mission following the same rules as above (e.g. if the new mission has no landing sequence and you're in a mission, the mission is reversed).

Closest Safe Destination Return Type (RTL_TYPE=3)

In this return type the vehicle:

  • Ascends to a safe minimum return altitude (above any expected obstacles).
  • Flies a direct path to the closest destination of: home location, mission landing pattern or rally point.
  • If the destination is a mission landing pattern the vehicle will follow the pattern to land.
  • If the destination is a home location or rally point, the vehicle will descend to the descent altitude (RTL_DESCEND_ALT) and then lands or waits. By default an MC or VTOL in MC mode will land, and a fixed-wing vehicle circles at the descent altitude. A VTOL in FW mode aligns its heading to the destination point, transitions to MC mode, and then lands.

Minimum Return Altitude

For most return types a vehicle will ascend to a minimum safe altitude before returning (unless already above that altitude), in order to avoid any obstacles between it and the destination.

INFO

The exception is when executing a mission path return from within a mission. In this case the vehicle follows mission waypoints, which we assume are planned to avoid any obstacles.

The return altitude for a fixed-wing vehicle or a VTOL in fixed-wing mode is configured using the parameter RTL_RETURN_ALT (does not use the code described in the next paragraph).

The return altitude for a multicopter or a VTOL vehicles in MC mode is configured using the parameters RTL_RETURN_ALT and RTL_CONE_ANG, which define a half cone centered around the destination (home location or safety point).

Return mode cone

If the vehicle is:

  • Above RTL_RETURN_ALT (1) it will return at its current altitude.
  • Below the cone it will return where it intersects the cone (2) or RTL_DESCEND_ALT (whichever is higher).
  • Outside the cone (3) it will first climb until it reaches RTL_RETURN_ALT.
  • Inside the cone:

Note:

  • If RTL_CONE_ANG is 0 degrees there is no "cone":
    • the vehicle returns at RTL_RETURN_ALT (or above).
  • If RTL_CONE_ANG is 90 degrees the vehicle will return at the greater of RTL_DESCEND_ALT and the current altitude.
  • The vehicle will always ascend at least RTL_DESCEND_ALT for the return.

Loiter/Landing at Destination

Unless executing a mission landing pattern as part of the return mode, the vehicle will arrive at its destination, and rapidly descend to the RTL_DESCEND_ALT altitude, where it will loiter for RTL_LAND_DELAY before landing. If RTL_LAND_DELAY=-1 it will loiter indefinitely.

The default landing configuration is vehicle dependent:

  • Multicopters are configured to hover for a short while, deploying landing gear if needed, and then land.
  • Fixed-wing vehicles use a return mode with a mission landing pattern, as this enables automated landing. If not using a mission landing, the default configuration is to loiter indefinitely, so the user can take over and manually land.
  • VTOLs in MC mode fly and land exactly as a multicopter.
  • VTOLS in FW mode head towards the landing point, transition to MC mode, and then land on the destination.

Mission Landing Pattern

A mission landing pattern is a landing pattern defined as part of a mission plan. This consists of a MAV_CMD_DO_LAND_START, one or more position waypoints, and a MAV_CMD_NAV_LAND (or MAV_CMD_NAV_VTOL_LAND for a VTOL Vehicle).

Landing patterns defined in missions are the safest way to automatically land a fixed-wing vehicle on PX4. For this reason fixed-wing vehicles are configured to use Mission landing/really point return by default.

Parameters

The RTL parameters are listed in Parameter Reference > Return Mode (and summarised below).

ParameterDescription
RTL_TYPEReturn mechanism (path and destination).
0: Return to a rally point or home (whichever is closest) via direct path.
1: Return to a rally point or the mission landing pattern start point (whichever is closest), via direct path. If neither mission landing or rally points are defined return home via a direct path. If the destination is a mission landing pattern, follow the pattern to land.
2: Use mission path fast-forward to landing if a landing pattern is defined, otherwise fast-reverse to home. Ignore rally points. Fly direct to home if no mission plan is defined.
3: Return via direct path to closest destination: home, start of mission landing pattern or safe point. If the destination is a mission landing pattern, follow the pattern to land.
RTL_RETURN_ALTReturn altitude in meters (default: 60m) when RTL_CONE_ANG is 0. If already above this value the vehicle will return at its current altitude.
RTL_DESCEND_ALTMinimum return altitude and altitude at which the vehicle will slow or stop its initial descent from a higher return altitude (default: 30m)
RTL_LAND_DELAYTime to wait at RTL_DESCEND_ALT before landing (default: 0.5s) -by default this period is short so that the vehicle will simply slow and then land immediately. If set to -1 the system will loiter at RTL_DESCEND_ALT rather than landing. The delay is provided to allow you to configure time for landing gear to be deployed (triggered automatically).
RTL_MIN_DISTMinimum horizontal distance from home position to trigger ascent to the return altitude specified by the "cone". If the vehicle is horizontally closer than this distance to home, it will return at its current altitude or RTL_DESCEND_ALT (whichever is higher) instead of first ascending to RTL_RETURN_ALT.
RTL_CONE_ANGHalf-angle of the cone that defines the vehicle RTL return altitude. Values (in degrees): 0, 25, 45, 65, 80, 90. Note that 0 is "no cone" (always return at RTL_RETURN_ALT or higher), while 90 indicates that the vehicle must return at the current altitude or RTL_DESCEND_ALT (whichever is higher).
COM_RC_OVERRIDEControls whether stick movement on a multicopter (or VTOL in MC mode) causes a mode change to Position mode (except when vehicle is handling a critical battery failsafe). This can be separately enabled for auto modes and for offboard mode, and is enabled in auto modes by default.
COM_RC_STICK_OVThe amount of stick movement that causes a transition to Position mode (if COM_RC_OVERRIDE is enabled).
RTL_LOITER_RAD[Fixed-wing Only] The radius of the loiter circle (at RTL_LAND_DELAY).
MIS_TKO_LAND_REQSpecify whether a mission landing or takeoff pattern is required. Generally fixed-wing vehicles set this to require a landing pattern but VTOL do not.