Reputation: 93
I have a question regarding Rotation (R) and Translation (T) matrices, I hope someone can help me as we use R and T a lot in robotics to find the position of the robot.
I have R and T of an object frame in regards to a camera frame and R and T of a second object in regards to the same camera. If both objects are on a common surface/plane
question #1: (being on the same surface/plane) this means R for both objects in reference to the camera is the same! is this assumption correct?
question #2: how can I compute the distance between objects (along an x or y axis for example) using the translation matrices?
I have a 1x3 translation matrix and a 3x3 rotation matrix => I derived a 4x4 transformation matrix from R and T
thanks in advance
Upvotes: 6
Views: 4879
Reputation: 1300
the best way to compute the distance between the translations is generally by using the euclidian distance. (more generally in cases of more than 3D dimensions you can use the L2 norm).
But for the rotations the best way to quantify the distance in an interpretable way is by using the geodesic distance between the two rotation matrices this will return an angle that gives you pretty much a good idea about angular distance between the two rotation matrices.
Upvotes: 0
Reputation: 11930
1) Yes, it is. If 2 objects are refered to same coordinate system, and them have the same plane (the vector view is the same), at force, they have the same Rotation matrix. You can learn how a rotation matrix is build HERE. It is very userful if you don't know how are build. It has an example very good. 2) You can use the Euclidean distance using the same point (the center of reference for each object). It is the same of traslation.
Remember: 1º do all rotations, and then traslation. If you traslate 1º, you will do it wrong.
Hope it help!
Upvotes: 4
Reputation: 22245
Answer to 2): If translation is the vector resulting of subtracting point2's position to point1's position then Euclidean distance follows the formula linked here.
Then you just need to compute sqrt(x^2 + y^2 + z^2) as (x,y,z) of translation vector(between 1 and 2) as it is already the difference between the two points coordinates.
That means you have to compute the euclidean norm of the translation vector.
If you have 2 translation vectors (one for each point) then just subtract them, and calculate the euclidean distance of the resulting vector.
Upvotes: 4