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

Fundamental questions on ros file system

asked 2012-03-16 02:31:07 -0500

owh gravatar image

After learning ROS for a while, I am trying to reorganize/correct some understandings. My current understanding in dealing with ROS packages/stacks is:

  1. Best to install from Ubuntu if available:

    sudo apt-get install ros-electric-stack_name

  2. Otherwise, check out and rosinstall:

    i. cd ~/ros_workspace (I put all checked out packages in here)

    ii. roslocate info package_name > package_name.rosinstall

    iii. rosinstall . /etc/ros/electric package_name.rosinstall

    iv. rosmake package_name (rosdep --install package_name to install system dependencies)

    v. deal with ROS dependencies by iterating 1 or 2

    I have the following line in .bashrc:

    source /opt/ros/electric/setup.bash

    and this line in /opt/ros/electric/setup.bash


    and this line in the /opt/ros/electric/

    export ROS_PACKAGE_PATH=~/ros_workspace:/opt/ros/electric/stacks

    Due to the above setup, I never bother to source the setup.bash from every rosinstall, neither I edit my .bashrc.

For packages installed in ~/ros_workspace, if I do not need them, I simply delete the folder. I didn't do any other cleanup, assuming I didn't specifically change for every rosinstall.


  1. Are there any problem in the above workflow? What is the best practice?

  2. In rosinstall ~/ros_workspace /opt/ros/electric package_name.rosinstall, why do we need both ~/ros_workspace /opt/ros/electric and how will /opt/ros/electric be used? The packages are always stored in ~/ros_workspace. Am I right that the "/opt/ros/electric" field is only used to add this path to the newly created

  3. I did not add "?rosdistro=electric&variant=robot&overlay=yes (or no)" to the end of rosinstall. What difference will this make? I don't understand the difference between "overlay=yes" and "overlay=on". What does overlay do? Does it check that if things are already available in /opt/ros/electric and only update the difference? If so, see 4.

  4. What does "Developing a stack against a full tree" means, e.g. "rosinstall ~/workspace package_name.rosinstall"? Will we still use all packages available from /opt/ros/electric, e.g. dependencies?

  5. What does "Updating a rosinstall tree" do? Does it update ROS_PACKAGE_PATH in with all the paths to packages? Will having "~/workspace:/opt/ros/electric/stacks" in the ROS_PACKAGE_PATH be sufficient if all stacks/packages are in these folders?

  6. I seem to be rosinstalling packages (due to dependencies) most of the time. Will it be necessary to rosinstall the stack instead?

  7. rospack list-duplicates shows a number of duplicates. Should I deal with them? What is the right way to do so (may not know which is latest or dependency for which package)?

  8. I can svn up in stack/package in /opt/ros/electric since they were not svn checked out. I tried update them with sudo apt-get install ros-electric-stack_name. Is this correct? What is the best practice?

  9. When I svn up in those packages in ~/ros_workspace, I received "At revision *". Is that it?

My apology for the long list of fundamental questions. I know this kind of questions don't ... (more)

edit retag flag offensive close merge delete


I would add another question. Is there a 'proper' way to handle different versions of the same package (i.e. a development version and a stable version) in one workspace? Or should separate workspaces be maintained? There definitely should be a wiki page suggesting good workspace practices, IMHO.

Miguel Prada gravatar image Miguel Prada  ( 2012-05-04 00:40:03 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2012-03-16 04:03:32 -0500

dornhege gravatar image

A somewhat generic answer to all questions:

From the ROS side installation in /opt/ros/electric (via apt) or in ~/ros_ws (via svn) shouldn't matter. It's just some paths in the ROS_PACKAGE_PATH to find things. When ROS looks for a package it walks through the package path and takes the first that matches.

The usual workflow for most users is to install ROS via apt and have their own code locally (i.e. in ~). Sometimes you also want to have ROS code locally to modify it. Installed code in /opt should never be modified (including, etc.) as you update this via apt-get and everything will be overwritten. It is better to adapt those things locally (e.g. extend ROS_PACKAGE_PATH in your bashrc). Local code you update from svn.

_7. If you have set them up to be there it is OK. If they surprise you, you might have double code. Make sure that always the one is used that you want (rospack find pkg shows that)

_8. apt-get

_9. yes

edit flag offensive delete link more


@dornhege Thank you very much for the reply, very much appreciated. You have clarified a bunch of my doubts in this aspect. I am still hoping to seek clarification on questions 2-6.

owh gravatar image owh  ( 2012-03-19 02:06:26 -0500 )edit

Question Tools



Asked: 2012-03-16 02:31:07 -0500

Seen: 459 times

Last updated: Mar 16 '12