> ## 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.

# 坐标变换

设备级坐标变换，独立于各数据流发布。

| API | 返回类型 | 说明 |
| - | - | - |
| `manager.tf_static()` | [FrameTransforms](/docs/wuji-sdk/data-reference#frametransforms) | 静态坐标变换（1 Hz 周期发送） |
| `manager.tf()` | [FrameTransforms](/docs/wuji-sdk/data-reference#frametransforms) | 动态坐标变换（数据驱动） |

```python theme={null}
sub = manager.tf_static().subscribe()
transforms = await sub.recv_async()
for tf in transforms.transforms:
    print(f"{tf.parent_frame_id} → {tf.child_frame_id}")
```

坐标变换类型定义见 SDK [FrameTransform](/docs/wuji-sdk/data-reference#frametransform) 和 [FrameTransforms](/docs/wuji-sdk/data-reference#frametransforms)。坐标系约定与 Frame 树见 [坐标系约定](/docs/wuji-glove/coordinate-frames)。

## tf\_static — 静态坐标变换

发布固定坐标系之间的变换关系，1 Hz 周期发送。通过 `manager.tf_static()` 订阅。

```json theme={null}
{
  "transforms": [
    {
      "timestamp_us": 1709876543210,
      "parent_frame_id": "l_wrist",
      "child_frame_id": "l_hand_emf_tx",
      "translation": [0.01, 0.042, 0.005],
      "rotation": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0,
        "w": 1.0
      }
    }
  ]
}
```

## tf — 动态坐标变换

由手背 IMU 姿态驱动，发布 `waist → {l/r}_wrist` 的实时变换，与 IMU 采样率同步。通过 `manager.tf()` 订阅。

```json theme={null}
{
  "transforms": [
    {
      "timestamp_us": 1709876543210,
      "parent_frame_id": "waist",
      "child_frame_id": "l_wrist",
      "translation": [0.0, -0.3, -0.5],
      "rotation": {
        "x": 0.0,
        "y": 0.17,
        "z": 0.0,
        "w": 0.98
      }
    }
  ]
}
```

<Tabs>
  <Tab title="Python">
    Python：本页前文已展示 Python 接口。
  </Tab>

  <Tab title="C">
    C SDK 使用全局坐标变换订阅接口，回调期间读取 `WujiFrameTransforms`。

    ```c theme={null}
    wuji_subscribe_tf(on_tf, user_data, &sub);
    wuji_subscribe_tf_static(on_tf_static, user_data, &sub_static);
    ```

    帧指针仅在回调期间有效。使用完毕后调用 `wuji_sub_close`。
  </Tab>
</Tabs>


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