Quaternions in Euler Angles
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
in my Programm i am calculating Quaternions in Euler Angles. My values for pitch and roll are from -180 to +180, my yaw values are from -90 to +90. Thats
how i do my calculation.
double pitchYawRollZ = (double)Math.Atan2(2*Y*W + 2*X*Z, 1 - 2*Y*Y - 2*Z*Z); // roll
double pitchYawRollY = (double)Math.Atan2(2*X*W + 2*Y*Z, 1 - 2*X*X - 2*Z*Z); // pitch
double pitchYawRollX = (double)Math.Asin(2*X*Y + 2*Z*W); // yaw
pitchYawRollZ = pitchYawRollZ * (180 / Math.PI);
pitchYawRollY = pitchYawRollY * (180 / Math.PI);
pitchYawRollX = pitchYawRollX * (180 / Math.PI);
Is there something wrong or why isn't my yaw just so wierd. I also got one more question. I got 4 different values in my quaternion. I get these quaternions from a Sensor and the values are jumping a little bit.
0,65564 -0,125366 -0,67804 -0,307739
0,65564 -0,125305 -0,67804 -0,307678
0,65564 -0,125244 -0,67804 -0,307678
0,655701 -0,125244 -0,67804 -0,307617
0,655701 -0,125183 -0,678101 -0,307556
0,655701 -0,125122 -0,678101 -0,307556
0,655762 -0,125122 -0,678101 -0,307495
My sensor is not moving but i got this little difference. Can i calculate this difference in angles?
quaternions angle
add a comment |Â
up vote
0
down vote
favorite
in my Programm i am calculating Quaternions in Euler Angles. My values for pitch and roll are from -180 to +180, my yaw values are from -90 to +90. Thats
how i do my calculation.
double pitchYawRollZ = (double)Math.Atan2(2*Y*W + 2*X*Z, 1 - 2*Y*Y - 2*Z*Z); // roll
double pitchYawRollY = (double)Math.Atan2(2*X*W + 2*Y*Z, 1 - 2*X*X - 2*Z*Z); // pitch
double pitchYawRollX = (double)Math.Asin(2*X*Y + 2*Z*W); // yaw
pitchYawRollZ = pitchYawRollZ * (180 / Math.PI);
pitchYawRollY = pitchYawRollY * (180 / Math.PI);
pitchYawRollX = pitchYawRollX * (180 / Math.PI);
Is there something wrong or why isn't my yaw just so wierd. I also got one more question. I got 4 different values in my quaternion. I get these quaternions from a Sensor and the values are jumping a little bit.
0,65564 -0,125366 -0,67804 -0,307739
0,65564 -0,125305 -0,67804 -0,307678
0,65564 -0,125244 -0,67804 -0,307678
0,655701 -0,125244 -0,67804 -0,307617
0,655701 -0,125183 -0,678101 -0,307556
0,655701 -0,125122 -0,678101 -0,307556
0,655762 -0,125122 -0,678101 -0,307495
My sensor is not moving but i got this little difference. Can i calculate this difference in angles?
quaternions angle
Are you asking why the formula for yaw looks different from the pitch and roll formulae? If that's so, you can see similar formulae, and helpful links, in the answers to this question but be aware that there's a host of different conventions for the angles, which leads to various different versions of the formulae with different signs etc. Otherwise, you may need to clarify your question.
â LonelyProf
Jul 26 at 16:29
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
in my Programm i am calculating Quaternions in Euler Angles. My values for pitch and roll are from -180 to +180, my yaw values are from -90 to +90. Thats
how i do my calculation.
double pitchYawRollZ = (double)Math.Atan2(2*Y*W + 2*X*Z, 1 - 2*Y*Y - 2*Z*Z); // roll
double pitchYawRollY = (double)Math.Atan2(2*X*W + 2*Y*Z, 1 - 2*X*X - 2*Z*Z); // pitch
double pitchYawRollX = (double)Math.Asin(2*X*Y + 2*Z*W); // yaw
pitchYawRollZ = pitchYawRollZ * (180 / Math.PI);
pitchYawRollY = pitchYawRollY * (180 / Math.PI);
pitchYawRollX = pitchYawRollX * (180 / Math.PI);
Is there something wrong or why isn't my yaw just so wierd. I also got one more question. I got 4 different values in my quaternion. I get these quaternions from a Sensor and the values are jumping a little bit.
0,65564 -0,125366 -0,67804 -0,307739
0,65564 -0,125305 -0,67804 -0,307678
0,65564 -0,125244 -0,67804 -0,307678
0,655701 -0,125244 -0,67804 -0,307617
0,655701 -0,125183 -0,678101 -0,307556
0,655701 -0,125122 -0,678101 -0,307556
0,655762 -0,125122 -0,678101 -0,307495
My sensor is not moving but i got this little difference. Can i calculate this difference in angles?
quaternions angle
in my Programm i am calculating Quaternions in Euler Angles. My values for pitch and roll are from -180 to +180, my yaw values are from -90 to +90. Thats
how i do my calculation.
double pitchYawRollZ = (double)Math.Atan2(2*Y*W + 2*X*Z, 1 - 2*Y*Y - 2*Z*Z); // roll
double pitchYawRollY = (double)Math.Atan2(2*X*W + 2*Y*Z, 1 - 2*X*X - 2*Z*Z); // pitch
double pitchYawRollX = (double)Math.Asin(2*X*Y + 2*Z*W); // yaw
pitchYawRollZ = pitchYawRollZ * (180 / Math.PI);
pitchYawRollY = pitchYawRollY * (180 / Math.PI);
pitchYawRollX = pitchYawRollX * (180 / Math.PI);
Is there something wrong or why isn't my yaw just so wierd. I also got one more question. I got 4 different values in my quaternion. I get these quaternions from a Sensor and the values are jumping a little bit.
0,65564 -0,125366 -0,67804 -0,307739
0,65564 -0,125305 -0,67804 -0,307678
0,65564 -0,125244 -0,67804 -0,307678
0,655701 -0,125244 -0,67804 -0,307617
0,655701 -0,125183 -0,678101 -0,307556
0,655701 -0,125122 -0,678101 -0,307556
0,655762 -0,125122 -0,678101 -0,307495
My sensor is not moving but i got this little difference. Can i calculate this difference in angles?
quaternions angle
asked Jul 26 at 13:15
Walter Nazarenus
1
1
Are you asking why the formula for yaw looks different from the pitch and roll formulae? If that's so, you can see similar formulae, and helpful links, in the answers to this question but be aware that there's a host of different conventions for the angles, which leads to various different versions of the formulae with different signs etc. Otherwise, you may need to clarify your question.
â LonelyProf
Jul 26 at 16:29
add a comment |Â
Are you asking why the formula for yaw looks different from the pitch and roll formulae? If that's so, you can see similar formulae, and helpful links, in the answers to this question but be aware that there's a host of different conventions for the angles, which leads to various different versions of the formulae with different signs etc. Otherwise, you may need to clarify your question.
â LonelyProf
Jul 26 at 16:29
Are you asking why the formula for yaw looks different from the pitch and roll formulae? If that's so, you can see similar formulae, and helpful links, in the answers to this question but be aware that there's a host of different conventions for the angles, which leads to various different versions of the formulae with different signs etc. Otherwise, you may need to clarify your question.
â LonelyProf
Jul 26 at 16:29
Are you asking why the formula for yaw looks different from the pitch and roll formulae? If that's so, you can see similar formulae, and helpful links, in the answers to this question but be aware that there's a host of different conventions for the angles, which leads to various different versions of the formulae with different signs etc. Otherwise, you may need to clarify your question.
â LonelyProf
Jul 26 at 16:29
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2863389%2fquaternions-in-euler-angles%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Are you asking why the formula for yaw looks different from the pitch and roll formulae? If that's so, you can see similar formulae, and helpful links, in the answers to this question but be aware that there's a host of different conventions for the angles, which leads to various different versions of the formulae with different signs etc. Otherwise, you may need to clarify your question.
â LonelyProf
Jul 26 at 16:29