Skip to content
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

Adds flag to preserve joint order inside JointActionCfg action term #787

Merged
merged 8 commits into from
Aug 7, 2024

Conversation

xav-nal
Copy link
Contributor

@xav-nal xav-nal commented Aug 5, 2024

Description

Add a new feature to allow the option to maintain the order of joint names in the action configuration when calling mdp.JointPositionActionCfg for example.

In action_cfg.py

    preserve_order:  bool = False
    """Whether to preserve the order of the joint names in the action output. Defaults to False."""

In joints_actions.py

self._joint_ids, self._joint_names = self._asset.find_joints(self.cfg.joint_names, preserve_order=self.cfg.preserve_order)

Fixes #786

Type of change

  • New feature

Screenshots

"action_cfg.py"
Before:
image

After
image

In "joints_actions.py"
Before:
image

After:
image

Checklist

  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • 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 ther

@Dhoeller19 Dhoeller19 added the enhancement New feature or request label Aug 5, 2024
@Mayankm96 Mayankm96 changed the title add preserve order action config Adds flag to preserve joint order inside JointActionCfg action term Aug 6, 2024
Copy link
Contributor

@Mayankm96 Mayankm96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Could you please update the version in the changelog and extension.toml as well?

@xav-nal
Copy link
Contributor Author

xav-nal commented Aug 6, 2024

I have just updated the two files changelog and extension.toml

Signed-off-by: Mayank Mittal <12863862+Mayankm96@users.noreply.github.com>
Signed-off-by: Mayank Mittal <12863862+Mayankm96@users.noreply.github.com>
@Mayankm96
Copy link
Contributor

@xav-nal The checks are failing for the pre-commit. Could you please run the command ./isaaclab.sh -f and also complete the checklist in the MR template?

@xav-nal
Copy link
Contributor Author

xav-nal commented Aug 6, 2024

When I run the commands listed here (https://isaac-sim.github.io/IsaacLab/source/refs/contributing.html) to contribute to the documentation, everything works: I see my change updated in the documentation. However I do not see any additional files to include in the pull request. I assume this is normal.

Regarding the point "I have added tests that prove my fix is effective or that my feature works," I must admit that I am not sure how to do do that.

@Dhoeller19
Copy link
Collaborator

Thanks a lot @xav-nal!

@Dhoeller19 Dhoeller19 merged commit 6451d23 into isaac-sim:main Aug 7, 2024
1 of 2 checks passed
iamdrfly pushed a commit to iamdrfly/IsaacLab that referenced this pull request Nov 21, 2024
…isaac-sim#787)

# Description

Adds the attribute `preserve_order` in `JointActionCfg`, to choose whether joint-related actions should keep the same
order as how the `joint_names` are listed in the config.

Fixes isaac-sim#786

## Type of change

- New feature 

## 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
- [ ] My changes generate no new warnings
- [ ] 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Proposal] Config action order
4 participants