ROS进二阶学习笔记(10) -- rospy.Publisher() 之 queue_size
ref link
===============
queue_size: publish() behavior and queuing
publish() in rospy is synchronous by default (for backward compatibility reasons) which means that the invocation is blocking until:
- the messages has been serialized into a buffer
- and that buffer has been written to the transport of every current subscriber
If any of the connections has connectivity problems that might lead to publish() blocking for an indefinite amount of time. This is a common problem when subscribing to topics via a wireless connection.
(sonictl: publish() 在rospy 里是同步进行的,为了向老版兼容。这就意味着对消息的调用会出现阻塞。直到:
>> message 序列性地进入 buffer
>> 并且buffe

ROS的rospy.Publisher中,queue_size决定了消息队列的行为和缓冲。默认同步发布可能导致阻塞,选择合适的queue_size至关重要。例如,queue_size=1适合最新值优先的情况,而更大的值用于确保消息不丢失,如用户界面消息。不推荐设置为0,可能导致无限增长的内存消耗。
 -- rospy.Publisher 之 queue_size&spm=1001.2101.3001.5002&articleId=54582608&d=1&t=3&u=90c7b120c7374fe296a8e6dce73df6fb)
321

被折叠的 条评论
为什么被折叠?



