Reputation: 11
I'm trying to perform hand to eye calibration for a staubli robot in combination with an Intel Realsense d455 depth camera. Therefore I am following the process described in: https://docs.opencv.org/4.5.4/d9/d0c/group__calib3d.html#gaebfc1c9f7434196a374c382abf43439b
The results are somewhat correct: The cameras Y-axis is aligned with the robots Y-axis, but the cameras X-axis corresponds to the robots Z-axis and the other way around. The translation values make no sense.
I'm suspecting the problem lies in my method of converting rx, ry, rz to a rotation matrix. The robots documentation mentiones:
We are using Tait-Bryan convention with XYZ system
Euler/Tait-Bryan angles are quite new to me, so I used this function like:
transforms3d.taitbryan.euler2mat(rx, ry, rz)
This seems to work in the sense that my coordinate systems are aligned, although according to its documentation this function returns "matrix for rotations around z, y and x axes". I suspect I have to use this function differently, because right now I swapped rx and rz, but I can't seem to figure out how to do this.
Thanks very much for thinking along!
Upvotes: 1
Views: 1182
Reputation: 11
It turned out that my robot returned clockwise rotations, while the rotation returned by my camera calibration were anti-clockwise. Simply multiplying rx_robot, ry_robot and rz_robot by -1 resolved my issues.
Upvotes: 0
Reputation: 404
I suspect that your rx, ry, rz values are a rotation vector and not Euler angles, so you are erroneously using euler2mat
.
You can use the cv2.Rodrigues
function to transform a rotation vector into a rotation matrix, or use scipy.spatial.transform.Rotation
objects, which are quite convenient.
Upvotes: 1