Skip to content

1.5 ROS Architecture

So far, we have installed ROS, run the built-in turtlesim demo, and written simple ROS programs, giving us a general understanding of ROS. However, this understanding might still be vague. Next, we will introduce the architectural design of ROS from a macro perspective.

The description of ROS architecture varies depending on the viewpoint. Generally, we can describe the ROS structure from four perspectives: the designers, the maintainers, the system architecture, and its own structure.

1. The Designers' Perspective

The ROS designers describe ROS as:
"ROS = Plumbing + Tools + Capabilities + Ecosystem"

  • Plumbing: Communication mechanisms (enabling interaction between different ROS nodes).
  • Tools: Tool software packages (development and debugging tools within ROS).
  • Capabilities: High-level robotic skills (collections of certain functions in ROS, e.g., navigation).
  • Ecosystem: Robotic ecosystem (the ROS alliance across regions, software, and hardware).

2. The Maintainers' Perspective

From the maintainers' viewpoint, the ROS architecture can be divided into two main parts:

  • main: The core part, primarily designed, provided, and maintained by Willow Garage and some developers. It provides basic tools for distributed computing and programs for the core parts of ROS.
  • universe: Global code developed and maintained by ROS community organizations from different countries. This includes library code (e.g., OpenCV, PCL); code provided from a functional perspective on the layer above libraries (e.g., face recognition, which calls lower-level libraries); and application-level code at the top layer, enabling robots to perform specific tasks.

3. The System Architecture Perspective

From the system architecture viewpoint, ROS can be divided into three layers:

  1. OS Layer: The operating system in the classical sense.
    ROS is only a meta-operating system and needs to rely on a true OS. Currently, Ubuntu Linux has the best compatibility, while Mac and Windows also support newer versions of ROS.

  2. Middleware Layer:
    This consists of middleware for robot development encapsulated by ROS, such as:

    • The TCPROS/UDPROS communication system, built upon TCP/UDP.
    • Nodelet is used for inter-process communication, supporting real-time data transmission.
    • Additionally, it provides a large number of libraries for robot development implementations, such as data type definitions, coordinate transformations, motion control, etc.
  3. Application Layer:
    Contains functional packages and nodes within those packages, e.g., the master, turtlesim control and motion nodes, etc.

4. The Internal Structure Perspective

In terms of ROS's own implementation, it can also be divided into three levels:

  1. Filesystem Level:
    Refers to the organization of ROS source code as seen on the hard disk.

  2. Computation Graph Level:
    Different processes in the ROS distributed system need to interact with data. The Computation Graph represents this data interaction process in a peer-to-peer network form. Important concepts include:

    • Node
    • Message
    • Communication Mechanism - Topic
    • Communication Mechanism - Service
  3. Open-Source Community Level:
    This level represents the form in which code is distributed on the ROS network.

    • Distribution: A ROS Distribution is a versioned set of meta-packages that can be installed independently. They function similarly to Linux distributions, making ROS software installation easier and maintaining consistent versions across a software collection.
    • Repository: ROS relies on websites or hosting services that share open-source code and software repositories, allowing different institutions to publish and share their robot software and programs.
    • ROS Wiki: The primary forum for documenting information about the ROS system. Anyone can register an account, contribute documentation, provide corrections or updates, write tutorials, and more. Website: http://wiki.ros.org/
    • Bug Ticket System: A resource for reporting issues or suggesting new features.
    • Mailing List: The main communication channel for ROS users, functioning like a forum for discussions ranging from ROS software updates to various questions about using ROS software. Website: http://lists.ros.org/
    • ROS Answers: A resource for users to ask questions. Website: https://answers.ros.org/questions/
    • Blog / Community: The official ROS blog has been retired and replaced by the ROS Community for updates, photos, and news. Website: https://discourse.ros.org/

Currently, we are in the early stages of learning, having only run built-in ROS demos and written simple implementations. Therefore, limited by our progress, we will not detail all modules in the design architecture exhaustively. For now, we will focus on explaining the Filesystem and the Computation Graph. The next chapter will introduce ROS's Communication Mechanisms, which is one of the core implementations of ROS.