0
$\begingroup$

Rosanswers logo

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?


Originally posted by Cerin on ROS Answers with karma: 940 on 2015-05-11

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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>

Originally posted by Wolf with karma: 7555 on 2015-05-12

This answer was ACCEPTED on the original site

Post score: 3

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.