Robotics StackExchange | Archived questions

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

[Ubuntu 18.04 | ROS Melodic]

My connection setup is as follows:

Laptop (Wifi: 192.168.43.181 [Method: Automatic(DHCP)]) <---> Jetson 1 ROS MASTER | (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 ROSIP and HOSTNAMES. Even ipv4forwarding 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.168.43.2 icmp_seq=2 Destination Port Unreachable
From 192.168.43.2 icmp_seq=3 Destination Port Unreachable ...

When I ping 192.168.43.181(laptop) from Jetson2

PING 192.168.43.181 (192.168.43.181) 56(84) bytes of data.
64 bytes from 192.168.43.181: icmp_seq=1 ttl=63 time=72.4 ms
64 bytes from 192.168.43.181: icmp_seq=2 ttl=63 time=226 ms
64 bytes from 192.168.43.181: icmp_seq=3 ttl=63 time=60.3 ms
64 bytes from 192.168.43.181: icmp_seq=4 ttl=63 time=65.8 ms ...

Thanks for the help :)

Asked by megh-bot15 on 2020-10-13 01:31:58 UTC

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.

Asked by gvdhoorn on 2020-10-13 03:05:45 UTC

@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.

Asked by megh-bot15 on 2020-10-14 07:09:45 UTC

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?

Asked by roboav8r on 2020-10-14 09:04:43 UTC

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

Asked by megh-bot15 on 2020-10-15 02:00:06 UTC

Answers