Repository navigation
[Newton] Fixes rotation computation for locomotion environment - #4499
Merged
Merged
Conversation
Contributor
Greptile OverviewGreptile SummaryThis PR fixes a critical bug in the locomotion environment where the walking direction angle was incorrectly calculated using the Z-axis coordinate instead of the Y-axis coordinate in the Key Changes:
Technical Context: Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Env as LocomotionEnv
participant ObsFunc as get_observations()
participant CompRot as compute_rot()
participant atan2 as torch.atan2()
Env->>ObsFunc: Request observations
ObsFunc->>ObsFunc: Get torso_position and targets
ObsFunc->>CompRot: compute_rot(torso_quat, velocity, ang_velocity, targets, torso_position)
CompRot->>CompRot: Transform velocities to local frame
CompRot->>CompRot: Extract roll, pitch, yaw from quaternion
CompRot->>atan2: Calculate walk_target_angle
Note over atan2: FIXED: Now uses Y-axis (index 1)<br/>Previously used Z-axis (index 2)
atan2-->>CompRot: walk_target_angle = atan2(Δy, Δx)
CompRot->>CompRot: angle_to_target = walk_target_angle - yaw
CompRot-->>ObsFunc: Return (vel_loc, angvel_loc, roll, pitch, yaw, angle_to_target)
ObsFunc-->>Env: Return observation tensor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes an issue where the walking direction was incorrectly calculated. Bug came from IsaacSim internal code. Need to look where else it's used.
Fixes #4465
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there