How can I use catkin package resources with the devel space?
I'm having trouble using package resources from the devel space of a catkin workspace. After I successfully run catkin_make
, I have new build and devel folders. If I source ws/devel/setup.bash
, I can then run binaries and use libraries, scripts, etc as I'd expect. But what about package-relative resources?
First question: How to I specify these resources in the package's CMakeLists.txt
? I wasn't able to find any examples in the docs. Here's what I've been doing:
$ cat ws/source/path/to/my_package/CMakeLists.txt ... install( DIRECTORY my_resources DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) ...
(but of course this isn't used for the devel space, right?)
Second question: How do I find these resources if I'm using the devel space?
My first try was rospack
. Here's the result:
$ rospack find my_package ws/build/path/to/my_package/catkin_generated/stamps/my_package
This location doesn't hold any resources (copies or links to the source space). (Or should it?)
I also stumbled upon catkin_find
. Here's the result:
$ catkin_find my_package ws/devel/share/my_package ws/source/path/to/my_package
I suppose the second one is what I want? Is this always the right thing to do?
Sidenote: It appears through some magic that roslaunch
knows where to look for launch files (or does it search everything in the catkin_find
list?).