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

1 次查看(过去 30 天)
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