Skip to main content

Crate turret

Crate turret 

Source
Expand description

Turret — gimbal control and MAVLink Gimbal Manager.

This crate is the library half of the turret package. The binary of the same name (src/main.rs) is a thin CLI consumer of the API below.

§Quick start

let mut gimbal = turret::detect_gimbal("/dev/ttyUSB0")?;
gimbal.set_attitude(10.0, 0.0, -15.0)?;

§Public surface

Lower-level modules (protocols and device_scanner) are exposed for advanced integration but do not yet guarantee a stable API surface.

For embedding the MAVLink Gimbal Manager + IPC server in your own binary with a custom GimbalDevice (different protocol, simulator, network-attached gimbal), see the module-level docs of daemon (only built with the daemon feature, which is on by default).

§Cargo features

  • daemon (default) — pulls in tokio, the IPC server, the MAVLink Gimbal Manager, and the daemon module. Disable with default-features = false to use this crate as a lean Storm32 driver (just serialport, thiserror, tracing, and serde).
  • cli (default) — pulls in clap and tracing-subscriber for the turret binary. The bin target requires both cli and daemon.

Re-exports§

pub use error::Error;
pub use error::Result;
pub use gimbal::detect_gimbal;
pub use gimbal::Attitude;
pub use gimbal::GimbalDevice;

Modules§

daemon
Long-running daemon: IPC server + MAVLink Gimbal Manager + hot-plug recovery glued onto a single gimbal handle.
device_scanner
Auto-detect a connected STorM32 gimbal by USB CDC vendor / product id.
error
Library-boundary error type.
gimbal
Gimbal device abstraction and runtime auto-detection.
protocols
Wire-protocol drivers that implement crate::gimbal::GimbalDevice.