Converting hello_world.idl to XML for Python

Open
#47 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python

Research direction

Start with rticonnextdds-getting-started/2_hello_world/python/README.md, the rtiddsgen -convertToXml ../hello_world.idl command, and HelloWorldPublisher.py. Compare the generated hello_world.xml with the XML used by the other examples and reproduce the parser error. Done means the documented conversion steps produce XML that the Python publisher can load without the reported error.

Written by the indexing model from the issue text.

Description

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!

Dominant language
C++
Stars
32
Forks
32
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rticommunity/rticonnextdds-getting-started

All issues in rticommunity/rticonnextdds-getting-started

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.