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

Difference between roslaunch and rosrun with image_view

asked 2015-05-11 23:17:21 -0600

Cerin gravatar image

If I run:

rosrun image_view stereo_view stereo:=raw_stereo image:=image_rect _approximate_sync:=true

I see the correct left and right channels of my stereo camera and a stereo depth map.

However, if I use roslaunch to run the equivalent launch file:

<launch>
    <node name="stereo_view" pkg="image_view" type="stereo_view">
        <param name="stereo" value="raw_stereo" />
        <param name="image" value="image_rect" />
        <param name="_approximate_sync" value="true" />
    </node>
</launch>

all I see are gray screens. What is the difference in the launch file that causes it to fail?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2015-05-12 01:29:30 -0600

Wolf gravatar image

updated 2015-05-12 01:47:28 -0600

It's caused by the usage of rosrun:

To set parameters when calling a node with ros run the syntax is:

rosrun package node _parameter:=value

To remap a topic when calling a node with ros run the syntax is:

rosrun package node topic_name:=remapped_topic_name

Note the lack of _ prefix before the topic_name! (See: http://wiki.ros.org/rosbash#rosrun )

Therefore in the example you've given stereo and image are topics and approximate_sync is a parameter. Hence, you cannot set stereo and image as parameters in the roslaunch, you must use the remap tag (See http://wiki.ros.org/roslaunch/XML/remap ). I think the correct launch equivalent would be something like:

<launch>
    <node name="stereo_view" pkg="image_view" type="stereo_view">
        <remap from="stereo" to="raw_stereo" />
        <remap from="image" to="image_rect" />
        <param name="approximate_sync" value="true" />
    </node>
</launch>
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-05-11 23:17:21 -0600

Seen: 3,444 times

Last updated: May 12 '15