\(\def\dt{\Delta t}\)
\(\newcommand{\transpose}[0]{^\mathrm{T}}\)
\(\newcommand{\half}[0]{\tfrac{1}{2}}\)
\(\newcommand{\Half}[0]{\frac{1}{2}}\)
\(\newcommand{\norm}[1]{\left\lVert#1\right\rVert}\)
\(\newcommand\given[1][]{\:#1\vert\:}\)
UP | HOME

ROS Concepts

Table of Contents

1 Introduction

This lecture covers the most basic concepts that exist in ROS.

2 ROS Filesystem Level

2.1 Packages

  • Collections of many of different things
    • Nodes
    • Configuration files
    • Launch files
    • Libraries
  • A package is defined by being in the ROS_PACKAGE_PATH environment variable and must have a package.xml file
  • Packages usually have a CMakeLists.txt file
    • although it is sometimes not really used for anything e.g. with packages containing no custom messages and only Python executables as nodes)
  • ROS also has the concept of a metapackage which is essentially a bundled collection of packages.

2.2 Manifests

  • This is what is described in the package.xml file
  • package.xml used to be called manifest.xml, so often it will colloquially be referred to as a manifest
  • Contains information about package
    • Dependencies
    • Name
    • Version
    • Authors/maintainers
    • Licensing

2.3 Message types

  • Files named *.msg
  • Use a special format to define data structures
  • ROS automatically creates code that implements the data structures for its client libraries when projects are built

2.4 Service types

  • Basically the same as messages, but they are *.srv files
  • Two message definitions stuck together for request and reply

2.5 Action types

  • Actions are very similar to services, but they are for long-running tasks that may need to be preempted

3 ROS Computation Graph Level

3.1 Nodes

  • Processes that perform some function or computation
  • Written in code from a client library
    • C++
    • Python
    • Java/Lisp/Ruby/etc. (less common)
  • Nodes are just executables in the ROS world

3.2 Topics

  • These are how messages are passed between nodes
  • They use a publish-subscribe paradigm
    • A node sends out data via a publisher
    • A node receives data via a subscriber
    • one-to-many
    • Nodes are invisible to each other
    • Master establishes and routes the connections

3.3 Messages

  • Data structures that are passed around via topics
  • Many standard datatypes can be combined to form messages
    • Floats
    • Bools
    • Integers
  • They support arrays, and message nesting

3.4 Services

  • A service is much like a topic, but it is a request/reply structure
  • A "provider" offers a service
  • A "client" uses the service

3.5 Parameter Server

  • Parameters are "global" data
  • Visible to all nodes
  • Typically for static data
  • Can be arrays, strings, whatever
  • Nodes get and set params by talking to the parameter server

3.6 Master

  • Establishes connections between nodes
  • Runs the parameter server

3.7 Bags

  • Special format for storing and playing back data from ROS topics
  • Supports compression
  • Export to CSV
  • Real-time plotting
  • Playback allows debugging and working without hardware

4 Names

Names are one of the most important concepts in ROS. Every single node, topic, parameter, and service has a unique name referred to as a Graph Resource Name. The way that these names are constructed and resolved follows a strict hierarchy that is the key to constructing complex systems in ROS. We will be discussing names in more detail in the next lecture. If you'd like to read about ROS names now, see the main Names page.

4.1 Package Resource Names

Certain features that a ROS package provides may be referred to using a package resource name. The package resource name is simply a way of identifying, at the ROS filesystem level, where this feature comes from. So, for example, let's say you have a package called package_a that defines a ROS message called PackageAMessage. This message would be defined in a file called PackageAMessage.msg and its path could be something like /home/<user>/<path-to-workspace>/src/package_a/msg/PackageAMessage.msg. The package resource name for this message would simply be package_a/PackageAMessage. Other packages or nodes that use this message would refer to it by this name.

Nodes, services, messages, actions, and launch files may all be sometimes referred to by their package resource name.

5 Resources

The links below are all links on the ROS wiki that supplement the information covered above.

5.1 Filesystem Level

Packages
Detailed description of what a ROS package is, including examples of what type of information may be found in a package.
Manifest
This page is the primary page that describes what should be included in a manifest (the package.xml file). Also see REP 140 which specifies all of the tags available in the modern format (Format 2) used in package.xml files. Note that even though the Format 2 is the recommended specification for manifests, you often find packages that still use Format 1. Knowing that both exist being able to recognize that there are some differences is valuable. It is recommended that all new packages use Format 2.
ROS msg
This page describes the message file format, what primitive types are available for the message fields, and what those types will be treated as in the two main client libraries (C++ and Python).
ROS srv
This describes the service file format (which is very similar to the message file format).

5.2 Computation Graph Level

Nodes
Detailed description of what a node really is, and how nodes can interact with names at runtime via Remapping, Pushing Down, and Private Parameters.
Master
Detailed description of the functionality of the ROS Master.
Parameter Server
Use cases of parameters, examples of setting parameters, and how the parameter names are use.
Messages
Naming conventions used in messages, descriptions of how .msg files get turned into code for the client libraries, and descriptions of the Header field which is used in many messages.
Topics
Discusses what a topic really is, how the information gets transported between nodes, and several very useful command line tools for working with topics.
Services
Similar to the Topics page, but for Services.
Actions
Actions did not originally exist in ROS, and they are not necessarily a core concept that is covered in the main ROS concepts described on the wiki. However, they are quite important, and many non-trivial ROS projects rely heavily on actions. The linked page is the main page for the actionlib ROS package that provides the supporting code required to use actions.
Bags
Description of what a Bag is, and common tools to use with Bags.
Creative Commons License
ME 495: Embedded Systems in Robotics by Jarvis Schultz is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.