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

ros node not working when using launch file.

asked 2016-07-29 07:04:33 -0500

jtim gravatar image

updated 2016-07-29 07:17:05 -0500

Similar issue has been addressed in these two questions before hello node and output roslaunch. But I cannot get my node to work through the launch file. If I run the node like this:


it works everything is printed correctly. However through the launch file:

    <node name="image_listener_test" type="image_listener_test_node" pkg="image_listener_test"  output="screen"/>


Nothing is printed and no error message. Is there something else I am missing?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2016-08-03 01:38:02 -0500

jtim gravatar image

I figured it out. It was sourcing that was the issue. This means an old project file of the node existed a different place. So when running rosrun or roslaunch they found the old version. and when I executed I had the correct version. Deleting all Devel and build folders in my folder solved it.

edit flag offensive delete link more

answered 2016-08-02 18:53:58 -0500

Mark Rose gravatar image

Have you tried using rosrun? That is, you should be able to start the node from the command line using "rosrun image_listener_test image_listener_test_node". If you can't do that, it won't work from roslaunch. If the rosrun command doesn't work, you probably have not installed the node correctly from CMakeLists.txt. Following the pattern in the ROS tutorials, I use something like this:


(There may be another way to do it by installing the whole nodes/ directory, but I haven't found it yet.) You'll need to run "catkin_make", of course. (Once you run it once, I think rosrun will find it from the package directory, so you don't have to run "catkin_make" after every edit while you're developing.)

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-07-29 07:04:33 -0500

Seen: 2,401 times

Last updated: Aug 02 '16