0
$\begingroup$

Rosanswers logo

I have two computers on the robot which are directly connected via ethernet. Let's call them "R1" and "R2". The roscore is running on R1, some of the nodes are on R1, some are on R2. Connection between the two is fine (ROS_MASTER_URI on R2 is set to http://192.168.1.9:11311).

R1 is also connected to a wireless network. On this wireless network there is a third computer "PC".

image description

Now I want to run rviz on PC to monitor what is going on on the robot. For this I set ROS_MASTER_URI=http://172.168.1.100:11311 on PC. After this I can see all topics via rostopic list but when I call rostopic echo /topic, I only get messages on topics that are published from R1, not from those published on R2. Accordingly rviz only shows data from R1.

I assume that the problem is, that the connections PC <-> R1 and R1 <-> R2 are in different networks and that I would have to somehow forward messages between the networks. What is the best/easiest way to achieve this?


Originally posted by luator on ROS Answers with karma: 108 on 2017-03-07

Post score: 3

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

This is most likely a routing problem, not a ROS problem.

Provided you have everything setup correctly (ie ROS_IP, ROS_MASTER_URI, etc), the most likely cause is that R2 does not know how to get traffic to PC, and PC does not know how to get traffic to R2.

Any Linux machine can be easily turned into a router, which is what would make this work. See this random ServerFault post that talks about this, and this random page that shows you how to enable this. You probably also have to tell all involved hosts in the different networks how to reach the other networks (by adding some static routes).

Note: enabling forwarding like this can change the way your IP stack works, in ways that may not be apparent, so please try to understand what the implications are before you do this.


Also: not sure whether you care, or whether you already know, but 172.168.1.0 is not a network in the private networking ranges (that would be anything in 172.16.0.0 – 172.31.255.255). Your robot is currently using a public IP on its WLAN interface. This might be ok (if that range is actually yours), but I just wanted to mention it.

If you don't need your robot to be on a different network as your PC, then it might make things easier to just put them in the same one. If you need more than 255 hosts in one segment, then you could use a netmask with less than 24 bits.


Originally posted by gvdhoorn with karma: 86574 on 2017-03-08

This answer was ACCEPTED on the original site

Post score: 4

$\endgroup$
0
$\begingroup$

Rosanswers logo

I had the same problem. Fixed it really easily ! Just check out my question : #q256070


Originally posted by wicked88 with karma: 83 on 2017-03-12

This answer was NOT ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.