ros2 / domain_bridge

Bridge communication across different ROS 2 domains.
Apache License 2.0
57 stars 11 forks source link

Different FastDDS XML configuration files for the two sides of the domain bridge #69

Open Vicidel opened 2 years ago

Vicidel commented 2 years ago

Hello all

I have a specific case I need to solve, for which I need the two sides of the domain bridge to connect to different machines. I'm using FastDDS whitelisting setup with an XML file following the documentation here.

My issue is that the two ROS2 nodes, for example gateway_0 and gateway_1 use the same XML file. I want to specify one file for gateway_0 and another for gateway_1, but am not sure how to proceed.

What I'm looking for to start on this issue is the code location where the nodes are created to understand more, and maybe at this location I can do something to switch from the two XML files.

Any help on the subject is appreciated! Victor

jacobperron commented 2 years ago

I'm not familiar with how to specify a particular FastDDS XML file for one ROS node in a process. Specifically, I guess you'll want to somehow associate the XML file per ROS context (which has a one-to-one mapping with DDS participants).

Here is where ROS nodes are created:

https://github.com/ros2/domain_bridge/blob/b5b296a6291a05384eeed10ca1779fc8220b2292/src/domain_bridge/domain_bridge.cpp#L165

and the ROS context for that node is created just above that:

https://github.com/ros2/domain_bridge/blob/b5b296a6291a05384eeed10ca1779fc8220b2292/src/domain_bridge/domain_bridge.cpp#L161