Skip to main content

Overview

Subscribe to the Wuji Hand 2 joint_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.
This example only reads. It doesn’t enable the motors, and the fingers don’t move.

Prerequisites

Hardware

Software

Data Flow

The handle from subscribe() supports both retrieval styles: await recv_async() asynchronously and recv() synchronously. Frame structure is identical to the callback form.

Runtime Handling

Integration Steps

Subscribing is read-only and needs neither 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 with asyncio.gather() is enough. Devices don’t block each other.

Lower the Rate

About 1 kHz is higher than most applications need. Use set_rate() on the same handle, noting the firmware version requirement described in Adjusting Stream Rate.