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

Compiling ROS development files from source

asked 2013-12-16 08:07:40 -0500

Mani gravatar image

updated 2013-12-20 07:43:29 -0500

I followed the source-based install documentation for ROS Hydro to compile ros_comm. It seems as if the the .rosinstall file lists stable released versions of packages from . However the development files for ros_comm is being hosted here: .

My ultimate goal is to compile roscpp from source in a catkin workspace so every package in that workspace is built against the local [and patched] version of roscpp. I also want to be able to merge upstream changes when there is an update available. I tried to clone ros_comm from github (the development repo) and make it, but it failed because of unmet dependencies (check the update below).

My questions is: What is the workflow to compile (and install) ROS core components in general (or roscpp in specific) from development repositories.


As @dirk mentioned, the current hydro-devel branch for ros_comm is unstable. That was the reason that building sources from github did not work. This is what I've done to overlay the latest stable version of roscpp in a catkin workspace based on @dirk and @demmeln answers.

mkdir roscppsrc_ws && cd roscppsrc_ws  
roslocate info roscpp > roscpp-stable.rosinstall 
# As the `hydro-devel` branch is unstable edit the `roscpp-stable.rosinstall` file
# and change version from `hydro-devel` to latest stable (e.g `1.9.50`)
wstool init src roscpp-stable.rosinstall
rosdep install --from-paths src --rosdistro hydro 
# Above did nothing on my computer with `ros-hydro-desktop` installed
source /opt/ros/hydro/setup.bash  # Not an isolated build

To test the overlay I copied the talker.cpp and listener.cpp from roscpp_tutorials in a new package in src/sample of the same workspace. After a catkin_make I can confirm than the executables are linked against the local versions of roscpp:

ldd ./devel/lib/sample/talker | grep roscpp => /home/mani/roscppsrc_ws/devel/lib/ (0x00007fc47ab80000)
edit retag flag offensive close merge delete


Just ot mention this in case you get strange behaviour/segfaults: In your described setup you might run intro trouble when the package you build ontop of your modified roscpp is linking also against a library from the Debian packages, which itself is linked against the Debian version of roscpp.

demmeln gravatar image demmeln  ( 2013-12-21 01:16:24 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2013-12-16 08:30:55 -0500

Dirk Thomas gravatar image

It is highly not recommended to build all packages from their source repositories. While some of them might be stable others might not even build. Therefore you should use the latest released version from the gbp repositories.

E.g. the current version of roscpp in the development repo will not work with its released dependencies but requires the development versions of some dependencies.

If you really need some recent patches from the source repository you should just switch one repository from gbp to source and keep all other packages from gbp repos. The easiest workflow for that is:

  • checkout the source repos which you want to use
  • use rosdep to install all required dependencies fom Debian packages
  • use the rosinstall_generator to generate a rosinstall file for a set of repositories on top of what you have installed / checked out from source
edit flag offensive delete link more


Thank you very much @dirk, I will give your solution a try and post the results here. So given this complexity, how people submit pull requests to core ros packages included in `ros_comm`?

Mani gravatar image Mani  ( 2013-12-16 15:34:15 -0500 )edit

The above description is very generic and describes the procedure. Most of the times it is sufficient to checkout the sources of the package to patch (e.g. roscpp from ros_comm) and a higher level package which uses it and needs the patch/enhancement. So it should be fairly easy to setup workspace like this (even by hand).

Dirk Thomas gravatar image Dirk Thomas  ( 2013-12-16 17:36:27 -0500 )edit

Thank you very much. I updated the post with what worked for me.

Mani gravatar image Mani  ( 2013-12-20 07:44:00 -0500 )edit

answered 2013-12-16 08:37:22 -0500

demmeln gravatar image

Have you checked out roscpp development version inside your workspace?

You can try to go to the src folder, remove from the .rosinstall all entries related to ros_comm, remove the corresponding folders from the src folder manually, then execute:

roslocate info ros_comm | wstool merge -
wstool update ros_comm

Afterwards return to the catkin_make_isolated command from the install instructions (don't execute it in src, but the root of the workspace). I'm not sure if this is the best way to go, but you can give it a try. This way you have the released packages of everything, except for packages in ros_comm, for which you are on the hydro-devel branch, you might of course need updates for other packages as well, but hopefully not for most of them (that you don't want to hack in).

Since ros_comm contains pretty basic packages, you probably cannot manage with an overlay, as suggested for packages you want to develop here:

edit flag offensive delete link more


Dirk's approach is probably easier than manually changing the existing .rosinstall.

demmeln gravatar image demmeln  ( 2013-12-16 08:40:22 -0500 )edit

Thank you @demmeln . I will try Dirk's solution first. However you pointed out very useful information which I really appreciate.

Mani gravatar image Mani  ( 2013-12-16 15:36:22 -0500 )edit

Question Tools

1 follower


Asked: 2013-12-16 08:07:40 -0500

Seen: 887 times

Last updated: Dec 20 '13