Reading Admin topic in python or traditional C++

2 posts / 0 new
Last post
ilya_1725's picture
Offline
Last seen: 2 years 3 months ago
Joined: 04/20/2020
Posts: 24
Reading Admin topic in python or traditional C++

I'm trying to make the python code work with the RTI Remote Administration interface. Python module requires XML type representation. A regular RTI release comes with the IDL type for the Remote Platform (inside rti_connext_dds-6.0.1/resource/idl/). The ServiceAdmin.idl has these types:

            /* CommandRequest */
            @appendable
            struct CommandRequest {
                @key int32 instance_id;
                @optional string<BOUNDED_STRING_LENGTH_MAX> application_name;
                CommandActionKind action;
                ResourceIdentifier resource_identifier;
                StringBody string_body;
                OctetBody octet_body;
            };

            /* CommandReply */
            @appendable
            struct CommandReply {
                CommandReplyRetcode retcode;
                int32 native_retcode;
                StringBody string_body;
                OctetBody octet_body;
            };

Converting the IDL to XML produces this:

 

<module name="RTI" autoid="hash" allowed_data_representation="xcdr2">
  <module name="Service">
    <module name="Admin">
      <const name="COMMAND_REQUEST_TOPIC_NAME" type="string" value="&quot;rti/service/admin/command_request&quot;"/>
      <const name="COMMAND_REPLY_TOPIC_NAME" type="string" value="&quot;rti/service/admin/command_reply&quot;"/>
      <const name="NAME_LENGTH_MAX" type="int32" value="(RTI::Service::BOUNDED_STRING_LENGTH_MAX)"/>
      <typedef name="EntityName" type="nonBasic"  nonBasicTypeName= "RTI::Service::BoundedString"/>
      <const name="RESOURCE_IDENTIFIER_LENGTH_MAX" type="int32" value="(RTI::Service::RESOURCE_IDENTIFIER_LENGTH_MAX)"/>
      <typedef name="ResourceIdentifier" type="nonBasic"  nonBasicTypeName= "RTI::Service::ResourceId"/>
      <typedef name="StringBody" stringMaxLength="255" type="string"/>
      <typedef name="OctetBody" sequenceMaxLength="100" type="byte"/>
      <enum name="CommandActionKind">
        <enumerator name="CREATE_ACTION"/>
        <enumerator name="GET_ACTION"/>
        <enumerator name="UPDATE_ACTION"/>
        <enumerator name="DELETE_ACTION"/>
      </enum> 
      <enum name="CommandReplyRetcode">
        <enumerator name="OK_RETCODE"/>
        <enumerator name="ERROR_RETCODE"/>
      </enum> 
      <struct name= "CommandRequest">
        <member name="instance_id" type="int32" key="true"/>
        <member name="application_name" stringMaxLength="RTI::Service::BOUNDED_STRING_LENGTH_MAX" type="string" optional="true"/>
        <member name="action" type="nonBasic"  nonBasicTypeName= "RTI::Service::Admin::CommandActionKind"/>
        <member name="resource_identifier" type="nonBasic"  nonBasicTypeName= "RTI::Service::Admin::ResourceIdentifier"/>
        <member name="string_body" type="nonBasic"  nonBasicTypeName= "RTI::Service::Admin::StringBody"/>
        <member name="octet_body" type="nonBasic"  nonBasicTypeName= "RTI::Service::Admin::OctetBody"/>
      </struct>
      <struct name= "CommandReply">
        <member name="retcode" type="nonBasic"  nonBasicTypeName= "RTI::Service::Admin::CommandReplyRetcode"/>
        <member name="native_retcode" type="int32"/>
        <member name="string_body" type="nonBasic"  nonBasicTypeName= "RTI::Service::Admin::StringBody"/>
        <member name="octet_body" type="nonBasic"  nonBasicTypeName= "RTI::Service::Admin::OctetBody"/>
      </struct>
    </module>
  </module>
</module>

The command works file and the recorder processes and sends replies. But for some reason my python code can't read the reply data. It doesn't even report that there is a publisher for rti/service/admin/command_reply topic.

Anyone had experince with this interface?

To note: the modern C++ example code, specified here, works fine. But I can't use modern C++. Traditional C++ exibits the same probelm.

 

 

Keywords:
Howard's picture
Offline
Last seen: 5 hours 54 min ago
Joined: 11/29/2012
Posts: 598

You'll probably be better off using your RTI support account to get an answer to this question.  I doubt that the general community has walked this path before...  Since your project has a support contract, you'll likely get an answer faster by submitting to the RTI support team.