MAVLINKHUD

Overview

The HDG parameter group (specifically HDG_CORR_EN and HDG_CORR_WT) configures the Heading Correction logic, primarily within the context of Autonomous Docking (DOCK mode) for ArduRover.

During the final stages of a docking approach, the vehicle must align its heading perfectly with the docking station entrance to avoid a collision.

Key Concepts

1. Correction Enable (HDG_CORR_EN)

Toggles the alignment correction logic. When enabled, the rover prioritizes heading alignment over direct-to-waypoint navigation during the "Final Approach" phase.

2. Weighting (HDG_CORR_WT)

Defines the strength of the correction.

  • Higher values: Vehicle will maneuver more aggressively to line up the heading.
  • Lower values: Smoother transition but may result in "crooked" docking.

Developer Notes

  • Library: Rover/mode_dock.cpp.
  • Context: Only relevant for ArduRover.

HDG_CORR_EN: Dock mode heading correction enable/disable

Description

When enabled, the autopilot modifies the path to approach the target head-on along the desired line of approach (DOCK_DIR) in Dock mode.

Values

Value Meaning
0 Disabled
1 Enabled

Description

This parameter forces the Rover (or Boat) to align with a specific compass heading (DOCK_DIR) before it reaches the dock, ensuring a straight-in approach. This is useful for docking into a slip or connecting to a charging station where the angle of arrival is critical.

  • Enabled (1): The vehicle generates a virtual waypoint along the approach vector to steer the vehicle onto the correct line.
  • Disabled (0): The vehicle drives directly towards the dock from its current position, regardless of the angle.

Source Code

ardupilot/Rover/mode_dock.cpp

HDG_CORR_WT: Dock mode heading correction weight

Description

This value describes how aggressively the vehicle tries to correct its heading to be on the desired line of approach.

Values

  • Range: 0.00 to 0.90
  • Increment: 0.05
  • Default: 0.75

Description

This parameter controls the position of the "virtual target" used to align the vehicle with the dock. It acts as a "carrot on a stick" placed along the desired approach line between the vehicle and the dock.

  • Value: Represents the fraction of the distance from the vehicle to the dock where the virtual target is placed (relative to the dock).
    • 0.75 (Default): The target is placed at 75% of the distance to the dock (effectively 25% ahead of the vehicle) along the approach line.
    • Higher Value (closer to 1.0): The target is placed closer to the vehicle's current distance but projected onto the line. This might result in smoother but slower convergence to the line.
    • Lower Value: The target is placed closer to the dock. This forces a sharper, more aggressive turn to get onto the line quickly.

Source Code

ardupilot/Rover/mode_dock.cpp