Quaternions in Euler Angles

The name of the pictureThe name of the pictureThe name of the pictureClash 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?







share|cite|improve this question



















  • 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














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?







share|cite|improve this question



















  • 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












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?







share|cite|improve this question











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?









share|cite|improve this question










share|cite|improve this question




share|cite|improve this question









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
















  • 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















active

oldest

votes











Your Answer




StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















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



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














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













































































Comments

Popular posts from this blog

What is the equation of a 3D cone with generalised tilt?

Relationship between determinant of matrix and determinant of adjoint?

Color the edges and diagonals of a regular polygon