Page

User

It is appreciated that problems/questions regarding this tutorial are asked on answers.ros.org. Don't forget to include in your question the link to this page, versions of your OS & ROS, and also add appropriate tags.

Quick Overview of Filesystem Concepts

Packages: Packages are the software organization unit of ROS code. Each package can contain libraries, executables, scripts, or other artifacts.

Manifest (package.xml): A manifest is a description of a package. Its serves to define dependencies between packages and to capture meta information about the package like version, maintainer, license, etc...

Note:rosbuild users might be wondering where stacks went, the concept of stacks was removed with catkin to simplify the growing code base and to support better distribution of packages. In catkin you can define metapackages to collect similar packages and multiple packages can reside in a single VCS repository. Those two features replace the functionality of stacks.

Filesystem Tools

Code is spread across many ROS packages. Navigating with command-line tools such as ls and cd can be very tedious which is why ROS provides tools to help you.

Using rospack

rospack allows you to get information about packages. In this tutorial, we are only going to cover the find option, which returns the path to package.

Usage:

# rospack find [package_name]

Example:

$ rospack find roscpp

Would return:

YOUR_INSTALL_PATH/share/roscpp

If you installed ROS from apt on Ubuntu Linux you would see exactly:

/opt/ros/hydro/share/roscpp

Using roscd

roscd is part of the rosbash suite. It allows you to change directory (cd) directly to a package or a stack.

Usage:

# roscd [locationname[/subdir]]

Run this example:

$ roscd roscpp

To verify that we have changed to the roscpp package directory. Now let's print the working directory using the Unix command pwd:

$ pwd

You should see:

YOUR_INSTALL_PATH/share/roscpp

You can see that YOUR_INSTALL_PATH/share/roscpp is the same path that rospack find gave in the previous example.