Euler Angle Calculation from rotated reference frame

조회 수: 8 (최근 30일)
Matthew
Matthew 2012년 7월 16일
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
Matthew
Matthew 2012년 7월 16일
Yes I have the original and rotated frame already and want the Euler rotation angles and yes frame refers to xyz axes. I believe that there should be a unique answer as long as 2 angles are restricted to a range of [-pi,pi] and the other is restricted to [-pi/2,pi/2].
Jan
Jan 2012년 7월 16일
편집: Jan 2012년 7월 16일
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.

댓글을 달려면 로그인하십시오.

답변 (2개)

James Tursa
James Tursa 2012년 7월 16일
You can use this FEX submission by John Fuller to convert from a direction cosine matrix to any Euler Angle sequence you like:

Jan
Jan 2012년 7월 16일
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);

카테고리

Help CenterFile Exchange에서 Assembly에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by