Ask Your Question

How to run image_proc with roslaunch

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

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:


  <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 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" />

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

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

Wolf gravatar image

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

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

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


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

Seen: 5,226 times

Last updated: May 07 '15