MAVLINKHUD

Overview

The RALLY parameter group configures the Rally Points system. Rally points are alternate "Safe Havens" for the drone to return to during a Failsafe or RTL event, instead of returning all the way to the original takeoff (Home) point.

Rally points are essential for long-range missions (e.g., 20km pipelines) where the vehicle may not have enough battery to return home if a failsafe occurs at the far end of the mission.

Key Concepts

1. Nearest Point Logic

By default, if Rally Points are loaded, the autopilot will calculate the distance to all points and the Home point. It will then choose the closest valid point to return to.

  • RALLY_INCL_HOME: Determines if the Home point is included in this "closest point" calculation.

2. Sanity Checks (RALLY_LIMIT_KM)

If the nearest Rally Point is extremely far away (e.g., left over from a previous flight at a different location), the autopilot will ignore it to prevent a "fly-away."

  • RALLY_LIMIT_KM: The maximum allowable distance to a rally point (default 5km).

Parameter Breakdown

  • RALLY_TOTAL: Read-only count of uploaded rally points.
  • RALLY_LIMIT_KM: Distance safety limit.

Integration Guide

  1. Plan: Use the "Plan" tab in Mission Planner to drop Rally Points along your mission path.
  2. Upload: Write them to the flight controller.
  3. Verify: Arm the vehicle and ensure the GCS shows the rally points on the map.

Developer Notes

  • Library: libraries/AP_Rally.
  • Storage: Stored in a dedicated region of EEPROM.

RALLY_INCL_HOME

Default 1
Range 0 1

Rally Include Home (RALLY_INCL_HOME)

Description

RALLY_INCL_HOME defines the drone's decision logic for Return-to-Launch when multiple "Safe Zones" exist.

Rally Points are pre-programmed safe landing locations. When you trigger RTL, the drone normally finds the closest Rally point and flies there. This parameter determines if the drone's original takeoff point (Home) should also be considered in that "closest" calculation.

  • 1: Enabled (Default). The drone will fly to either Home or the nearest Rally point, whichever is physically closer to its current location.
  • 0: Disabled. The drone will ignore Home and only fly to a Rally point. This is useful if the takeoff point is no longer safe (e.g., you are launching from a moving boat or a crowded area).

Tuning & Behavior

  • Default: 1.
  • Recommendation: Leave at 1 for most users. Only disable if your landing site is strictly restricted to designated Rally zones.

RALLY_LIMIT_KM

km
Default 5
Range 0 100

Rally Limit (RALLY_LIMIT_KM)

Description

This is a safety parameter ("Sanity Check") for Rally Points. If the nearest Rally Point is further away than this limit, the autopilot will ignore it and default to returning to Home (RTL) instead. This prevents the dangerous situation where a drone tries to fly to a Rally Point saved from a previous mission at a distant location (e.g., a different flying field).

The Mathematics

Logic Check:
$$ ext{Target} = \begin{cases} ext{Rally Point} & \text{if } ext{Dist}( ext{Vehicle}, ext{Rally}) < ext{RALLY\_LIMIT\_KM} \ ext{Home} & \text{otherwise} \end{cases} $$

The Engineer's View

Defined in libraries/AP_Rally/AP_Rally.cpp.

  • 0: Disabled. The closest rally point is ALWAYS used, regardless of distance.
  • >0: Enforces the distance limit.

Tuning & Behavior

  • Default Value: 5 km
  • Recommendation: Keep this set to a reasonable radius for your operation (e.g., 2-5km) to prevent fly-aways.

RALLY_TOTAL

Default 0
Range 0 50

RALLY_TOTAL: Rally Total

Description

Number of rally points currently loaded.

Values

  • Range: 0 to 50
  • Default: 0

Description

This parameter indicates how many Rally Points (safe landing/loiter locations) are currently stored in the autopilot's persistent memory.

  • Usage: This is typically updated automatically by the Ground Control Station (GCS) when you upload a Rally Point list. You should not normally edit this manually.
  • Function: The autopilot uses this count to know how many points to check when looking for the nearest safe location during an RTL (Return to Launch).