当前位置:网站首页>When the fixed frequency artifact falls in love with multithreading | ros2 fixed frequency topic release demo
When the fixed frequency artifact falls in love with multithreading | ros2 fixed frequency topic release demo
2022-07-01 18:02:00 【Fish flavored ROS】
We want to publish topics at a fixed rate , May adopt ROS2 Timing artifact in Rate, Unclear Rate You can read this article of Xiaoyu :ROS Can you use the fixed frequency artifact in
In order to be able to recycle all the time rate, We open a separate thread for publishing joint_states Topic data , stay ROS2 In the program, the routine of opening a thread separately for topic publishing is as follows :
import threadingfrom rclpy.node import Nodeclass RotateWheelNode(Node):def __init__(self):# Create a Rate And threadself.pub_rate = self.create_rate(5) #5Hz# Create threadself.thread_ = threading.Thread(target=self._thread_pub)self.thread_.start()def _thread_pub(self):while rclpy.ok():# Do something , Use rate Ensure the cycle frequencyself.pub_rate.sleep()
边栏推荐
- ZABBIX alarm execute remote command
- Replace UUID, nanoid is faster and safer!
- People help ant help task platform repair source code
- How to use JMeter function and mockjs function in metersphere interface test
- 开发那些事儿:EasyCVR集群设备管理页面功能展示优化
- Source code of new campus errand / campus task platform on mutual station
- Petrv2: a unified framework for 3D perception of multi camera images
- Data warehouse (3) star model and dimension modeling of data warehouse modeling
- Detailed explanation of string's trim() and substring()
- MFC obtains local IP (used more in network communication)
猜你喜欢
Roewe rx5's "a little more" product strategy

Length of learning and changing

Penetration practice vulnhub range Tornado

Oom caused by improper use of multithreading

Yuancosmos game farmersworld farmers world - core content of the second conference in China!

Rotation order and universal lock of unity panel

Explain in detail the process of realizing Chinese text classification by CNN

New patent applications and transfers

Cassette helicopter and alternating electric field magnetic manometer DPC

How to use JMeter function and mockjs function in metersphere interface test
随机推荐
In depth Research Report on China's disposable sanitary products production equipment industry (2022 Edition)
Is the software of futures pioneer formal and safe? Which futures company is safer to choose?
Intelligent operation and maintenance practice: banking business process and single transaction tracking
APK签名流程介绍[通俗易懂]
C language implementation of sum of two numbers [easy to understand]
Blackwich: the roadmap of decarbonization is the first step to realize the equitable energy transformation in Asia
Code example of libcurl download file
Penetration practice vulnhub range Tornado
Product service, operation characteristics
Euler function: find the number of numbers less than or equal to N and coprime with n
SLO is increasingly used to achieve observability | Devops
Develop those things: add playback address authentication to easycvr platform
徽商期货是正规期货平台吗?在徽商期货开户安全吗?
Easycvr accesses the equipment through the national standard gb28181 protocol. What is the reason for the automatic streaming of the equipment?
To improve the efficiency of office collaboration, trackup may be the best choice
传感器尺寸、像素、DPI分辨率、英寸、毫米的关系
Extract the compressed package file and retrieve the password
At present, where is the most formal and safe account opening for futures speculation? How to open a futures account?
February 16, 2022 Daily: graph neural network self training method under distribution and migration
Cassette helicopter and alternating electric field magnetic manometer DPC