MAVLINKHUD

Overview

The SRTL parameter group configures the Smart Return to Launch (SmartRTL) mode. Unlike standard RTL, which flies a straight line home, SmartRTL retraces the exact path the vehicle took to get there.

This is ideal for flying in areas with obstacles (like indoors or in a forest) where a straight-line path home might lead to a collision.

Key Concepts

1. Breadcrumb Trail

As the drone flies, it continuously drops "breadcrumbs" in memory to record its path.

  • SRTL_POINTS: The maximum number of points held in memory. Once full, the oldest points are discarded (or simplified).

2. Path Pruning (SRTL_ACCURACY)

To save memory, the system "prunes" (simplifies) the path. If three points are in a nearly straight line, the middle point is deleted.

  • SRTL_ACCURACY: The maximum allowed deviation (meters) from the original path during pruning.

Parameter Breakdown

  • SRTL_OPTIONS: Bitmask for specialized behaviors (e.g., face direction of flight during return).

Integration Guide

  • Prerequisite: SmartRTL is always active in the background if enabled. You can switch to it manually via RC or let it be the target for a Failsafe action.

Developer Notes

  • Library: libraries/AP_SmartRTL.
  • Safety: If the breadcrumb buffer is empty (e.g., failsafe happens immediately after takeoff), the vehicle defaults to standard straight-line RTL.

SRTL_ACCURACY

m
Default 2.0
Range 0 10.0

SmartRTL Accuracy (SRTL_ACCURACY)

Description

SRTL_ACCURACY defines the resolution of your "Breadcrumb" trail when using Smart RTL.

Unlike a standard RTL (which flies a straight line home), Smart RTL records your exact flight path and "rewinds" it to fly you back the same way you came. This is critical for avoiding obstacles like trees or buildings in complex environments. This parameter sets how far you must travel before the autopilot drops a new breadcrumb.

Tuning & Behavior

  • Default: 2.0 meters.
  • Effect of Decreasing: Dropping points more often (e.g., every 0.5m) creates a very smooth, exact path, but it fills up the drone's memory much faster.
  • Effect of Increasing: (e.g. 5m) saves memory, but the return path will be "choppier" and might cut corners.
  • Safety: If the breadcrumb memory fills up, the drone will revert to standard (straight-line) RTL.

SRTL_OPTIONS

Bitmask
Default 0
Range 0 3

SmartRTL options (SRTL_OPTIONS)

Description

This bitmask allows you to customize the behavior of the Smart RTL (Return To Launch) mode, which returns the vehicle home by retracing its outbound path.

The Mathematics

Bitmask.

The Engineer's View

Defined in libraries/AP_SmartRTL/AP_SmartRTL.cpp.

  • Bit 0: Ignore Pilot Yaw. If set, the vehicle will face the direction of travel along the path rather than allowing the pilot to look around.
  • Bit 1: Prune Path. If set, the algorithm aggressively simplifies the path to save memory.

Tuning & Behavior

  • Default Value: 0
  • Recommendation: Default is usually best.

SRTL_POINTS

Default 100
Range 0 500

SRTL_POINTS: SmartRTL maximum number of points on path

Description

This parameter sets the memory limit for the "Smart RTL" (Return to Launch) path tracking.

Values

  • Range: 0 to 500
  • Default: 100
  • Memory Cost: ~3 KB per 100 points.

Description

Smart RTL allows a drone to return home by replaying its outgoing path (like a breadcrumb trail), which is essential if you are flying in an area with obstacles (like buildings or trees) that would block a straight-line RTL.

  • Function: As you fly, the autopilot saves your position as a series of "Points." This parameter limits how many points can be stored.
  • Out of Space: If you fly a very long, complex path and run out of points, Smart RTL will simplify the older parts of the path by deleting intermediate breadcrumbs.
  • Disable: Setting this to 0 completely disables the Smart RTL feature to save RAM on memory-constrained boards.
  • Reboot Required: Changes to this parameter require a reboot to reallocate memory.