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
- Mount calibration board on robot gripper
- Determine transformation matrix from calibration board to camera (up to this point everything works).
- Retrieve pose from robot (x,y,z,rx,ry,rz)
- convert pose to rotation matrix (I suspect this is where i go wrong)
- Use cv2.CalibrateHandEye(R_base_to_gripper, t_base_to_gripper, R_target_to_cam, t_target_to_cam)
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!