Rosanswers logo

This is a bit of a follow up on the answer to this questions: http://answers.ros.org/question/108916/openni_launch-rosdep-on-os-x/

So assuming I have build and installed ROS (e.g. the desktop-full variant), I'm woundering how to best maintain my installation, meaning adding additional packages (which on ubuntu I would install via apt-get) and updating the whole installation to current releases (staying on the same distro, hydro in my case).

Is it possible and recommended to install to the same install space (e.g. /opt/ros/hydro) from different workspaces? E.g. I would like to add additional packages like suggested in the answer linked above. Can I build them in a freshly created workspace and install to /opt/ros/hydro? Should I instead extend my workspace with which I build the original packages installed to /opt/ros/hydro?

How would I go about upgrading my packages to the latest releases? Can I use my existing workspace and update the .rosinstall file to the latest released versions? What is the best practice here?

Originally posted by demmeln on ROS Answers with karma: 4306 on 2013-12-12

Post score: 4

Original comments

Comment by demmeln on 2013-12-16:
Noone? There must be a ton of people having pure source-installs, no?


2 Answers 2


Rosanswers logo

Given that you have a base ROS installed, lets say to ~/hydro/install, with the sources in ~/hydro/src, which was generated from a rosinstall_generator command like rosinstall_generator desktop_full --rosdistro hydro --deps --wet-only > hydro-desktop-full-wet.rosinstall. In order to update this install I would do the following:

$ mv hydro-desktop-full-wet.rosinstall hydro-desktop-full-wet.rosinstall.old
$ rosinstall_generator desktop_full --rosdistro hydro --deps --wet-only > hydro-desktop-full-wet.rosinstall
$ diff hydro-desktop-full-wet.rosinstall.old hydro-desktop-full-wet.rosinstall

On my machine I get something like this:

% diff hydro-desktop-full-wet.rosinstall.old hydro-desktop-full-wet.rosinstall
<     version: release/hydro/orocos_kdl/1.2.0-1
>     version: release/hydro/orocos_kdl/1.2.1-0
<     version: release/hydro/urdf_tutorial/0.2.1-0
>     version: release/hydro/urdf_tutorial/0.2.2-0
<     version: release/hydro/urdfdom/0.2.8-1
>     version: release/hydro/urdfdom/0.2.10-3

This tells me that those three packages have new versions, then you can use wstool to update your ~/hydro/src folder:

$ wstool merge -t src hydro-desktop-full-wet.rosinstall

     Change details of element (Use --merge-keep or --merge-replace to change):
  orocos_kdl,  urdf_tutorial,  urdfdom

Continue: (y)es, (n)o, (v)erbosity, (a)dvanced options: y
Config changed, maybe you need run wstool update to update SCM entries.
Overwriting /Users/william/hydro/src/.rosinstall

update complete.

The above command will have updated the .rosinstall file in the ~/hydro/src folder, grep shows me that orocos has indeed been updated:

% cat src/.rosinstall | grep orocos
- git: {local-name: orocos_kdl, uri: 'https://github.com/smits/orocos-kdl-release.git',
    version: release/hydro/orocos_kdl/1.2.1-0}

At this point though, you have not updated the source code you have, to do this you must use wstool again:

% wstool up -t src

The above command will check each entry in the .rosinstall against the thing in the source folder. When it finds an inconsistency, it will ask your what you want to do:

Prepare updating https://github.com/ros-gbp/catkin-release.git (version release/hydro/catkin/0.5.77-0) to /Users/william/hydro/src/catkin
Url https://github.com/ros/catkin does not match https://github.com/ros-gbp/catkin-release.git requested.
  (d)elete and replace, (a)bort, (b)ackup and replace, (s)kip: s
Skipping install of catkin because: Url https://github.com/ros/catkin does not match https://github.com/ros-gbp/catkin-release.git requested.

I have a custom version of catkin which I do not want to update, so I'll skip that one. Packages which are new will be fetched, I had removed opencv2, so it re-fetched that:

[opencv2] Fetching https://github.com/ros-gbp/opencv2-release.git (version release/hydro/opencv2/2.4.6-3) to /Users/william/hydro/src/opencv2

Finally it gets to orocos_kdl and updates it:

[orocos_kdl] Updating /Users/william/hydro/src/orocos_kdl
remote: Counting objects: 227, done.
remote: Compressing objects: 100% (119/119), done.
remote: Total 189 (delta 66), reused 187 (delta 64)
Receiving objects: 100% (189/189), 20.61 KiB | 0 bytes/s, done.
Resolving deltas: 100% (66/66), completed with 16 local objects.
From https://github.com/smits/orocos-kdl-release
   b198d62..8909a85  debian/hydro/orocos_kdl -> origin/debian/hydro/orocos_kdl
   321632a..fa9be31  debian/hydro/precise/orocos_kdl -> origin/debian/hydro/precise/orocos_kdl
   eeb590d..e81a661  debian/hydro/precise/python_orocos_kdl -> origin/debian/hydro/precise/python_orocos_kdl
   aac5a5b..6f3732f  debian/hydro/python_orocos_kdl -> origin/debian/hydro/python_orocos_kdl
   707290a..43eb2ee  debian/hydro/quantal/orocos_kdl -> origin/debian/hydro/quantal/orocos_kdl
   784f63b..4b422b5  debian/hydro/quantal/python_orocos_kdl -> origin/debian/hydro/quantal/python_orocos_kdl
   9e30d46..be57517  debian/hydro/raring/orocos_kdl -> origin/debian/hydro/raring/orocos_kdl
   dd3ea36..83cb73b  debian/hydro/raring/python_orocos_kdl -> origin/debian/hydro/raring/python_orocos_kdl
   cd114b1..66acb41  master     -> origin/master
   3f2c2a6..82391b6  patches/debian/hydro/orocos_kdl -> origin/patches/debian/hydro/orocos_kdl
   b4da946..f2bd89f  patches/debian/hydro/precise/orocos_kdl -> origin/patches/debian/hydro/precise/orocos_kdl
   3e61cee..44e58b9  patches/debian/hydro/precise/python_orocos_kdl -> origin/patches/debian/hydro/precise/python_orocos_kdl
   517103d..d44ddf6  patches/debian/hydro/python_orocos_kdl -> origin/patches/debian/hydro/python_orocos_kdl
   02f4013..b2cf5d4  patches/debian/hydro/quantal/orocos_kdl -> origin/patches/debian/hydro/quantal/orocos_kdl
   9f1f5ec..67a0eac  patches/debian/hydro/quantal/python_orocos_kdl -> origin/patches/debian/hydro/quantal/python_orocos_kdl
   7917a14..c038702  patches/debian/hydro/raring/orocos_kdl -> origin/patches/debian/hydro/raring/orocos_kdl
   5d92f2a..45fbe18  patches/debian/hydro/raring/python_orocos_kdl -> origin/patches/debian/hydro/raring/python_orocos_kdl
   f9a1676..39b40d9  patches/release/hydro/orocos_kdl -> origin/patches/release/hydro/orocos_kdl
   f946058..71c4b15  patches/release/hydro/python_orocos_kdl -> origin/patches/release/hydro/python_orocos_kdl
   2d94e1c..2c5d3a2  release/hydro/orocos_kdl -> origin/release/hydro/orocos_kdl
   2468f71..84e236b  release/hydro/python_orocos_kdl -> origin/release/hydro/python_orocos_kdl
   bb592b5..ae2dc7c  upstream   -> origin/upstream
 * [new tag]         debian/ros-hydro-orocos-kdl_1.2.1-0_precise -> debian/ros-hydro-orocos-kdl_1.2.1-0_precise
 * [new tag]         debian/ros-hydro-orocos-kdl_1.2.1-0_quantal -> debian/ros-hydro-orocos-kdl_1.2.1-0_quantal
 * [new tag]         debian/ros-hydro-orocos-kdl_1.2.1-0_raring -> debian/ros-hydro-orocos-kdl_1.2.1-0_raring
 * [new tag]         debian/ros-hydro-python-orocos-kdl_1.2.1-0_precise -> debian/ros-hydro-python-orocos-kdl_1.2.1-0_precise
 * [new tag]         debian/ros-hydro-python-orocos-kdl_1.2.1-0_quantal -> debian/ros-hydro-python-orocos-kdl_1.2.1-0_quantal
 * [new tag]         debian/ros-hydro-python-orocos-kdl_1.2.1-0_raring -> debian/ros-hydro-python-orocos-kdl_1.2.1-0_raring
 * [new tag]         release/hydro/orocos_kdl/1.2.1-0 -> release/hydro/orocos_kdl/1.2.1-0
 * [new tag]         release/hydro/python_orocos_kdl/1.2.1-0 -> release/hydro/python_orocos_kdl/1.2.1-0
 * [new tag]         upstream/1.2.1 -> upstream/1.2.1
[orocos_kdl] Done.

Once that command finishes you can run catkin_make_isolated --install --force-cmake to rebuild and re-install the new and updated packages.

This is the workflow I would use if I just updated often, but I rebuild the whole thing so frequently that I just start with a fresh workspace.

Originally posted by William with karma: 17335 on 2013-12-16

This answer was ACCEPTED on the original site

Post score: 4

Original comments

Comment by demmeln on 2013-12-16:
Thanks for you extensive answer. This almost fully answers my question. With this update model it seems fine to keep extending the workspace of the "base install" with additional stable packages (which i would otherwise want to install from a package manager).

Comment by demmeln on 2013-12-16:
However can you comment on installing an overlay into the same install space as the underlay (= base install)? See the third paragraph of my question.

Comment by jkolb on 2014-01-22:
This should really be on the wiki and linked to from the source installation page.

Comment by demmeln on 2014-01-22:
@jkolb: agreed, can you put it there? :-P @William: any idea about reusing the underlays install space?

Comment by ahendrix on 2014-01-24:
I've added another section to the wiki with these instructions: http://wiki.ros.org/hydro/Installation/Source

Comment by demmeln on 2014-03-10:
Regarding installing an overlay into the install space of an underlay. Conventional wisdom says it works: http://answers.ros.org/question/137121/installing-an-overlay-in-the-install-space-of-the-underlay


Rosanswers logo

When managing a large workspace, it gets awkward having to rebuild massive amounts of code every time you change one of the CMakeLists.txt files. I don't do anything as large as your source setup, but this works reasonably well for me:

  1. Keep packages you are actively working on in a separate catkin workspace, overlaying to the main one.

  2. Use wstool update to bring the latest sources into a given workspace, then rebuild it.

UPDATE: When building things from source in a catkin workspace, I normally run from that workspace. I generally only make install to verify that all the necessary files are being copied before releasing a package to the build farm.

  • A command like wstool set robot_model --version-new robot_model-1.7.1 will change an existing checkout to a different branch or tag. If needed, do that before running wstool update.

Originally posted by joq with karma: 25443 on 2013-12-16

This answer was NOT ACCEPTED on the original site

Post score: 5

Original comments

Comment by demmeln on 2013-12-16:
Yes, that makes sense. I am more concerned about the standard packages that I do not want to hack. I.e. I have the base install, and want to add another stable package from source and have it installed in /opt/... Have you ever installed and overlay to the install space of the base install?

Comment by demmeln on 2013-12-16:
I guess the wstool update works only as wanted if the .rosinstall tracks e.g. the devel-hydro packages, but the rosinstall_generator (as used according to the install instructions in the wiki) tracks the release tags. Or am I mistaken? Can I switch to the latest release tags with wstool?

Comment by joq on 2014-01-22:
Yes, wstool set allows you to change the version tag.

Comment by demmeln on 2014-01-22:
Yes, but only if you know the tag you want. I was more concerned with getting the latest release for all the base packages, but William outlined a good way to handle it using rosinstall_generator and wstool merge.


Your Answer

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