rticonnextdds-connector python3 problems

11 posts / 0 new
Last post
Offline
Last seen: 3 months 1 day ago
Joined: 03/26/2019
Posts: 4
rticonnextdds-connector python3 problems

Hey there, 

I'm trying to create a testing application for some of our systems and I'm using the python connector to implement it. I've been successful reading and pubishing data using the connector with python2.7, but when I try to use it with python3 I can't seem to ever get a valid sample. No errors are displayed but no data is ever received. 

According to the github the connector should support Python 3.6, but I seem to be having no luck getting it to work. Any help would be appreciated.

Thanks!

gianpiero's picture
Offline
Last seen: 5 months 2 weeks ago
Joined: 06/02/2010
Posts: 174

Hello Andrew,

Thank you for writing about your issue with the Python Connector. I just run the simple/writer.py and simple/reader.py that we have on github [here] and it seems to work. I am on a mac with python 3.6. 

Can you verify if the simple example works for you?

Best,
   Gianpiero

Offline
Last seen: 3 months 1 day ago
Joined: 03/26/2019
Posts: 4

Hi Gianpiero,

Sorry for the delayed response. It seems that there was a version mismatch between python 2 and 3. Python 2 was using the 0.3.3 version of the connector while Python3 was using 0.4.4. When I installed the 0.3.3 version for python 3 it seemed to work fine. Not sure what was causing the issue in the new version.

Regards,

Andrew

Offline
Last seen: 5 months 2 weeks ago
Joined: 04/04/2019
Posts: 2

Hello,

I am coming across a similar issue trying to test our system. I am using Python 2.7.15, and when I use 0.3.3 in my tool, I am able to read samples published by our system no problem. If I use version 0.4.4 in my tool however, the samples are not read. The one exception to this is when I use 0.3.3 first, stop my tool that uses the rti connector, install 0.4.4, and use the tool again. Then, for a minute or two, the tool is able to read the samples published by our system, then later fails to read any samples. The xml file I use doesn't change at all. 

I also made a simple reader and writer program similar to the Shapes example, only using the xml file for our system. When the samples are published by the simple writer, the reader is able to pick them up. It seems that 0.4.4 is causing some issues with the communication between connector and the samples published by our system?

Regards,

Daniel

 

gianpiero's picture
Offline
Last seen: 5 months 2 weeks ago
Joined: 06/02/2010
Posts: 174

Hello there,

@andrewindoe: glad you solved the issue. 

 @minad

As I mention in github:

There should not be difference between the two versions when it comes to receive samples. Be aware that now when you iterate through sample you have to start from 0 so old code may miss the first sample and go one over and crash.

Beside that, is what you call "our system" a c-system? Is it compiled against Connext 6? (Connector >= 0.4) is based on the new Connext 6.  You can look at this migration guide to learn more about compatibility between versions: 

https://community.rti.com/static/documentation/connext-dds/6.0.0/doc/manuals/migration_guide/index.html

I hope this helps,

 Gianpiero

Offline
Last seen: 5 months 2 weeks ago
Joined: 04/04/2019
Posts: 2

Hello,

Our system is written in traditional C++. It uses RTI 5.2.0. Is 0.4.4 not backwards compatible with older versions of RTI? If so I guess that could be the issue.

The iterating through samples starting at 0 isn't the issue, as I accounted for that when using 0.4.4.

Thanks,

Daniel 

 

gianpiero's picture
Offline
Last seen: 5 months 2 weeks ago
Joined: 06/02/2010
Posts: 174

Hi @minad,

That may be the issue. Connext 6 is backward compatible with older versions but you most likely have to do some extra qos configurations. For example for the wire compatibility. See here for more info. 

Best,
  Gianpiero

Offline
Last seen: 1 month 3 weeks ago
Joined: 04/13/2019
Posts: 5

Python Connector for Connext v6.0.0 "Failed to auto-enable entity"

I tried my *QoS.xml files that were working with RTI Connector for Connext DDS v5.3.* and I get these errors :

[D0000|Sub(80000009)|T=rov_beacon|CREATE Reader]
PRESTypePluginDefaultEndpointData_createMD5StreamWithInfo:no space on heap for structure of size 2147482623 bytes aligned at 0 bytes
PRESPsService_enableLocalEndpointWithCursor:failed to attach endpoint to typePlugin
PRESPsService_enableLocalEndpoint:!enable local endpoint
DDS_Subscriber_create_datareader:ERROR: Failed to auto-enable entity
DDS_FactoryXmlPlugin_createDataReadersWithNamesI:!create DataReader
DDS_FactoryXmlPlugin_createDataReaders:!create DataReaders from XML DataReader "::MyParticipantLibrary::Zero::MySubscriber::MyRovBeaconReader"

On Win10 x64 I installed using git clone of rticonnextdds-connector-py.
Using Python 3.7.2, the .\examples\simple\reader.py could see the writer.py data.

I then incrementally added my QoS information to the ShapeExample.xml and had
no errors until I added my reader to <subscriber with the MySquareReader.
<data_reader name="MyRovBeaconReader" topic_ref="rov_beacon" />

I have the same results on Ubuntu 18.04.

Bill

Offline
Last seen: 1 month 3 weeks ago
Joined: 04/13/2019
Posts: 5

I'm attaching the ShapeExample_QoS.xml file for my above post. Uncommenting the  <data_reader name="MyRovBeaconReader"... line will produce the above error.

I've been using this QoS.xml file OK with the Python Connector for Connext DDS v5.3.1.

I'm wondering if it has anything in common with marknelson's "Python on Windows" forum topic.

File Attachments: 
Offline
Last seen: 1 week 3 days ago
Joined: 10/22/2018
Posts: 29

Hi webhopper,

Using the XML file that you attached, I was able to reproduce your issue.

I believe that the issue is relatd to the unbounded strings in your type.
There is a migration guide topic on the subject here.
In summary, previously, unbounded strings (such as those in your ROVBeacon type) were in fact bounded to a default max length of 255. We removed this limitation with our latest release (Connext 6.0.0).

If your strings really are unbounded, then you will ned to modify the memory usage of the application. If they are not truly unbounded, you should use the stringMaxLength parameter to set their bound in the type of your XML file.


I tested this with your reproducer and was able to run the application in Connext 6.0.0 when I limited the string length.


Hope this helps,
Sam

Offline
Last seen: 1 month 3 weeks ago
Joined: 04/13/2019
Posts: 5

Sam,

Adding the stringMaxLength worked great! I didn't add it to the const strings. The only other change was the reader index from 1 to 0 and everything is working like 5.3.

Hopefully I'll be able to contribute something to the OpenROV Trident community.

Thanks much,

Bill