当前位置:网站首页>Get to know ROS for the first time
Get to know ROS for the first time
2022-07-05 00:09:00 【DWQY】
Need to use ROS, Just learn ROS. As Xiaobai , It's hard to avoid mistakes , Please, Haihan . Help me point out more mistakes . The purpose of this article is to make novices understand ROS Have a simple understanding , Basically speaking, they are conceptual things . I hope this article can explain the following questions clearly :
1.ROS What is it? /ROS Can do ?
2.ROS What is your infrastructure ?
3.ROS Explanation of some proper nouns :ROS node (node)、 Node manager (master)、 Parameter server (parameter server)、 news (message)、 topic of conversation (topic)、 service (service)、 Message logging package (bag)
1.ROS What is it? /ROS Can do ?
ROS The full name is Robot Operating System, That is, the robot operating system . Literally, it helps us operate robots . But and Linux This kind of bottom os Different ,ROS It's based on the bottom layer os Of , That is to say Linux above , It can be understood as in Linux It is encapsulated so that you can directly call all kinds of packages used to operate robots .ROS There are several versions of , There are different corresponding Linux Environmental Science ( You can find it online , Is not the point , No more details here . But the author uses kinetic The corresponding is ubuntu16.04 La ~).
that ROS What are the benefits ? Why use ROS Well ? This is from ROS The design goal of :ROS It is convenient for code reuse in robot research and development , Is a distributed process framework , The core lies in the middleware framework that can transfer message data synchronously or asynchronously . To put it simply ROS Its modularity and reusability are particularly good , In this way, developers can focus on the design of main logic . It's also a bit like building blocks ( The building blocks have been built ). I think another advantage is :ROS Description using simplified type description language ros Published data , Through this description language ,ros You can use multiple programming languages (C++ PYTHON java matlab) Write different nodes , Realize the communication between nodes ( Not limited to one , That's great !)
about ROS Can do ? In fact, I think it is used to develop robots . Now all kinds of robots, no matter UAV、UGV It's all based on ROS On the development of drops . Want to let robot Do something personalized ,ROS It should be learned . and ROS Now it has been recognized as a standard ( The good news : Open source !).
2.ROS What is your infrastructure ?
Leave it alone ROS What's the specific , First, give it a sample from the macro view .ROS The architecture of has three parts :ROS file system 、ROS Calculation chart 、ROS Community
ROS file system : The file system is actually ROS The organizational structure of the document , Knowing the file system, you will know which file is called when the program executes to which step . File system has many basic concepts :package、manifest.
ROS Calculation chart : The calculation diagram is equivalent to ROS The mechanism of operation , Including how nodes communicate . Some places are also called Computing Networks , All nodes can connect to this network for communication . I think this is ROS The core part of . The concept of design includes :node、master、message、topic、service
ROS Community : It is rare to see communities in the framework , but ROS At present, it looks like a completely open source thing . Open source projects need to be maintained by the community , Maybe the keynote set by the initial design is like this .
( Many concepts have been mentioned above , I will explain one by one in the following )
3.ROS Conceptual explanation ( According to the structural division )
package( Function pack )
package In fact, it can be regarded as an organization ROS A basic unit of code .ROS in package More refers to the code package . If we say the biggest one should be workspace( working space ), The workspace includes the code space (src, The main code to implement the application can be cpp/py), Compilation space (build, Mainly the compilation environment catkin_make After that, I don't care ), Development space (devel, Save the compiled package ), Installation space (install, After this command is generated, it is basically useless ).package That is, a basic unit in code space . An application corresponds to a package.ROS utilize package Realize modularity and reusability
package The structure of is as follows ( Because it just introduces the basic concepts , So I won't talk about the role of each document in detail ~)
Picture source :ROS Learning notes ( One ) ROS file system _ My proud blog -CSDN Blog
manifest
Full name package manifest, by package Provide dependencies between . What's preserved is package Some basic information of : edition 、 Maintainer 、 Dependent options 、 Compilation flags and so on . The implementation of specific documents is package The inside package.xml
metapackage( Meta function pack )
metapackage It's better than package A higher level concept , yes package Set . It used to be called stack, Now and abandoned
metapackage manifest
This ratio manifest A higher level , Function like manifest, It's just for metapackage
node( node )
ROS On the whole, it is a distributed architecture , That is, there are many nodes . Maybe it can also be said ROS The basic action execution unit of , You can assign tasks to nodes . The same workspace There cannot be a node with the same name under ( This is not certain ), But there can be nodes with the same name in different workspaces
As a whole , There should also be mutual cooperation between nodes .ROS Have their own communication mechanism , So let's talk about that :
ROS There are two means of communication : The messaging 、 The service call
message( news )/topic( The theme )
message It corresponds to messaging , But the news can't be passed directly . With the help of carrier : That is to say topic( It can be understood as a pipe ). If a node wants to send a message , Just choose one topic( This topic It can be created by yourself or by others ), choose topic Hair message This action is pulish( Release ). If you want to accept the message , Also through topic. And this action is called subscribe( subscribe ). The two nodes are based on actions , Known as publisher and subscriber.
server( service )
server Corresponding to service invocation , however server The audience is smaller . Between two nodes . The process of service invocation is :client The node sends request to server node ,server After the node performs processing , send out response to client node
What's the difference between messaging and service invocation ?
1) Service invocation implements one-to-one , Message passing implements many to many . Service invocation is just between two parties , The same in messaging topic There can be multiple publishers and subscribers ( There is also a limitation : A message with the same name published by two publishers , The type must be the same )
2) The service call ( two-way ), The messaging ( A one-way ). In the service, the sender will wait for the receiver response, In message delivery, the publisher doesn't care about this message after sending it —— One way transmission system ( It's a bit like in Jiwang TCP and UDP, Actually in ROS It's called in Chinese rostcp/rosudp)
3) Service invocation is synchronous , Messaging is asynchronous . Therefore, in the process of message delivery, the queue is often set as a buffer to adjust the sending rate .
4)topic Commonly used for data transmission , and service Commonly used in logical processing .
master( Node manager )
There must be a leader when there are many nodes ,master Is responsible for managing all nodes . It will take charge of the related between each node topic、service Information list . Although there are managers , But when communicating, the message goes directly from the publishing node to the subscribing node , The middle does not pass through the node manager .ROS The parameter server is part of the node manager , All nodes can access and modify data ( data / Configuration information ). In all examples, first roscore once , What starts is master. But if two nodes have passed master Established a connection , And began to communicate . Turn it off at this time master It will not affect the communication between the two nodes .master It only works when establishing a connection .
bag( Message logging package )
A bag is ROS For storing ROS File format of message data . Save and playback ROS File format of message data . The extension of the package is .bag. When using complex robots , Collecting data is cumbersome . You can go through bag Save data once , The later simulation can be played back bag The data in achieves the same purpose .
Here is an example : Judge ros Whether the installation is successful or not, we will use an example of little turtle mobile , Then why can the little turtle move ? This is the process :
/teleop_turtle The node will issue these motion control commands to topic of conversation /turtle1/cmd_vel; meanwhile , because turtlesim_node Subscribed to this topic , So it will receive these messages , Control the turtle to move at the predetermined speed
Reference material :
ROS Introduction learning - coding-for-self - Blog Garden (cnblogs.com)
ROS The core concept 、 working space and Function pack .ROS Learning resources _Bruce’s blog-CSDN Blog
Due to the limited level of the author , If something is wrong , Please indicate in the comments section below , thank you !
边栏推荐
- Tester's algorithm interview question - find mode
- 业务实现-日志写到同一个行数据里面
- Hisilicon 3559 universal platform construction: YUV422 pit stepping record
- URL和URI
- 2022.07.03(LC_6109_知道秘密的人数)
- Illustrated network: what is gateway load balancing protocol GLBP?
- How many triangles are there in the golden K-line diagram?
- The input of uniapp is invalid except for numbers
- A new method for analyzing the trend chart of London Silver
- [IELTS reading] Wang Xiwei reading P4 (matching1)
猜你喜欢
Summer challenge brings you to play harmoniyos multi terminal piano performance
Verilog tutorial (11) initial block in Verilog
XML的解析
他做国外LEAD,用了一年时间,把所有房贷都还清了
圖解網絡:什麼是網關負載均衡協議GLBP?
Acrel-EMS综合能效平台在校园建设的意义
Tester's algorithm interview question - find mode
Design of emergency lighting evacuation indication system for urban rail transit station
[论文阅读] CarveMix: A Simple Data Augmentation Method for Brain Lesion Segmentation
Fs8b711s14 electric wine bottle opener MCU IC scheme development special integrated IC
随机推荐
uniapp微信小程序拿来即用的瀑布流布局demo2(方法二)(复制粘贴即可使用,无需做其他处理)
JS convert pseudo array to array
Introduction to ACM combination counting
(脚本)一键部署redis任意版本 —— 筑梦之路
Go step on the pit - no required module provides package: go mod file not found in current directory or any parent
How many triangles are there in the golden K-line diagram?
模板的进阶
Significance of acrel EMS integrated energy efficiency platform in campus construction
初识ROS
【雅思阅读】王希伟阅读P3(Heading)
Every time I look at the interface documents of my colleagues, I get confused and have a lot of problems...
[ODX studio edit PDX] -0.3- how to delete / modify inherited elements in variant variants
如何报考PMP项目管理认证考试?
【雅思阅读】王希伟阅读P4(matching2段落信息配对题【困难】)
AcWing164. 可达性统计(拓扑排序+bitset)
P4408 [NOI2003] 逃学的小孩(树的直径)
P4281 [ahoi2008] emergency assembly / gathering (LCA)
Specification for fs4061a boost 8.4v charging IC chip and fs4061b boost 12.6V charging IC chip datasheet
Cross domain request
[path planning] RRT adds dynamic model for trajectory planning