-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Fix zero agent for semantic action spaces #7439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
source/isaaclab/changelog.d/mhaiderbhai-neutral-actions.minor.rst
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Added | ||
| ^^^^^ | ||
|
|
||
| * Added semantic neutral actions for manager-based action terms, including absolute differential IK, | ||
| Pink IK, RMPFlow, and operational-space controllers. |
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). | ||
| # All rights reserved. | ||
| # | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| """Tests for semantic neutral actions.""" | ||
|
|
||
| from types import SimpleNamespace | ||
|
|
||
| import torch | ||
|
|
||
| from isaaclab.envs.mdp.actions.pink_task_space_actions import PinkInverseKinematicsAction | ||
|
|
||
|
|
||
| def test_pink_neutral_actions_use_current_frame_poses() -> None: | ||
| """Pink IK neutral actions contain valid current poses and hand joint positions.""" | ||
| action_term = object.__new__(PinkInverseKinematicsAction) | ||
| action_term._controlled_frame_ids = [1, 0] | ||
| action_term._hand_joint_ids = [1, 3] | ||
|
|
||
| body_poses = torch.tensor( | ||
| [ | ||
| [[1.0, 2.0, 3.0, 0.0, 0.0, 0.0, 1.0], [4.0, 5.0, 6.0, 0.0, 0.0, 1.0, 0.0]], | ||
| [[7.0, 8.0, 9.0, 0.0, 1.0, 0.0, 0.0], [10.0, 11.0, 12.0, 1.0, 0.0, 0.0, 0.0]], | ||
| ] | ||
| ) | ||
| joint_positions = torch.tensor([[0.1, 0.2, 0.3, 0.4], [0.5, 0.6, 0.7, 0.8]]) | ||
| env_origins = torch.tensor([[1.0, 1.0, 1.0], [2.0, 2.0, 2.0]]) | ||
| action_term._asset = SimpleNamespace( | ||
| data=SimpleNamespace( | ||
| body_link_pose_w=SimpleNamespace(torch=body_poses), | ||
| joint_pos=SimpleNamespace(torch=joint_positions), | ||
| ) | ||
| ) | ||
| action_term._env = SimpleNamespace(scene=SimpleNamespace(env_origins=env_origins)) | ||
|
|
||
| actions = action_term.neutral_actions | ||
|
|
||
| expected_poses = body_poses[:, [1, 0]].clone() | ||
| expected_poses[..., :3] -= env_origins.unsqueeze(1) | ||
| expected = torch.cat((expected_poses.flatten(start_dim=1), joint_positions[:, [1, 3]]), dim=-1) | ||
| assert torch.equal(actions, expected) | ||
| assert torch.all(torch.linalg.vector_norm(actions[:, :14].reshape(2, 2, 7)[..., 3:7], dim=-1) == 1.0) |
5 changes: 5 additions & 0 deletions
5
source/isaaclab_rl/changelog.d/mhaiderbhai-zero-agent-actions.rst
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Fixed | ||
| ^^^^^ | ||
|
|
||
| * Fixed the zero agent to use semantic neutral actions, support composite and multi-agent action spaces, | ||
| and reject invalid task configurations before launching the simulator. |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Warning · Api — Pink neutral pose uses wrong quaternion order
body_link_pose_wstores orientation as(w, x, y, z), but this term documents its pose slots as position plus orientation(x, y, z, w)(seeorientation_dim). Concatenating the raw body pose therefore handsprocess_actionsa reordered quaternion, so the "hold current frames" command requests a different orientation than the current one. Convert the quaternion to the action term's documented layout before flattening.