Subscription Modes
Async Receive
Sync Non-blocking Receive
Callback Receive
- Python
- C
WujiFrameKind. WUJI_FRAME_KIND_OK means the frame is readable, _LAG means the consumer fell behind and carries a lag count, and _END and _ERROR are terminal. The frame pointer is valid only for the duration of the callback, so copy anything you need to keep.
Closing Subscriptions
Callback subscriptions must be manually closed:- Python
- C
Adjusting the Stream Output Rate
Adjust the firmware push rate of a subscribed stream. The call returns the rate the device applies:- Python
- C
- Call it on an open subscription handle. The setting stays in effect for the life of the subscription.
- Rates can only go down, not above the native rate. The device quantizes the request to a supported rate (an integer division of the native rate), and the applied rate is what counts. In C, pass
NULLforout_actual_hzwhen the applied rate isn’t needed. - The rate belongs to the stream, not to the handle: all subscribers of the stream share the setting, and the last write wins.
- The setting doesn’t persist: the rate resets to the device default full rate when the last subscription to the stream is closed or the device reconnects.
- Only streams produced directly by the device support rate control. Derived streams follow their source rate automatically, and global resources such as
tf_staticare aggregated by the SDK. Adjusting either raisesWujiExceptionin Python and returnsWUJI_STATUS_ERR_UNSUPPORTED(-8) in C. - Requires firmware with stream rate control support. Firmware without it raises
WujiExceptionin Python and returnsWUJI_STATUS_ERR_UNSUPPORTED(-8) in C.
joint_states and joint_diagnostics on the Wuji Hand 2 share one device stream, so adjusting either changes both.
For complete examples, see examples/python/wuji_glove/6.set_stream_rate.py, examples/python/wuji_hand_2/4.set_stream_rate.py, examples/c/wuji_glove/1_set_stream_rate.c, and examples/c/wuji_hand_2/4_set_stream_rate.c.
Cross-device Merged Subscription
Global resources automatically aggregate data from all connected devices. Global resources in the current version:
Query the full list of global resources at runtime, then subscribe:
- Python
- C
Available Data Streams
Index by Product
Interface List
Python offers three ways to take frames: async, sync non-blocking, and callback. C offers callbacks only, and the frame pointer is valid only for the duration of the callback. For memory ownership and callback constraints in C, see the C Interface Reference.