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

Fixes apply actions method in the NonHolonomicAction action term class #317

Merged
merged 4 commits into from
Mar 22, 2024

Conversation

KyleM73
Copy link
Contributor

@KyleM73 KyleM73 commented Mar 22, 2024

Description

in NonHolonomicAction.apply_actions() the velocity command was incorrectly named self.joint_vel instead of self._joint_vel_command as initialized in NonHolonomicAction.__init__(). This causes an error when trying to instantiate the action config. I have made the correction and tested that it works.

Type of change

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

Screenshots

Please attach before and after screenshots of the change if applicable.

Before:

    def apply_actions(self):
        # obtain current heading
        quat_w = self._asset.data.body_quat_w[:, self._body_idx]
        yaw_w = euler_xyz_from_quat(quat_w)[2]
        # compute joint velocities targets
        self.joint_vel[:, 0] = torch.cos(yaw_w) * self.processed_actions[:, 0]  # x
        self.joint_vel[:, 1] = torch.sin(yaw_w) * self.processed_actions[:, 0]  # y
        self.joint_vel[:, 2] = self.processed_actions[:, 1]  # yaw
        # set the joint velocity targets
        self._asset.set_joint_velocity_target(self.joint_vel, joint_ids=self._joint_ids)

After:

    def apply_actions(self):
        # obtain current heading
        quat_w = self._asset.data.body_quat_w[:, self._body_idx]
        yaw_w = euler_xyz_from_quat(quat_w)[2]
        # compute joint velocities targets
        self._joint_vel_command[:, 0] = torch.cos(yaw_w) * self.processed_actions[:, 0]  # x
        self._joint_vel_command[:, 1] = torch.sin(yaw_w) * self.processed_actions[:, 0]  # y
        self._joint_vel_command[:, 2] = self.processed_actions[:, 1]  # yaw
        # set the joint velocity targets
        self._asset.set_joint_velocity_target(self._joint_vel_command, joint_ids=self._joint_ids)

Checklist

  • I have run the pre-commit checks with ./orbit.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 run all the tests with ./orbit.sh --test and they pass
  • 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

@Mayankm96
Copy link
Contributor

Mayankm96 commented Mar 22, 2024

Thanks a lot for sending this fix. Could you please also modify extension.toml file and also run the pre-commit checks? :)

@Mayankm96 Mayankm96 changed the title [bug fix] rename joint_vel to _joint_vel_command in NonHolonomicActionCfg Fixes apply actions method in the NonHolonomicAction action term class Mar 22, 2024
@KyleM73
Copy link
Contributor Author

KyleM73 commented Mar 22, 2024

just did both, all tests green :)

Signed-off-by: Mayank Mittal <12863862+Mayankm96@users.noreply.github.com>
@Mayankm96 Mayankm96 merged commit dcc33a2 into isaac-sim:main Mar 22, 2024
@Mayankm96
Copy link
Contributor

Thanks a lot for the fix :)

fatimaanes pushed a commit to fatimaanes/omniperf that referenced this pull request Aug 8, 2024
…ass (isaac-sim#317)

# Description

in `NonHolonomicAction.apply_actions()` the velocity command was
incorrectly named `self.joint_vel` instead of `self._joint_vel_command`
as initialized in `NonHolonomicAction.__init__()`. This causes an error
when trying to instantiate the action config. I have corrected
and tested that it works.

## 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
`./orbit.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
- [X] I have run all the tests with `./orbit.sh --test` and they pass
- [X] 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
iamdrfly pushed a commit to iamdrfly/IsaacLab that referenced this pull request Nov 21, 2024
…ass (isaac-sim#317)

# Description

in `NonHolonomicAction.apply_actions()` the velocity command was
incorrectly named `self.joint_vel` instead of `self._joint_vel_command`
as initialized in `NonHolonomicAction.__init__()`. This causes an error
when trying to instantiate the action config. I have corrected
and tested that it works.

## 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
`./orbit.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
- [X] I have run all the tests with `./orbit.sh --test` and they pass
- [X] 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants