MAVLINKHUD

RTL Mode (Plane)

Executive Summary

Return to Launch (RTL) is the primary autonomous safety mode for fixed-wing aircraft. When triggered (by a switch or failsafe), the plane navigates back to the Home position (or the nearest Rally Point), climbs to a safe altitude, and loiters indefinitely until the pilot regains control or the battery fails.

Theory & Concepts

1. Failsafe Logic Chain

RTL is often the end of a Decision Tree.

  • Trigger 1: Radio link lost (GCS Failsafe).
  • Trigger 2: Low Battery.
  • Trigger 3: Geofence Breach.
  • The Reaction: ArduPilot chooses the safest way back. If "Smart RTL" has a valid path, it uses that (to avoid obstacles). If not, it uses standard RTL.

2. The Return Altitude Profile

Planes don't climb like elevators.

  • The Geometry: To climb 100m, a plane must fly forward ~500m.
  • The Logic: ArduPilot doesn't wait to reach the altitude before turning. It turns towards home and climbs while flying. This saves battery but requires the pilot to ensure RTL_ALTITUDE is high enough to clear local obstacles along the entire path.

Hardware Dependency Matrix

RTL is an autonomous navigation mode.

Sensor Requirement Code Implementation Notes
GPS CRITICAL Required for position tracking and ground speed control. If GPS is lost, RTL cannot function (Mode Change Failure or degradation to Circle).
Compass CRITICAL Required for heading control.
Barometer REQUIRED Primary source for altitude.
Airspeed RECOMMENDED Prevents stall during the potentially aggressive climb-and-turn maneuver.

Control Architecture (Engineer's View)

RTL operates as a variation of Loiter but with a specific destination and altitude profile.

  1. Destination Selection:
    • On entry, it calculates the "Best Return Location".
    • Default: Home Position (where it armed).
    • Rally: If Rally Points are configured (RALLY_LIMIT_KM), it selects the closest valid Rally Point instead of Home.
    • Code Path: ModeRTL::_enter().
  2. Climb vs Turn:
    • The plane attempts to turn towards home and climb simultaneously.
    • Safety: If RTL_CLIMB_MIN is set, the bank angle is limited until the plane has climbed at least that many meters. This prevents the "Death Spiral" where a low plane banks hard, loses more altitude, and crashes.
  3. Arrival:
    • The plane flies a straight line to the destination.
    • Upon arrival, it enters a Loiter (Orbit) at RTL_RADIUS.
    • It maintains RTL_ALTITUDE.

Pilot Interaction

  • Locked Out: Pilot stick input is ignored by default.
  • Override: You must switch flight modes (e.g., to FBWA or Manual) to regain control. Nudging is generally not supported in RTL.

Failsafe Logic

  • RTL Autoland: If RTL_AUTOLAND is enabled, the plane will not loiter indefinitely. Instead, it will traverse to the nearest DO_LAND_START mission item and execute an automatic landing sequence. This is critical for BVLOS operations to save the airframe if the link is never regained.

Key Parameters

Parameter Default Description
RTL_ALTITUDE 100 (m) Target altitude. -1 = Maintain current altitude.
RTL_RADIUS 0 (m) Loiter radius at home. 0 = Use WP_LOITER_RAD.
RTL_CLIMB_MIN 0 (m) Altitude to climb before allowing full banking.
RTL_AUTOLAND 0 0=Disabled (Loiter forever), 1=Fly Home then Land, 2=Go Straight to Landing Sequence.

Source Code Reference