Skip to content

Improve the implementation of euler_xyz_from_quat #2365

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ShaoshuSu
Copy link

@ShaoshuSu ShaoshuSu commented Apr 24, 2025

Description

Previously, euler_xyz_from_quat returned Euler angles in the [0, 2π) range, which is uncommon in robotics applications. As a result, several users implemented their own workarounds to adjust the angle range to (−π, π]. Examples include:

To address this issue, we have updated the default angle range from [0, 2π) to (−π, π] by removing the % (2 * torch.pi) operation at the return statement, since the atan2 function naturally outputs angles within the (−π, π] range.

We also introduced a new parameter, wrap_to_2pi: bool = False. Setting this parameter to True will maintain the previous behavior:

  • Default (wrap_to_2pi=False): Angles returned in the range (−π, π].
  • Optional (wrap_to_2pi=True): Angles wrapped in the original [0, 2π) range.

Additionally, multiple test samples have been added to evaluate and ensure performance and accuracy across different scenarios.

What’s Changed

  • Default behavior updated to (−π, π] (non-breaking).
  • New argument wrap_to_2pi for optional wrapping.
  • Unit tests added for both wrapped and unwrapped outputs.

Fixes #2364

Type of Change

  • Enhancement (non-breaking addition of functionality)

Checklist

  • Ran ./isaaclab.sh --format and all pre-commit checks pass
  • Updated docstrings to describe wrap_to_2pi parameter
  • Added tests covering both wrapped and unwrapped outputs
  • No new warnings introduced
  • Updated changelog and bumped version in config/extension.toml
  • Confirmed my name is listed in CONTRIBUTORS.md

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.

[Proposal] Change Default Euler Angle Range in euler_xyz_from_quat
1 participant