Skip to main content
A GimbalDriver moves a stabilised mount to a commanded attitude or rate, and reports back the current pointing state. The first-party reference is the MAVLink Gimbal v2 driver at altnautica/ADOSExtensions/extensions/mavlink-gimbal-v2, which targets ArduPilot’s Gimbal Manager Protocol v2 and stubs out SimpleBGC, Storm32 NT, and Gremsy serial drivers behind the same base.

The interface

A Rust trait of the same shape ships in the ados-sdk crate at ados_sdk::drivers::GimbalDriver. It mirrors the Python contract (discover, open, close, capabilities, command_attitude, command_rate, get_state, state_iterator) with an associated Session type, takes f32 angles, and returns DriverResult (command_rate returns DriverError::NotSupported for position-only mounts). GimbalCandidate, GimbalCapabilities, and GimbalState carry the same fields. Pick the language that matches your plugin’s agent.runtime (python or rust).

Capabilities

Limits are degrees from neutral. None on max_rate_dps means the gimbal is position-controlled only.

State

Drivers that cannot report rates fill *_rate_dps with 0.0. Driver-specific status (fault codes, mount temperature, vendor firmware version) goes under metadata; the GCS panel renders known keys with friendly labels and shows the rest as a generic detail list.

Manifest permissions

ROI vs attitude

Two separate motion modes:
  • Attitude / rate: the GCS sets pitch and yaw directly via command_attitude or command_rate. The driver propagates the command verbatim.
  • ROI (region of interest): the GCS hands the driver a geographic point (lat, lon, alt). The driver figures out the attitude that points the camera at that point and tracks it as the vehicle moves. ROI is implemented inside the driver because the mount hardware sometimes resolves it in firmware.
The reference MAVLink driver maps ROI to MAV_CMD_DO_SET_ROI_LOCATION (cmd 195) and release-ROI to MAV_CMD_DO_SET_ROI_NONE (cmd 197).

Registering

Testing without hardware

Construct the driver against a mock MAVLink router (or a mock serial port). The reference plugin’s tests/ shows the round-trip pattern: command pitch=-30 yaw=45, capture the encoded COMMAND_LONG byte payload, inject a GIMBAL_MANAGER_STATUS reply, assert state updates.

See also