Esempio n. 1
0
 def createWriter(self, topic):
     global mutex
     guard = OpenRTM_aist.ScopedLock(mutex)
     if self._qosProfile:
         return self._publisher.create_datawriter(
             topic, self._qosProfile.get_writer_qos())
     else:
         writer_qos = dds.Qos([
             dds.DurabilityQosPolicy(dds.DDSDurabilityKind.TRANSIENT),
             dds.DeadlineQosPolicy(dds.DDSDuration(500)),
             dds.LatencyBudgetQosPolicy(dds.DDSDuration(3000)),
             dds.LivelinessQosPolicy(
                 dds.DDSLivelinessKind.MANUAL_BY_PARTICIPANT),
             dds.ReliabilityQosPolicy(dds.DDSReliabilityKind.RELIABLE,
                                      dds.DDSDuration.infinity()),
             dds.DestinationOrderQosPolicy(
                 dds.DDSDestinationOrderKind.BY_SOURCE_TIMESTAMP),
             dds.HistoryQosPolicy(dds.DDSHistoryKind.KEEP_ALL),
             dds.ResourceLimitsQosPolicy(10, 10, 10),
             dds.TransportPriorityQosPolicy(700),
             dds.LifespanQosPolicy(dds.DDSDuration(10, 500)),
             dds.OwnershipQosPolicy(dds.DDSOwnershipKind.EXCLUSIVE),
             dds.OwnershipStrengthQosPolicy(100),
             dds.WriterDataLifecycleQosPolicy(False)
         ])
         return self._publisher.create_datawriter(topic, writer_qos)
Esempio n. 2
0
 def createReader(self, topic, listener):
     global mutex
     guard = OpenRTM_aist.ScopedLock(mutex)
     if self._qosProfile:
         return self._subscriber.create_datareader(
             topic, self._qosProfile.get_reader_qos(), listener)
     else:
         reader_qos = dds.Qos([
             dds.DurabilityQosPolicy(dds.DDSDurabilityKind.TRANSIENT),
             dds.DeadlineQosPolicy(dds.DDSDuration(500)),
             dds.LatencyBudgetQosPolicy(dds.DDSDuration(3000)),
             dds.LivelinessQosPolicy(
                 dds.DDSLivelinessKind.MANUAL_BY_PARTICIPANT),
             dds.ReliabilityQosPolicy(dds.DDSReliabilityKind.RELIABLE,
                                      dds.DDSDuration.infinity()),
             dds.DestinationOrderQosPolicy(
                 dds.DDSDestinationOrderKind.BY_SOURCE_TIMESTAMP),
             dds.HistoryQosPolicy(dds.DDSHistoryKind.KEEP_ALL),
             dds.ResourceLimitsQosPolicy(10, 10, 10),
             dds.OwnershipQosPolicy(dds.DDSOwnershipKind.EXCLUSIVE),
             dds.TimeBasedFilterQosPolicy(dds.DDSDuration(2, 500)),
             dds.ReaderDataLifecycleQosPolicy(dds.DDSDuration(3),
                                              dds.DDSDuration(5))
         ])
         return self._subscriber.create_datareader(topic, reader_qos,
                                                   listener)
 def createTopic(self, datatype, topicname):
     global mutex
     guard = OpenRTM_aist.ScopedLock(mutex)
     if topicname in self._topic:
         return self._topic[topicname]
     else:
         geninfo = self.genInfo(datatype)
         if geninfo:
             if self._qosProfile:
                 self._topic[topicname] = geninfo.register_topic(
                     self._domainParticipant, topicname, self._qosProfile.get_topic_qos())
             else:
                 topic_qos = dds.Qos([dds.DurabilityQosPolicy(dds.DDSDurabilityKind.TRANSIENT),
                                      dds.DurabilityServiceQosPolicy(dds.DDSDuration(
                                          2, 500), dds.DDSHistoryKind.KEEP_ALL, 2, 100, 100, 100),
                                      dds.DeadlineQosPolicy(
                                          dds.DDSDuration(500)),
                                      dds.LatencyBudgetQosPolicy(
                                          dds.DDSDuration(3000)),
                                      dds.LivelinessQosPolicy(
                     dds.DDSLivelinessKind.MANUAL_BY_PARTICIPANT),
                     dds.ReliabilityQosPolicy(
                     dds.DDSReliabilityKind.RELIABLE, dds.DDSDuration.infinity()),
                     dds.DestinationOrderQosPolicy(
                     dds.DDSDestinationOrderKind.BY_SOURCE_TIMESTAMP),
                     dds.HistoryQosPolicy(
                                          dds.DDSHistoryKind.KEEP_ALL),
                     dds.ResourceLimitsQosPolicy(
                                          10, 10, 10),
                     dds.TransportPriorityQosPolicy(700),
                     dds.LifespanQosPolicy(
                                          dds.DDSDuration(10, 500)),
                     dds.OwnershipQosPolicy(
                                          dds.DDSOwnershipKind.EXCLUSIVE)
                 ])
                 self._topic[topicname] = geninfo.register_topic(
                     self._domainParticipant, topicname, topic_qos)
             return self._topic[topicname]
         return None