GimbalDriver moves a stabilised mount to a commanded attitude or rate, and reports the current pointing state.
The first-party reference is MavlinkGimbalDriver in the MAVLink Gimbal v2 plugin (extensions/mavlink-gimbal-v2). It drives any gimbal that speaks the MAVLink Gimbal Manager Protocol v2 (ArduPilot or PX4 forwarding; Storm32 NT and Gremsy in MAVLink mode). It ships no serial SimpleBGC, Storm32 or Gremsy drivers.
The interface
f32, and command_rate returns DriverError::NotSupported on a position-only mount.
Capabilities
max_rate_dps=None means the gimbal is position-controlled only.
State
*_rate_dps at 0.0. Put driver-specific status (fault codes, mount temperature, firmware version) under metadata. Your plugin’s GCS half renders this data; publish it with ctx.telemetry.extend or ctx.events.publish.
Region of interest
ROI is not part of theGimbalDriver contract. A driver that supports it adds its own methods. The reference driver adds set_roi_location and clear_roi, which map to MAV_CMD_DO_SET_ROI_LOCATION (195) and MAV_CMD_DO_SET_ROI_NONE (197).
Opening the driver from your plugin
The reference plugin builds its driver inon_start around a router handle for the agent’s MAVLink link, registers its MAVLink component, and feeds incoming GIMBAL_DEVICE_ATTITUDE_STATUS messages to driver.on_attitude_status(...). See agent/src/altnautica_gimbal_v2/plugin.py. For MAVLink gimbals declare mavlink.read, mavlink.write and mavlink.component.gimbal; the full table is on Driver layer.
Testing without hardware
Construct the driver against a mock MAVLink router. The reference plugin’sagent/tests/test_mavlink_driver.py shows the round trip: command pitch -30 and yaw 45, capture the encoded COMMAND_LONG, feed a GIMBAL_DEVICE_ATTITUDE_STATUS sample through driver.on_attitude_status(...), and assert the state updates.
Next steps
Driver layer
The shared contract and the manifest table.
MAVLink extensions
Own a MAVLink component id from a plugin.
Hardware testing
Mock routers and SITL.
LiDAR driver
The next driver kind.