resource limitation and protocol settings in Python API

4 posts / 0 new
Last post
Offline
Last seen: 9 months 3 weeks ago
Joined: 11/23/2021
Posts: 32
resource limitation and protocol settings in Python API

Hi @all,

actually I am looking if it is possible to communicate with Micro C using the RTI Python API. Therefore I wrote a "hello world publisher" in Python and a took a "hello world subscriber" example in Micro C.
The application is running so far, but what I noticed is that I was not able to define QoS settings belonging to resource limitation or protocol settings in the RTI Python API.

When I for example try to define some protocol specific QoS settings for "heartbeat_period" (see below) in the XML file which is then importet by the Python application I get the following error:

DDS_RtpsReliableWriterProtocol_is_consistentI:inconsistent QoS policies: fast_heartbeat_period and heartbeat_period
DDS_DataWriterProtocolQosPolicy_is_consistentI:inconsistent QoS policy: rtps_reliable_writer
DDS_DataWriterQos_is_consistentI:inconsistent QoS policy: protocol
DDS_Publisher_create_datawriter_disabledI:ERROR: Inconsistent QoS

<protocol>
    <rtps_reliable_writer>
        <heartbeat_period>
            <sec>0</sec>
            <nanosec>250000000</nanosec> <!--250ms -->
        </heartbeat_period>
    </rtps_reliable_writer>
</protocol>

My general quesion: Is it possible to define QoS settings belonging to resource limitation or protocol settings like e.g. heartbeats_per_max_samples, max_samples_per_instance, etc....? Or is this only possible in Micro C?

Have I done some mistake in the QoS naming above? Where are the main limitation for a communiction between Micro C and the Python API?

Thanks in advance and Regards,

Marc

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

Hi Marc,

When defining the base heartbeat_period, you must ensure that the fast_heartbeat_period and late_joiner_heartbeat_period values are also consistent relative to the new base value. They must be at the same rate or faster.


<
datawriter_qos>
   <protocol>
      <rtps_reliable_writer>
         <heartbeat_period>
            <sec>0</sec>
            <nanosec>250000000</nanosec>
        </heartbeat_period>
        <late_joiner_heartbeat_period>
           <sec>0</sec>
           <nanosec>250000000</nanosec>
        </late_joiner_heartbeat_period>
        <fast_heartbeat_period>
           <sec>0</sec>
           <nanosec>250000000</nanosec>
        </fast_heartbeat_period>
     </rtps_reliable_writer>
   </protocol>
</datawriter_qos>
 

 

Offline
Last seen: 9 months 3 weeks ago
Joined: 11/23/2021
Posts: 32

Hi Marc,

Ok, with the fast_heartbeat_period and late_joiner_heartbeat_period qos settings it works fine!

Another question:

when I insert the resouce_limit qos settings inside the "datawriter_qos" (see below) I get the following error:

<resource_limits>
  <max_samples_per_instance>32</max_samples_per_instance>
  <max_instances>2</max_instances>
  <max_samples>64</max_samples>
</resource_limits>


rti.connextdds.Error: Failed to create DataWriter
DDS_ResourceLimitsQosPolicy_is_consistentI:inconsistent QoS policies: max_instances and initial_instances
DDS_DataWriterQos_is_consistentI:inconsistent QoS policy: resource_limits
DDS_Publisher_create_datawriter_disabledI:ERROR: Inconsistent QoS

When I insert the resouce_limit qos settings inside "participant_qos" tag it works fine.

Do the resource_limit tag only work inside "participant_qos" ?

Regards,

Marc

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

Hi Marc,

This is another difference between available QoS in Pro vs Micro. In Micro there are only max_instances and max_samples values for resource limits in DataWriters/DataReaders. These resources are allocated at entity creation and will not change once the entity is created. In Pro, you also have settings for initial_instances and initial_samples, which is the starting allocation for resources that can grow dynamically up to the configured max at runtime. Like the heartbeat settings, the initial must be consistent with the max, so initial must be less than or equal to the configured max (when equal, there will be no dynamic resizing). The default value for initial_instances is 32, which is why you are seeing this error for inconsistent QoS with an explicitly set max_instances of 2.

Regards,

Marc