> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wuji.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# 数据订阅

> 用 sub 订阅实时数据流并采集到文件

## 订阅 topic

`wuji sub <topic>` 订阅设备实时数据。默认持续订阅直到 Ctrl+C，加 `--count N` 收满 N 帧后自动退出：

```bash theme={null}
wuji sub emf_poses --count 1             # 收 1 帧后退出
wuji sub tactile --count 10 --sn <SN>    # 指定设备收 10 帧
wuji sub imu_data/palm --count 1 --jsonl # 每帧一行紧凑 JSON
```

可订阅的 topic 用 `wuji resources` 查看，完整清单以命令输出为准。常用 topic 速查：

| Topic | 说明 |
| - | - |
| `tactile` | 触觉矩阵 |
| `emf_poses` | EMF 姿态 |
| `imu_data/palm` | IMU 数据 |
| `tip_poses` | 指尖位姿 |
| `hand_joint_angles` | 关节角 |
| `hand_skeleton` | 手部骨架 |
| `tf` | 坐标变换 |

## 采集数据到文件

`--jsonl` 每帧输出一行紧凑 JSON，配合管道即可轻量录制：

```bash theme={null}
wuji sub tactile --count 500 --jsonl > tactile.jsonl          # 静默录制
wuji sub emf_poses --count 500 --jsonl | tee emf.jsonl | jq   # 边录边看
```

退出码为 0 表示按预期收满帧数，非 0 表示订阅失败，可用于脚本判定。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.