Ask Your Question

roslaunch cannot find node executable

asked 2017-06-27 08:35:31 -0500

Ali250 gravatar image

I have an ROS node called bag_player_controller inside a package which is also called bag_player_controller. In another ROS package within the same catkin workspace, I have the following lines:

<node name="bag_player_controller" pkg="bag_player_controller" type="bag_player_controller" output="screen" required="false">   
    <!-- name of the bag player node to control -->     
    <param type="str" name="player_name" value="bag_player"/>


But when I run the launch file, I get this error:

OSError: [Errno 2] No such file or directory: '/'

For some reason, ROS is searching for the executable inside the src directory. But when I do rosrun bag_player_controller bag_player_controller, it runs fine. Also, when I run catkin_find bag_player_controller bag_player_controller, it gives the correct path to the executable inside devel/RelWithDebInfo/lib/bag_player_controller/bag_player_controller, so I don't think there's a problem with my CMakeLists.txt, or my environment.

Any ideas?

edit retag flag offensive close merge delete


This is strange, because your node clearly is assigned to your package. Can you try only typing <node name="bag_player_controller" pkg="bag_player_controller" type="bag_player_controller"/> just to test if that works? I'm fairly new to ROS, but I launch all my executables that way.

Felix_N gravatar image Felix_N  ( 2017-06-28 12:30:46 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2017-06-29 02:46:45 -0500

Ali250 gravatar image

I managed to solve the problem. For some reason (build related or my own doing some time earlier), there was a broken symlink to the executable file inside my src folder. Once I deleted that, the launch file started working fine. I guess the important take-away here is that when you launch a node from a launch file, it does actually look inside your src folder for the executable before moving onto the devel/lib folder.

edit flag offensive delete link more


you should do this command before roslaunch :

$ cd ~/catkin_ws/

~/catkin_ws/$ source devel/setup.bash

~/catkin_ws/$ catkin_make

~/catkin_ws/$ roslaunch <package> <launch_file>

أسامة الادريسي gravatar image أسامة الادريسي  ( 2017-06-29 04:17:13 -0500 )edit

A naive solution is to copy the executable and paste it in the src directory.

MohammedHyder gravatar image MohammedHyder  ( 2017-06-29 18:05:51 -0500 )edit

Guys: thanks for the additional suggestions, but "copying binaries to the src directory" is obviously not a solution, it's at best a work-around (and one that should be avoided).

@أسامة الادريسي : you have the catkin_make and source steps reversed.

gvdhoorn gravatar image gvdhoorn  ( 2017-06-30 01:41:22 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2017-06-27 08:35:31 -0500

Seen: 975 times

Last updated: Jun 29 '17