[zeele_tech] Introduction to ROS / ROS 2

Time:2022-5-11

Krypton software and Electronics Center Wang Yangming

preface

ROS is the English abbreviation of robot operating system. ROS is a highly flexible software architecture used to write robot software programs. The prototype of ROS comes from Stanford University’s Stanford artistic intelligence robot (stair) and personal Robotics (PR) projects.
Robot industry and academia have obvious differences in the use of software tools. Because the robot industry is not as large as consumer electronics, absolute high technical barriers and closed ecology are very common. In order to improve their technical barriers, these companies often design a complete set of closed software and hardware, so that others (competitors or developers) can not replace them with their own tools. In academic circles, students and teachers tend to embrace the open source community and choose existing tools for development and research in order to reduce the repeated work of building wheels. The most widely known is ROS (robot operating system)
[zeele_tech] Introduction to ROS / ROS 2
What is ROS

ROS / ROS 2 is not a software, but a collection of a series of software. Generally, we call it software solution stack. It includes hardware driver, network module, communication architecture and robot algorithm implementation, etc. ROS puts all these function packages under one umbrella, so developers don’t need to rebuild the wheel.
ROS is not an operating system, but is generally called meta operating system, that is, an operating system based on more than one operating system.
ROS is not a middleware, because it realizes many functions, including perception, navigation, control, motion planning and simulation.
[zeele_tech] Introduction to ROS / ROS 2

ROS
ROS1. Version 0 was released in 2010. Based on PR2 robot, a series of robot related basic software packages were developed. Subsequently, the version of ROS iterates frequently. Generally, the version of ROS will be updated with the long-term support (LTS) version of Ubuntu system. The latest version of ROS has been adapted to Ubuntu 20.04 LTS. ROS is only CI tested on Ubuntu, but community members actively support other Linux versions, Mac OS X, Android and windows, making ROS compatible, but only providing limited functional support.
Historical version of ROS
Release time of ROS version Ubuntu version
ROS Noetic Ninjemys
May 23rd, 2020 Ubuntu 20.04(Focal)
ROS Melodic Morenia
May 23rd, 2018 Ubuntu 18.04(Bionic)
ROS Lunar Loggerhead
May 23rd, 2017 Ubuntu 17.04(Zesty)
ROS Kinetic Kame
May 23rd, 2016 Ubuntu 16.04(Xenial)
ROS Jade Turtle
May 23rd, 2015 Ubuntu 15.04 (Vivid)
ROS Indigo Igloo
July 22nd, 2014 Ubuntu 14.04 (Trusty)
ROS Hydro Medusa
September 4th, 2013 Ubuntu 12.04 (Precise)
ROS Groovy Galapagos
December 31, 2012 Ubuntu 12.04(Precise)
ROS Fuerte Turtle
April 23, 2012 Ubuntu 10.04(Lucid)
ROS Electric Emys
August 30, 2011 Ubuntu 10.04(Lucid)
ROS Diamondback
March 2, 2011 Ubuntu 10.04(Lucid)
ROS C Turtle
August 2, 2010 Ubuntu 9.04(Lucid)
ROS Box Turtle
March 2, 2010 Ubuntu 8.04(Hardy)
Comparison of advantages and disadvantages of ROS
ROS brings us a lot of convenience in developing robots, but it does have some problems:
Advantages and disadvantages
The loosely coupled mechanism provides framework communication with limited real-time performance
The stability of the rich robot function library system does not meet the industrial requirements
There are no protective measures for the safety of a large number of users
Free and open source only supports Linux (Ubuntu)
The performance of the core mechanism of convenient data recording, analysis and simulation tools is not optimized and occupies resources
Mature cases of ROS
ROS has gone through ten years. With the great development of robot technology, ROS has also been greatly promoted and applied. Although ROS still has many limitations, it can not hide the edge of ROS. The function package in the community is still increasing exponentially year by year, which brings great convenience to robot development. Many developers and research institutions have also improved the limitations of ROS, but the improvement of these local functions is often difficult to improve the overall performance, and a large number of mature applications have been accumulated in the industry:
[zeele_tech] Introduction to ROS / ROS 2
Keba, the leading enterprise in the manipulator controller, has supported ROS

Robonaut 2 developed by NASA based on ROS
[zeele_tech] Introduction to ROS / ROS 2

The bottom layer of Baidu Apollo unmanned vehicle is developed based on ROS
[zeele_tech] Introduction to ROS / ROS 2

In general, ROS is more suitable for scientific research and open source users. If it needs to be optimized and customized in industrial scenario applications (such as driverless), ROS has stopped updating, and robot developers are increasingly calling for a new generation of ROS, ros2 The news of 0 is also heard.

ROS 2
ROS cannot really enter the industry and naturally cannot be commercialized. In order to solve this problem, the community proposed ROS 2. Make ROS have the characteristics of product, including real-time, suitable for the whole platform, suitable for low-performance hardware (MCU + RTOS), distributed, data encryption and the support of modern programming language.

Historical version of ROS 2
Release time of ROS version Ubuntu version
Humble Hawksbill
May 23rd, 2022 TBD
Galactic Geochelone
May 23rd, 2021 Ubuntu 20.04(Focal)
Foxy Fitzroy
June 5th, 2020 Ubuntu 20.04(Focal)
Eloquent Elusor
November 22nd, 2019 Ubuntu 18.04 (Bionic)
Dashing Diademata
May 31st, 2019 Ubuntu 18.04 (Bionic)
Crystal Clemmys
December 14th, 2018 Ubuntu 16.04 (Xenial)
Bouncy Bolson
July 2nd, 2018 Ubuntu 16.04 (Xenial)
Ardent Apalone
December 8th, 2017 Ubuntu 16.04 ( Xenial)
Real time and distributed
In order to solve the problem of decentralization and real-time communication between messages, ROS 2 introduces data distribution service (DDS), which has been widely used in national defense, civil aviation, industrial control and other fields, and has become a standard solution for data publishing / subscription in distributed real-time system. As shown in the figure below, ROS 1 is on the left and ROS 2 is on the right.
[zeele_tech] Introduction to ROS / ROS 2

In ROS 1, each node of the user, whether the same device or different devices, must know the IP of the master node and all rely on the master node for communication. Once the master node fails or the device fails, all node functions of the whole environment will be lost. Unable to recover. Because of this, ROS 1 cannot be applied to formal products.
ROS 2 introduces a decentralized data communication mode based on DDS. Different nodes can communicate through unknown IP, which is also helpful to solve the problem of multi robot system. Moreover, ROS 2 also introduces the quality of service mechanism to ensure good communication effect in some poor network environments by setting different service quality.

Real time
For the real-time performance, because DDS has many applications in many industries and industries and has a good ecology, its performance is beyond doubt. The test results are as follows:
The test equipment is two PowerEdge r330 e34s
OS: Ubuntu 18.04.2 LTS bionic
Architecture: x86_64
CPU(s): 8
Thread(s) per core: 2
Model name: Intel(R) Xeon(R) CPU E3-1230 v6 @ 3.50GHz
[zeele_tech] Introduction to ROS / ROS 2

Taking fast rtps as an example, it can be seen that the delay can be stable at 100 in the communication between the two devices μ S, and the throughput bandwidth has reached more than 750mbit / s. The detailed running score data can be understood by referring to fast rtps vs cyclone DDS vs opensplice DDS, and the communication efficiency in the same equipment will far exceed this result.

data encryption
ROS 2 introduces the concept of SROs on the basis of DDS. The design document refers to ROS 2 DDS security integration, that is, all ROS 2 messages can be encrypted, decrypted, authenticated, authorized, log and data mark permission control through SROs. Based on the original design logic of ROS 2, we can even put the key generation and storage of data into arm tee OS to achieve high security data assurance

Modern programming language support
Since the initial release of ROS 1 was in 2007, the long-term support and the support of many development libraries lead to the new features of many languages can not be well applied. For example, for Python, python 3 was not supported for the first time until the noetic version released in 2020, while Python 2 stopped supporting in January 2020. Another example is C + +, ROS 1 is implemented based on C + + 03, and the support for C + + 11 is not good, let alone the support for C + + 14 and C + + 17.
ROS 2 fully supports Python 3 and is written based on modern C + +. Based on its loose coupling mode, it also supports programming languages such as Java and rust. As shown in the line below the user application in the figure below, any programming language can be supported as long as the developer wants.
[zeele_tech] Introduction to ROS / ROS 2
Flexible mechanism
ROS 2 provides a management mode based on life cycle, that is, the operation state of each node is completely controllable. Refer to the description of the design document managed nodes. All managed nodes can be configured, managed, shut down and started in real time at runtime, and can be awakened and reset by the management node in case of error. This method not only ensures the stability and robustness of the whole system, but also improves the ability of the system to return to normal after error.
ROS 2 can replace DDS middleware during operation, and can also communicate between the implementations of different DDS middleware.

5g support
Driven by Ericsson, ROS 2 is discussing the formulation and implementation of 5g ROS 2 communication scheme.

New ecology
Inheriting the extensive open source ecological resources of ROS 1, the release of ROS 2 has aroused everyone’s enthusiasm for the productization of ROS. Many companies have contributed solutions and codes to ROS 2, including but not limited to Intel, NVIDIA, Ericsson, etc.
In addition to contributing new code, the excellent tools of ROS 1 are also fully inherited into ROS 2, such as moveit, rviz and rosbag. And some modules, such as navigation, have been upgraded to navigation 2 in the developer’s improvement, which has improved many problems and improved the convenience of use.

Multiple communication modes
ROS 2 topic is a communication bridge between nodes. Nodes can publish and receive topics at the same time. There is a many to many relationship between nodes and topics
[zeele_tech] Introduction to ROS / ROS 2
Service is another method of node communication on ROS diagram. The service is based on the call response model rather than the publisher subscriber model of the subject. There is a one-to-one or one to many relationship between the server and the client
[zeele_tech] Introduction to ROS / ROS 2
Action is one of the communication types used for long-running tasks in ROS 2. They are composed of three parts: goal, result and feedback
[zeele_tech] Introduction to ROS / ROS 2

Mature cases of ROS 2
The quadruped robot of ghost robotics invested by the U.S. military uses eloquent version of ROS 2 for development, and the DDS scheme adopts commercial cyclone DDS
[zeele_tech] Introduction to ROS / ROS 2
The underwater vehicle (ROV) of mission robotics is developed using the fox version of ROS 2
[zeele_tech] Introduction to ROS / ROS 2

summary
The real revolution of automobile industry has begun, and the era of software defining automobile has come. Automobile is accelerating the transformation from mechanical equipment to highly digital and information-based intelligent terminal, involving huge and complex fields. An autonomous car, in a sense, is also an autonomous robot. Of course, it can be developed using ROS 2. ROS 2 provides a large number of basic components, which greatly facilitates the deployment of navigation algorithms, autonomous driving algorithms and some AI algorithms. Of course, ROS 2 still has many defects. The scheduling model of ROS 2 cannot be preempted. Sometimes scheduling instances with high priority may be blocked by scheduling with low priority. No automobile industry company has used ROS 2 to implement its products.
Facing these challenges, the software and Electronics Center of krypton made a bold attempt to develop the automotive operating system based on SOA architecture based on the communication framework and platform architecture of ROS 2, and achieved good test results. Krypton’s software and Electronics Center has been making in-depth exploration in cutting-edge technology and is committed to building zeekr OS vehicle operating system. People with lofty ideals are also welcome to join us to explore the next generation of vehicle operating system.

Recommended Today

Examples of JQ commands in Linux

JSON is a data representation format used to store and transfer data between different layers of an application; It stores data in key: value pairs. In this article, we will learn how to use JQ commands to manipulate and process JSON data in the shell.How to install JQ commandsIn centos8, use the following command to […]