ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

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: 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?

edit retag flag offensive close merge delete

Comments

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
0

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

Comments

Looking at the documentation it seems to me that node discovery does work in ROS2: https://index.ros.org/doc/ros2/Concep...

I've installed ROS2 Foxy Fitzroy Desktop Version today on my desktop PC and a Jetson Nano following the instructions here: https://index.ros.org/doc/ros2/Instal...

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: https://de.mathworks.com/help/ros/ug/...

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

I have also found that both machines need to have the ROS_DOMAIN_ID set to the same value. Otherwise topics published on one machine cannot be seen from the other. An easy way to set it via commandline is: export ROS_DOMAIN_ID=1

M@t gravatar image M@t  ( 2021-12-21 22:01:05 -0500 )edit

Question Tools

1 follower

Stats

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

Seen: 7,136 times

Last updated: Jul 21 '20