ROS Network Setup: Cannot view (rviz or echo) topics published from machine on different subnet

asked 2020-10-13 01:31:58 -0500

megh-bot15 gravatar image

updated 2022-07-10 12:19:15 -0500

lucasw gravatar image

[Ubuntu 18.04 | ROS Melodic]

My connection setup is as follows:

Laptop (Wifi: [Method: Automatic(DHCP)]) <---> Jetson 1 [ROS MASTER] (Wifi:[Method: Manual]) | (Ethernet: [Method: Shared to other computers]) <--> Jetson 2 (Ethernet:[Method: Manual])

There is no direct connection between Laptop and jetson2 (they are on different subnets).

I can ping Laptop(WiFI IP) from my Jetson 2. But I cannot ping Jetson2( from my Laptop and hence, cant view the topics published by jetson 2 on my laptop's rviz, not even with rostopic echo. Rostopic echo of J2 topics work on J1.

I have set ROS MASTER URI on all machines and their respective ROS_IP and HOSTNAMES. Even ipv4_forwarding has been set to 1. I have also set up the "/etc/hosts" file on all machines with the hostname and IPs.

laptop:   localhost   laptop    jetson1        jetson2

jetson1:   localhost   jetson1  laptop   jetson2

jetson2:   localhost   jetson2   jetson1  laptop

I have even added routes as described in other discussions


Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         UG    600    0        0 wlp1s0   UG    0      0        0 wlp1s0     U     1000   0        0 wlp1s0   U     600    0        0 wlp1s0


Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         UG    20600  0        0 wlan0   U     100    0        0 eth0     U     1000   0        0 wlan0   U     600    0        0 wlan0


Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         UG    20100  0        0 eth0   U     100    0        0 eth0     U     1000   0        0 eth0   UG    0      0        0 eth0

When I try to ping from my laptop:

PING ( 56(84) bytes of data.
From icmp_seq=1 Destination Port Unreachable
From 192 ...
edit retag flag offensive close merge delete


If you don't have a working connection between the two hosts you want to have ROS nodes running on, that would indicate you have a routing problem (in this case, as you have two different subnets).

That's not a ROS issue, but a network configuration one.

You'll have to figure that out before using ROS.

gvdhoorn gravatar image gvdhoorn  ( 2020-10-13 03:05:45 -0500 )edit

@gvdhoorn, agreed that it is not a ROS issue, but I was hoping that someone from the ROS community might be able to help. I have one doubt though, the Ethernet connection method on Jetson1 should it be in "Manual" or "Shared to other computers" for setting a static IP. I have used the latter.

megh-bot15 gravatar image megh-bot15  ( 2020-10-14 07:09:45 -0500 )edit

The configurations so far look good at first glance. Have you tried checking your firewall settings? What is the output of sudo ufw status verbose on each machine?

roboav8r gravatar image roboav8r  ( 2020-10-14 09:04:43 -0500 )edit

@roboav8r, it shows Status: inactive for all the three devices.

megh-bot15 gravatar image megh-bot15  ( 2020-10-15 02:00:06 -0500 )edit