当前位置:网站首页>Ros2 - ros2 vs. ros1 (II)

Ros2 - ros2 vs. ros1 (II)

2022-07-05 06:50:00 Me and nano

ROS2 Robot operating system


Preface

 Insert picture description here

One 、ROS1 The limitations of

ROS The earliest design goal is to develop such a PR2 Home service robot , This robot works independently most of the time , In order to make him have sufficient ability :

It is equipped with a workstation level computing platform and various advanced communication equipment , Don't worry about not being able to calculate , It has enough strength to support various complex real-time operations and processing ;
Because it is a single soldier operation , The vast majority of communications are done internally , Then you can use a wired connection , Ensure a good network connection , There is no risk of losing data or hacking ;
The robot was eventually produced in small quantities , But because of the high cost and price , It can only be used for academic research .
 Insert picture description here
With ROS The popularity of , application ROS The robot type of has been compared with PR2 Robots have earth shaking problems , Also does not have PR2 Such conditions , That was originally aimed at PR2 Designed software framework , There will be some problems , such as :

To run in an embedded system with limited resources ;
Ensure the reliability of communication in places with interference ;
We should make products and go to the market , Even used in autonomous vehicle and space robots .
Similar problems continue to emerge , This makes it more suitable for a new generation of robot applications ROS The birth of , That is to say ——ROS2.

Two 、 all-new ROS2

ROS2 With the historical mission of transforming the era of intelligent robots , At the beginning of the design , Considering the need to meet a variety of robot applications .
 Insert picture description here
Multi robot system : Robots in the future must not be independent individuals , Robots and robots also need communication and cooperation ,ROS2 It provides a standard method and communication mechanism for the application of multi robot systems .

Cross platform : Robot application scenarios are different , The control platforms used will also vary greatly , For example, the computational performance of autonomous vehicle is definitely better than AMR Robots are much better , In order for all robots to work ROS2,ROS2 It can run across platforms Linux、Windows、MacOS、RTOS, Even a microcontroller without any system (MCU) On , So we don't have to worry about whether our controller can be used ROS 了 .

The real time : Robot motion control and many behavior strategies require that robots have real-time performance , For example, robots should be reliable in 100ms Find pedestrians in front , Or stable in 1ms Complete the kinematics in the cycle 、 Solution of dynamics ,ROS2 It provides basic guarantee for such real-time requirements .

network connections : No matter what kind of network environment ,ROS2 Can try to ensure the integrity and security of a large number of robot data , For example wifi When the signal is bad, try your best to send the data , When there is a risk of hacker intrusion, the data should be encrypted and decrypted .

Commercialization :, A large number of robots have come into our life , There will be more and more in the future ,ROS2 It can not only be used in the robot development stage , It can also be directly carried in the product , Go to the consumer market , This is right ROS2 The stability of 、 Strength also poses great challenges .

project management : Robot development is a complex system engineering , Design 、 Development 、 debugging 、 test 、 Deploy the whole process of project management tools and mechanisms , Will also be in ROS2 In the embodiment , It is more convenient for us to develop a robot .

To meet these needs ,ROS2 The design and development of is not simple , Compared with such standardized products as mobile phones ,Android The system can also be standardized as much as possible , But robot classes vary greatly , How to fit as many robots as possible , This may be far more complicated than developing a mobile phone system or a computer system .
ROS Developers face two choices , The first is in ROS1 On the framework of , Make changes and optimizations , Like a built house , We make it into a blank room , Redecorate and renovate , But it will certainly be subject to the pattern of the original building , In the long run, it is not the best choice , They finally chose the second option , That is to push down and start over .

therefore ROS2 Is a new robot operating system , Learning from ROS1 Based on successful experience , The system architecture and software code are redesigned and implemented . And ROS1 comparison , In the following points :
 Insert picture description here

3、 ... and 、ROS2 vs ROS1

 Insert picture description here
In this picture , On the left is ROS1, The right side is ROS2, Pay attention to the most obvious changes between the two , That's it Master.
stay ROS1 in , In the application layer Master The role of this node manager is critical , All nodes have to listen to it , Similar to a company CEO, There is one and only one , If this CEO Suddenly disappeared , The company will definitely be in a mess .ROS2 Please leave this most unstable role , Nodes can pass another set discovery—— Self discovery mechanism , Find each other , So as to establish a stable communication connection .
The middle layer is ROS Encapsulated standard communication interface , When we write programs , I will deal with these communication interfaces frequently , For example, publish the data of an image , Receive a radar message , The client library will call the underlying complex driver and communication protocol , Let our development become more simple and clear .
stay ROS1 in ,ROS Communication depends on the underlying TCP and UDP agreement , And in the ROS2 in , The communication protocol has been replaced by a more complex but more perfect DDS System .
If you need to communicate a lot of data in the process ,ROS1 and ROS2 Both provide communication methods based on shared memory , It's just that the name is different .
At the bottom is the system layer , So you can put ROS Which operating systems are installed ,ROS1 Mainly installed in Linux On ,ROS2 There are many options ,Linux、windows、MacOS、RTOS Fine .

ROS2 comparison ROS1 The biggest change , Except for omitting Master outside , It should be the change of communication system .ROS1 Based on TCP/UDP Our communication system , Frequently criticized for delays 、 Losing data 、 Unable to encrypt and other problems ,ROS2 Medium DDS The functions at the communication level are much richer .

DDS In fact, it is a communication protocol widely used in the Internet of things , Similar to what we often hear 5G Communication is the same ,DDS It's an international standard , The software system that can implement this standard is not the only one , So we can choose from many manufacturers DDS System , Like here OpenSplice、FastRTPS, There are more manufacturers , The performance of each company is different , The applicable scenarios are also different .
 Insert picture description here
 Insert picture description here

Four 、 Mode of operation

 Insert picture description here
Overall speaking ,ROS2 More object-oriented implementation methods and language features will be used , From the perspective of programming language , It will be more difficult , But when we cross this barrier , We will find that the program we write will be more readable and portable , It will also be closer to the process of robot software development in real enterprises .
 Insert picture description here
ROS1 The command lines in are relatively scattered , Each function is an independent command , such as rosrun Start a node ,rostopic Control topic related functions .

ROS2 The command line is greatly integrated , All commands are integrated in one ros2 In the main command of , such as ros2 run, It means starting a node ,ros2 topic Indicates the function related to the topic .

summary

The node has been killed Master
The communication has been replaced by DDS
The core concept has not changed
The difficulty of programming has increased

原网站

版权声明
本文为[Me and nano]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207050635158421.html