Page

User

Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the 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.

Manifests (package.xml): A manifest is a description of a package. It 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/kinetic/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]]

To verify that we have changed to the roscpp package directory, run this example: