Does ROS2 provide better/lower communication latency than ROS?
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?
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.
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.
could you maybe tell us what makes you ask this question?
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..