Skip to main content
A CameraDriver pumps frames from a physical or networked imaging device into the agent’s frame bus. Visible, thermal, depth, and multi-spectral devices all share this interface. The first-party reference is the FLIR Lepton USB UVC plugin at altnautica/ADOSExtensions/extensions/thermal-camera-flir-lepton-usb.

The interface

Writing the agent half in Rust? The trait equivalent is ados_sdk::drivers::CameraDriver (re-exported from the drivers module of the ados-sdk crate). It carries the same six methods (discover, open, close, capabilities, frame_iterator, set_param) over an async-trait, with CameraCandidate, CameraCapabilities, and FrameBuffer as the matching types. Set runtime: rust in the manifest and the host treats the driver the same way it treats the Python one.

Candidates

CameraCandidate carries the four fields the host needs to render a “select a device” UI:
device_id should be stable across reboots when the bus can produce a stable identifier (USB serial, CSI lane, RTSP URL). Where stability is impossible (raw v4l2 indexing) the driver should still produce a deterministic id within a single boot.

Capabilities

Returned once per session, after open. The host uses these to size buffers, set the GCS preview, and gate features:
radiometric=True tells the host every pixel encodes a temperature and FrameBuffer.radiometric_k will carry the per-pixel K matrix.

Frame buffers

data is a memoryview so downstream consumers can avoid copying when feasible. Drivers may attach driver-specific fields under metadata.

Manifest permissions

Without sensor.camera.register the host rejects peripheral_manager.register_camera_driver(self) and the plugin is moved to the failed state.

Registering

The host calls discover() immediately and then on every USB hotplug and on operator-triggered rescan.

Testing without hardware

Build a MockUvcBackend (or MockSerialBackend, etc.) that produces synthetic frames and inject it into the driver via the constructor. The reference plugin ships exactly this fixture under tests/. The PluginHarness from @altnautica/plugin-sdk/harness is the GCS-side equivalent.

See also