当前位置:网站首页>Ros2 topic (03): the difference between ros1 and ros2 [01]
Ros2 topic (03): the difference between ros1 and ros2 [01]
2022-07-07 23:19:00 【Mr anhydrous】
1 summary
future ROS2 Will become more and more popular , and ROS1 About to exit history ; millet 、 Huawei is widely used ROS2 了 , However ,ROS2 Data is extremely scarce , Here I will sift out some key information from foreign materials , For those riders who can speed up their horses .
2 Architecturally speaking
1) Communication protocols are different
ros1 It's using TCP and UDP agreement , and ROS2 use DDS agreement ;DDS It is a private bus protocol , Faster and faster communication .
2) Different architectures
ROS1 need Master That is to say roscore That thing ;roscore It can be understood as a communication switch , Users' communications are all concentrated on Master In exchange for .
3)ROS2 One more. rcl
Users rely on rclpy and rclcpp package , These two packages are responsible for rcl signal communication , and rcl By DDS Agreement supported .
The difference between them is clearly expressed in the figure below .
3 From the code point of view
Let's start with “number” Take the procedure of the topic as an example , see ros1 and ros2 What is the code difference between .
3.1 Dependent package differences
3.2 Callback function
3.3 Main function call
4 From the perspective of communication body
ros1 The smallest unit of operation is the node , From the perspective of communication ,ros1 Node mechanism , That is, nodes can communicate with each other , Because each node can be connected with master signal communication ; and ros2 The smallest running unit of is the executable object , Each executable object can contain several components , Components can communicate with each other .
5 The lifecycle of the slave node
ros1 Nodes in have no lifecycle , When to start , When to quit , The node itself has no control , Control is on the subject that uses the node , Nodes are purely passive .
ros2 Began to have the concept of life cycle , That is, the node has unconfigured status , Inactive state , active , And frozen state ; obviously ,ros2 The node of is already a multi-threaded management mechanism , Internal state machine organization .
6 Launch Comparison of documents
The contrast shows that , Two kinds of launch The files are very different :
1)ros1 Of launch The documents are as follows :
2)ros2 Of launch The file is a python Script
( Ongoing update ... ... )
边栏推荐
- Byte hexadecimal binary understanding
- PMP项目管理考试过关口诀-1
- 聊聊支付流程的设计与实现逻辑
- I wish you all the best and the year of the tiger
- Grid
- Oracle-数据库的备份与恢复
- Add data analysis tools in Excel
- JMeter interface automated test read case, execute and write back result
- [untitled] reprint melting ice - track icedid server with a few simple steps
- Adrnoid Development Series (XXV): create various types of dialog boxes using alertdialog
猜你喜欢
微信论坛交流小程序系统毕业设计毕设(4)开题报告
Transform XL translation
Matlab 信号处理【问答随笔·2】
Wechat forum exchange applet system graduation design completion (8) graduation design thesis template
Binary tree
十三、系统优化
Puce à tension stabilisée LDO - schéma de bloc interne et paramètres de sélection du modèle
Solve the problem of duplicate request resource paths /o2o/shopadmin/o2o/shopadmin/getproductbyid
ArcGIS: field assignment_ The attribute table field calculator assigns values to fields based on conditions
Cloud native is devouring everything. How should developers deal with it?
随机推荐
网络安全-sqlmap与DVWA爆破
位运算(Bit Operation)
1. Sum of two numbers
Dynamics 365 find field filtering
Grid
Gee (III): calculate the correlation coefficient between two bands and the corresponding p value
Software test classification
Network security sqlmap and DVWA explosion
Talk about the design and implementation logic of payment process
Inftnews | the wide application of NFT technology and its existing problems
ArcGIS:矢量要素相同字段属性融合的两种方法
Add data analysis tools in Excel
In the field of software engineering, we have been doing scientific research for ten years!
Network security -burpsuit
十三、系统优化
【微服务|SCG】gateway整合sentinel
leetcode-520. Detect capital letters -js
Exploratory data analysis of heartbeat signal
Bit operation
经纬度PLT文件格式说明