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 wrap_to_pi function in math utilities #771

Merged
merged 4 commits into from
Aug 2, 2024
Merged

Conversation

Mayankm96
Copy link
Contributor

@Mayankm96 Mayankm96 commented Aug 1, 2024

Description

The previous implementation of wrap_to_pi was rather incorrect since it would map -PI to PI but -3PI to -PI. Following the general convention of this function (based on MATLAB), all odd positive multiples of PI should map to PI, and all negative multiples should map to -PI.

This MR fixes the function and also adds a unit test for it.

Fixes #770

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

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 there

@Mayankm96 Mayankm96 self-assigned this Aug 1, 2024
@Mayankm96 Mayankm96 added the bug Something isn't working label Aug 1, 2024
@Mayankm96 Mayankm96 merged commit c3e4b0d into main Aug 2, 2024
2 of 3 checks passed
@Mayankm96 Mayankm96 deleted the fix/wrap-to-pi-func branch August 2, 2024 09:22
@Mayankm96 Mayankm96 removed the request for review from kellyguo11 August 2, 2024 10:41
iamdrfly pushed a commit to iamdrfly/IsaacLab that referenced this pull request Nov 21, 2024
# Description

The previous implementation of `wrap_to_pi` was rather incorrect since
it would map -PI to PI but -3PI to -PI. Following the general convention
of this function (based on MATLAB), all odd positive multiples of PI
should map to PI, and all negative multiples should map to -PI.

This MR fixes the function and also adds a unit test for it.

Fixes isaac-sim#770

## Type of change

- Bug fix (non-breaking change which fixes an issue)
- Breaking change (fix or feature that would cause existing
functionality to not work as expected)

## 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
- [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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report] Incorrect results of math_utils due to torch.jit.script
2 participants