Euler Angle Calculation from rotated reference frame
8 ビュー (過去 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 件のコメント
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
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:
0 件のコメント
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);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Assembly についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!