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

Overlaying a package with "cmake" build type

asked 2015-05-08 22:04:05 -0500

Neil Traft gravatar image

updated 2015-05-10 19:31:51 -0500

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 git@github.com: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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2015-05-09 00:16:39 -0500

William gravatar image

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.

edit flag offensive delete link more

Comments

By "clone a copy of catkin into the workspace" did you mean just git clone git@github.com:ros/catkin.git and re-run catkin_make_isolated?

Neil Traft gravatar image Neil Traft  ( 2015-05-09 13:55:50 -0500 )edit

Just clone it into your "source" space, usually the src folder in your workspace.

William gravatar image William  ( 2015-05-09 21:38:06 -0500 )edit

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.

Neil Traft gravatar image Neil Traft  ( 2015-05-09 22:02:23 -0500 )edit

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.

Neil Traft gravatar image Neil Traft  ( 2015-05-09 22:02:54 -0500 )edit

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.

William gravatar image William  ( 2015-05-10 03:32:10 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-05-08 22:04:05 -0500

Seen: 1,044 times

Last updated: May 10 '15