How to transform Euler Angles from a local joint to its parent?

조회 수: 2 (최근 30일)
Julia Williams
Julia Williams 2019년 7월 12일
댓글: Julia Williams 2019년 7월 12일
I have a motion capture system of the hand that gives me coordinates (x,y,z) and euler angles (xyz). Each joint of the finger is locally based upon the one before. For example the first knuckle is based on the base of the finger (and so on). I am trying to find the angle of each finger joint but I first need to transform the coordinates I have been given from locally based to global. I know the euler angles are important in doing this but I am not sure how to accomplish this. Do I need a rotation matrix or a transformation matrix? This is what I have tried but it gives me the wrong answer unfortunately. Any help is much appreciated!
eul1 = [deg2rad(-0.0126580) deg2rad(0.572242) deg2rad(-0.074901)];
rotm1 = eul2rotm(eul1, 'XYZ');
vector2 = [52.975353 -0.000015 0.000008];
vector3 = transpose(vector2);
indexknuckle1 = rotm1*vector3;
  댓글 수: 1
Julia Williams
Julia Williams 2019년 7월 12일
Update: I am trying to multiply the rotation matrices in order to rotate the vectors relative to each joint's relative axis. This link shows how to transform matrices Transformation Matrices. I am attempting to do this from the second joint (rotm2) to the base (rotmbase). If anyone has any experience with rotation matrices I would love any input!
eulbase = [deg2rad(0) deg2rad(-9.607748) deg2rad(-3.075402)];
rotmbase = eul2rotm(eulbase, 'XYZ');
eul1 = [deg2rad(-0.0126580) deg2rad(0.572242) deg2rad(-0.074901)];
rotm1 = eul2rotm(eul1, 'XYZ');
eul2 = [deg2rad(-4.340429) deg2rad(1.83644) deg2rad(-28.632479)];
rotm2 = eul2rotm(eul2, 'XYZ');
Rbase1 = transpose(rotmbase)*rotm1;
R12 = transpose(rotm1)*rotm2;
Rbase2 = R12*Rbase1;
vectorbase = [-11.685307 7.564209 17.163254];
vectorbaseR = transpose(vectorbase);
indexbase = rotmbase * vectorbaseR;

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

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by