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: 192.168.43.181 [Method: Automatic(DHCP)]) <---> Jetson 1 [ROS MASTER] (Wifi: 192.168.43.2[Method: Manual]) | (Ethernet: 10.42.0.1 [Method: Shared to other computers]) <--> Jetson 2 (Ethernet: 10.42.0.2[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(10.42.0.2) 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:

127.0.0.1   localhost
127.0.1.1   laptop
192.168.43.2    jetson1
10.42.0.2        jetson2

jetson1:

127.0.0.1   localhost
127.0.1.1   jetson1
192.168.43.181  laptop
10.42.0.2   jetson2

jetson2:

127.0.0.1   localhost
127.0.1.1   jetson2
10.42.0.1   jetson1
192.168.43.181  laptop

I have even added routes as described in other discussions

laptop:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.43.223  0.0.0.0         UG    600    0        0 wlp1s0
10.42.0.0       192.168.43.2    255.255.255.0   UG    0      0        0 wlp1s0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlp1s0
192.168.43.0    0.0.0.0         255.255.255.0   U     600    0        0 wlp1s0

jetson1:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.43.223  0.0.0.0         UG    20600  0        0 wlan0
10.42.0.0       0.0.0.0         255.255.255.0   U     100    0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlan0
192.168.43.0    0.0.0.0         255.255.255.0   U     600    0        0 wlan0

jetson2:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.42.0.1       0.0.0.0         UG    20100  0        0 eth0
10.42.0.0       0.0.0.0         255.255.255.0   U     100    0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0
192.168.43.0    10.42.0.1       255.255.255.0   UG    0      0        0 eth0

When I try to ping 10.42.0.2(Jetson2) from my laptop:

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

Comments

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