piper_client/lib.rs
1//! 客户端接口模块
2//!
3//! 本模块提供 Piper 机械臂的用户友好接口,包括:
4//! - Type State Pattern(编译期状态安全)
5//! - Commander/Observer 模式(读写分离)
6//! - 强类型单位(Rad、Deg、NewtonMeter)
7//! - 轨迹规划和控制
8//!
9//! # 使用场景
10//!
11//! 这是大多数用户应该使用的模块,提供了类型安全、易于使用的 API。
12//! 如果需要直接控制 CAN 帧或需要更高性能,可以使用 piper_sdk 的 driver 模块。
13//!
14//! # 高级诊断接口
15//!
16//! 对于需要底层访问的场景(如自定义录制、调试),参见 [`diagnostics`] 模块。
17//!
18//! # 标准录制 API
19//!
20//! 对于常规录制场景,参见 [`recording`] 模块。
21
22pub mod builder; // Client 层 Builder
23pub mod control;
24pub mod diagnostics;
25pub mod heartbeat;
26pub mod observer;
27pub(crate) mod raw_commander;
28pub mod recording;
29pub mod state;
30pub mod types;
31
32// 测试模块
33#[cfg(test)]
34mod recording_tests;
35
36// 重新导出常用类型
37pub use builder::PiperBuilder;
38pub use diagnostics::PiperDiagnostics;
39pub use observer::Observer;
40pub use recording::{
41 RecordingConfig, RecordingHandle, RecordingMetadata, RecordingStats, StopCondition,
42};
43pub use state::Piper; // Type State Pattern 的状态机
44pub use types::*;