0
$\begingroup$

Rosanswers logo

Edit: I think the final answer to this question was basically, "This is expected. Don't worry about it."


I want to overlay the ompl package, which is a cmake-only build: <buildtool_depend>cmake</buildtool_depend> . I follow the steps according to the workspace overlaying tutorial:

$ mkdir -p ~/ompl-ws/src && cd ~/ompl-ws/src
$ catkin_init_workspace
$ git clone [email protected]:ros-gbp/ompl-release.git ompl
$ cd ..
$ catkin_make_isolated  # "isolated" is needed for cmake-only builds.
$ source devel_isolated/setup.zsh  # I use zsh.
$ rospack find ompl
/opt/ros/hydro/share/ompl

At this point, I would expect rospack find ompl to return ~/ompl-ws/src/ompl, but it does not. That's because the ROS_PACKAGE_PATH hasn't been updated. In fact, here's the setup file (devel_isolated/ompl/setup.sh):

#!/usr/bin/env sh
# generated from catkin.builder module

# remember type of shell if not already set
if [ -z "$CATKIN_SHELL" ]; then
  CATKIN_SHELL=sh
fi
# detect if running on Darwin platform
_UNAME=`uname -s`
IS_DARWIN=0
if [ "$_UNAME" = "Darwin" ]; then
  IS_DARWIN=1
fi

# Prepend to the environment
export CMAKE_PREFIX_PATH="/home/ntraft/Development/ompl-ws/devel_isolated/ompl:$CMAKE_PREFIX_PATH"
if [ $IS_DARWIN -eq 0 ]; then
  export LD_LIBRARY_PATH="/home/ntraft/Development/ompl-ws/devel_isolated/ompl/lib:$LD_LIBRARY_PATH"
else
  export DYLD_LIBRARY_PATH="/home/ntraft/Development/ompl-ws/devel_isolated/ompl/lib:$DYLD_LIBRARY_PATH"
fi
export PATH="/home/ntraft/Development/ompl-ws/devel_isolated/ompl/bin:$PATH"
export PKG_CONFIG_PATH="/home/ntraft/Development/ompl-ws/devel_isolated/ompl/lib/pkgconfig:$PKG_CONFIG_PATH"
export PYTHONPATH="/home/ntraft/Development/ompl-ws/devel_isolated/ompl/lib/python2.7/dist-packages:$PYTHONPATH"

This is very different from the normal setup file! Even when I put a normal setup file in there, it still doesn't work, because it's not a catkin build (it doesn't have a .catkin file, which is what _setup_util.py looks for). If I use workspace chaining to build something else that depends on ompl, it does use the overlayed version, but it makes me nervous because it doesn't say it's using the overlaid version, and rospack find still points to the system version:

# It says:
-- This workspace overlays: /opt/ros/hydro
# It SHOULD say:
-- This workspace overlays: /home/<user>/ompl-ws/devel_isolated;/opt/ros/hydro

Is this normal?? What's the correct way to overlay a cmake-only package?


Originally posted by Neil Traft on ROS Answers with karma: 205 on 2015-05-08

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

At this point, I would expect rospack find ompl to return ~/ompl-ws/src/ompl, but it does not. That's because the ROS_PACKAGE_PATH hasn't been updated.

ompl isn't a ROS package, and therefore does not directly or indirectly depend on or find_package roslib which is the package which sets the ROS_PACKAGE_PATH.

The setup.*sh files are normally generated by each catkin package, but since ompl doesn't find_package catkin and doesn't call catkin_package in its CMake, it doesn't generate any setup.*sh files. So, catkin_make_isolated places basic setup.*sh files on behalf of the package.

A reasonably simple workaround is to clone a copy of catkin into the workspace with ompl. This is quick and it will ensure that setup.*sh are generated by catkin_make* commands.


Originally posted by William with karma: 17335 on 2015-05-09

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Neil Traft on 2015-05-09:
By "clone a copy of catkin into the workspace" did you mean just git clone [email protected]:ros/catkin.git and re-run catkin_make_isolated?

Comment by William on 2015-05-09:
Just clone it into your "source" space, usually the src folder in your workspace.

Comment by Neil Traft on 2015-05-09:
Yeah, doing that with any random catkin package will correctly overlay that package, but only that package is added to the package path and ompl is still missing: ROS_PACKAGE_PATH=/home/ntraft/Development/ompl-ws/src/catkin:/opt/ros/hydro/share:/opt/ros/hydro/stacks.

Comment by Neil Traft on 2015-05-09:
It's still added to all those other paths, as shown above, but it's just missing from the package path. Not sure if that's fine or if it will cause errors at some point.

Comment by William on 2015-05-10:
As I said, ompl is not a ROS package, and because of that it does not directly or indirectly depend on roslib. Only packages which directly or indirectly depend on and find package roslib get added to the ROS_PACKAGE_PATH.

$\endgroup$

Your Answer

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