Overview
The public 2.recording.py example usesTopicRecorder to save WUJI Glove streams to an MCAP file.
This page uses Python. For C SDK recording, see Recording Examples.
Prerequisites
- Complete the device connections and network setup in WUJI Glove Getting Started.
- Install WUJI SDK. For environment requirements, see the WUJI SDK Quick Start.
Example Configuration
Integration Steps
The following snippets run insideasync def main() in the public example. See the example file for imports and the complete control flow.
Connect the Device
The example callsmanager.scan(), filters for DeviceType.WujiGlove, and connects to the first glove by serial number. If no device or glove is found, it prints a message and exits.
Register the Channels
Create a recorder and register three device streams:Start Recording
Create the output directory, generate a timestamped filename, and start recording:Stop and Clean Up
After 10 seconds, callhandle.stop(). If the task is cancelled, asyncio.shield() protects the stop task, and the example waits for it to finish:
finally block calls manager.disconnect_all() to disconnect the device.
Running It
Run the following command from the root of the publicwuji-sdk repository:
Done line shows these results:
Open the MCAP file with Foxglove Studio or inspect it with
mcap info.