Skip to content

Commit 11b1096

Browse files
Adds preserve order flag to JointPositionToLimitsAction (#3716)
# Description Adds `preserve_order` flag to `JointPositionToLimitsActionCfg` ## Type of change - New feature (non-breaking change which adds functionality) ## Screenshots Please attach before and after screenshots of the change if applicable. <!-- Example: | Before | After | | ------ | ----- | | _gif/png before_ | _gif/png after_ | To upload images to a PR -- simply drag and drop an image while in edit mode and it should upload the image directly. You can then paste that source into the above before/after sections. --> ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there <!-- As you go through the checklist above, you can mark something as done by putting an x character in it For example, - [x] I have done this task - [ ] I have not done this task --> --------- Signed-off-by: Kelly Guo <[email protected]> Co-authored-by: Kelly Guo <[email protected]>
1 parent 26083c7 commit 11b1096

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

source/isaaclab/config/extension.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
# Note: Semantic Versioning is used: https://semver.org/
4-
version = "0.48.7"
4+
version = "0.48.8"
55

66
# Description
77
title = "Isaac Lab framework for Robot Learning"

source/isaaclab/docs/CHANGELOG.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
Changelog
22
---------
33

4+
0.48.8 (2025-10-15)
5+
~~~~~~~~~~~~~~~~~~~
6+
7+
Added
8+
^^^^^
9+
10+
* Added :attr:`preserve_order` flag to :class:`~isaaclab.envs.mdp.actions.actions_cfg.JointPositionToLimitsActionCfg`
11+
12+
413
0.48.7 (2025-11-25)
514
~~~~~~~~~~~~~~~~~~~
615

source/isaaclab/isaaclab/envs/mdp/actions/actions_cfg.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ class JointPositionToLimitsActionCfg(ActionTermCfg):
131131
This operation is performed after applying the scale factor.
132132
"""
133133

134+
preserve_order: bool = False
135+
"""Whether to preserve the order of the joint names in the action output. Defaults to False."""
136+
134137

135138
@configclass
136139
class EMAJointPositionToLimitsActionCfg(JointPositionToLimitsActionCfg):

source/isaaclab/isaaclab/envs/mdp/actions/joint_actions_to_limits.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ def __init__(self, cfg: actions_cfg.JointPositionToLimitsActionCfg, env: Manager
5555
super().__init__(cfg, env)
5656

5757
# resolve the joints over which the action term is applied
58-
self._joint_ids, self._joint_names = self._asset.find_joints(self.cfg.joint_names)
58+
self._joint_ids, self._joint_names = self._asset.find_joints(
59+
self.cfg.joint_names, preserve_order=cfg.preserve_order
60+
)
5961
self._num_joints = len(self._joint_ids)
6062
# log the resolved joint names for debugging
6163
logger.info(
@@ -77,17 +79,22 @@ def __init__(self, cfg: actions_cfg.JointPositionToLimitsActionCfg, env: Manager
7779
elif isinstance(cfg.scale, dict):
7880
self._scale = torch.ones(self.num_envs, self.action_dim, device=self.device)
7981
# resolve the dictionary config
80-
index_list, _, value_list = string_utils.resolve_matching_names_values(self.cfg.scale, self._joint_names)
82+
index_list, _, value_list = string_utils.resolve_matching_names_values(
83+
self.cfg.scale, self._joint_names, preserve_order=cfg.preserve_order
84+
)
8185
self._scale[:, index_list] = torch.tensor(value_list, device=self.device)
8286
else:
8387
raise ValueError(f"Unsupported scale type: {type(cfg.scale)}. Supported types are float and dict.")
88+
8489
# parse clip
8590
if self.cfg.clip is not None:
8691
if isinstance(cfg.clip, dict):
8792
self._clip = torch.tensor([[-float("inf"), float("inf")]], device=self.device).repeat(
8893
self.num_envs, self.action_dim, 1
8994
)
90-
index_list, _, value_list = string_utils.resolve_matching_names_values(self.cfg.clip, self._joint_names)
95+
index_list, _, value_list = string_utils.resolve_matching_names_values(
96+
self.cfg.clip, self._joint_names, preserve_order=cfg.preserve_order
97+
)
9198
self._clip[:, index_list] = torch.tensor(value_list, device=self.device)
9299
else:
93100
raise ValueError(f"Unsupported clip type: {type(cfg.clip)}. Supported types are dict.")

0 commit comments

Comments
 (0)