MAVLINKHUD

GUIDED Mode (Plane)

Executive Summary

GUIDED Mode is designed for "Offboard Control". It allows a Ground Control Station (GCS) or Companion Computer to command the aircraft dynamically. The most common use case is "Click to Fly," where the user clicks a point on the map, and the plane flies to that location and loiters. It also supports advanced "Attitude Target" commands for researchers testing custom control loops.

Theory & Concepts

1. Offboard State Machine

GUIDED mode is the entry point for Robotic Automation.

  • The Concept: Standard modes are for "Flying." GUIDED mode is for "Instruction."
  • Targeting: You don't tell the plane how to fly; you tell it where you want it to be. The L1 and TECS controllers take over to solve the math of the flight path.

2. High-Latency Safe Logic

When a companion computer controls a drone, there is always Latency (delay).

  • The Hazard: If the computer crashes or the WiFi drops, the drone shouldn't keep flying straight.
  • The Guard: Guided mode includes a "Slew" mechanism. It will only accept changes within a certain rate. If no new instructions arrive, the plane reverts to its default behavior (usually Loitering) rather than continuing its last commanded vector into a mountain.

Hardware Dependency Matrix

Guided mode is a navigation mode.

Sensor Requirement Code Implementation Notes
GPS CRITICAL Required for all Position-based commands.
Compass CRITICAL Required for heading.
Telemetry CRITICAL A link to the GCS/Companion Computer is required to receive commands.

Control Architecture (Engineer's View)

Plane Guided mode is simpler than Copter Guided mode. It generally behaves like Loiter but with a dynamic target.

  1. Waypoint Logic:
    • When you set a target location (Position + Altitude), the controller generates a path to it.
    • Once it reaches the target, it enters a Loiter (Orbit) state.
    • Code Path: ModeGuided::navigate() calls plane.update_loiter().
  2. Attitude Target (Research):
    • If enabled, external software can stream SET_ATTITUDE_TARGET messages (Quaternion + Thrust).
    • The Plane bypasses its high-level navigation and attempts to match the requested Roll/Pitch/Yaw.
    • Warning: No safety limits are applied here. You can stall or crash if the external computer commands it.
  3. Velocity Control:
    • Limitation: Unlike Copter, standard fixed-wing Plane Guided mode does not generally support direct Velocity Vector control (e.g., "Fly North at 10m/s"). It is Position-centric.

Pilot Interaction

  • Stick Mixing: By default, Stick Mixing is disabled in Guided mode (STICK_MIXING logic). The pilot is a passenger.
  • Takeover: To abort, switch flight modes (e.g., to FBWA or Manual).

Failsafe Logic

  • Data Link Loss: If the GCS link is lost, the plane will continue to Loiter at the last received target indefinitely (unless a separate GCS Failsafe is triggered to force RTL).

Key Parameters

Parameter Default Description
GUIDED_SLEW_SPD 0 Max speed change rate.
GUIDED_SLEW_ALT 0 Max altitude change rate.

Source Code Reference