Separate definitions of domainParticipants/qosProfiles into 2 XML files

4 posts / 0 new
Last post
Offline
Last seen: 1 year 2 months ago
Joined: 10/06/2021
Posts: 4
Separate definitions of domainParticipants/qosProfiles into 2 XML files

Hi, I'm in the process of porting some existing code from 6.0.1 C++ API to 6.1 C# API.
I've looked through the example project that rtiddsgen 3.1 generates for dotnet5 to get a hang of things, but I'm currently stuck at trying to load 2 separate XML files. One defines the domain participants, while the other defines QOS profiles.

In the original application, I would push the 2 file paths into a string vector before assigning them as qos provider params, like so:

dds::core::StringSeq files;
files.push_back(filePath1);
files.push_back(filePath2);

dds::core::QosProvider provider;
rti::core::QosProviderParams params;

params.url_profile(files);
provider->default_provider_params(params);
participant = provider->create_participant_from_config(...);


In the C# version:

QosProvider provider = new QosProvider(filePath1);
provider.ProviderParams.UrlProfile.Add(filePath2);
participant = provider.CreateParticipantFromConfig(...);

I would get error processing tag 'datareader_qos' when it is processing the xml that contains the domain participants. It seems to be unable to find the corresponding QOS profiles defined in the other XML file.
The creation of the XML application works if I define the QOS profile within the domain participant XML, so I believe it's an issue with how I'm passing in the files to be processed by the QosProvider.

Thanks

 

Howard's picture
Offline
Last seen: 1 week 9 hours ago
Joined: 11/29/2012
Posts: 567

Sorry, without knowing what's in the XML files and then which configuration you're trying to use, it's difficult to assess the problem.  It would also be good to know the actual error message being printed.

Offline
Last seen: 1 year 2 months ago
Joined: 10/06/2021
Posts: 4

XML config for app creation :

<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../schema/rti_dds_profiles.xsd">
<!-- Domain Library -->
<domain_library name="SystemDomainLibrary">
    <domain name="BaseDomain">
        <topic name="StatusUpdate" register_type_ref="DDSStatusUpdate"/>
    </domain>
</domain_library>

<participant_library name="ParticipantLibrary1">
    <domain_participant name="Participant1" domain_ref="SystemDomainLibrary::BaseDomain">
        <data_reader name="StatusUpdateReader" topic_ref="StatusUpdate">
            <datareader_qos base_name="qosLibrary::StatusUpdateQos"/>
        </data_reader>
    </domain_participant>
</participant_library>
</dds>

 XML config for qos profiles : 

<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../schema/rti_dds_profiles.xsd">
    <qos_library name="qosLibrary">
        <qos_profile name="StatusUpdateQos" base_name="BuiltQosLibExp::Generic::BestEffort"/>
    </qos_library>
</dds>

The error message I would get is Parse Error at line 14: Error processing tag 'datareader_qos'
Apologies for not including more details, as I am working in an environment with no network access

Howard's picture
Offline
Last seen: 1 week 9 hours ago
Joined: 11/29/2012
Posts: 567

Well, I suggest that you first confirm that the XML file that contains the QoS Profiles, i.e., the qos_library "qosLibrary", is actually being loaded.

Connext DDS doesn't complain when it doesn't find a file that you've set as one to be loaded.  It only complains when it needs a definition that hasn't been loaded.

So, the best way to test whether a specific file is being loaded by Connext is to create a syntax error in the file.  For example, create a unknown tag without a closing tag.

<aaa>

Then if Connext DDS actually tries to load the file, it will at that time complain and print out an error message.

If it's the case that the file isn't loaded.  Then it's likely how you're adding files to the QosProvider to be loaded.  I see that the way that you did it in C# is different than C++.