Hello,
I would ask how it is with the rotation angles A, B, C. They are the Euler angles, or Tait-Bryan angles? And how to calculate? What I have found is, that is calculated from the rotation matrix, which is in the form R = Rz(A)Ry(B)Rx(C).
My main question is how to obtain this rotation matrix from the vector given two points in the Cartesian coordinate system. I have given 2 points (which have changed over time) that I have to pass through two points by tool rotation according to the direction vector given these two points.
I ask you for advice on how to calculate the angle A, B, C.
Thank you all in advance for any advice.
Computing A, B, C angles from the direction vector
-
Dastych.L -
September 23, 2016 at 10:44 PM -
Thread is marked as Resolved.
-
-
Hello,
I would ask how it is with the rotation angles A, B, C. They are the Euler angles, or Tait-Bryan angles?Proper Euler angles only use two axis... for example Z-X-Z, etc. (first and third rotation are same, in this case Z). In reality they are not the same thing because Z axis points in different direction after second rotation.
Tait-Bryan uses three axes... X,Y and Z.
in the form R = Rz(A)Ry(B)Rx(C).so there are three basic rotations involving all three axes (X,Y,Z), therefore this is considered Tait-Bryan....
And how to calculate?just reverse the process or randomize A,B, C till you get right output.... kidding
you should check forum as this was discussed few times and sample code was posted as well.
https://www.robot-forum.com/robotforum/kuk…lgorithm-works/ -
You can't calculate the angles just from one vector. You need at least two vectors, because a vector can rotate around its axis the same way a spindle does. And to lock the rotation to a specific orientation you need the second vector. Then you use these two vectors to calculate the x, y and z axes of the rotation matrix by using crossproduct, then form the matrix, and then calculate the angles from it.
-
Thank you panic mode and Spl for your advice.
Yes, I watched the referenced discussion and I came out of it, but the third point (or second vector) missed me.
I would ask how to choose these 3 points (P1, P2 and P3).
As a point P1 I chose starting point of my direction vector and the second point of the vector I do not know whether chose to P2 or P3. And then how do you correctly choose the third point, which will form with point P1 the second vector? I tried to choose the second vector as a unit vector x axis (P2 = (1, 0, 0)), and with it my calculation did not get along, but the question is whether I had correctly calculate and that this point should not be a point P3.
Please, give me an advice. -
Read manual how to measure base using 3point method
-
Read manual how to measure base using 3point methodBut the manual I read just the same as what you wrote panic mode in referenced post, and that is the basic point P1, P2 point is shifted along the X axis and P3 is a point XY plane, where Y is a positive. I guess it all wrong I understand, but in this case not considered by the Z-axis, ie. vector in space, but only in the plane. What should I do to take into account the vector in 3D space?
When I tried to calculate for P1 = (1000, 0, 1000), P2 = (1100, 0, 1000), P3 = (1100, 100, 1000), so I calculated the rotation matrix:
1 0 0
R = 0 0.707 0
0 0 0.707
From this matrix, I counted the angles B = 0, A = 0 and C = 0 (if I count from an element R (3,2)), or C = 45 ° (if I count from an element R (3,3)) . I think that this is not correct. I estimate that the correct value should be around A = 180, B = 90 ° C = 180 ° (angle C I'm not sure).
Please advice what I'm doing wrong. -
vx = p2-p1 = 100, 0, 0 -> normalized = 1, 0, 0
v = p3-p1 = 100, 100, 0 -> normalized = 0.707, 0.707, 0
vz = normalized(cross(vx,v)) = 0, 0, 1 https://www.wolframalpha.com/input/?i=norma…,(0.707,0.707,0))
vy = normalized(cross(vz,vx)) = 0, 1, 0 https://www.wolframalpha.com/input/?i=norma…s(0,0,1),(1,0,0))1 0 0
-> R = 0 1 0
0 0 1-> A = 0, B = 0, C = 0
-
yep, not every matrix is a rotation matrix. rotation matrix is special in several ways. when doing computation, vectors need to be normalized.
btw, just look at the code in mentioned link, it shows exactly what computer does.