Search code examples
data-distribution-service

RTI DDS creating own data types


I am working on a .Net example where I define my own data type using RTI Connext DDS.

Instead of creating the application from the beginning, I got help from the source code of the hello_world_xml_dynamic example in rti_workspace directory. I have made several changes to the USER_QOS_PROFILES.xml file to create my own data type and changes its name to MY_PROFILES.xml

But when I compile the application and run it from the command line, I get the following error:

DDS_DomainParticipantFactory_create_participant_from_config_w_paramsI:ERROR: Profile library 'MyParticipantLibrary::PublicationParticipant' not found
! Unable to create DDS domain participant

The line of code that catching the error:

if (this.participant == null)
{
this.participant = DDS.DomainParticipantFactory.get_instance().
create_participant_from_config(
"MyParticipantLibrary::PublicationParticipant");
if (this.participant == null)
{
Console.Error.WriteLine("! Unable to create DDS domain participant");
return;
}
}

this is the configuration file MY_PROFILES.xml :

<!--
RTI Data Distribution Service Deployment
-->
<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/6.0.1/rti_dds_profiles.xsd">

    <!-- Qos Library -->
    <qos_library name="qosLibrary">
        <qos_profile name="DefaultProfile">
        </qos_profile>
    </qos_library>

    <!-- types -->
    <types>  
        <struct name="FlightData">
            <member name="Latitude"  type="double"/>
            <member name="Longitude" type="double"/>
            <member name="Altitude"   type="double"/>
        </struct>
    </types>

    <!-- Domain Library -->
    <domain_library name="MyDomainLibrary" >

        <domain name="FlightDataDomain" domain_id="0">
            <register_type name="FlightDataType"
                           type_ref="FlightData" />
            <topic name="FlightDataTopic"
                   register_type_ref="FlightDataType">
                <topic_qos name="FlightData_qos"
                           base_name="qosLibrary::DefaultProfile"/>
            </topic>
        </domain>
    </domain_library>

    <!-- Participant library -->
    <domain_participant_library name="MyParticipantLibrary">

        <domain_participant name="PublicationParticipant"
                            domain_ref="MyDomainLibrary::FlightDataDomain">
            <publisher name="MyPublisher">
                <data_writer name="FlightDataWriter"
                             topic_ref="FlightDataTopic"/>
            </publisher>
        </domain_participant>

        <domain_participant name="SubscriptionParticipant"
                            domain_ref="MyDomainLibrary::FlightDataDomain">
            <subscriber name="MySubscriber">
                <data_reader name="FlightDataReader"
                             topic_ref="FlightDataTopic">
                    <datareader_qos name="FlightData_reader_qos"
                                    base_name="qosLibrary::DefaultProfile"/>
                </data_reader>
            </subscriber>
        </domain_participant>

    </domain_participant_library>

</dds>

where am i making a mistake?


Solution

  • Your XML file looks correct. From the 'not found' error message, it seems that you may not have taken the right steps to instruct your application to load that profiles-file MY_PROFILES.xml to actually learn about your desired Participant. You can easily verify that this is the case by introducing an error in your XML file (for example by incorrectly renaming one tag) and rerun your application. If it does not complain about the syntax or schema of the XML, then your file did not get loaded and this hypothesis is correct.

    If that turns out to be your problem indeed, then you have several options to fix that. They are listed in the User's Manual section 18.5 How to Load XML-Specified QoS Settings.