State, subscriptions, and real-time control
Snapshots read once, subscriptions pull periodically, and Servo sessions send continuous targets.
| API | Direction | Use |
|---|---|---|
state.snapshot() | Device to application | Preflight and post-command verification |
state.subscribe() | Device to application | Continuous state monitoring and logging |
touch.subscribe() | Device to application | Tactile monitoring and algorithm input |
health.subscribe() | Device to application | Runtime and fault monitoring |
open_servo() | Application to device | Continuous position or impedance targets |
Subscription lifecycle
python
subscription = hand.state.subscribe(period=0.02)
try:
while True:
state = await subscription.next()
process_state(state)
finally:
subscription.close()Subscriptions do not retain history. Use bounded queues and define a drop or downsampling policy when consumers are slower than acquisition; do not allow telemetry to accumulate without a limit.
Servo session
A Servo session owns control state. Complete layout and Health checks before opening it, define send timing and command timeout, monitor telemetry without assuming its rate equals the control rate, and close the session on every exit. No unconditional fixed frequency is guaranteed across hosts, adapters, bus load, and firmware.