Skip to content

Fixes the implementation of quat_inv() - #2797

Merged
kellyguo11 merged 7 commits into
isaac-sim:mainfrom
ozhanozen:fix/quat_inv
Jun 28, 2025
Merged

kellyguo11 merged 7 commits into
isaac-sim:mainfrom
ozhanozen:fix/quat_inv

Conversation

@ozhanozen

Copy link
Copy Markdown
Contributor

Description

Corrects quat_inv() in utils/math.py: the inverse is now computed as:

quat_conjugate(q) / q.pow(2).sum(dim=-1, keepdim=True).clamp(min=eps)

ensuring correct results for non-unit quaternions.

Fixes #1263 (see discussion for details). Also updated CHANGELOG.rst and corrected a few minor typos within.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update

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

@jtigue-bdai

Copy link
Copy Markdown
Collaborator

Can you add a test in isaaclab/test/utils/test_math.py that verifies the effectiveness of this change.

@ozhanozen

Copy link
Copy Markdown
Contributor Author

Can you add a test in isaaclab/test/utils/test_math.py that verifies the effectiveness of this change.

Hi @jtigue-bdai, I have added a unit test that checks for the following:

$$ q \otimes q^{-1} = q^{-1} \otimes q = (1,0,0,0) $$

The old implementation fails at this; the new one passes.

@kellyguo11
kellyguo11 merged commit 3d6f55b into isaac-sim:main Jun 28, 2025
@ozhanozen
ozhanozen deleted the fix/quat_inv branch June 30, 2025 08:53
harry-wf-cheung pushed a commit to harry-wf-cheung/IsaacLab-Harry that referenced this pull request Jul 30, 2025
# Description

Corrects `quat_inv()` in utils/math.py: the inverse is now computed as:

`quat_conjugate(q) / q.pow(2).sum(dim=-1, keepdim=True).clamp(min=eps)`

ensuring correct results for **non-unit** quaternions.  

Fixes isaac-sim#1263 (see discussion for details). Also updated `CHANGELOG.rst`
and corrected a few minor typos within.

## Type of change

<!-- As you go through the list, delete the ones that are not
applicable. -->

- Bug fix (non-breaking change which fixes an issue)
- This change requires a documentation update

## 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
- [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

---------

Co-authored-by: Kelly Guo <[email protected]>
LJones-alt pushed a commit to LJones-alt/IsaacLab-Laura that referenced this pull request Jul 1, 2026
# Description

Corrects `quat_inv()` in utils/math.py: the inverse is now computed as:

`quat_conjugate(q) / q.pow(2).sum(dim=-1, keepdim=True).clamp(min=eps)`

ensuring correct results for **non-unit** quaternions.  

Fixes isaac-sim#1263 (see discussion for details). Also updated `CHANGELOG.rst`
and corrected a few minor typos within.

## Type of change

<!-- As you go through the list, delete the ones that are not
applicable. -->

- Bug fix (non-breaking change which fixes an issue)
- This change requires a documentation update

## 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
- [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

---------

Co-authored-by: Kelly Guo <[email protected]>
csj-275 pushed a commit to csj-275/IsaacLab that referenced this pull request Jul 8, 2026
# Description

Corrects `quat_inv()` in utils/math.py: the inverse is now computed as:

`quat_conjugate(q) / q.pow(2).sum(dim=-1, keepdim=True).clamp(min=eps)`

ensuring correct results for **non-unit** quaternions.  

Fixes isaac-sim#1263 (see discussion for details). Also updated `CHANGELOG.rst`
and corrected a few minor typos within.

## Type of change

<!-- As you go through the list, delete the ones that are not
applicable. -->

- Bug fix (non-breaking change which fixes an issue)
- This change requires a documentation update

## 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
- [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

---------

Co-authored-by: Kelly Guo <[email protected]>
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.

[Bug Report] Potential implementation error in quat_inv()

3 participants