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

A bug in quaternion.py #150

Open
kai-lan opened this issue Sep 22, 2024 · 1 comment
Open

A bug in quaternion.py #150

kai-lan opened this issue Sep 22, 2024 · 1 comment

Comments

@kai-lan
Copy link

kai-lan commented Sep 22, 2024

Hi,

I think there is a bug in Euler to Quaternion conversion (euler2quat function in quaternion.py) for ``zyx'' ordering. I have run the following test:

from scipy.spatial.transform import Rotation as R

order = 'zyx'
e = torch.tensor([0.1*torch.pi, 0.2*torch.pi, 0.5*torch.pi])

q = R.from_euler(order.upper(), e.numpy()).as_quat(scalar_first=True)

q1 = euler2quat(e, order, deg=False)

print(q)
print(q1.numpy())

Expected output:

[ 0.69840115 -0.11061587  0.32101977  0.6300368 ]
[ 0.69840115 -0.11061587  0.32101977  0.6300368 ]

Actual output:

[ 0.69840111  0.63003677  0.32101977 -0.11061588]
[ 0.69840115 -0.11061587  0.32101977  0.6300368 ]
@kai-lan
Copy link
Author

kai-lan commented Sep 22, 2024

I have started a PR for a potential fix.

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

No branches or pull requests

1 participant