Ask Your Question
0

Multiple usb webcams with their own calibration file

asked 2017-10-15 04:30:56 -0500

marcoresk gravatar image

I launched two webcams with the usb_cam package (ROS Indigo).

My launchfile is very simple:

<launch>
  <node name="left" pkg="usb_cam" type="usb_cam_node" output="screen" >
    <param name="video_device" value="/dev/video0" />
    <param name="image_width" value="960" />
    <param name="image_height" value="720" />
    <param name="pixel_format" value="yuyv" />
    <param name="camera_frame_id" value="my_stereo/left" />
        <param name="io_method" value="mmap"/>
      </node>

  <node name="right" pkg="usb_cam" type="usb_cam_node" output="screen" >
    <param name="video_device" value="/dev/video1" />
    <param name="image_width" value="960" />
    <param name="image_height" value="720" />
    <param name="pixel_format" value="yuyv" />
    <param name="camera_frame_id" value="my_stereo/right" />
    <param name="io_method" value="mmap"/>
  </node>

</launch>

And the correct output is

[ INFO] [1508058286.935975255]: using default calibration URL
[ INFO] [1508058286.936074756]: camera calibration URL: file:///home/marcor/.ros/camera_info/head_camera.yaml
[ INFO] [1508058286.936820975]: using default calibration URL
[ INFO] [1508058286.936874935]: camera calibration URL: file:///home/marcor/.ros/camera_info/head_camera.yaml
[ INFO] [1508058286.936916388]: Starting 'head_camera' (/dev/video0) at 960x720 via mmap (yuyv) at 30 FPS
[ INFO] [1508058286.937664502]: Starting 'head_camera' (/dev/video1) at 960x720 via mmap (yuyv) at 30 FPS

All works and webcams are correctly published. My question is: both camera are launched with the same calibration file. There is a way to set different calibraton .yaml files for every different camera? (I already have these files, left.yaml and right.yaml)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-10-15 05:01:18 -0500

gvdhoorn gravatar image

usb_cam reads a camera_info_url parameter at startup. From the parameter documentation:

~camera_info_url (string, default: '')

An url to the camera calibration file that will be read by the CameraInfoManager class

You can use that to provide package:// or file:// urls to the left.yaml and right.yaml that you have.

edit flag offensive delete link more

Comments

Thank you very much

marcoresk gravatar image marcoresk  ( 2017-10-15 05:32:09 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-10-15 04:30:56 -0500

Seen: 451 times

Last updated: Oct 15 '17