Euler Angle Calculation from rotated reference frame
Mostra commenti meno recenti
Hello, I am trying to calculate Euler Angles from a rotated reference frame and am running into problems. I need to find the Euler angle rotations between the rotated reference frame and the original frame. I already have the reference frames calculated but I can't seem to correctly calculate the rotation. I first need to rotate about the x-axis, then y-axis and finally z-axis. I know that this is not the typical rotation order, but it is what the model I am simulating requires. I would greatly appreciate some help! Thanks!
3 Commenti
Honglei Chen
il 16 Lug 2012
Are you saying that you have the original and rotated frame already and you want to find out the rotation angles? When you say frame do you mean the three axes? If so, I thought the angles are not unique?
Matthew
il 16 Lug 2012
Please explain what "the reference frame" exactly means. Any explicit example would help us to formulate and answer as easy as possible.
While there is no "typical" rotation order, it matters if you want the transformation from the rotated to the reference system or the other way around.
Risposte (2)
James Tursa
il 16 Lug 2012
2 voti
You can use this FEX submission by John Fuller to convert from a direction cosine matrix to any Euler Angle sequence you like:
Jan
il 16 Lug 2012
XYZ means, that you are looking for an Euler-Cardan angle, not an Euler angle.
Here "BC" is the child system, while "BP" is the parent. The fields X, Y, Z are [n x 3] matrices, which contain the 1x3 ortho-normal local coordinate vectors.
% case 'xyz' % EULER-CARDAN
% c=cos, s=sin, i means the i.th component
% X = [c3.*c2, c3.*s2.*s1+s3.*c1, -c3.*s2.*c1+s3.*s1];
% Y = [-s3.*c2, -s3.*s2.*s1+c3.*c1, s3.*s2.*c1+c3.*s1];
% Z = [s2, -c2.*s1, c2.*c1];
% REAL(ASIN(X)) catchs rounding errors:
% if X is greater than 1.0, ASIN(X) is complex.
EM = [atan2(Dot(BC.Y, BP.Z), Dot(BC.Z, BP.Z)), ...
real(asin(-Dot(BC.X, BP.Z))), ...
atan2(Dot(BC.X, BP.Y), Dot(BC.X, BP.X))]
function R = Dot(X, Y);
R = X(:, 1) .* Y(:, 1) + X(:, 2) .* Y(:, 2) + X(:, 3) .* Y(:, 3);
Categorie
Scopri di più su Assembly in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!