Comparing ROS 1 and ROS 2 architecture
In this section, we will examine the fundamental architectural changes of ROS 1 and ROS 2 and the important reasons why the ROS 2 project started. Figure 1.3 shows the architecture of ROS 1 and ROS 2.

Figure 1.3: ROS 1 and ROS 2 architecture comparison
As you can see in Figure 1.3, there are three main layers in both of the architectures. They are:
- OS Layer
- Middleware Layer
- Application Layer
Let’s take a look at each layer in detail.
OS layer
On the left, you can see the architecture of ROS 1, and on the right, ROS 2. The bottom layer is the OS layer. As you know, ROS is a software framework that can be installed on an OS. ROS 1 is mainly compatible with Ubuntu/Linux, whereas ROS 2 is compatible with Linux, Windows, macOS, RTOS, etc.
Middleware layer
The next layer is the middleware layer, which constitutes the main ROS components. If you look at the ROS 1 architecture, it has...