Fundamental questions on ros file system
After learning ROS for a while, I am trying to reorganize/correct some understandings. My current understanding in dealing with ROS packages/stacks is:
Best to install from Ubuntu if available:
sudo apt-get install ros-electric-stack_name
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:
Are there any problem in the above workflow? What is the best practice?
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?
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.
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?
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?
I seem to be rosinstalling packages (due to dependencies) most of the time. Will it be necessary to rosinstall the stack instead?
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)?
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?
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 ...
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.