ROS2 Router: Service Call Request made, but no Response

Hello,

I have a setup with husarnet and ros2 router. I am able to have ros2 communication over husarnet: I can run the talker-listener example on different devices and filter out topics via the router so I only see relevant topics on the other device, however when I make a service call from one device on the husarnet to another the request gets sent, service successfully executes, while the response doesn’t get received back.

My setup is with two devices connected over husarnet.

  • Device 1 (server) has two docker containers running:
    dev1-app (cyclonedds used, husarnet installed here, network_mode=host)
    dev1-ros2router (network_mode=host)
  • Device 2 (client) has three docker containers running:
    dev2-husarnet (ipc: shareable)
    dev2-app (cyclonedds used, network_mode=service:husarnet, ipc: service:husarnet)
    dev2-ros2router (network_mode=service:husarnet, ipc: service:husarnet)

filter.yaml on both ros2 routers:
allowlist:
- name: “rt/*”
- name: “rr/*”
- name: “rq/*”
- name: “rs/*”
- name: “rp/*”
- name: “ra/*”

Observed Behavior:
Device 1:
ros2 run demo_nodes_cpp add_two_ints_server
[INFO] [1708606668.513606241] [add_two_ints_server]: Incoming request
a: 2 b: 3

Device 2:
ros2 run demo_nodes_cpp add_two_ints_client
(…hangs…)

Expected Behavior:
Device 1:
ros2 run demo_nodes_cpp add_two_ints_server
[INFO] [1708606668.513606241] [add_two_ints_server]: Incoming request
a: 2 b: 3

Device 2:
ros2 run demo_nodes_cpp add_two_ints_client
[INFO] [1708606668.514139916] [add_two_ints_client]: Result of add_two_ints: 5

What can I do to receive ros2 service call responses back on device 2?

Hi @kalin,

You need to add a wildcard character after rq/* and rr/* to enable service communication for all services.

Best,
Dominik

Thanks for the fast reply @dominik! Yes I have the wildcard character in my config (I hadn’t rendered it properly on this discussion, now it’s fixed.).

In addition to not receiving responses, I notice that I do not see a node when running ros2 run demo_nodes_cpp even_parameters_node.

That is the node is not reachable by the client and ros2 node list doesn’t show the /even_parameters_node.
Interestingly, when I run the add_two_ints_server demo, I do see the service on the client.

The filter on both the server and client allows all traffic through (the 6 wildcards above).

Can you create a minimal Docker based setup in a github repo allowing me to replicate the issue on my end?

@dominik, Here is my repo with a docker setup that reproduces the issue I am having. It is based on your ros2 router lan bridge demo.

Note that one of my machines is an AWS EC2 instance (the listener) and the other is my local computer (the talker). I disabled firewall on both and I opened up port 11811 to both UDP and TCP traffic on ipv4 and ipv6 on the EC2 if that matters. I don’t think that should matter, but I wanted to remove all possible problems. Could you let me know if there is any special network config that should be done on the EC2?

Hi @kalin , I have just created my own github repo with the minimal setup with ROS 2 topics and ROS 2 services communicating over Husarnet with ROS 2 Router. Everything is purely Docker based.

Please check it out and let me know how it works on your end.

Best,
Dominik

Thank you for giving me the example, @dominik. It works on my end, however when I try to use cycloneDDS (which is not the default DDS for humble) instead of your example with iron the example no longer works. It does work if I use fastrtps with humble instead.

I assume that ros2 router only routs the fastrtps, but I could be wrong. Is there a way to configure ros2 router to route cycloneDDS for Humble? Or is it that I need some extra configuration elsewhere to make this work?

UPDATE: I also tried to explicitly use cycloneDDS with iron and it still did not work (before I thought iron would use cycloneDDS by default, but turns out it used fastrtps in your example) .

Hi @dominik, I have tested different combinations of ros2router versions. It never works with fully. Sometimes I can get a cyclonedds talker and cyclonedds listener to communicate if I have a separate fastrtps talker publishing. I found GitHub - husarion/dds_bridge and was wondering if that can be configured to make it possible to transmit CycloneDDS data over ros2router and route it properly?

Hi @kalin ,

Basically there are three ways of connecting ROS 2 powered devices over the Internet with Husarnet VPN:

a) Using ros2router: ROS 2 Router for Remote Robotics and Topic Filtering | Husarnet
b) Using husarnet-dds binary: Introducing Husarnet-DDS | Husarnet
c) Manual DDS xml config file setup: Using Husarnet & ROS 2 | Husarnet

I have tried husarnet/ros2router Docker image (that uses GitHub - eProsima/DDS-Router: The DDS Router is an application developed by eProsima that allows, using Fast DDS, to communicate by DDS protocol different networks. Looking for commercial support? Contact info@eprosima.com) with ROS 2 node running Cyclone, and on my end (for some reason that i will check) it doesn’t work.

I will investigate the issue, because there shouldn’t be any issues in connecting Cyclone and FastDDS over VPN. I have just created a demo using husarnet-dds (so no ros2router) where we’re connecing two ROS 2 nodes running different DDS implementations and it just works: GitHub - DominikN/different-dds-demo: Connecting Cyclone DDS and Fast DDS powered ROS 2 nodes over the internet. Please note that the base Docker image we’re using is husarnet/ros:humble-ros-core that already contains the husarnet-dds binary. You can find the source code of this image here: GitHub - husarnet/ros-docker: ROS docker images with built-in configs for Husarnet VPN

The simplest way of solving your issues might be switching to Fast DDS only. Have you considered that?

Thank you for looking into the issue! Let me know if you are able to resolve this. I also reached out to eProsima, but still haven’t received a response). For my setup I can’t just use FastDDS because we are tied to the CycloneDDS middleware for our purposes.

One note on the setup you provided is that while the talker-listener demo works, a service call doesn’t work (where the server and client have different dds: fastrtps and cyclonedds) - this is the original issue I observed in this thread (response is received and executes correctly, but request hangs and in this case outputs an error message):

  • Server running with cyclonedds:
root@2fa289b8c85d:/ros2_ws# ros2 run demo_nodes_cpp add_two_ints_server 
1709557536.624367 [0] add_two_in: config: //CycloneDDS/Domain/General: 'NetworkInterfaceAddress': deprecated element (file:///var/tmp/husarnet-cyclone.xml line 6)
[INFO] [1709557544.864836911] [add_two_ints_server]: Incoming request
a: 0 b: 0
  • Client running with fastrtps:
root@c5c53adaff52:/ros2_ws# RMW_IMPLEMENTATION=rmw_fastrtps_cpp ros2 run demo_nodes_cpp add_two_ints_client
[INFO] [1709557541.329421317] [add_two_ints_client]: service not available, waiting again...
[INFO] [1709557542.329963278] [add_two_ints_client]: service not available, waiting again...
[INFO] [1709557543.330158756] [add_two_ints_client]: service not available, waiting again...
[INFO] [1709557544.330408269] [add_two_ints_client]: service not available, waiting again...
2024-03-04 13:05:44.827 [RTPS_READER_HISTORY Error] Change payload size of '28' bytes is larger than the history payload size of '15' bytes and cannot be resized. -> Function can_change_be_added_nts
(...hangs...)

I have since switched from the eProsima fastDDS-based ros2router to using the eclipse cycloneDDS-based zenoh and its router and bridge configurations to achieve the desired functionality.

In case anyone is interested in using Husarnet + ROS2 + CycloneDDS, here is an example that works with zenoh:

Hi @kalin,

With the husarnet/ros2router:1.9.1 Docker image Fast DDS <> Cyclone DDS communication works fine. Version 1.9.0 was based on Fast DDS v2.13.1 that had compatibility issues with Cyclone. Fast DDS v2.13.2 used in 1.9.1 works fine.

I have updated the demo: GitHub - DominikN/ros2router-service-test

Please let me know how it works on your end.