-
Notifications
You must be signed in to change notification settings - Fork 471
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
Euler angle calculation is different from Wikipedia? #468
Comments
Maybe they define roll and yaw opposite to the way we do? WHich one gives
the correct results in your device?
…On Sun, Oct 3, 2021 at 12:04 PM Ayush Sinha ***@***.***> wrote:
Wikipedia shows
[image: image]
<https://user-images.githubusercontent.com/54477816/135767715-f530fb4c-98bd-433c-95cf-1956631287a2.png>
And in the code it is
yaw = atan2(2.0f * (q[1] * q[2] + q[0] * q[3]), q[0] * q[0] + q[1] * q[1]
- q[2] * q[2] - q[3] * q[3]);
pitch = -asin(2.0f * (q[1] * q[3] - q[0] * q[2]));
roll = atan2(2.0f * (q[0] * q[1] + q[2] * q[3]), q[0] * q[0] - q[1] * q[1]
- q[2] * q[2] + q[3] * q[3]);
it seems Euler angle calculation is different from the wikipedia displays.
(Formulae for Yaw and Roll seem interchanged)
https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#468>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABTDLKVGSYP6TSZDBASRSWDUFCSKLANCNFSM5FH5B7EA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wikipedia shows
And in the code it is
yaw = atan2(2.0f * (q[1] * q[2] + q[0] * q[3]), q[0] * q[0] + q[1] * q[1] - q[2] * q[2] - q[3] * q[3]);
pitch = -asin(2.0f * (q[1] * q[3] - q[0] * q[2]));
roll = atan2(2.0f * (q[0] * q[1] + q[2] * q[3]), q[0] * q[0] - q[1] * q[1] - q[2] * q[2] + q[3] * q[3]);
it seems Euler angle calculation is different from the wikipedia displays. (Formulae for Yaw and Roll seem interchanged)
https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles
The text was updated successfully, but these errors were encountered: