0
$\begingroup$

Rosanswers logo

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

    . $SCRIPT_PATH/setup.sh

    and this line in the /opt/ros/electric/setup.sh

    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 setup.sh for every rosinstall.

Question:

  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 setup.sh?

  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 setup.sh 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 appear in this circle of smart people. Well, sometimes there are black sheep. I am far from being smart but I just love robots. I had read http://www.ros.org/wiki/rosinstall and other webpages/forum threads (Google is my only teacher now) but can't really figure out the answers to above questions.

Hopeful for some help here. Thanks.


Originally posted by owh on ROS Answers with karma: 67 on 2012-03-16

Post score: 2


Original comments

Comment by Miguel Prada on 2012-05-04:
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.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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 setup.sh, 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


Originally posted by dornhege with karma: 31395 on 2012-03-16

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by owh on 2012-03-19:
@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.

$\endgroup$

Your Answer

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