ROS 2 talker-listener on 2 machines not working
ROS 2: Galactic
RMW: default
OS: Ubuntu
Hello! I am trying to run the talker-listener example but instead of running both nodes locally I am trying to reproduce the same behavior but using two different machines connected to the same network.
Machine 1 (Ethernet): ros2 run demo_nodes_cpp talker
Machine 2 (Wifi): ros2 run demo_nodes_cpp listener
Output:
Machine 1: String being published
Machine 2: Empty
I have also tried to run ros2 multicast send
and ros2 multicast receive
between both machines and nothing happens. When I run these two commands in the same machine, I see the desired output.
I am also not using the ROS_DOMAIN_ID variable, so they should be communicating.
Any help on how to debug this problem?
Can you ping these computers between each other normally?
Yes I can, but from what I have seen this does not necessarily mean that ROS 2 is able to work in this condition. I think that the problem is that UDP multicast does not work
As per https://roboticsbackend.com/ros2-mult..., checking with the
ping
is the first thing to do :) Can you check your firewall settings?sudo ufw status
returnsStatus: inactive
so I suppose that it is not affecting communicationsAnother thing I should add: When I try this example but with my laptop and a docker container, it also does not work.
Interesting... If I run 2 docker containers, they can communicate with each other and the talker-listener example works as expected.