Skip to content

Commit f62a968

Browse files
authored
fix(robots): correct ANYmal default_orientation to wxyz identity (#782)
default_orientation is consumed as wxyz by every backend (mujoco reads qw,qx,qy,qz; isaacgym/newton reorder wxyz->xyzw; isaacsim rot is wxyz). The value [0,0,0,1] is the xyzw identity pasted into a wxyz field — under wxyz it is a 180-degree yaw, so ANYmal spawned facing backwards. Use [1,0,0,0]. No task or policy references anymal, so nothing depended on the old spawn. Adds a general regression test asserting the wxyz identity.
1 parent b584311 commit f62a968

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

roboverse_pack/robots/anymal_cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class AnymalCfg(RobotCfg):
7979

8080
# Default base position
8181
default_position: list[float] = [0.0, 0.0, 0.62]
82-
default_orientation: list[float] = [0.0, 0.0, 0.0, 1.0] # quaternion
82+
default_orientation: list[float] = [1.0, 0.0, 0.0, 0.0] # quaternion (wxyz); identity
8383

8484
# Observation configuration
8585
observe_base_position: bool = True

tests/test_roboverse_robot_cfg_validation.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,20 @@ def test_known_gap_dicts_match_actual_failures():
205205
f"_KNOWN_DEFAULT_POS_OUT_OF_RANGE_GAPS[{name!r}] lists this as a gap ({reason!r}) but "
206206
f"all defaults are now inside limits — remove the entry."
207207
)
208+
209+
210+
@pytest.mark.general
211+
def test_anymal_default_orientation_is_wxyz_identity():
212+
"""Regression: ANYmal's default_orientation must be wxyz identity [1,0,0,0].
213+
214+
Handlers consume default_orientation as wxyz (mujoco.py reads qw,qx,qy,qz;
215+
isaacgym reorders wxyz->xyzw). The value was [0,0,0,1] (the xyzw identity),
216+
which under wxyz is a 180 degree yaw — ANYmal would spawn facing backwards.
217+
"""
218+
from roboverse_pack.robots.anymal_cfg import AnymalCfg
219+
220+
cfg = AnymalCfg()
221+
assert cfg.default_orientation == [1.0, 0.0, 0.0, 0.0], (
222+
f"expected wxyz identity [1,0,0,0], got {cfg.default_orientation} "
223+
f"(w must be the largest component for an identity quaternion)"
224+
)

0 commit comments

Comments
 (0)