Galactic multi computer network setup
Hi all, my first question here.
I would like to achieve the following setup (sorry, I cannot upload a picture due to no points):
The robot consists of two computers, Computer 1 and Computer 2. The computers are connected with each other using ethernet. Computer 1 has ethernet ifname enx806d97376320 and IP address 10.0.0.1. Computer 2 has ethernet ifname enx806d97376322 and IP address 10.0.0.2. Pinging works both ways. Then, I have a ground control station (GCS) computer connected to a router using ethernet. The router gateway address is 192.168.1.1. The GCS computer has IP address 192.168.1.89. Both Computer 1 and Computer 2 are also connected to the router using wifi. Computer 1 has wifi network ifname wlx60634c314865 with IP address 192.168.1.237. Computer 2 has wifi network ifname wlx60634c314866 with IP address 192.168.1.238.
Generally, I am running control and navigation on Computer 1 and perception on Computer 2. From the GCS computer, I would like to communicate with both Computer 1 and Computer 2, mostly receiving topics with low QoS settings, but also sending action goals to Computer 1. I would also like to establish communication between Computer 1 and Computer 2 with multiple topics both ways.
I would like all communication between Computer 1 and Computer 2 to go through the ethernet connection, but all communication between the GCS computer and Computer 1 and Computer 2 to go through the router.
All computers are running Ubuntu 20.04 and ROS2 Galactic.
My problem is that I can't establish ROS2 communication over both network interfaces on the robot computers. That is, either I can communicate between the robot computers and the GCS, or I can communicate in between the robot computers, but not both. Which network interface is used is determined by the default gateway specified with ip route
.
I have tried the following (on the robot computers):
Using CycloneDDS with no configuration, default gateway via the ethernet interface in between the robot computers:
The talker/listener demo nodes works between Computer 1 and Computer 2, but not between Computer 1 and the GCS computer. Likewise with ros2 multicast send/receive
.
Using CycloneDDS with no configuration, default gateway via the wifi interface connected to the router: The talker/listener demo doesn't work between the GCS computer, neither between the robot computers. ros2 multicast send/receive
works between the GCS computer and Computer 1 but not between the robot computers, unless I also put the default gateway on Computer 2 as via the wifi interface, then it works between the robot computers but it the traffic goes through the router, which is undesired.
I have then tried to configure Cyclone DDS to use both network interfaces using the following configuration:
<CycloneDDS>
<Domain>
<General>
<NetworkInterfaceAddress>enx806d97376320,wlx60634c314865</NetworkInterfaceAddress>
</General>
</Domain>
</CycloneDDS>
Using CycloneDDS with both network interfaces configured in XML, default gateway via ethernet: Talker/listener and ros2 multicast send/receive ...