当前位置:网站首页>[advanced ROS] Lecture 3 ROS file system and distributed communication
[advanced ROS] Lecture 3 ROS file system and distributed communication
2022-06-29 21:00:00 【Life is like Zhaoxu】
【ROS Advanced 】 The third is ROS File system and distributed communication

List of articles
Preface
We have already known ,ROS The system is a typical Multi process distributed framework , A complete system can be divided into the following levels :
- host ;
- working space workspace;
- Function pack package;
- node node;
- topic of conversation topic;
- The hierarchical framework under the host can be shown in the following figure :

The main problems of this paper are as follows : - How to use the meta function pack ( Associated feature packs )
- ROS Workspace coverage and hidden dangers
- ROS Distributed communication ( Communication between different hosts )
One 、 Meta function pack
1. Concept

Application scenarios : In practice ROS Development process , Robots often need to design multiple functions , You need to call different function packages , But if you install them one by one, it will lead to inefficiency , A waste of time , At this point, you need to package the function package ;
Concept : Meta function pack (metapackage),ROS A virtual package in , There is no substantive content , But it relies on other software packages , In this way, other packages can be combined
example :
sudo apt install ros-noetic-desktop-full
It's going on ROS When installing , We run the above instructions , Similar to a directory index , Tell the host a Feature Pack Collection , Download and install one by one ;
2. Realization
- New function pack
- modify package.xml:
<exec_depend> Integrated function package </exec_depend>
.....
<export>
<metapackage />
</export>
- Modify Compilation Rules CMakeLists.txt:
cmake_minimum_required(VERSION 3.0.2)
project(demo)
find_package(catkin REQUIRED)
catkin_metapackage()
Reference address :ROS Wiki Metapackage
Two 、 Workspace coverage
1. Problem analysis
- To achieve :
- Create two new workspaces , Create a feature pack with the same name in two spaces wssim
- Add environment variables , modify ~/.bashrc:
source /home/ user / route / working space A/devel/setup.bash source /home/ user / route / working space B/devel/setup.bash
- Load environment variables :
source.bashrc- View environment variables :
echo $ROS_PACKAGE_PATH- Enter the workspace :
roscd wssim
- There's a problem : That is, it will directly enter the workspace B, The actual space nesting is :
working space B -> working space A -> System built-in space
- reason : The relationship between configuration order and priority
In the actual parsing process ,ROS First of all, according to bashrc file , Set the workspace priority according to its configuration , Generate the corresponding function package ROS_PACKAGE_PATH ROS route , But I will follow a principle :
ROS_PACKAGE_PATH The value in , and .bashrc The order of configuration is reversed -> The priority of first configuration is low
2. Conclusions and hidden dangers
- Concept : There are function packages with the same name in different workspaces ;
- The essence : When the function package has the same name , According to ROS_PACKAGE_PATH lookup , Priority will be given to those before configuration ;
- hidden danger : Because of this situation, call wssim The workspace will be called first B Feature pack in , It may not meet our needs for actual operation , There will be call problems
BUG explain :
When in .bashrc In file source After multiple workspaces , Possible situations , stay ROS PACKAGE PATH Contains only two workspaces , You can delete a custom workspace build And devel Catalog , again catkin_make, And then reload .bashrc file , Problem solving .
3、 ... and 、 Distributed communication
1. Demand scenarios

In actual development ,ROS The system is often used to complete the communication and cooperation among multiple computers , Will be distributed on different computers , In the process of running, it often communicates with other nodes , There are many network configuration requirements :
- There must be a complete two-way connection between all machines on all ports
- Each computer must advertise itself by a name that all other computers can resolve
2. Realization
- Basic preparation : Make different hosts in The same network , Setting up IP
virtual machine : Change the network adapter to bridge mode
- Modify the configuration file : Mainly refers to the modification of the computer /etc/hosts The file of , Add the other party's... To the file IP Address and computer name
Network instructions :
- IP Address check :ifconfig
- Computer name :hostname
- Test network communication :ping
- To configure IP Address :
host : modify ~/.bashrc file
export ROS_MASTER_URI=http:// host IP:11311
export ROS_HOSTNAME= host IP
Slave : modify ~/.bashrc file
export ROS_MASTER_URI=http:// host IP:11311
export ROS_HOSTNAME= Slave IP
- test :
- The host starts roscore
- Host start subscription node , Start the publishing node from the server , Test communication
- The host starts the publishing node , Start the subscription node from the machine , Reverse phase test
summary
- Statement : The blog section of this section refers to CSDN User zhaoxuzuo ROS course , The next blog will focus on node names 、 Topic name 、 On the problem of duplicate names of parameter names , Introduce the abnormal conditions caused by repetition .

边栏推荐
- THREEJS基础入门
- Set up your own website (12)
- Cantata version 9.5 has officially passed the sgs-t Ü V certification and conforms to all major software safety standards
- Chainsafe cross chain bridge deployment tutorial
- Final review [microcomputer principle]
- Navigation [microcomputer principle]
- HAproxy + Keepalive实现LDAP代理服务
- LSF-bsub命令
- [fishing artifact] code tool for lowering the seconds of UI Library -- form part (I) design
- Enter the year and month to find the total number of days in the month
猜你喜欢
![Navigation [microcomputer principle]](/img/79/8311a409113331e72f650a83351b46.png)
Navigation [microcomputer principle]

双目立体视觉摄像头的标定、矫正、世界坐标计算(opencv)

WIN10设置自动拨号联网任务,实现开机、断网自动重连

"Operation and maintenance department has Xiao Deng" to review and analyze file and folder access rights
![Navigation experiment [microcomputer principle] [experiment]](/img/79/8311a409113331e72f650a83351b46.png)
Navigation experiment [microcomputer principle] [experiment]

leetcode:307. 区域和检索 - 数组可修改

Information system project manager -- Chapter VII examination questions of project cost management over the years

阿里云发布《中国机器人产业图谱(2022)》,122页pdf

CAD assistant - 3D model format conversion tool

STL教程6-deque、stack、queue、list容器
随机推荐
【摸鱼神器】UI库秒变低代码工具——表单篇(一)设计
LSF bsub command
STM32最小系统搭建(原理图)
导航 实验【微机原理】【实验】
Detailed description of gaussdb (DWS) complex and diverse resource load management methods
[a must for reptiles - > scrapy framework from black iron to king] first chapter - detailed explanation of 10000 character blog posts (recommended Collection)
MES系统究竟有何独特之处?
广东二级造价工程师《造价管理》真题解析
"Xiaodeng" ad domain delegation for operation and maintenance
Sentinel's quick start takes you through flow control in three minutes
HAproxy + Keepalive实现LDAP代理服务
如何评价科大讯飞AI翻译笔P20系列,值得买吗?
「运维有小邓」实时监控用户登录操作
Mysql Json 数据类型&函数
[cloud native practice] kubesphere practice - Multi tenant system practice
What problems should be avoided when using the points mall games for marketing?
verilog实现DDS波形发生器模块,可实现频率、相位可调,三种波形
「运维有小邓」Active Directory批量用户创建
Storage principle of string
flutter BottomNavigationBar切换页面保持状态