Ask Your Question

Running ROS2 across multiple machines

asked 2020-07-20 09:47:35 -0500

Magnus Sörensen gravatar image

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:

The RPi:

OS: Ubuntu server 20.04
ROS Version: ROS2 Foxy
The static IP address on the local LAN:

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:


Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         UG    100    0        0 enp4s0     U     1000   0        0 enp4s0   U     100    0        0 enp4s0       U     0      0        0 enp4s0


Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         UG    600    0        0 wlan0   U     600    0        0 wlan0   U     600    0        0 wlan0       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?

edit retag flag offensive close merge delete


To clarify, which RMW implementation are you using? If you didn't change the default, then it is Fast-DDS.

jacobperron gravatar image jacobperron  ( 2020-07-22 17:59:56 -0500 )edit

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

goksankobe gravatar image goksankobe  ( 2021-04-09 04:47:59 -0500 )edit

If you are using "raw" discovery without a fastdds discovery server, your switch/router will need to forward UDP Broadcast packages.

highmax1234 gravatar image highmax1234  ( 2021-05-12 01:12:31 -0500 )edit

yes, i can confirm that it was my ISP's router that was blocking it.

goksankobe gravatar image goksankobe  ( 2021-05-12 04:15:32 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2020-07-21 04:16:01 -0500

Magnus Sörensen gravatar image

updated 2020-07-21 04:17:09 -0500

After many hours of research, I, unfortunately, come to the conclusion that node discovery do not work on ROS2 yet. Going back to ROS1 as its a bit more mature.

edit flag offensive delete link more


Looking at the documentation it seems to me that node discovery does work in ROS2:

I've installed ROS2 Foxy Fitzroy Desktop Version today on my desktop PC and a Jetson Nano following the instructions here:

After that I ran the talker node on the Jetson with: ros2 run demo_nodes_cpp talker
And the listener node on my Desktop PC with: ros2 run demo_nodes_py listener
Since the ROS_DOMAIN_ID environment variable is not set in both systems, both nodes can see each other and the data transfer works without a problem. So it seems something else was not right with your setup (don't know what, sorry).

Here you can find some more information regarding node discovery in ROS2:

fb21 gravatar image fb21  ( 2020-08-30 16:35:24 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2020-07-20 09:47:35 -0500

Seen: 1,279 times

Last updated: Jul 21 '20