当前位置:网站首页>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 ... ... )
边栏推荐
- JMeter interface automated test read case, execute and write back result
- GEE(四):计算两个变量(影像)之间的相关性并绘制散点图
- 智慧社区和智慧城市之间有什么异同
- 二叉树(Binary Tree)
- Lecture 30 linear algebra Lecture 5 eigenvalues and eigenvectors
- Inftnews | web5 vs Web3: the future is a process, not a destination
- GEE(三):计算两个波段间的相关系数与相应的p值
- leetcode-520. 检测大写字母-js
- 智慧社區和智慧城市之間有什麼异同
- 云原生正在吞噬一切,开发者该如何应对?
猜你喜欢
Cloud native is devouring everything. How should developers deal with it?
【微服务|SCG】gateway整合sentinel
Transform XL translation
微信论坛交流小程序系统毕业设计毕设(6)开题答辩PPT
UE4_UE5全景相机
PMP project management exam pass Formula-1
Binary tree
Specific method example of V20 frequency converter manual automatic switching (local remote switching)
LDO稳压芯片-内部框图及选型参数
ArcGIS:矢量要素相同字段属性融合的两种方法
随机推荐
Classification and prediction of heartbeat signal
网络安全-beef
漏洞复现----49、Apache Airflow 身份验证绕过 (CVE-2020-17526)
网络安全-sqlmap与DVWA爆破
Exploratory data analysis of heartbeat signal
Installing spss25
Why does the market need low code?
Clean C disk
Wechat forum exchange applet system graduation design completion (8) graduation design thesis template
定位到最底部[通俗易懂]
力扣解法汇总648-单词替换
ArcGIS: field assignment_ The attribute table field calculator assigns values to fields based on conditions
统计电影票房排名前10的电影并存入还有一个文件
Wechat forum exchange applet system graduation design completion (6) opening defense ppt
FreeLink开源呼叫中心设计思想
ArcGIS:字段赋值_属性表字段计算器(Field Calculator)依据条件为字段赋值
LDO稳压芯片-内部框图及选型参数
Handling file exceptions
Unity3D学习笔记5——创建子Mesh
JS triangle