[ROS2] Intra-process communication and QoS
Hi, using Eloquent I wanted to test intra-process communication with manual composition but I bumped into a wall really difficult to overcome.
Intra-process communication requires that ALL publishers and subscribers use "volatile" as "reliability" configuration for QoS, I guess this is coherent.
My problem is that my node has a static TF publisher member that instantiates its internal publisher with "transient_local" setting, also this is coherent.
Is there a smart way to overcome this conflict?
Thank you, Walter
Asked by Myzhar on 2020-10-23 03:35:42 UTC
Answers
Hi!
Starting in Eloquent, the ROS 2 default middle-ware (Fast DDS) supports intra-process delivery. If you run publishers and subscribers in the same process, the communication occurs through Fast DDS' intra-process mechanism. Using that feature, you can use any DDS QoS configuration of your choice, such ad VOLATILE durability or RELIABLE reliability. By default, this feature is disabled in ROS 2 Eloquent (in ROS 2 Foxy is enabled by default). You can activate it using a XML profiles file as described here.
Mind that this intra-process mechanism is not the same as the ROS 2 "built-in" intra-process mechanism, but will most likely get you were you want to go.
Furthermore, if you're interested in overcoming network traffic between separate processes running in the same machine, starting ROS 2 Foxy, you could checkout Fast DDS Shared Memory Transport (SHM).
I hope that helps!
Asked by EduardoPonz on 2020-10-26 09:39:05 UTC
Comments
Hi, I'm using FastDDS, so you are saying that in this case, even if I force ROS2 intra-process communication to false to be able to start the nodes, under the hood it is used, and latency and overhead are reduced?
Asked by Myzhar on 2020-10-26 10:32:00 UTC
I'm sorry, my answer was not 100% complete, I've update it. If you configure Fast DDS to use intra-process communication, then it will use it when possible, effectively improving latency performance. In ROS 2 Eloquent, this feature can be activated using and XML profiles file as explained here. This step is not necessary from ROS 2 Foxy on, since intra-process delivery is enabled by default.
Please, do let me know if you need some assistance configuring the feature.
Asked by EduardoPonz on 2020-10-26 10:58:31 UTC
Comments
I am having the exact same issue: a node with all publisher set to durability volatile BUT tf_static, which prevents me from start the node with use_intra_process_comms to True (independently from the RMW used). Did you fin a solution @Myzhar ?
Asked by doisyg on 2021-05-28 03:04:16 UTC
Not yet :(
Asked by Myzhar on 2021-05-28 04:03:59 UTC
Hi, please don't post follow ups as answers.
Asked by allenh1 on 2021-05-28 08:17:34 UTC
Does this process only have one node in it?
Asked by allenh1 on 2021-05-28 08:17:58 UTC