What conventions does rotm2eul rely on?

12 views (last 30 days)
JS
JS on 9 Apr 2016
Edited: David Goodmanson on 29 Mar 2024 at 6:13
Hi,
does the function rotm2eul(rotm,'zyz') generate euler angles for an extrinsic or intrinsic rotation? I assume that the righthanded convention for angles is used. Is this assumption correct?
Moreover, is the extraction of three euler angles from the rotation matrix rotm unique? I know that the uniqueness of euler angles can be achieved by limiting the range of alpha, beta and gamma. Does rotm2eul take this into account or just provides me with one possible solution.
Thank you very much.
  2 Comments
Vladislav
Vladislav on 28 Mar 2024
Got exactly the same question! Would be helpful to have an answer!
David Goodmanson
David Goodmanson on 29 Mar 2024 at 6:07
Edited: David Goodmanson on 29 Mar 2024 at 6:13
Hi JS,
I don't have any of the toolboxes containing rotm2eul or eul2rotm but it should be fairly easy to find out the convention with some experimentation. And it's kind of fun to explore. I think it's safe to assume that the coordinate system is right handed. Under the convention that postive angles rotate an object in the counterclockwise direction when the axis of rotation is coming up out of the page, three rotation matrices are shown below.
Rotation matrices operate from the left on column vectors
w' = R*w
If you create a rotation matrix with known euler angles, for example
theta_x = .2*pi;
theta_y = .3*pi;
theta_z = .4*pi;
cx = cos(theta_x); sx = sin(theta_x);
cy = cos(theta_y); sy = sin(theta_y);
cz = cos(theta_z); sz = sin(theta_z);
Rx = [1 0 0
0 cx -sx
0 sx cx];
Ry = [cy 0 sy
0 1 0
-sy 0 cy];
Rz = [cz -sz 0
sz cz 0
0 0 1];
and then do
Rmat = Rx*Ry*Rz; % known euler angles
eulerangles = rotm2eul(Rmat,'xyz')
either you will get back 0.2, 0.3, 0.4 or you won't. If you do, great. If not, there are not that many alternatives to check:
[1] 'zyx' instead of 'xyz'. [2] All angles get replaced by their negatives. Equivalently, the angle stays the same but s and -s change places in the definition of the rotation matrix. [3] do both [1]& [2]. which is extrinsic<---> intrinsic. If none of those work there is the possibililty that not all angles change sign and only one or two of them do. This I think is less likely although of course it can be checked.

Sign in to comment.

Answers (0)

Categories

Find more on 3-D Scene Control in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!