The driver layer is a sub-pattern of agent plugins. Same manifest, same lifecycle, same sandbox. What is new is a set of typed base classes that the host knows how to register, discover, and route data to and from. A driver is just a plugin that subclasses one of these bases and declares the matchingDocumentation Index
Fetch the complete documentation index at: https://docs.altnautica.com/llms.txt
Use this file to discover all available pages before exploring further.
sensor.*.register capability
in its manifest.
Why a driver layer
Hardware-driver plugins are the highest-value class of extensions. A vendor shipping a thermal camera, a LiDAR, a custom GPS, a payload actuator, or a vendor-specific gimbal wants their hardware to “just work” once installed. They do not want to fork the agent. They want a stable interface that says “implement these methods and we will route the rest.”The six driver kinds
| Kind | Base class | Page |
|---|---|---|
| Camera (visible, thermal, depth, multi-spectral) | CameraDriver | Camera driver |
| Gimbal (SBGC, MAVLink mount, vendor serial) | GimbalDriver | Gimbal driver |
| LiDAR (RPLidar, Livox, Velodyne, custom) | LidarDriver | LiDAR driver |
| GPS (u-blox, NMEA, RTK, vendor-custom) | GpsDriver | GPS driver |
| ESC telemetry (DShot, KISS, BLHeli32) | EscDriver | ESC driver |
| Payload actuator (sprayer, dropper, claw, sampler) | PayloadActuatorDriver | Payload actuator driver |
CameraDriver yields
FrameBuffers. A GpsDriver yields GpsFixes. A GimbalDriver
takes attitude commands. The shared four-method preamble lets the
agent’s peripheral manager handle every kind uniformly.
Lifecycle
- The plugin’s
on_starthook constructs the driver and registers it:peripheral_manager.register_camera_driver(driver). The manifest must declare the matchingsensor.camera.registercapability or registration is rejected. - The peripheral manager calls
discover()on every registered driver at boot and on USB / serial hotplug events. Each driver reports a list ofXCandidates for devices it claims it can open. - Multiple drivers may claim the same device. The peripheral
manager arbitrates by priority (manifest’s
driver_priorityfield) and falls back to first-registered when ties occur. - The winning driver gets
open(candidate, config)called against it.configis the operator-edited config validated againstconfig-schema.json. - The driver yields data through its kind-specific stream method
(
frame_iterator,fix_iterator,state_iterator, etc.). - On unload or hotplug-disappear,
close(session)runs.
Errors
Drivers raise fromados.sdk.drivers.errors:
DriverError is the base. DriverDeviceNotFound says “the
candidate disappeared between discover and open.” DriverPermissionDenied
says “the device exists but the agent process cannot open it”
(missing udev rule, locked USB, etc.).
The host catches these, logs them, and surfaces them in the GCS
plugin event stream. A driver that raises bare Exception is
treated as crashed and the plugin is moved to the circuit-breaker
state per the lifecycle rules.
Where to go next
- Camera driver for the worked example, including the FLIR Lepton USB UVC reference plugin.
- Vendor binaries when your driver
needs a closed-source
.soto talk to the device. - Hardware testing for SITL, hardware-in-loop, and rig-on-bench testing patterns.