1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! 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
//!
//! ```no_run
//! # fn main() -> turret::Result<()> {
//! let mut gimbal = turret::detect_gimbal("/dev/ttyUSB0")?;
//! gimbal.set_attitude(10.0, 0.0, -15.0)?;
//! # Ok(()) }
//! ```
//!
//! # Public surface
//!
//! - [`GimbalDevice`] — trait implemented by every supported gimbal backend.
//! - [`detect_gimbal`] — probe a serial device for a supported protocol and
//! return a boxed [`GimbalDevice`].
//! - [`Attitude`] — Euler angles returned by the device.
//! - [`Error`] / [`Result`] — typed errors at the library boundary.
//!
//! 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`.
// Crate-level lint floor (`forbid(unsafe_code)`, `deny(clippy::unwrap_used)`,
// etc.) lives in `Cargo.toml [lints]`. Tests opt out per `mod tests` block
// via `#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]`.
pub use ;
pub use ;