Communication between remote ROS2 nodes using OpenVPN

I am trying to listen to a topic published by my robot on my host machine.

My setup is as follows:
Robot: ROS2 Foxy on Ubuntu 20.04
Host: ROS2 Galactic on Ubuntu 20.04

Both the host and the robot are connected to an OpenVPN server and I can ping/ssh from any one of them to the other when OpenVPN is running.

The VPN uses tun0 interface on both the robot and the host and the IP addresses of the host machine and the robot are 10.8.70.4 and 10.8.70.6 respectively.

My problem is that published topics on any of the machines don’t get discovered by the other machine.

Do I have to set the DDS network interface on both FastDDS and CyclonDDS sides to use tun0? Or do they publish on all interfaces by default? If so, how shall I do that?

Is the issue related to OpenVPN? Do I need to modify the default OpenVPN server communication so that my nodes can discover each other over the VPN?

Best regards

Have you tried setting the ROS middleware layer on the robot and host to use the same RMW implementation? I use Wireguard, and have no issues with getting the topics working.

# Your env variables would look something like this
RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
export CYCLONEDDS_URI=file:///cyclonedds.xml 
1 Like

+1 to Wireguard. We used that while defining the architecture of FogROS2 [1] [2]. The CycloneDDS-Wireguard combination works well.

You’ve got examples of how to do it programatically within the FogROS 2 source code.


  1. Architecture discussion · Issue #6 · BerkeleyAutomation/FogROS2 · GitHub ↩︎

  2. ROS2 DDS node discovery does not support VPN · Issue #1 · BerkeleyAutomation/FogROS2 · GitHub ↩︎

1 Like

I think cross-distribution communication is not supported as official, see Can nodes from different ROS 2 distributions communicate compatibly? - ROS Answers: Open Source Q&A Forum.

cross-distribution within the same RMW implementation even does not work.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.