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

fix axis angle conversion when the rotation matrix is close to identity #296

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

yzqin
Copy link

@yzqin yzqin commented Sep 25, 2024

Fix rotation matrix to axis-angle conversion for near-identity matrices

Description:
This PR fixes the rotation matrix to axis-angle conversion when the matrix is close to identity. The current implementation uses strict equality (==) to check for identity, which fails due to float precision issues. This can lead to division by zero and NaN results.

This fix prevents NaN outputs and ensures accurate conversion for small rotations.

@AlexanderFabisch
Copy link
Member

AlexanderFabisch commented Sep 25, 2024

Hi @yzqin , thanks for your contribution. Do you have a test case that clearly demonstrates that the previous versions fails?

edit: I'm asking because whenever I had such a case, renormalization of the rotation matrix with norm_matrix before calling this function would usually fix it.

@AlexanderFabisch AlexanderFabisch changed the base branch from main to develop October 15, 2024 19:06
@AlexanderFabisch AlexanderFabisch deleted the branch dfki-ric:develop October 28, 2024 16:02
@AlexanderFabisch
Copy link
Member

@yzqin Did you find a case in which the current version fails?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

3 participants