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

Do packages have to be in the catkin source space?

asked 2017-10-09 09:48:24 -0600

ServoRen gravatar image

Hi there! Been trying out ROS and I'm simply amazed just how detailed the tutorials have been. One thing that's been puzzling me though is that catkin_make (and in my case, catkin build) seems to also look into the /opt/ros/kinetic/share folder on top of the source space. What is the reason for this? Is the latter space exclusively for packages I write while the former is for packages developed by other parties?

Many thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-10-09 20:52:57 -0600

tfoote gravatar image

You can have the concept of overlays such that you can layer new versions of packages on top of other ones and leverage shared installations such as the binaries.

There's a tutorial on this at:

edit flag offensive delete link more


@tfoote: so the answer is essentially 'yes' then? :) (an overlay just adds a 'new' source space).

And extending ROS_PACKAGE_PATH manually would also be akin to adding a new source space, but it the build artefacts will not end up in a corresponding build/devel space, but of the workspace ..

gvdhoorn gravatar image gvdhoorn  ( 2017-10-10 01:32:46 -0600 )edit

.. where catkin_make / catkin build was invoked.

@ServoRen: as ROS (catkin) pkgs are just CMake projects, you could actually build without Catkin. That would remove the 'workspace' concept. It's not often done though.

gvdhoorn gravatar image gvdhoorn  ( 2017-10-10 01:33:10 -0600 )edit

Yes, if you're talking about packages that you want to build, they have to be in the source space. The source space is specifically a subset of the current workspace and does not include the other paths

tfoote gravatar image tfoote  ( 2017-10-10 13:37:33 -0600 )edit

I see. So let's say I want to share my work and it uses both packages I wrote and not-so-common packages by other people, it would be best to place both categories of packages in the source space ..

ServoRen gravatar image ServoRen  ( 2017-10-11 04:12:04 -0600 )edit

.. More common packages like geometry_msgs or roscpp can be assumed to be taken from the /opt/ros/<distro>/share folder. Is this right?

Thanks so much!

ServoRen gravatar image ServoRen  ( 2017-10-11 04:12:55 -0600 )edit

That cannot be assumed, you should provide instructions on how to install your depedencies. There are tools like rosdep to automate this based on the contents of the source space and the dependencies in their package.xml files.

tfoote gravatar image tfoote  ( 2017-10-11 11:43:50 -0600 )edit

I see. Thanks for the input.

ServoRen gravatar image ServoRen  ( 2017-10-13 00:55:52 -0600 )edit

Question Tools



Asked: 2017-10-09 09:48:24 -0600

Seen: 314 times

Last updated: Oct 09 '17