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

Usb_cam ignoring camera_frame_id [closed]

asked 2015-05-10 22:01:15 -0500

Cerin gravatar image

updated 2015-05-11 21:28:16 -0500

I have a launch file for starting a stereo USB camera:

<launch>
    <arg name="device_left" default="/dev/video1" />
    <arg name="device_right" default="/dev/video2" />
    <arg name="width" default="320" />
    <arg name="height" default="240" />
    <arg name="format" default="yuyv" />
    <group ns="raw_stereo">
        <node name="left" pkg="usb_cam" type="usb_cam_node" output="screen">
            <param name="video_device" value="$(arg device_left)" />
            <param name="image_width" value="$(arg width)" />
            <param name="image_height" value="$(arg height)" />
            <param name="pixel_format" value="$(arg format)" />
            <param name="camera_frame_id" value="left_camera" />
            <param name="io_method" value="mmap" />
            <param name="camera_info_url" type="string" value="file://$(find stereo_slam_test)/config/usb1-config-left.yml" />
        </node>
        <node name="right" pkg="usb_cam" type="usb_cam_node" output="screen">
            <param name="video_device" value="$(arg device_right)" />
            <param name="image_width" value="$(arg width)" />
            <param name="image_height" value="$(arg height)" />
            <param name="pixel_format" value="$(arg format)" />
            <param name="camera_frame_id" value="right_camera" />
            <param name="io_method" value="mmap" />
            <param name="camera_info_url" type="string" value="file://$(find stereo_slam_test)/config/usb1-config-right.yml" />
        </node>
    </group>
</launch>

However, when I run this, I get the warnings:

[ WARN] [1431313131.230893149]: [head_camera] does not match name left_camera in file ~/git/stereo_slam_test/src/stereo_slam_test/config/usb1-config-left.yml
[ INFO] [1431313131.230983626]: Starting 'head_camera' (/dev/video1) at 320x240 via mmap (yuyv) at 30 FPS
[ INFO] [1431313131.273715224]: camera calibration URL: ~/git/stereo_slam_test/src/stereo_slam_test/config/usb1-config-right.yml
[ WARN] [1431313131.275529366]: [head_camera] does not match name right_camera in file ~/git/stereo_slam_test/src/stereo_slam_test/config/usb1-config-right.yml

Why is it using the "head_camera" frame id for both cameras when I explicitly set it to "left_camera" and "right_camera" in my launch file?

Edit: The output of rosparam get /raw_stereo:

left:
  camera_frame_id: left_camera
  camera_info_url: file:///home/chris/git/stereo_slam_test/src/stereo_slam_test/config/usb1-config-left.yml
  image_height: 240
  image_raw:
    compressed: {format: jpeg, jpeg_quality: 80, png_level: 9}
    compressedDepth: {depth_max: 10.0, depth_quantization: 100.0, png_level: 9}
    theora: {keyframe_frequency: 64, optimize_for: 1, quality: 31, target_bitrate: 800000}
  image_width: 320
  io_method: mmap
  pixel_format: yuyv
  video_device: /dev/video1
right:
  camera_frame_id: right_camera
  camera_info_url: file:///home/chris/git/stereo_slam_test/src/stereo_slam_test/config/usb1-config-right.yml
  image_height: 240
  image_raw:
    compressed: {format: jpeg, jpeg_quality: 80, png_level: 9}
    compressedDepth: {depth_max: 10.0, depth_quantization: 100.0, png_level: 9}
    theora: {keyframe_frequency: 64, optimize_for: 1, quality: 31, target_bitrate: 800000}
  image_width: 320
  io_method: mmap
  pixel_format: yuyv
  video_device: /dev/video2
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Miquel Massot
close date 2015-06-25 02:46:31.416113

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-05-11 16:09:10 -0500

ahendrix gravatar image

From reading the usb_cam documentation and source code, your configuration looks correct. After running your launch file, you should be able to confirm that the desired parameters are being set correctly by running rosparam get /raw_stereo

edit flag offensive delete link more

Comments

I am. But where is this "head_camera" name coming from and why does it complain if I use a different name than that? Is that hard-coded in usb_cam?

Cerin gravatar image Cerin  ( 2015-05-11 17:14:26 -0500 )edit

head_camera appears to be the default camera frame name in the usb_cam node.

ahendrix gravatar image ahendrix  ( 2015-05-11 17:28:13 -0500 )edit

But then why doesn't camera_frame_id override it?

Cerin gravatar image Cerin  ( 2015-05-11 18:29:24 -0500 )edit

I don't know. As suggested in my answer, please run rosparam get /raw_stereo and include the output in your question.

ahendrix gravatar image ahendrix  ( 2015-05-11 18:33:01 -0500 )edit

Sorry, I've appended the output. It seems the camera_frame_id is being set, even though it does not match the camera name in the yml files.

Cerin gravatar image Cerin  ( 2015-05-11 21:31:49 -0500 )edit

There appears to be an undocumented camera_name parameter; try setting that to the name of your camera. See: https://github.com/bosch-ros-pkg/usb_...

ahendrix gravatar image ahendrix  ( 2015-05-11 22:55:57 -0500 )edit

Thank you! That was it.

Cerin gravatar image Cerin  ( 2015-05-11 23:21:17 -0500 )edit

Ok. I've updated the documentation on the wiki page.

ahendrix gravatar image ahendrix  ( 2015-05-11 23:51:06 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-05-10 22:01:15 -0500

Seen: 1,141 times

Last updated: May 11 '15