# IsaacLab AMP任务四元数wxyz误传xyzw致人形机器人倒立训练

> 原文链接：https://robotics.hellobike.com/pitfalls/2026-11-16-isaaclab-8534
> 频道：pitfalls | 更新日期：2026-11-16 | 标签：auto, github-issue, isaaclab
> 核心摘要：MotionLoader输出wxyz格式四元数未转换直接传入xyzw接口，导致重置与AMP观测中躯干倒置。需在两处边界调用convert_quat转换为xyzw格式。

# IsaacLab AMP任务四元数wxyz误传xyzw致人形机器人倒立训练

::: v-pre
> 本文由 AI 根据公开内容整理，可能有误，请以原文为准：[[Bug] contrib humanoid_amp: wxyz motion-file quaternions are passed to xyzw APIs, so the humanoid spawns and trains upside down (3.0)](https://github.com/isaac-sim/IsaacLab/issues/8534)（GitHub isaac-sim/IsaacLab #8534）

**状态**：有绕过办法

## 问题

Isaac Lab 3.0的contrib AMP任务（Walk/Run/Dance）读取motion文件时为wxyz格式，但直接传入期望xyzw的API。导致每次reset时躯干朝下，AMP参考观测也呈倒置状态。策略虽能训练至接近10s时长，但实际表现为头着地行走；torso up-vector z分量约为-0.99而非+1。

## 环境

Isaac Lab 3.0 (develop分支 commit 0ab97e9)，任务IsaacContrib-Humanoid-AMP-Walk-Direct，RL库skrl，算法AMP，内置humanoid_walk.npz等motion文件。

## 解决办法

1. 在`humanoid_amp_env.py`第154行reset root pose赋值前，对`body_rotations[:, motion_torso_index]`调用`isaaclab.utils.math.convert_quat(to="xyzw")`进行格式转换。
2. 在同文件第191行计算reference AMP observation时，对传入`compute_obs`的`body_rotations[:, self.motion_ref_body_index]`同样执行`convert_quat(to="xyzw")`转换。
3. 保持`MotionLoader`及原始npz文件仍为wxyz格式不变，仅在消费端边界做转换。
4. 添加无仿真器回归测试，验证bundled `humanoid_walk.npz`经转换后torso up-vector z≈+0.997。

讨论原作者：@liminallyspaced 等，版权归原作者所有。
:::

## 原始参考来源 (Sources)

- [GitHub isaac-sim/IsaacLab #8534：[Bug] contrib humanoid_amp: wxyz motion-file quaternions are passed to xyzw APIs, so the humanoid spawns and trains upside down (3.0)](https://github.com/isaac-sim/IsaacLab/issues/8534)