当前位置:网站首页>Some records during the development of ros2/ros1
Some records during the development of ros2/ros1
2022-07-29 02:38:00 【zhangrelay】
Actually , It's going on ROS2/ROS1 When programming , You usually need to start many nodes , Sometimes greater than 60+ Nodes are also very common .
that , You need to schedule these nodes . Different nodes work at different frequencies , Some are 10Hz Can , Some need 1000Hz.
Basic concepts :
- taskset
- isolcpus
taskset Used in a given pid Set or retrieve the of the running process CPU Affinity , Or start with a given CPU The new command of affinity . CPU Affinity is a scheduler property , It will make the process “ binding ” To a set of given on the system CPU. Linux The scheduler will follow the given CPU Affinity , And the process will not be in any other CPU Up operation . Please note that ,Linux The scheduler also supports natural CPU Affinity : For performance reasons , The scheduler will try to keep the process in the same CPU On , As long as it works . therefore , Force specific CPU Affinity is only useful in some applications .
CPU Affinity is expressed as a bit mask , The lowest bit corresponds to the first logic CPU, The highest bit corresponds to the last logic CPU. Not all CPU Can exist on a given system , But the mask may specify more than existing CPU. The retrieved mask will only reflect the physical CPU The corresponding bit . If an invalid mask is given ( namely , It corresponds to that there is no valid CPU The mask of ), It will return an error . Masks are usually given in hexadecimal . for example ,
- 0x00000001 It's the processor #0
- 0x00000003 It's the processor #0 and #1
- 0xFFFFFFFF Yes, all processors (#0 To #31)
When the task set returns , It can ensure that the given program has been dispatched to a legal CPU On .
isolcpus We need to pay attention to amd and intel The difference , If it is arm or nVidia……
In extreme cases, the performance is unstable , perhaps CPU completely fill .
use "events executor", This is in ROS 2 Humble You can use it directly , Other previous versions need to compile the corresponding source code .
Callback function or time
FastDDS It needs to be configured before using , This is better .
otherwise , Sometimes FastDDS Cannot list nodes after restarting nodes while other nodes are running / The theme .
Specific to see discovery_server; Or switch to CycloneDDS
If you choose CycloneDDS, Configuration is also required , Instead of using default parameters directly .
ROS_DOMAIN_ID The same configuration will make the network overburdened in the case of a large number of network needs or multiple robots ……
colcon build It's best to add some parameters, otherwise it's not easy to use .
边栏推荐
- Code random notes_ Hash_ 349 intersection of two numbers
- Double write consistency of MySQL and redis
- Why is redis fast? Message queue, single thread
- 如何把thinkphp5的项目迁移到阿里云函数计算来应对流量洪峰?
- [upload picture 2-cropable]
- Explanation of engineering economics terms
- Meeting notice of meeting OA
- 当Synchronized遇到这玩意儿,有个大坑,要注意
- 如何利用 RPA 实现自动化获客?
- Multimodal Unsupervised Image-to-Image Translation多通道无监督图像翻译
猜你喜欢

新版海螺影视主题模板M3.1全解密版本多功能苹果CMSv10后台自适应主题开源全解密版

I was stunned by this question that I browsed 746000 times

Redis master-slave mode, sentinel cluster, fragment cluster

Ten methods to prevent blackmail software from attacking data

When synchronized encounters this thing, there is a big hole, so be careful

6年测试经验,教大家测试~如何把控项目

外包公司“混”了2年,我只认真做了5件事,如今顺利拿到字节 Offer。

FPGA skimming memory (Verilog implementation of ram and FIFO)

Explain the four asynchronous solutions of JS in detail: callback function, promise, generator, async/await

Quickly master nodejs installation and getting started
随机推荐
IOT components
Understand the evolution of redis architecture in one article
主从复制及其原理
The outsourcing company "mixed" for two years, and I only did five things seriously. Now I get byte offer smoothly.
Continuous learning / life long learning
Teach you how to install vscode by hand (with illustrated steps)
Cuda-npp image and video processing
当我看源码的时候,我在想什么?
TCP重传机制有哪些?
童年的快乐时光
Esbuild Bundler HMR
Where, having, group by, order by, is null, not in, subquery, delete, date function
redis为什么快,消息队列,单线程
[golang learning notes 2.2] map, structure and interface
where、having、group by、order by,is null,not in,子查询,delete,日期函数
HTTP cache
CUDA details GPU architecture
What happens if you have to use ArrayList in multithreading?
Source code and display of 18 classic programs in C language vs2019
Explain asynchronous tasks in detail: task status and lifecycle management