ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You do not need to calibrate a camera every time you use it. The output of a camera calibration is saved in a file named after your camera in the ~/.ros/camera_info directory (for example, for a camera named elecom_ucam you would get a file named ~/.ros/camera_info/elecom_ucam.yaml). The name used for this file comes from the camera_name parameter passed to the camera driver nodes. Nodes that use the camera_info_manager and follow the camera driver conventions do this - see here for a list.

So you can specify a name for your cameras in the launch file, e.g.:

<node name="left_camera" pkg="usb_cam" type="usb_cam_node" output="screen">
  <param name="camera_name" value="stereo_cam_left"/>
  <param name="camera_frame_id" value="stereo_cam_left_link"/>
  <param name="video_device" value="/dev/video0"/>
</node>

<node name="right_camera" pkg="usb_cam" type="usb_cam_node" output="screen">
  <param name="camera_name" value="stereo_cam_right"/>
  <param name="camera_frame_id" value="stereo_cam_right_link"/>
  <param name="video_device" value="/dev/video01"/>
</node>

This will link the two camera names to the two devices. Then run the stereo calibration routine:

rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.108 \
    left:=/left_camera/image_raw left_camera:=/left_camera \
    right:=/right_camera/image_raw right_camera:=/right_camera

When you commit the data it will save the camera information in ~/.ros/camera_info. This will be used automatically every time you start your camera nodes using the same camera names.

Calibrating both cameras simultaneously is not strictly necessary but if they are fixed together it is more convenient because you only need to go through the process once.