Skip to content

Commit

Permalink
Fixes JointAction not preserving order when using all joints (#1587)
Browse files Browse the repository at this point in the history
# Description

This PR fixes #1586.

An additional condition is added to the `JointAction._joint_ids` logic
where if user specifies to preserve the joint order, the `_joint_ids`
field will not be cleared even if the speficied list contains all the
joints.

## Type of change

- Bug fix (non-breaking change which fixes an issue)

## Checklist

- [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
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [ ] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

Signed-off-by: -T.K.- <t_k_233@outlook.com>
  • Loading branch information
T-K-233 authored Dec 27, 2024
1 parent dd044a4 commit fae5c7a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init__(self, cfg: actions_cfg.JointActionCfg, env: ManagerBasedEnv) -> Non
)

# Avoid indexing across all joints for efficiency
if self._num_joints == self._asset.num_joints:
if self._num_joints == self._asset.num_joints and not self.cfg.preserve_order:
self._joint_ids = slice(None)

# create tensors for raw and processed actions
Expand Down

0 comments on commit fae5c7a

Please sign in to comment.