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

How can I fix this launchfile? [closed]

asked 2014-09-17 13:00:26 -0500

diegomex gravatar image

updated 2014-09-18 07:28:50 -0500

Hi dear ROS community!

I've started learning ROS a few months ago. Currently I'm trying to create my first launchfile that starts gscam and image_view packages to open a camera and visualize the video stream. I made a launch file, however, gscam and image_view cannot get connected. Gscam node is launching properly, but not the image_view one; it seems that it is not receiving the parameter. If I launch image_view manually ($rosrun image_view image_view image:=/camera/image_raw) everything works fine and I can visualize the video stream from my camera. How can I fix my launch file? Thank you!

    <launch>
<node pkg="gscam" type="gscam" name="gscam01">
<env name="GSCAM_CONFIG" value="v4l2src device=/dev/video0 ! video/x-raw-rgb,framerate=30/1 ! ffmpegcolorspace" />
</node>

<node pkg="image_view" type="image_view" name="image_view01">
<param name="image" type="string" value="/camera/image_raw" />
</node>

</launch>

SOLUTION:

launch>
<node pkg="gscam" type="gscam" name="gscam01">
<env name="GSCAM_CONFIG" value="v4l2src device=/dev/video0 ! video/x-raw-rgb,framerate=30/1 ! ffmpegcolorspace" />
</node>

<node pkg="image_view" type="image_view" name="image_view01">
<remap from="image" to="/camera/image_raw"/>
</node>

</launch>

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by diegomex
close date 2014-09-18 07:29:19.619860

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-09-17 13:20:58 -0500

ahendrix gravatar image

The input to image_view is a topic, not a parameter. (the command-line usage here can be a little confusing).

Try using the <remap> tag:

<remap from="image" to="/camera/image_raw"/>
edit flag offensive delete link more

Comments

Thank you very much, this worked perfectly!

diegomex gravatar image diegomex  ( 2014-09-18 05:03:37 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-09-17 12:58:11 -0500

Seen: 142 times

Last updated: Sep 18 '14