Rotation Matrices - omega phi kappa vs yaw pitch roll

조회 수: 81 (최근 30일)
Elisavet Konstantina Stathopoulou
Elisavet Konstantina Stathopoulou 2021년 10월 27일
댓글: Bjorn Gustavsson 2021년 10월 28일
Hello,
I have omega phi kappa and corresponding yaw (Z) pitch (Y) roll (X) measurements from a sensor.
Both are in degrees but I convert them to rads.
I try to do some tranformations for a photogrammetry project.
While using the yaw, pitch, roll values and the Robotics Toolbox function:
R_euler = eul2r(yaw_rad, pitch_rad, roll_rad)
the result of the transformation is as expected (visually)
However, I need to calculate the rotation matrix also based on the omega, phi, kappa values.
I use my own rotation matrix for (w,f,k) = (omega, phi, kappa) that I have used successfuly in the past for similar transformation problems:
R=[ cos(f)*cos(k) cos(w)*sin(k)+sin(w)*sin(f)*cos(k) sin(w)*sin(k)-cos(w)*sin(f)*cos(k)
-cos(f)*sin(k) cos(w)*cos(k)-sin(w)*sin(f)*sin(k) sin(w)*cos(k)+cos(w)*sin(f)*sin(k)
sin(f) -sin(w)*cos(f) cos(w)*cos(f)];
but I do not get the same result, and indeed it looks not as good. I tried various transformations, also using the inverted
R = R'
but it doesn't work.
I am wondering which transformation matrix is used in the Robotics Toolbox function, as I could not find anything in the documentation.
Just in case, I give you my exaple values in degrees:
omega phi kappa = 3.927820353,4.052795303,44.806238302
and corresponding
roll pitch yaw = -174.358491845,0.100258014,44.950203063
Any help? Thanks!
  댓글 수: 4
Elisavet Konstantina Stathopoulou
Elisavet Konstantina Stathopoulou 2021년 10월 27일
@Cris LaPierre that's right I am using Peter Corke's robotics toolbox
Elisavet Konstantina Stathopoulou
Elisavet Konstantina Stathopoulou 2021년 10월 27일
@Bjorn Gustavsson I guess I make the same mistake, I tried different combinations but cannot get it right

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

답변 (1개)

Bjorn Gustavsson
Bjorn Gustavsson 2021년 10월 27일
If you have mixed up the order of the rotations you might step through the different combinations of rotations and sign-conventions by separating your R-matrix into the different single-matrix components:
Rx = @(w) [1 0 0;0,cos(w) -sin(w);0 sin(w) cos(w)];
Ry = @(phi) [cos(phi) 0 sin(phi);0 1 0;-sin(phi) 0 cos(phi)];
Rz = @(k) [cos(k) -sin(k) 0;sin(k) cos(k) 0; 0 0 1];
Then you can combine them in different order:
R_1 = @(w,phi,kappa) Rx(w)*Ry(phi)*Rz(kappa);
R_2 = @(w,phi,kappa) Rx(w)*Rz(kappa)*Ry(phi);
R_3 = @(w,phi,kappa) Ry(phi)*Rx(w)*Rz(kappa);
R_4 = @(w,phi,kappa) Ry(phi)*Rz(kappa)*Rx(w);
R_5 = @(w,phi,kappa) Rz(kappa)*Ry(phi)*Rx(w);
R_6 = @(w,phi,kappa) Rz(kappa)*Rx(w)*Ry(phi);
After that you should be able to find the correct one by stepping through the different sign-combinations for w, phi, and kappa. That should at worst be 2^3 cases for each of the 6 matrices, so 48 combinations...
HTH
  댓글 수: 2
Elisavet Konstantina Stathopoulou
Elisavet Konstantina Stathopoulou 2021년 10월 28일
@Bjorn Gustavsson Thanks for the hint, but I think it is not a problem of how I compose the R matrix. I guess I need to know which matrix is used in the Robotics Toolbox function to cross check the order.
Bjorn Gustavsson
Bjorn Gustavsson 2021년 10월 28일
Well then you either have to read the code of the eul2r function and figure out which order and what sign-convention is used, or use the method I proposed on that end of your problem, simply plug in a couple of yaw, pitch and roll-angles and see which combination of my 6 rotation-matrix-functions gives you the same rotation-matrices.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by