Capability Model
robot_behavior expresses capabilities through composable traits. A type does not need to implement everything; it exposes only the behavior it actually supports.
Core Layers
Robot
├── Joints<N>
├── EndPoint
├── MoveTo<S>
├── MoveTraj<S>
├── ControlWith<S>
└── Arm<N> = Robot + Joints<N> + EndPoint + MoveTo<JointSpace<N>> + MoveTo<FlangeSpace>
Arm<N> is the aggregate arm trait, but it is not the only entry point. A simulation-only type may implement RobotDescription; a driver supporting one control channel may implement just that ControlWith<S>.
Data and State
Robot::Stateis the driver's native state and may mirror a vendor SDK type.ArmState<N>containsjoint: JointState<N>, a flangeStateView<SpatialSample>, optional TCP/stiffness views, and optional load data. EachStateView<T>preservesmeas,cmdanddes.LoadStatedescribes payload mass, center of mass and inertia.
Why Not Runtime Enums
Older APIs used runtime enums such as MotionType / ControlType. The current mainline uses typed spaces:
Benefits:
- The compiler can distinguish joint position and joint torque even if both are
[f64; N]. - A driver can implement each supported space/channel separately.
- Generic upper layers can state their required capability exactly through trait bounds.