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

Hi

Back to your original question. The ros camera calibration delivers you a *.ini file, but that's not usable for the uvc_camera driver you should convert that to a *.yml file. I made a link on the http://www.ros.org/wiki/camera_calibration/Tutorials/MonocularCalibration --> on the bottom so its easier to find how to do.

<launch>  
  <group ns="lifecam" >
     <node name="lifecam" pkg="uvc_camera" type="camera_node">
     <param name="camera_info_url" value="file://$(find YOUR_NOTENAME)/cal.yml" />
     <param name="device" type="string" value="/dev/video0"/>
     <param name="width" type="int" value="320"/>
     <param name="height" type="int" value="240"/>
     <param name="fps" type="int" value="10"/>
  </node>
 </group> 
</launch>

The cal.yml file:

image_width: 640
image_height: 480
camera_name: lifecam
camera_matrix:
  rows: 3
  cols: 3
  data: [522.284, 0, 294.957, 0, 519.92, 221.282, 0, 0, 1]
distortion_coefficients:
  rows: 1
  cols: 5
  data: [0.075017, -0.17182, -0.005117, -0.00046, 0]
rectification_matrix:
  rows: 3
  cols: 3
  data: [1, 0, 0, 0, 1, 0, 0, 0, 1]
projection_matrix:
  rows: 3
  cols: 4
  data: [522.284, 0, 294.957, 0, 0, 519.92, 221.282, 0, 0, 0, 1, 0]
click to hide/show revision 2
camera_calibration_parsers ini yml camera_info_url

Hi

Back to your original question. The ros camera calibration delivers you a *.ini file, but that's not usable for the uvc_camera driver you should convert that to a *.yml file. file. Have a look at the camera_calibration_parsers --> http://www.ros.org/wiki/camera_calibration_parsers I made a link on the http://www.ros.org/wiki/camera_calibration/Tutorials/MonocularCalibration --> on the bottom so its easier to find how to do.

<launch>  
  <group ns="lifecam" >
     <node name="lifecam" pkg="uvc_camera" type="camera_node">
     <param name="camera_info_url" value="file://$(find YOUR_NOTENAME)/cal.yml" />
     <param name="device" type="string" value="/dev/video0"/>
     <param name="width" type="int" value="320"/>
     <param name="height" type="int" value="240"/>
     <param name="fps" type="int" value="10"/>
  </node>
 </group> 
</launch>

The cal.yml file:

image_width: 640
image_height: 480
camera_name: lifecam
camera_matrix:
  rows: 3
  cols: 3
  data: [522.284, 0, 294.957, 0, 519.92, 221.282, 0, 0, 1]
distortion_coefficients:
  rows: 1
  cols: 5
  data: [0.075017, -0.17182, -0.005117, -0.00046, 0]
rectification_matrix:
  rows: 3
  cols: 3
  data: [1, 0, 0, 0, 1, 0, 0, 0, 1]
projection_matrix:
  rows: 3
  cols: 4
  data: [522.284, 0, 294.957, 0, 0, 519.92, 221.282, 0, 0, 0, 1, 0]