Example of using Static EDP (Fast DDS) with ROS 2

asked 2020-09-09 23:22:43 -0500

Seiwert gravatar image

Hey All,

I was curious if anyone has a working example of using the Static Discovery system provided by Fast DDS with ROS 2? I'm trying to get just a simple proof of concept working by attempting to get the Talker Listener demo to make use of it and I'm encountering some issues.

First, here is some of what I've tried so far. Here is my XML profile file :

<?xml version="1.0" encoding="UTF-8"?>
<dds xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
    <profiles>
        <participant profile_name="participant_profile_static_edp" is_default_profile="true">
            <rtps>
                <builtin>
                    <discovery_config>
                        <EDP>STATIC</EDP>
                        <staticEndpointXMLFilename>/mnt/c/Users/adam/Documents/git/network_test/static_publisher.xml</staticEndpointXMLFilename>
                    </discovery_config>
                </builtin>
            </rtps>
        </participant>
        <data_writer profile_name="chatter_writer" is_default_profile="true">
            <topic>
            <userDefinedID>500</userDefinedID>
            <entityID>2</entityID>
        </data_writer>
        <data_reader profile_name="chatter_reader" is_default_profile="true">
            <userDefinedID>3</userDefinedID>
            <entityID>4</entityID>
        </data_reader>
    </profiles>
</dds>

And here is my Static EDP XML:

<staticdiscovery>
    <participant>
        <name>HelloWorldPublisher</name>
        <writer>
            <userId>500</userId>
            <entityID>2</entityID>
            <topicName>chatter</topicName>
            <topicDataType>String</topicDataType>
            <reliabilityQos>RELIABLE_RELIABILITY_QOS</reliabilityQos>
        </writer>
    </participant>
    <participant>
        <name>HelloWorldListener</name>
        <reader>
            <userId>3</userId>
            <entityID>4</entityID>
            <topicName>chatter</topicName>
            <topicDataType>String</topicDataType>
            <reliabilityQos>RELIABLE_RELIABILITY_QOS</reliabilityQos>
        </reader>
    </participant>
</staticdiscovery>

I'm already aware of the Static Discovery examples provided by Fast DDS However, I see some potential problems that may prohibit this from being possible in ROS 2 at all and I'm curious if there are some workarounds. Here is one of my bigger questions:

Static EDP requires some of the properties of the Datawriters and Datareaders to be known to generate the Static EDP XML. How can you associate things such as the userDefinedID to the Static EDP file for say the chatter publisher if ROS 2 is the one generating the Datawriter with it's create_publisher function? (Disclaimer: I am not 100% certain the create_publisher generates a Datawriter but I would assume that is what's going on behind the scenes)

Any additional information on this topic would be greatly appreciated. Thanks!

edit retag flag offensive close merge delete

Comments

Hi! Did you have any success in making a simple working example? if you had, can you please share it?

Lidor Shimoni gravatar image Lidor Shimoni  ( 2020-11-08 06:30:36 -0500 )edit
1

I did not get an example working with in ROS. I was able to get the Fast DDS static example's working though and after evaluating those I realized Static Discovery wouldn't fulfill my needs.

Seiwert gravatar image Seiwert  ( 2020-11-08 12:49:38 -0500 )edit

Hi! were you able to get any progress with the working of the static discovery?

bishaljais gravatar image bishaljais  ( 2021-03-11 22:57:17 -0500 )edit