Overview
Subscribe to the Wuji Hand 2joint_states stream with async/await. Compared with callbacks, frames come out sequentially inside a coroutine with no cross-thread handoff.
When your application already runs on asyncio, this fits more naturally. Concurrency across devices falls out of asyncio.gather() rather than thread management.
Matching example: examples/python/wuji_hand_2/1.subscribe_async.py.
For joint state and field definitions, see SDK Reference. This page covers only how to run it and what the measurements show.
The C API has no async form. C subscriptions all go through callbacks, described in Subscribing With Callbacks.
Prerequisites
Hardware
Software
Data Flow
The handle fromsubscribe() supports both retrieval styles: await recv_async() asynchronously and recv() synchronously. Frame structure is identical to the callback form.
Runtime Handling
Integration Steps
enable() nor disable().
Running It
Measurements
On a right-hand Wuji Hand 2 with all 20 joints online:
Both retrieval styles reach the same throughput and both keep up with the device’s roughly 1 kHz broadcast. Choose based on how your application is structured, not on performance.
Adapting It
Async or Callback
Concurrency Across Devices
One coroutine per device withasyncio.gather() is enough. Devices don’t block each other.
Lower the Rate
About 1 kHz is higher than most applications need. Useset_rate() on the same handle, noting the firmware version requirement described in Adjusting Stream Rate.
Related
- Subscribing With Callbacks: the callback form, and the only form the C API offers
- Adjusting Stream Rate: lower the firmware push rate
- Data Subscription: subscription model and lifecycle