ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Some ROS nodes not communicating remotely through vpn

asked 2020-07-17 08:13:10 -0600

Gowresh gravatar image

updated 2022-02-18 08:19:18 -0600

I have two remote systems connected through Hamachi vpn. System 1 is the master and System 2 is the slave. When I roslaunch some nodes in master, I am able to see the topics through rostopic list. I am able to rostopic echo some topics. But there are some topics that I am not able to echo or subscribe to. When I echo these topics, I get no response. Following are my configurations:

System 1 (master)


System 2 (slave)


All the ip addresses have been configured in /etc/hosts as well.

I have a rosserial node running on master with some other nodes(like imu_madgwick_filter and ekf_localization). Of all the nodes I am able to rosnode info only the rosserial node and I am able to rostopic echo only the topics published by rosserial. With all the other nodes, when I rosnode info, I get the following error:

ERROR: Communication with node[http://rosubuntu-desktop:45519/] failed!

This is my launch file:

    <!-- Start ROS communication between the robot's computer and Arduino base -->
    <node   pkg="rosserial_python" name="rosserial" type="" output="screen" respawn="false">

    <!-- IMU relay from linorobot_msgs/Imu to sensor_msgs/Imu -->
    <node  pkg="imu_calib" type="apply_calib" name="apply_calib" output="screen" respawn="false">
        <param name="calib_file" value="$(find imu_calib)/param/imu_calib.yaml" />
        <param name="calibrate_gyros" value="true" />

    <!-- Filter and fuse raw imu data -->
    <node  pkg="imu_filter_madgwick" type="imu_filter_node" name="imu_filter_madgwick" output="screen" respawn="false" >
        <param name="fixed_frame" value="base_footprint" />
        <param name="use_mag" value="false" />
        <param name="publish_tf" value="false" />
        <param name="use_magnetic_field_msg" value="true" /> 
        <param name="world_frame" value="enu" />
        <param name="orientation_stddev" value="0.05" />

    <!-- Publish static transform from base_footprint to imu_link -->
    <node  pkg="tf2_ros" type="static_transform_publisher" name="base_footprint_to_imu_link" args="0 0 0 0 0 0  /base_footprint /imu_link"/>

    <!-- Linear odom from imu -->
    <node  pkg="imu_calib" name="odom" type="" output="screen" respawn="false">
    <!-- Odom-IMU Extended Kalman Filter-->
    <node  pkg="robot_localization" type="ekf_localization_node" name="ekf_localization"> 

        <rosparam command="load" file="$(find imu_calib)/param/ekf_localization.yaml" /> 

So my question is why is it that one node can successfully communicate across networks but other nodes cannot? How can I solve this?


The problem was solved by changing the host names as follows:

  1. In Master, ROS hostname should always be resolved as the desktop name pointing to localhost.

    export ROS_MASTER_URI=http://localhost:11311


    export ROS_MASTER_URI-http://rosubuntu-desktop:11311 #rosubuntu-desktop in hosts

  2. In slave hosts should contain the VPN IP of the master in its name

PS: OpenVPN worked better tha Hamachi

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-05-01 08:47:39 -0600

rafix89 gravatar image

updated 2021-05-01 08:52:41 -0600

Hello if up to date

System 1 (master) ROS_MASTER_URI= ROS_IP=

System 2 (slave) ROS_MASTER_URI= ROS_IP=

set yourself like this

edit flag offensive delete link more

Question Tools



Asked: 2020-07-17 08:13:10 -0600

Seen: 697 times

Last updated: Feb 18 '22