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

rosrun cannot find my executable [closed]

asked 2014-01-28 08:12:26 -0600

brice rebsamen gravatar image

updated 2014-01-28 13:49:07 -0600

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?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by demmeln
close date 2014-03-29 11:00:36

Comments

1

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?

ahendrix gravatar image ahendrix  ( 2014-01-28 09:41:27 -0600 )edit
1

aha, good point. It's actually a directory. Why is rosrun even considering a directory as a possible executable? is that a bug?

brice rebsamen gravatar image brice rebsamen  ( 2014-01-28 10:09:16 -0600 )edit

Perhaps, but crawling the source tree is an inherently messy and error-prone task.

joq gravatar image joq  ( 2014-01-28 12:59:51 -0600 )edit

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?

Constantin S gravatar image Constantin S  ( 2014-01-29 08:41:37 -0600 )edit

Simply extend your ROS_PACKAGE_PATH after sourcing the setup file.

Dirk Thomas gravatar image Dirk Thomas  ( 2014-01-29 08:58:53 -0600 )edit

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.

Constantin S gravatar image Constantin S  ( 2014-01-29 09:12:06 -0600 )edit

Seems lilkely. I have seen that happen also, but never figured out why. I sometimes end up recreating the workspace to untangle the mess.

joq gravatar image joq  ( 2014-01-29 12:16:31 -0600 )edit

5 Answers

Sort by ยป oldest newest most voted
2

answered 2014-01-29 11:51:38 -0600

brice rebsamen gravatar image

updated 2014-03-04 06:13:28 -0600

I think what happened, is that in between multiple cycles of sourcing various devel spaces, and deleting the build and devel folder, and rerunning catkin_make, my devel setup file got confused and I ended with /opt/ros/hydro in front of my devel space path in CMAKE_PREFIX_PATH. So now I double check my CMAKE_PREFIX_PATH when things are weird.

edit flag offensive delete link more

Comments

That has happened to me, too. Easiest solution I know is deleting the workspace and carefully recreating it.

joq gravatar image joq  ( 2014-03-04 07:03:30 -0600 )edit
2

answered 2014-01-28 15:16:51 -0600

joq gravatar image

/opt/ros/hydro/share/velodyne is a meta-package, the catkin version of the old rosbuild velodyne stack. I am not sure why your velodyne package does not take precedence over that one, but having two different packages with the same name seems likely to cause problems.

You can uninstall that package. It is just use a convenient way to install velodyne_driver, velodyne_msgs and velodyne_pointcloud.

edit flag offensive delete link more
2

answered 2014-01-29 09:25:44 -0600

Constantin S gravatar image

catkin_find uses the environment variable CMAKE_PREFIX_PATH to find catkin workspaces. These workspaces in turn are used in rosrun. ROS_PACKAGE_PATH is no longer enough.

edit flag offensive delete link more
1

answered 2014-01-28 10:03:06 -0600

William gravatar image

For the devel space rosrun looks first to the source space because that allows you to modify your scripts in the source space and have those modifications take effect without rebuilding. This obviously only works for scripts written in interpreted languages. I imagine you install the conversion script using a CMake snippet like this:

install(FILE src/conversion DESTINATION ....)

This means it is only installed when you invoke the install target, i.e. catkin_make install, and nothing is done in the devel space, i.e. plain catkin_make.

It looks like your setup will work fine if you just make your source copy of the script executable:

chmod +x src/conversion
edit flag offensive delete link more
-1

answered 2014-03-29 03:31:09 -0600

lidj gravatar image

Maby you forget use "source devel/setup.sh"

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2014-01-28 08:12:26 -0600

Seen: 9,808 times

Last updated: Mar 29 '14