Connext DDS Python API

6 posts / 0 new
Last post
Offline
Last seen: 1 year 7 months ago
Joined: 01/07/2021
Posts: 9
Connext DDS Python API

We're using rti_connect_dds-6.0.1 (modern C++) and are looking into the python API, mainly for test purposes. So we are currently trying to figure out which one of the two available options to go for:

1. RTI Connector for Python: https://community.rti.com/static/documentation/connector/current/api/python/index.html
2. Connext DDS Python API: https://community.rti.com/static/documentation/connext-dds/6.0.1/api/connext_dds/api_python/index.html 

From usability point of view I think we would prefer the latter since it's more similar to the modern C++ API and we can do more things programatically in python instead of expressing it in xml. The docs also states that

 

This is the Python API for RTI® Connext® DDS.

As an experimental product, this API documentation is less comprehensive than the documentation for the other language APIs. We assume you are already familiar with Connext DDS and at least one of the other language APIs. You can check out the RTI Community for the Connext DDS Getting Started Guide, User’s Manual and the reference for the C, C++, Java, and .NET APIs.

RTI also provides RTI Connector, a limited, simpler API for Python® and JavaScript. RTI Connector for Python is production-ready and easier to use, but the Connext DDS Python API is more extensive. 

 

So the Connext DDS Python API seems to be more extensive but also less mature than the RTI Connector so the question is basically if it's mature enough to start using (for test purposes)? Any input, recommendations, experiences from the Connext DDS Python API etc is appreciated.

 

Offline
Last seen: 1 year 4 months ago
Joined: 08/24/2017
Posts: 2

As you say, Connext DDS Python API is an experimental product so, importantly, should not be used for production projects/products. It's experimental status does mean however that it is constantly maturing (for example, the last update to the git repo was only a few days ago).
Experimental (RTI Labs) products can be used for test purposes. In the case of Connext DDS Python API it will allow you to use a number of features that are not possible within Python Connector such as dynamically updated content filters, topic queries and certain QoS modifications at runtime.
Feel free to contact me (ptingey@) directly for more information about the Connext DDS Python API.

Marc.Chiesa's picture
Offline
Last seen: 2 years 1 month ago
Joined: 07/24/2017
Posts: 32

Hi Christian,

The Connext DDS Python API is definitely mature enough to use for testing purposes. Depending on what you need to do in your testing, Connector may be both easier to get started with and sufficient from a feature standpoint. The Python API provides access to many APIs that are not available when using Connector, but Connector is easily installed from PyPI using pip and is capable of covering most basic use cases. To use the Python API you would need to build a wheel for the target platform from our github repo.

Note that because the Python API is experimental any questions that come up during evaluation should be raised on these community forums.

Regards,

Marc

Offline
Last seen: 1 year 7 months ago
Joined: 01/07/2021
Posts: 9

Thanks for your input! We'll give the new Connext DDS Python API a try.

BR,

Christian

Offline
Last seen: 1 month 2 weeks ago
Joined: 05/02/2023
Posts: 4

Can I use instances with the Python API?   Any idea why, with the code below, I get an exception:  "AttributeError: 'Sample' object has no attribute 'guid'"

     reader = dds.DataReader(read_condition.data_reader)

     samples = reader.read()

     for sample in samples:
          if sample.info.valid:

          # get the key value(s)
          instance = reader.lookup_instance( sample)

 

 

Offline
Last seen: 1 month 2 weeks ago
Joined: 05/02/2023
Posts: 4

I resolved this issue by passing sample.data to reader.lookup_instance()

     reader = dds.DataReader(read_condition.data_reader)

     samples = reader.read()

     for sample in samples:
          if sample.info.valid:

          # get the key value(s)
          instance = reader.lookup_instance( sample.data)