How to receive topic information from an external machine on a different network ?

asked 2020-02-19 06:05:34 -0500

mamarbao gravatar image

Hello everyone, currently, I'm working in a project where the achievement is to manage to get information about 'robot'(another PC inside a robot with Ubuntu16.04) with Ros kinetic. In addition to this, there is a connection via WLAN that connects the 'robot' to external Router2 . In this case, Router2 has a PC connected via Ethernet and the 'robot' via WLAN. Of course, assets connected to Router2 have other IP due to having in another network (192.168.1.0/24).
To simplify a bit, the name robot refers to the pc that has a certain robot with Kinetic ROS incorporated.

Here a scheme to clarify the network scheme:

image description

Recently, I have consulted other posts about this problem like

In these posts, some users suggest to use sudo route add -net ETHERNET_NETWORK_IP netmask ETHERNET_NETWORK_MASK gw ROBOT_PC_IP, but unfortunately, I have not been able to fix it.

The test performed:

  1. PC(192.168.1.130) ping to motherboard (192.168.1.135) OK , also in reverse OK
  2. In PC(192.168.1.130):

    export ROS_MASTER_URI=http://192.168.1.135:11311
    export ROS_IP=192.168.1.130
    

Then, I can list the topics of 'motherboard' from my PC, but when I try to launch the command rostopic echo «topic» I don't receive nothing, but If I connect via ssh to 'motherboard'(robot) and launch that command I receive information. When I write the following command in 'motherboard': rostopic info «topic»

    rostopic info /counter 
    Type: std_msgs/Int32
    Publishers: 
     * /counter_publisher (http://192.168.0.200:35115/)
    Subscribers: 
     * /rostopic_8672_1565641783401 (http://192.168.0.200:43663/)

Does anyone have any idea about how to fix this problem or another test that I can make?

Thank you in advance.

edit retag flag offensive close merge delete