0
$\begingroup$

Rosanswers logo

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?


Originally posted by brice rebsamen on ROS Answers with karma: 1001 on 2014-01-28

Post score: 2


Original comments

Comment by ahendrix on 2014-01-28:
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?

Comment by brice rebsamen on 2014-01-28:
aha, good point. It's actually a directory. Why is rosrun even considering a directory as a possible executable? is that a bug?

Comment by joq on 2014-01-28:
Perhaps, but crawling the source tree is an inherently messy and error-prone task.

Comment by Constantin S on 2014-01-29:
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?

Comment by Dirk Thomas on 2014-01-29:
Simply extend your ROS_PACKAGE_PATH after sourcing the setup file.

Comment by Constantin S on 2014-01-29:
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.

Comment by joq on 2014-01-29:
Seems lilkely. I have seen that happen also, but never figured out why. I sometimes end up recreating the workspace to untangle the mess.

$\endgroup$

4 Answers 4

0
$\begingroup$

Rosanswers logo

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

Originally posted by William with karma: 17335 on 2014-01-28

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

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


Originally posted by joq with karma: 25443 on 2014-01-28

This answer was NOT ACCEPTED on the original site

Post score: 2

$\endgroup$
0
$\begingroup$

Rosanswers logo

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.


Originally posted by Constantin S with karma: 296 on 2014-01-29

This answer was NOT ACCEPTED on the original site

Post score: 2

$\endgroup$
0
$\begingroup$

Rosanswers logo

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.


Originally posted by brice rebsamen with karma: 1001 on 2014-01-29

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by joq on 2014-03-04:
That has happened to me, too. Easiest solution I know is deleting the workspace and carefully recreating it.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.