Does ROS2 provide better/lower communication latency than ROS?

asked 2021-02-17 23:05:35 -0500

bishaljais gravatar image

updated 2021-02-17 23:06:14 -0500

For a data transfer between 2 nodes ( 1 publisher and 1 subscriber ), both the nodes being hosted on 2 different systems connected to the same wifi network. Is the communication latency using ROS2 lower than the communication latency experienced by the data transfer using ROS1? If so why?

edit retag flag offensive close merge delete

Comments

I'm going to be difficult (but post the obvious first answer) and say: this is not answerable in general.

Network communication performance is dependent on many environmental factors, including the state of the hosts used.

Additionally: size of messages, frequency of publication, connected vs connectionless transport, DDS QoS settings (if DDS is used with the ROS 2 install you're testing), frequencies used, number of active hosts on the network, contention for the medium, etc, etc.

connected to the same wifi network

and this doesn't help either. Unless this is a controlled environment (ie: a lab with no other radios competing for the same spectrum), use of wireless networking significantly complicates these kinds of measurements.

Is the communication latency using ROS2 lower than the communication latency experienced by the data transfer using ROS1? If so why?

could you maybe tell us what makes you ask this question?

gvdhoorn gravatar image gvdhoorn  ( 2021-02-18 01:44:51 -0500 )edit

I was trying to see what suits better ros or ros2 for multi robots communications over a network. I did an experiment with various packet sizes, and the latency for ros2 was seen to be much lower than that of ROS. This was all in a controlled lab environment with all other network dependencies, environmental factors, and host states remaining the same for both ros and ros2 . But I am not sure about what makes the latency lower. I am aware of the fact that the MASTER Node is the one that comes as an intermediate node for the establishment of communication but is there any other function of the master node which increases the overall latency? I am just trying to see what makes ROS2 better in terms of performance..

bishaljais gravatar image bishaljais  ( 2021-02-18 04:28:04 -0500 )edit