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

How to run image_proc with roslaunch

asked 2015-05-06 23:16:44 -0600

Cerin gravatar image

How do you write a launch file to pipeline a color usb camera into image_proc, convert it to mono, and display it in a window?

To display a color usb webcam, this simple launch file works well:

webcam_color.launch:

<launch>
  <node name="usb_cam" 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="usb_cam" />
    <param name="io_method" value="mmap" />
  </node>
  <node name="image_view" pkg="image_view" type="image_view" respawn="false" output="screen">
    <remap from="image" to="/usb_cam/image_raw" />
    <param name="autosize" value="true" />
  </node>
</launch>

However, I can't find any examples of using image_proc in a launch file. I can pipe the color video stream into image_proc and display the mono using:

roslaunch mypkg webcam_test.launch
ROS_NAMESPACE=usb_cam rosrun image_proc image_proc
rosrun image_view image_view image:=/usb_cam/image_mono

What would be the equivalent of doing this all in a single launch file?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
7

answered 2015-05-07 13:43:53 -0600

Wolf gravatar image

the node tag in roslaunch xml format allows a ns, i.e. namespace, attribute:

wiki.ros.org/roslaunch/XML/node#Attributes

i think

ROS_NAMESPACE=usb_cam rosrun image_proc image_proc

would be something like

  <node name="image_proc" pkg="image_proc" type="image_proc" ns="usb_cam"/>

in a launch file.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-05-06 23:16:44 -0600

Seen: 6,763 times

Last updated: May 07 '15