rosrun cannot find my executable [closed]
I have a wet package called velodyne, which provides a roscpp node called conversion. It builds alright, I can see it in the devel space ([WS]/devel/lib/velodyne/conversion), it has the executable bit set, but rosrun cannot find because it looks for it in the source folder.
I've had this problem a lot recently. Usually, after resourcing my setup several times, rebuilding several times, and other random fiddling, I finally can launch the node. I would like to know what's the issue and how to get rid of it...
my catkin workspace is located in /data/driving_repos/catkin_ws in my bashrc I source /data/driving_repos/catkin_ws/devel/setup.bash
$ rosrun velodyne conversion
[rosrun] Couldn't find executable named conversion below /data/driving_repos/catkin_ws/src/rdr_v2/packages/perception/velodyne
[rosrun] Found the following, but they're either not files,
[rosrun] or not executable:
[rosrun] /data/driving_repos/catkin_ws/src/rdr_v2/packages/perception/velodyne/src/conversion
Indeed, /data/driving_repos/catkin_ws/src/rdr_v2/packages/perception/velodyne/src/conversion is a folder!
Interestingly, after typing 'rosrun velodyne ' and using tab completion, it lists all the executables in my velodyne package alright...
Also, uninstalling ros-hydro-velodyne solves my problem. I checked the source code of rosrun and it calls
catkin_find --without-underlays --libexec --share velodyne
which returns /opt/ros/hydro/share/velodyne !
It's strange however that it returns that path... shouldn't the packages in my workspace have priority?
What is /data/driving_repos/catkin_ws/src/rdr_v2/packages/perception/velodyne/src/conversion ? Is a file, directory, etc? Is it a python script without the execute bit set?
aha, good point. It's actually a directory. Why is rosrun even considering a directory as a possible executable? is that a bug?
Perhaps, but crawling the source tree is an inherently messy and error-prone task.
Brice, do you always source the setup.bash in devel? What happens if you have old "dry" packages that you also need to run from a launch file - how do you keep them in your ROS_PACKAGE_PATH?
Simply extend your ROS_PACKAGE_PATH after sourcing the setup file.
Dirk, Thank you, I will "simply" do that, everytime. Brice - next time it happens take a look at your CMAKE_PREFIX_PATH. That is what catkin_find uses to find packages.
Seems lilkely. I have seen that happen also, but never figured out why. I sometimes end up recreating the workspace to untangle the mess.