Python (Connector) Subscriber - Subscribe to Java Example

3 posts / 0 new
Last post
Offline
Last seen: 7 years 1 month ago
Joined: 10/26/2017
Posts: 2
Python (Connector) Subscriber - Subscribe to Java Example

Hi,

I have been working with the hello_idl example in the rti_workspace->examples->connext_dds->java.

I want to write a subscriber in Python that can listen to the java publisher. But so far I haven't gotten it to work. What do I need to change in the .xml to be able to listen to the java publisher.

I tried to follow the steps in this post: https://community.rti.com/forum-topic/testing-dds-network-python-tests

I get it to work fine with for instance the "hello_world_xml_dynamic" example. Then I can simply use the attached "USER_QOS_PROFILES.xml" . Is there something similair for the hello_idl exmaple? The "USER_QOS_PROFILES.xml" for the hello_idl examples, look totally different, and I can not find the relevant names.

 

 

XML Snapshot

 

Thanks.

Magnus

 

Organization:
ajimenez's picture
Offline
Last seen: 2 years 6 months ago
Joined: 09/29/2017
Posts: 21

Hi Magnus,

I could communicate a publisher running Java and a Subscriber running rticonnextdds-connector.

The XML configuration that I have used in for the Subscriber is:

<!-- types -->
<types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <const name="HELLODDS_MAX_PAYLOAD_SIZE" type="int32" value="8192"/>
    <const name="HELLODDS_MAX_STRING_SIZE" type="int32" value="64"/>
    <struct name= "HelloWorld">
        <member name="prefix" stringMaxLength="HELLODDS_MAX_STRING_SIZE" type="string"/>
        <member name="sampleId" type="int32"/>
        <member name="payload" sequenceMaxLength="HELLODDS_MAX_PAYLOAD_SIZE" type="byte"/>
    </struct>
</types>

  
<!-- Domain Library -->
<domain_library name="MyDomainLibrary">
    <domain name="MyDomain" domain_id="0">
        <register_type name="HelloWorld" type_ref="HelloWorld" />
        <topic name="Hello IDL" register_type_ref="HelloWorld"/>
    </domain>
</domain_library>

<!-- Participant library -->
<domain_participant_library name="MyParticipantLibrary">
    <domain_participant name="Zero" domain_ref="MyDomainLibrary::MyDomain">
        <subscriber name="MySubscriber">
            <data_reader name="MyHelloIDL" topic_ref="Hello IDL" />
        </subscriber>
    </domain_participant>
</domain_participant_library>

Find attached the python subscriber and the XML configuration.

Could you please try it and see if it is working?

In the case that it is not working, please try to check with RTI Administration Console if the topics match or not.

Thank you.
Antonio.

 

Offline
Last seen: 7 years 1 month ago
Joined: 10/26/2017
Posts: 2

Thank you Antonio!

That worked perfectly. I am not so familiar with RTI DDS yet, but thank you for the tip about using the RTI Admin Console, that helped too.

Best regards,

Magnus