3

使用UDPROS进行通信 | 沉默杀手

 2 years ago
source link: https://charon-cheung.github.io/2022/11/12/ROS/ROS%20Kinetic%E7%9F%A5%E8%AF%86/%E4%BD%BF%E7%94%A8UDPROS%E8%BF%9B%E8%A1%8C%E9%80%9A%E4%BF%A1/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

使用UDPROS进行通信 | 沉默杀手

使用UDPROS进行通信
2022-11-12|ROSROS Kinetic知识|
Word count: 213|Reading time: 1 min

TCPROS是ROS默认使用的传输方式。另一种通信类型是 UDPROS,这种方式是一种低延迟、非可靠的传输,仅适用于远程操作。

在发布的消息头中,在发布消息之前将当前时间戳写到timeStamp中,然后在订阅器的回调函数中再计算消息中的timeStamp到当前时间的Duration,这样子能够大概计算这个经过的时间;实际上网络延迟会比这个Duration稍微短一点。

更换为UDP 通信只需要在 ros::Subscriber 的构造函数最后加上ros::TransportHints().unreliable().maxDatagramSize(1000) 即可。

  • 随着频率的增加,通信延迟也相应增加
  • 在UDP通信中,随着maxDatagramSize的增加,通信延迟也随着降低。
  • 随着订阅者数量增加,通信延迟也会增加。

参考:
Transport Hints
UDPROS

©2018 - 2022 By Charon Cheung
Driven - Hexo|Theme - Melody

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK