Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting hello_world.idl to XML for Python #47

Open
mattmz opened this issue Mar 8, 2021 · 2 comments
Open

Converting hello_world.idl to XML for Python #47

mattmz opened this issue Mar 8, 2021 · 2 comments

Comments

@mattmz
Copy link

mattmz commented Mar 8, 2021

I am running the 2_hello_world example for Python. I am hitting a parsing issue with the converted hello_world.idl XML and while I can work around it by following other examples, I am wondering if I am performing any steps incorrectly or if there are additional steps apart from rticonnextdds-getting-started/2_hello_world/python/README.md.

To convert hello_world.idl to XML I am using:

rtiddsgen -convertToXml ../hello_world.idl

The output XML is:

<?xml version="1.0" encoding="UTF-8"?>
<types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:////Applications/rti_connext_dds-6.0.1/bin/../resource/app/app_support/rtiddsgen/schema/rti_dds_topic_types.xsd">
<struct name= "HelloWorld">
  <member name="msg" stringMaxLength="256" type="string"/>
</struct>
</types>

Next I run HelloWorldPublisher.py with the following error output:

python3 HelloWorldPublisher.py

DDS_XMLStruct_initialize:!init XML struct object
DDS_XMLStruct_newI:!init XML struct object
RTIXMLParser_onStartTag:Parse error at line 3: Error processing tag 'struct'
RTIXMLParser_parseFromFile_ex:Parse error in file '/Users/test/Documents/test/rticonnextdds-getting-started/2_hello_world/python/../hello_world.xml'
DDS_XMLParser_parse_from_file:Error parsing file
DDS_QosProvider_load_profiles_from_urlI:ERROR: loading profiles file '/Users/test/Documents/test/rticonnextdds-getting-started/2_hello_world/python/../hello_world.xml'
DDS_QosProvider_load_profiles_from_url_groupI:ERROR: loading profiles
DDS_QosProvider_load_profiles_from_url_sequenceI:ERROR: loading profiles
DDS_QosProvider_load_profiles_from_policyI:ERROR: loading profiles
DDS_QosProvider_load_profilesI:ERROR: loading profiles
Traceback (most recent call last):
File "HelloWorldPublisher.py", line 83, in
run_example(args.domain_id, args.sample_count)
File "HelloWorldPublisher.py", line 30, in run_example
provider = dds.QosProvider(FILE)
rti.connextdds.Error:
DDS_XMLStruct_initialize:!init XML struct object
DDS_XMLStruct_newI:!init XML struct object
RTIXMLParser_onStartTag:Parse error at line 3: Error processing tag 'struct'
RTIXMLParser_parseFromFile_ex:Parse error in file '/Users/test/Documents/test/rticonnextdds-getting-started/2_hello_world/python/../hello_world.xml'
DDS_XMLParser_parse_from_file:Error parsing file
DDS_QosProvider_load_profiles_from_urlI:ERROR: loading profiles file '/Users/test/Documents/test/rticonnextdds-getting-started/2_hello_world/python/../hello_world.xml'
DDS_QosProvider_load_profiles_from_url_groupI:ERROR: loading profiles
DDS_QosProvider_load_profiles_from_url_sequenceI:ERROR: loading profiles
DDS_QosProvider_load_profiles_from_policyI:ERROR: loading profiles
DDS_QosProvider_load_profilesI:ERROR: loading profiles
reload profiles

I can fix this by adopting an XML style similar to the other examples. Example:

<?xml version="1.0" encoding="UTF-8"?>
<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/6.0.1/rti_dds_qos_profiles.xsd"
   version="6.0.1">
  <type_library name="builtin_topics_lib">
    <struct name= "HelloWorld">
      <member name="msg" stringMaxLength="256" type="string"/>
    </struct>
  </type_library>
</dds>

I am wondering if there is additional configuration I need for rtiddsgen to have the XML conversion work seamlessly or if this is a known issue/change.

Thank you!

@rosemwahlin
Copy link
Contributor

Hello Matthew!

You aren't doing anything wrong - this is a known issue. You do need to use that workaround for now, but there is a fix in our upcoming Connext DDS release.

Thank you,
Rose

@mattmz
Copy link
Author

mattmz commented Mar 8, 2021

Thank you for the information! Much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants