Camera and Hand-eye Calibration

The camera calibration and hand eye calibration is performed in two steps. First, we need to capture several images of the calibration target in different poses. For the hand-eye calibration it is necessary to save also a transformation from the "base_link" or "rX_link_1" to the "rX_link_6", and joint values for the arm where the camera is attached. The second step is offline processing of the calibration data, this is performed in Matlab. The second step, consist of dot pattern detection, camera calibration and hand eye calibration.

This tutorial describes the calibration procedure for Xtion1 and Xtion2 for detailed description see the clopema_calibration (hydro) package.

Capture Calibration Data

Capturing of the calibration data is performed by calling the camera_calib_capture.py in the clopema_calibration package which is part of the clopema_testbed repository. The script will perform the following actions:

  • Move to home position
  • Move the other arm away (optional)
  • Rotate robot towards the target (optional)
  • Plan the trajectory through calibration poses
  • Perform the trajectory while capturing images, transformations, and joint values

The calibration capture is performed by running these commands in separate terminals, this command sequence expects that the calibration target is on the desk, the calibration will be save in the camera_calib_1 and camera_calib_1 for xtion1 and xtion2 respectively:

  • Xtion 1
    -- Start Robot
    $ roslaunch clopema_launch start_robot.launch
    -- Start Xtion
    $ roslaunch clopema_launch xtion1.launch
    -- Start calibration capture
    $ rosrun clopema_calibration camera_calib_capture.py -l xtion1_link -o camera_calib_1 -t t2_desk -i /xtion1/rgb/image_raw -f
    
  • Xtion 2
    -- Start Robot
    $ roslaunch clopema_launch start_robot.launch
    -- Start Xtion
    $ roslaunch clopema_launch xtion2.launch
    -- Start calibration capture
    $ rosrun clopema_calibration camera_calib_capture.py -l xtion2_link -o camera_calib_2 -t t2_desk -i /xtion2/rgb/image_raw -f
    

Process Calibration Data

The second part is the offline processing of the calibration data. This process include:

This is done by running the following commands:

Xtion 1:

$ rosrun clopema_calibration run_calib_camera.sh -i `pwd`/camera_calib_1 -c xtion1_rgb --hand-eye xtion1_link_ee

Xtion 2:
$ rosrun clopema_calibration run_calib_camera.sh -i `pwd`/camera_calib_2 -c xtion2_rgb --hand-eye xtion2_link_ee