Rospack can't find catkin built package with install flag
Trying to install a custom package into the workspace's install folder so that another package can find it. However I encountered a problem where after setting catkin config install flag, rospack can no longer find any of the packages built in that workspace. Could not find any info about this issue, am I doing something wrong?
Using newest version of ROS Melodic on Ubuntu 18.04 desktop PC with kernel 5.4.0-117-generic.
Starting from clean catkin workspace without setting install flag, everything works as intended: (using publicly accessible package for showing the issue)
mkdir -p catkin_test/src
cd catkin_test
catkin init
cd src && git clone https://github.com/OctoMap/octomap_msgs.git
catkin build
source ../devel/setup.bash
rospack find octomap_msgs
-> success
The same steps taken, but install flag is set. The rospack can no longer find the package:
- 1-4 as above
catkin config --install
catkin build
source ../devel/setup.bash
rospack find octomap_msgs
-> [rospack] Error: package 'nodelet_sample' not found
See the previously asked question difference between devel folder and install folder in catkin_ws
Thanks, it clarified some misunderstandings. I did not find a nice way of exporting header files in devel space, so this is what I ended up with for anyone interested:
AFAIK, if you have an
install
space, you mustsource /path/to/install/setup.bash
, not/path/to/devel/setup.bash
.Unless you're auto-generating code, or do some other weird things, you should not need any tricks when switching to an
install
space.You just need to make sure to
source
the correctsetup.bash
.