eul2rotm missmatch why?
조회 수: 26 (최근 30일)
이전 댓글 표시
Hello why do the following don't match:
ax=90;
ay=0;
az=90;
Cx = [1 0 0; 0 cosd(ax) -sind(ax); 0 sind(ax) cosd(ax)];
Cy = [cosd(ay) 0 sind(ay); 0 1 0; -sind(ay) 0 cosd(ay)];
Cz = [cosd(az) -sind(az) 0; sind(az) cosd(az) 0; 0 0 1];
C1 = Cz*Cy*Cx; % 'XYZ'
C2 = eul2rotm(deg2rad([ax ay az]),'XYZ');
C3 = eul2rotm(deg2rad([az ay ax]),'ZYX');
Why is `C1` not the same as `C2`? But `C1` is equal to `C3`...
'XYZ' – The order of rotation angles is x-axis, y-axis, z-axis.
Implying that when 'XYZ' is used you first rotate about X, then Y and finally Z. Same as C1 = Cz*Cy*Cx, right?
댓글 수: 1
답변 (2개)
David Goodmanson
2018년 5월 9일
편집: David Goodmanson
2018년 5월 10일
Hello Wouter,
I don't have the robotics toolbox, but in the documentation for eul2rotm it says:
"When using the rotation matrix, premultiply it with the coordinates to be rotated (as opposed to postmultiplying)"
That sounds like the coordinates are a row vector in front rather than a column vector afterwards. In that case obviously the order of multiplication of the C's is not reversed.
댓글 수: 0
Roger Rouse
2021년 10월 12일
This is the command line help for eul2rotm. It does not mention whether to pre or post mulitpy the matrix. It should be stated in this help somewhere!
>> help eul2rotm
eul2rotm Convert Euler angles to rotation matrix
R = eul2rotm(EUL) converts a set of 3D Euler angles, EUL, into the
corresponding rotation matrix, R. EUL is an N-by-3 matrix of Euler rotation
angles. The output, R, is an 3-by-3-by-N matrix containing N rotation
matrices. Rotation angles are input in radians.
R = eul2rotm(EUL, SEQ) converts 3D Euler angles into a rotation matrix.
The Euler angles are specified by the body-fixed (intrinsic) axis rotation
sequence, SEQ.
The default rotation sequence is 'ZYX', where the order of rotation
angles is Z Axis Rotation, Y Axis Rotation, and X Axis Rotation.
The following rotation sequences, SEQ, are supported: 'ZYX', 'ZYZ', and
'XYZ'.
Example:
% Calculate the rotation matrix for a set of Euler angles
% By default, the ZYX axis order will be used.
angles = [0 pi/2 0];
R = eul2rotm(angles)
% Calculate the rotation matrix based on a ZYZ rotation
Rzyz = eul2rotm(angles, 'ZYZ')
See also rotm2eul
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Computational Geometry에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!