# How do overlays work?

Hi, I recently came across a post that mentioned that we should never try to edit stuff in ros/fuerte/stacks, the correct way should be through overlay instead. This means I have been doing stuff the wrong way all along. I have been making changes to launch files in erratic_robot, which is located in stack.

I would like to know how does overlay works, the wiki page states that"The overlay now includes all packages that were installed in /opt/ros/fuerte." But it is not the case for me, my overlay (fuerte workspace) only contain a sandbox, turtlebot which i installed and some setup files.

In addition, when I installed a package (eg.erratic_robot), where should it be located? For me, the erratic_robot appears in ros/fuerte/stacks.

I appreciate your help, thank you.

edit retag close merge delete

Sort by » oldest newest most voted

The overlay does not directly contain the packages in /opt/ros/fuerte, it just includes them. All packages in /opt/ros/fuerte are known to the system, i.e. you can run them using roslaunch/rosrun, you can depend on them in your manifest file etc.

If you are creating new packages or want to edit existing ones, you need to put the corresponding source code in the sandbox directory or another directory that has been added to your overlay with rosws set. For instance, if you want to edit the package erratic_robot, add a copy to your overlay. The copy will "shadow" the package installed in /opt/ros/fuerte, i.e. when using roslaunch/rosrun, the system will use that one in your overlay. You can add the source code of erratic_robot as follows:

rosws set --svn erratic_robot https://ua-ros-pkg.googlecode.com/svn/stacks/erratic_robot/trunk
rosws update
source ~/fuerte_workspace/setup.bash


Then you need to build it: rosmake erratic_robot.

more

I see. That really helps in my understanding. Thanks a lot!

( 2012-11-06 01:00:10 -0500 )edit

@Lorenz - I am trying to do something similar. I have the folder "sandbox" (as per ROS tutorials) and my "original" package is already installed there. So if I need to modify the source code, I should use what you mention above in the same folder, right?

( 2013-03-04 10:00:37 -0500 )edit