RTI Python Connector Error: Failed to create Output:

5 posts / 0 new
Last post
Offline
Last seen: 1 year 4 months ago
Joined: 11/23/2021
Posts: 32
RTI Python Connector Error: Failed to create Output:

Hi @all,

I am actually implementing a little example using DDS Connector for Python.
I have created two DataWriters in the XML file which looks like the follows:

<!-- Domain Library -->
<domain_library name="MyDomainLibrary">
  <domain name="MyDomain" domain_id="0">
      <register_type name="ProximityDataType" type_ref="ProximityData"/>
      <register_type name="DeviceStatusType" type_ref="DeviceStatus"/>
      <topic name="Proximity Data" register_type_ref="ProximityDataType"/>
      <topic name="Device Status" register_type_ref="DeviceStatusType"/>
  </domain>
</domain_library>
<!-- Domain Participant Library-->
<domain_participant_library name="MyParticipantLibrary">
  <domain_participant name="MyPubParticipant" domain_ref="MyDomainLibrary::MyDomain">
      <publisher name="MyPublisher">
          <data_writer name="DeviceStatusDataWriter" topic_ref="Device Status" />
          <data_writer name="ProximityDataWriter" topic_ref="Proximity Data" />
      </publisher>
  </domain_participant>

However if I try to get the output like the follows in my application:

proximity_data = connector.get_output("MyPublisher::ProximityDataWriter")
device_status = connector.get_output("MyPublisher::DeviceStatusDataWriter")

I get the following error:

    raise Error("Failed to create " + entity_name + ": "
rticonnextdds_connector.rticonnextdds_connector.Error: Failed to create Output:

Has somebody any idea what the problem here is?
Thanks in advance.

Regards

Marc

 

 

 

 

 

 

 

Offline
Last seen: 3 weeks 4 hours ago
Joined: 10/22/2018
Posts: 91

Hi, please can you provide the full output of the console? And how you are creating the connector object too.

Thanks,
Sam

Offline
Last seen: 1 year 4 months ago
Joined: 11/23/2021
Posts: 32

Hi Sam,

Full output of console:

Traceback (most recent call last):
  File "C:/...../.../proximity_sensor.py", line 27, in <module>
    device_status = connector.get_output("MyPublisher::DeviceStatusDataWriter")
  File "C:\....\rticonnextdds_connector\rticonnextdds_connector.py", line 1295, in get_output
    return Output(self, output_name)
  File "C:\.....\...\rticonnextdds_connector.py", line 1107, in __init__
    _check_entity_creation(self.native, "Output")
  File "C:\........\....\rticonnextdds_connector.py", line 92, in _check_entity_creation
    raise Error("Failed to create " + entity_name + ": "
rticonnextdds_connector.rticonnextdds_connector.Error: Failed to create Output:

The connector object is created like follows:

with rti.open_connector(
        config_name="MyParticipantLibrary::MyPubParticipant",
url="ViltSystemDesign.xml") as connector:

Regards,

Marc

Offline
Last seen: 3 weeks 4 hours ago
Joined: 10/22/2018
Posts: 91

What version of Connector are you using?

I tried to reproduce your issue, here is the XML I am using (it is named ShapeExample.xml):


<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="https://community.rti.com/schema/current/rti_dds_qos_profiles.xsd">

    <types>
        <struct name="ProximityData" extensibility="extensible">
            <member name="x" type="long"/>
            <member name="y" type="long"/>
        </struct>
        <struct name="DeviceStatus" extensibility="extensible">
            <member name="x" type="long"/>
            <member name="y" type="long"/>
        </struct>
    </types>
    <domain_library name="MyDomainLibrary">
        <domain name="MyDomain" domain_id="0">
            <register_type name="ProximityDataType" type_ref="ProximityData"/>
            <register_type name="DeviceStatusType" type_ref="DeviceStatus"/>
            <topic name="Proximity Data" register_type_ref="ProximityDataType"/>
            <topic name="Device Status" register_type_ref="DeviceStatusType"/>
        </domain>
  </domain_library>
  <domain_participant_library name="MyParticipantLibrary">
        <domain_participant name="MyPubParticipant" domain_ref="MyDomainLibrary::MyDomain">
            <publisher name="MyPublisher">
                <data_writer name="DeviceStatusDataWriter" topic_ref="Device Status" />
                <data_writer name="ProximityDataWriter" topic_ref="Proximity Data" />
            </publisher>
        </domain_participant>
        <domain_participant name="MySubParticipant" domain_ref="MyDomainLibrary::MyDomain">
            <subscriber name="MySubscriber">
                <data_reader name="DeviceStatusDataReader" topic_ref="Device Status" />
                <data_reader name="ProximityDataReader" topic_ref="Proximity Data" />
            </subscriber>
        </domain_participant>
    </domain_participant_library>
</dds>

 Then in my reader.py I do:

with rti.open_connector(
        config_name="MyParticipantLibrary::MySubParticipant",
        url=file_path + "/../ShapeExample.xml") as connector:

    input = connector.get_input("MySubscriber::ProximityDataReader")

and in writer.py:

with rti.open_connector(
        config_name="MyParticipantLibrary::MyPubParticipant",
        url=file_path + "/../ShapeExample.xml") as connector:

    output = connector.get_output("MyPublisher::ProximityDataWriter")

And there are no errors creating the entities or receiveing data. Can you see any difference between what I am doing and what you are doing?

Offline
Last seen: 1 year 4 months ago
Joined: 11/23/2021
Posts: 32

Hi,

Thanks for your help!
after implementing your example I noticed that there is a problem wiith the QoS Settings because without QoS settings it was running.
After deleting the publication name out of the QoS settings the error disappeared.

<publication_name>
    <name>ProximityDataWriter</name>
</publication_name>

Regards,

Marc