Euler Angle Calculation from rotated reference frame

7 次查看(过去 30 天)
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