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

ros_camera_info service not found for usb_cam

asked 2013-05-15 02:55:27 -0500

ZoltanS gravatar image

updated 2013-05-17 11:29:39 -0500


I use 2 USB cameras for stereo vision with the usb_cam driver in ROS Groovy and I would like to calibrate them with the camera_calibration package. I start the cameras with the following launch file:

  <group ns="stereo">
    <node name="left" pkg="usb_cam" type="usb_cam_node" output="screen" >
        <param name="video_device" value="/dev/video1" />
        <param name="image_width" value="640" />
        <param name="image_height" value="480" />
        <param name="pixel_format" value="mjpeg" />
        <param name="camera_frame_id" value="left" />
        <param name="io_method" value="mmap"/>      

    <node name="right" pkg="usb_cam" type="usb_cam_node" output="screen" >
        <param name="video_device" value="/dev/video2" />
        <param name="image_width" value="640" />
        <param name="image_height" value="480" />
        <param name="pixel_format" value="mjpeg" />
        <param name="camera_frame_id" value="right" />
        <param name="io_method" value="mmap"/>      

they work nicely. Then I want to calibrate them with the following command:

 rosrun camera_calibration --size 9x7 --square 0.0053 right:=/stereo/right/image_raw left:=/stereo/left/image_raw left_camera:=/stereo/left right_camera:=/stereo/right --approximate=0.005

and it generates the following errors:

Waiting for service /stereo/left/set_camera_info ...
Service not found
Waiting for service /stereo/right/set_camera_info ...
Service not found

Why? How can I fix it? I know I can use the the --no-service-check parameter and it works afterwards, but it won't commit then the calibration parameters to cameras. What is the proper way to do camera calibration with the usb_cam driver?

Running the calibration with the --no-service-check parameter works and results a /tmp/calibrationdata.tar.gz file which contains the ost.txt text file with the calibration parameters. But I don't know what to do with this data in order to use the stereo vision. Can anybody help me here?

Update 1:

the /stereo/left/camera_info do exists in my case and the rostopic echo /stereo/left/camera_info streams messages like this:

  seq: 1383
    secs: 1368623369
    nsecs: 14836818
  frame_id: left
height: 480
width: 640
distortion_model: ''
D: []
K: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
R: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
P: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
binning_x: 0
binning_y: 0
  x_offset: 0
  y_offset: 0
  height: 0
  width: 0
  do_rectify: False

Update 2:

the rosservice list query results the following output:

edit retag flag offensive close merge delete


I don't see any code in that driver to publish the set_camera_info service. What does rosservice list print when the driver is running?

joq gravatar image joq  ( 2013-05-16 15:16:03 -0500 )edit

I am at home now, and I have here different USB cameras but everything else is the same, same laptop, same setup. I made a query rosservice list and I got the stuff that I just included above in the original question.

ZoltanS gravatar image ZoltanS  ( 2013-05-16 23:22:25 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2013-05-17 05:46:01 -0500

joq gravatar image

updated 2013-05-17 05:49:34 -0500

This looks like a bug in the driver to me.

It advertises /left/set_camera_info when it should provide /stereo/left/set_camera_info, and similarly for the right.

Possibly the driver is advertising an absolute name when it should be providing a relative name within the /stereo namespace. You can try running in the top-level namespace (without /stereo) to see if that works around the problem.

Why don't you open an issue with a link back to this question, so you don't have to repeat all the details?

edit flag offensive delete link more


Thanks @joq! Unfortunately there were some problems with the rosservice list output, so I update it. It seems that previously there were some remnant services after a crash from an other testrun with the uvc_cam driver. Now in the current output the set_camera_infos disappeared.

ZoltanS gravatar image ZoltanS  ( 2013-05-17 11:33:54 -0500 )edit

Question Tools

1 follower


Asked: 2013-05-15 02:55:27 -0500

Seen: 3,640 times

Last updated: May 17 '13