enpose_api/
lib.rs

1//! Public Rust API for the Enpose 6-DoF tracking system.
2//!
3//! This API lets external applications discover Enpose tracker devices on
4//! the local network ([`DeviceDiscovery`]) and connect to one to receive a
5//! live stream of marker poses ([`PoseStream`]).
6//!
7//! The networking parts are behind the default `net` feature. Building with
8//! `default-features = false` keeps only the wire types ([`MarkerPose`]) and
9//! the pure [`protocol`] constants, which is what targets without a sockets
10//! stack (e.g. `wasm32`) should depend on.
11//!
12//! # Example
13//!
14//! ```no_run
15//! use enpose_api::{DeviceDiscovery, PoseStream};
16//!
17//! // Find a device, then stream poses from it.
18//! if let Some(device) = DeviceDiscovery::new().discover()?.into_iter().next() {
19//!     let mut stream = PoseStream::from_device(&device, false)?;
20//!     // `true` waits for a pose update (up to a 3-second timeout).
21//!     for pose in stream.receive_pose_updates(true)? {
22//!         println!("marker {} @ ({}, {}, {})", pose.marker_id, pose.x, pose.y, pose.z);
23//!     }
24//! }
25//! # Ok::<(), std::io::Error>(())
26//! ```
27
28pub mod marker_pose;
29pub mod protocol;
30
31#[cfg(feature = "net")]
32pub mod devicediscovery;
33#[cfg(feature = "net")]
34pub mod ffi;
35#[cfg(feature = "net")]
36pub mod posestream;
37
38pub use marker_pose::MarkerPose;
39
40#[cfg(feature = "net")]
41pub use devicediscovery::{DeviceDiscovery, DeviceInfo};
42#[cfg(feature = "net")]
43pub use posestream::PoseStream;