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

roslaunch cannot find node executable

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

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"/>

</node>

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

OSError: [Errno 2] No such file or directory: '/home.net/aa17gil/work/mapper/src/bag_player_controller/bag_player_controller'

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

Comments

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 -0600 )edit

1 Answer

Sort by » oldest newest most voted
0

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

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

Comments

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 -0600 )edit
1

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 -0600 )edit
1

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 -0600 )edit

Question Tools

2 followers

Stats

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

Seen: 1,538 times

Last updated: Jun 29 '17