Running ROS2 across multiple machines
Hello ROS forum.
I'm trying to get a Raspberry PI to talk to a computer on the same network using the tutorial files provided in this example. But the listener is never showing anything.
The PC:
OS: Ubuntu 20.04
ROS Version: ROS2 Foxy.
The static IP address on local LAN: 192.168.1.42
The RPi:
OS: Ubuntu server 20.04
ROS Version: ROS2 Foxy
The static IP address on the local LAN: 192.168.1.99
I tested that communication is working between the two machines by using nc.
$ nc -lu -p 5555 # Machine 1
$ nc -vzu 192.168.1.xx 5555 # Machine 2
And in both cases the results where Connection to ... [udp/rplay] succeed!
The tried approaches:
The first approach is using the ROS_MASTER_URI
but that approach did not seem to work and as stated here that environmental variable is no longer used so removed them.
I also tried to as stated here restart the daemon. But that did not change anything.
In this post the user finally added the routing for multicast. I did that:
PC:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 100 0 0 enp4s0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 enp4s0
192.168.1.0 0.0.0.0 255.255.255.0 U 100 0 0 enp4s0
224.0.0.0 0.0.0.0 240.0.0.0 U 0 0 0 enp4s0
RPi:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 600 0 0 wlan0
192.168.1.0 0.0.0.0 255.255.255.0 U 600 0 0 wlan0
192.168.1.0 0.0.0.0 255.255.255.0 U 600 0 0 wlan0
224.0.0.0 0.0.0.0 240.0.0.0 U 0 0 0 wlan0
Restarted the ros2 daemon to be on the safe side. But that did not solve the problem either.
Conclusion I have tried what I think can be the problem but clearly I'm missing something or I'm something is not right with my setup. Can anyone give me a push in the right direction?
To clarify, which RMW implementation are you using? If you didn't change the default, then it is Fast-DDS.
On dashing, I've tried with both connext, fast-dds and cyclone. Using multicast send/receive works both ways on both machines. However, cannot see the topics being published from one machine cannot be echoed or listed on the other machine
If you are using "raw" discovery without a fastdds discovery server, your switch/router will need to forward UDP Broadcast packages.
yes, i can confirm that it was my ISP's router that was blocking it.