From 7925a928704678b25d7ebe433f4f279f17318c8c Mon Sep 17 00:00:00 2001 From: Angus Forbes Date: Wed, 2 Dec 2026 09:41:46 -0600 Subject: [PATCH 1/2] Fix XYZW quaternion zeroing slice in ForgeEnv Signed-off-by: Angus Forbes --- .../isaaclab_tasks/isaaclab_tasks/contrib/forge/forge_env.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/forge/forge_env.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/forge/forge_env.py index 20b200d31f5b..7c266579cb1b 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/contrib/forge/forge_env.py +++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/forge/forge_env.py @@ -79,7 +79,8 @@ def _compute_intermediate_values(self, dt): self.noisy_fingertip_quat = quat_mul( self.fingertip_midpoint_quat, quat_from_angle_axis(rot_noise_angle, rot_noise_axis) ) - self.noisy_fingertip_quat[:, ::3].zero_() + # Zero z (idx 2) and w (idx 3) in XYZW format, preserving x=cos(yaw/2) and y=-sin(yaw/2). + self.noisy_fingertip_quat[:, 2:4].zero_() self.noisy_fingertip_quat = self.noisy_fingertip_quat * self.flip_quats.unsqueeze(-1) # Repeat finite differencing with noisy fingertip positions. From 9e2acb24c5d539712c2f66510061f3087f61a801 Mon Sep 17 00:00:00 2001 From: Angus Forbes Date: Wed, 2 Dec 2026 09:47:53 -0600 Subject: [PATCH 2/2] Address review feedback: add changelog fragment and tighten comment Signed-off-by: Angus Forbes --- .../changelog.d/fix-forge-xyzw-quat-zeroing.fixed.rst | 3 +++ .../isaaclab_tasks/isaaclab_tasks/contrib/forge/forge_env.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 source/isaaclab_tasks/changelog.d/fix-forge-xyzw-quat-zeroing.fixed.rst diff --git a/source/isaaclab_tasks/changelog.d/fix-forge-xyzw-quat-zeroing.fixed.rst b/source/isaaclab_tasks/changelog.d/fix-forge-xyzw-quat-zeroing.fixed.rst new file mode 100644 index 000000000000..9467f77b849c --- /dev/null +++ b/source/isaaclab_tasks/changelog.d/fix-forge-xyzw-quat-zeroing.fixed.rst @@ -0,0 +1,3 @@ +* Fixed ``ForgeEnv._compute_intermediate_values`` zeroing ``noisy_fingertip_quat[:, ::3]`` (``x`` and ``w`` in XYZW + format) instead of ``[:, 2:4]`` (``z`` and ``w``), which dropped yaw orientation information for the downward-facing + end-effector after the WXYZ-to-XYZW migration. diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/forge/forge_env.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/forge/forge_env.py index 7c266579cb1b..b02a028f2bea 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/contrib/forge/forge_env.py +++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/forge/forge_env.py @@ -79,7 +79,7 @@ def _compute_intermediate_values(self, dt): self.noisy_fingertip_quat = quat_mul( self.fingertip_midpoint_quat, quat_from_angle_axis(rot_noise_angle, rot_noise_axis) ) - # Zero z (idx 2) and w (idx 3) in XYZW format, preserving x=cos(yaw/2) and y=-sin(yaw/2). + # Zero z and w in XYZW format to project the downward-facing EE orientation onto yaw. self.noisy_fingertip_quat[:, 2:4].zero_() self.noisy_fingertip_quat = self.noisy_fingertip_quat * self.flip_quats.unsqueeze(-1)