Ros2 Learning 01-Ros2 VS Ros1

The earliest design goal of ROS was to develop such a PR2 home service robot. This robot works independently most of the time. In order to give it sufficient capabilities:

It is equipped with a workstation-level computing platform and various advanced communication equipment. You don’t have to worry about insufficient computing power. It has enough strength to support various complex real-time calculations and processing. Since it is a single-soldier operation, most of the communication is completed internally
. , then you can use a wired connection to ensure a good network connection without the risk of data loss or hacker intrusion; although
this robot was eventually produced in small batches, it could only be used for academic research due to the high cost and selling price.

Insert image description here
The system architecture has undergone disruptive changes : all nodes in ROS1 need to work under the management of the node manager ROS Master. Once there is a problem with the Master, the system faces the risk of downtime. ROS2 has achieved true distribution and is no longer With the role of Master, a new communication framework DDS is used to provide reliable guarantee for the communication of all nodes.

The software API has been redesigned . The original interface of ROS1 can no longer meet the needs. ROS2 combines the latest C++ standards and Python3 language features to design a more versatile API. Although the original ROS1 code cannot be run directly in ROS2, However, similar usage methods are retained as much as possible, and a large number of transplantation instructions are provided.

The compilation system has been upgraded . There are many problems with rosbuild and catkin used in ROS1. Especially for large projects with a lot of code and projects written in Python, errors in compilation and linking often occur. ROS2 has also optimized these problems. After re-optimization The compilation system is called ament and colcon. You will experience how to use the new version of the compiler in subsequent courses.

ROS2 vs ROS1
system architecture

Insert image description here
In this picture, ROS1 is on the left and ROS2 is on the right. Pay attention to the most obvious change between the two, which is Master.

In ROS1, the role of the Master node manager in the application layer is very important. All nodes must obey its command. It is similar to the CEO of a company. There is only one CEO. If the CEO suddenly disappears, the company will definitely be in a mess. . ROS2 takes away this most unstable role, and nodes can find each other through another set of discovery-self-discovery mechanisms, thereby establishing stable communication connections.
The middle layer is a standard communication interface encapsulated by ROS. When we write programs, we will frequently deal with these communication interfaces, such as publishing image data and receiving radar information. The client library will then call the underlying complex drivers and communications. The protocol makes our development simpler and clearer.
In ROS1, ROS communication relies on the underlying TCP and UDP protocols, while in ROS2, the communication protocol is replaced by a more complex but more complete DDS system.
If a large amount of data needs to be communicated within a process, both ROS1 and ROS2 provide communication methods based on shared memory, but the names are different.
The bottom is the system layer, which is the operating systems on which ROS can be installed. ROS1 is mainly installed on Linux. ROS2 has many options, including Linux, windows, MacOS, and RTOS.
Through this comparison, we understand the overall architecture of ROS2. If you have been exposed to ROS1, this framework should not be difficult to understand. If you start learning from ROS2, you will have a rough impression first. Through subsequent study, you will Have a deeper understanding.

DDS communication

Insert image description here
The biggest change in ROS2 compared to ROS1, apart from the omission of the Master, is probably the change in the communication system. The TCP/UDP-based communication system in ROS1 is frequently criticized for problems such as delay, data loss, and inability to encrypt. The DDS in ROS2 has much richer functions at the communication level.

Core idea

ROS1 has been widely used, with millions of developers around the world. Everyone is already familiar with the ROS1 development method and many of its concepts. ROS2 retains these concepts as much as possible to facilitate developers to migrate from ROS1 to ROS2.

Insert image description here
We compared ROS2 and ROS1, and the summary is:

The node has eliminated the Master
communication and replaced it with DDS.
The core concept has not changed
and the difficulty of programming has increased.

Guess you like

Origin blog.csdn.net/hai411741962/article/details/133376108