Husarnet + FastDDS Discovery Server cannot list topics

Hi,

I’ve tried following the Discovery Server + Husarnet tutorial tutorial, and I can see the messages if I run ros2 run demo_nodes_cpp listener, but I can never list the topics with ros2 topic list. Neither can I with ros2 topic echo /chatter.

I already created an issue more than a month ago, and today I just added a new comment there (ros2 topic list does not show /chatter on Docker Container (only shows /rosout and /parameter_events) · Issue #2 · DominikN/fastdds-discovery-server-demo · GitHub), but I could not get an answer yet (and that is why I’m coming here).

Is there any working example of how to make ros2 topic list work when using Husarnet + FastDDS Discovery Server?

I look forward to hearing from you.

cc: @dominik, @ympek

Hi @ralves ,

That’s a normal behaviour of FastDDS Discovery Server. It limits discovery traffic, so not all topic discovery information is available on every node (like in standard multicasting based DDS discovery).

They have created a solution for that called a Super Client configuration.

Read more about that in the official FastDDS documentation.

Please let me know while you solve your issues.

Best,
Dominik

Hi @dominik,

Thank you for mentioning Super Client.

I remember testing Super Client a while ago, but since it overrides the FASTRTPS_DEFAULT_PROFILES_FILE variable that is set by Husarnet to use a file different from the one used by Husarnet, I assumed back then that Husarnet + Super Client would never work together. You could only have one or another, not both.

But after reading your answer above, it came to my mind that I could possibly merge both files(Husarnet with Discovery Server + Super Client). I then tried this but I don’t know which settings I really need.

I tried many different combinations of params on fastdds_server.xml and fastdds_client.xml provided by Husarnet, but none of my combinations worked.

My last fastdds_server.xml looks like this:

<?xml version="1.0" encoding="UTF-8" ?>
<dds>
    <profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">

        <transport_descriptors>
            <transport_descriptor>
                <transport_id>udpv6_transport</transport_id>
                <type>UDPv6</type>
            </transport_descriptor>
        </transport_descriptors>

        <participant profile_name="server_profile" is_default_profile="true">
            <rtps>
                <userTransports>
                    <transport_id>udpv6_transport</transport_id>
                </userTransports>
                <useBuiltinTransports>false</useBuiltinTransports>
                <prefix>44.49.53.43.53.45.52.56.45.52.5F.31</prefix>
                <builtin>
                    <discovery_config>
                        <discoveryProtocol>SERVER</discoveryProtocol>
                    </discovery_config>
                    <metatrafficUnicastLocatorList>
                        <locator>
                            <udpv6>
                                <address>dds-discovery-server</address>
                                <port>11811</port>
                            </udpv6>
                        </locator>
                    </metatrafficUnicastLocatorList>
                </builtin>
            </rtps>
        </participant>

        <!-- Super Client -->

        <participant profile_name="super_client_profile" is_default_profile="false">
            <rtps>
                <userTransports>
                    <transport_id>udpv6_transport</transport_id>
                </userTransports>
                <useBuiltinTransports>false</useBuiltinTransports>
                <prefix>44.49.53.43.53.45.52.56.45.52.5F.31</prefix>

                <builtin>
                    <discovery_config>
                        <discoveryProtocol>SUPER_CLIENT</discoveryProtocol>
                        <discoveryServersList>
                            <RemoteServer prefix="44.53.00.5f.45.50.52.4f.53.49.4d.41">
                                <metatrafficUnicastLocatorList>
                                    <locator>
                                        <udpv6>
                                            <!-- <address>talker2</address> -->
                                            <address>fc94:9953:2a47:60c:8c5e:7d85:aa7f:4ba5</address>
                                            <port>11811</port>
                                        <udpv6>
                                    </locator>
                                </metatrafficUnicastLocatorList>
                            </RemoteServer>
                        </discoveryServersList>
                    </discovery_config>
                </builtin>
            </rtps>
        </participant>
    </profiles>
</dds>

And my last fastdds_client.xml is like this:

<?xml version="1.0" encoding="UTF-8" ?>
<dds>
    <profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">

        <transport_descriptors>
            <transport_descriptor>
                <transport_id>udpv6_transport</transport_id>
                <type>UDPv6</type>
            </transport_descriptor>
        </transport_descriptors>

        <participant profile_name="client_profile" is_default_profile="true" >
            <rtps>
                <userTransports>
                    <transport_id>udpv6_transport</transport_id>
                </userTransports>
                <useBuiltinTransports>false</useBuiltinTransports>
                <builtin>
                    <discovery_config>
                        <discoveryProtocol>CLIENT</discoveryProtocol>
                        <discoveryServersList>
                            <RemoteServer prefix="44.49.53.43.53.45.52.56.45.52.5F.31">
                                <metatrafficUnicastLocatorList>
                                    <locator>
                                        <udpv6>
                                            <address>dds-discovery-server</address>
                                            <port>11811</port>
                                        </udpv6>
                                    </locator>
                                </metatrafficUnicastLocatorList>
                            </RemoteServer>
                        </discoveryServersList>
                    </discovery_config>
                </builtin>
            </rtps>
        </participant>

        <participant profile_name="super_client_profile" is_default_profile="false">
            <rtps>
                <userTransports>
                    <transport_id>udpv6_transport</transport_id>
                </userTransports>
                <useBuiltinTransports>false</useBuiltinTransports>

                <builtin>
                    <discovery_config>
                        <discoveryProtocol>SUPER_CLIENT</discoveryProtocol>
                        <discoveryServersList>
                            <RemoteServer prefix="44.53.00.5f.45.50.52.4f.53.49.4d.41">
                                <metatrafficUnicastLocatorList>
                                    <locator>
                                        <udpv6>
                                            <address>talker2</address>
                                            <port>11811</port>
                                        <udpv6>
                                    </locator>
                                </metatrafficUnicastLocatorList>
                            </RemoteServer>
                        </discoveryServersList>
                    </discovery_config>
                </builtin>
            </rtps>
        </participant>
    </profiles>
</dds>

I already tried providing the device name (talker2) and also the IPV6 for the address of the Super Client, but it never works.
When launching compose.discovery-server.yaml or compose.talker.yaml, for example, I always get an error like this:

listener-discovery-server_1  | Ready to launch ROS 2 nodes
listener-discovery-server_1  | 2022-09-16 23:25:26.135 [XMLPARSER Error] Error opening '/fastdds_server.xml' -> Function loadXML
listener-discovery-server_1  | 2022-09-16 23:25:26.135 [XMLPARSER Error] Error parsing '/fastdds_server.xml' -> Function loadXMLFile
listener-discovery-server_1  | 2022-09-16 23:25:26.138 [SERVER_CLIENT_DISCOVERY Error] Wrong locator passed into the server's list "fc94:9953:2a47:60c:8c5e:7d85:aa7f:4ba5:11811" -> Function load_environment_server_info
listener-discovery-server_1  | ### Server is running ###
listener-discovery-server_1  |   Participant Type:   SERVER
listener-discovery-server_1  |   Server ID:          0
listener-discovery-server_1  |   Server GUID prefix: 44.53.00.5f.45.50.52.4f.53.49.4d.41
listener-discovery-server_1  |   Server Addresses:   UDPv4:[0.0.0.0]:11811
listener-discovery-server_1  | 2022-09-16 23:25:26.282 [XMLPARSER Error] Error opening '/fastdds_server.xml' -> Function loadXML
listener-discovery-server_1  | 2022-09-16 23:25:26.282 [XMLPARSER Error] Error parsing '/fastdds_server.xml' -> Function loadXMLFile
listener-discovery-server_1  | 2022-09-16 23:25:26.283 [SERVER_CLIENT_DISCOVERY Error] Wrong locator passed into the server's list "fc94:9953:2a47:60c:8c5e:7d85:aa7f:4ba5:11811" -> Function load_environment_server_info
husarnet-discovery-server_1  | ...
husarnet-discovery-server_1  | done
husarnet-discovery-server_1  | 
husarnet-discovery-server_1  | [step 3/3] Joining to Husarnet network

So my final questions are:

Please forgive my ignorance. I’m not versed in DDS, let alone Husarnet + Discovery Server + Super Client.

Hi @ralves, good news: I have prepared a working demo with a Discovery Server and a Super Client DDS config.

Check it out here: https://github.com/DominikN/discovery-server-superclient-demo

It is a basic talker-listener demo. The Talker node is running on a device (Docker container) with a Discovery Server DDS config, and the Listener node is running on a device (Docker container) with a Super Client DDS config.

After you enter the shell of a Docker container running the Listener you can execute

ros2 topic list

and see all available topics - the same way as you used to with a standard multicasting based DDS discovery.

Best,
Dominik

HI @dominik,

thank you very much for the working example of Discovery Server + Super Client.

I tested it here and it seems to be working nice.

I tried running on the first PC:

  • Discovery Server
  • Super Client
  • Talker
  • Listener

Everything was working nicely. Then I went to a second PC, and I ran:

  • Listener
  • Then, in another terminal, “ros2 topic list” and “ros2 topic echo /chatter”.

Everything seemed to work also. Then I restarted the Talker on the first PC, but then I could no longer see the topics. But ok, maybe it is because I’m already a bit tired. I’ll give it another try perhaps tomorrow and let you know how it goes.

In any case, thank you very much for providing the working example.

Hi @dominik,

I’ve been doing more tests and things are working really smoothly as far as my tests go.

Tomorrow I’ll be working on integrating it into our system, and testing it more extensively next week.

Once again, thank you very much for the working example.

1 Like