Skip to content

[Bug Report] [Newton Branch] Incorrect axis index for compute_rot in locomotion envs #4465

Closed

Description

@fanzongsao

Describe the bug

In the dev/newton and feature/newton branches, the compute_rot function in both locomotion_env_warp.py and locomotion_env.py calculates angle_to_target using the Z-axis (index 2) instead of the Y-axis (index 1).

The environment is Z-up, and the calculated angle is compared with the robot's Yaw (rpy[...][2]). Therefore, the target angle must be calculated in the XY plane to be physically meaningful. The current implementation incorrectly calculates the angle in the XZ plane (pitch/elevation).

Steps to reproduce

Inspect the code in isaaclab_tasks_experimental/isaaclab_tasks_experimental/direct/locomotion/ or isaaclab_tasks/isaaclab_tasks/direct/locomotion/on branch dev/newton or feature/newton.

File 1: locomotion_env_warp.py

# In compute_rot kernel
angle_to_target[env_index] = (
    # Bug: Uses index [2] (Z) instead of [1] (Y)
    wp.atan2(targets[env_index][2] - torso_pose[env_index][2], targets[env_index][0] - torso_pose[env_index][0])
    - rpy[env_index][2]
)

File 2: locomotion_env.py
The same logic error exists in the compute_rot function for this file as well.

Proposed Fix:
Change index 2 to 1 in both files to correctly calculate the heading angle in the XY plane:

wp.atan2(targets[env_index][1] - torso_pose[env_index][1], targets[env_index][0] - torso_pose[env_index][0]) - rpy[env_index][2]

Checklist

  • I have checked that there is no similar issue in the repo
  • I have checked that the issue is not in running Isaac Sim itself and is related to the repo

Activity

  1. RandomOakForest commented on Jan 30, 2026

    @RandomOakForest
    Collaborator

    Thank you for posting this. The team will review it.

  2. added
    bug
    on Jan 30, 2026
  3. AntoineRichard commented on Jan 30, 2026

    @AntoineRichard
    Collaborator

    Thanks for reporting this @fanzongsao ! It does look like a bug. This was taken from IsaacSim's internal code. For now I have a PR to fix it, but we'll do more digging, maybe it's just an inappropriate use of the function.

  4. added a commit that references this issue on Jan 30, 2026
    1f73b93
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions