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

ros node not working when using launch file.

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

jtim gravatar image

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

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:

./image_listener_test_node

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

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

</launch>

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
0

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

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
1

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

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:

catkin_install_python(
    PROGRAMS
        nodes/image_listener_node
    DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

(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

Stats

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

Seen: 2,654 times

Last updated: Aug 02 '16