[openrtm-commit:03206] r954 - branches/FSM4RTC/OpenRTM-aist-Python/OpenRTM_aist

openrtm @ openrtm.org openrtm @ openrtm.org
2018年 3月 2日 (金) 10:40:49 JST


Author: miyamoto
Date: 2018-03-02 10:40:49 +0900 (Fri, 02 Mar 2018)
New Revision: 954

Modified:
   branches/FSM4RTC/OpenRTM-aist-Python/OpenRTM_aist/Manager.py
   branches/FSM4RTC/OpenRTM-aist-Python/OpenRTM_aist/RingBuffer.py
Log:
[merge] r899 has been merged from trunk.

Modified: branches/FSM4RTC/OpenRTM-aist-Python/OpenRTM_aist/Manager.py
===================================================================
--- branches/FSM4RTC/OpenRTM-aist-Python/OpenRTM_aist/Manager.py	2018-02-28 05:35:53 UTC (rev 953)
+++ branches/FSM4RTC/OpenRTM-aist-Python/OpenRTM_aist/Manager.py	2018-03-02 01:40:49 UTC (rev 954)
@@ -3052,7 +3052,7 @@
   # @if jp
   # @brief µ¯Æ°»þ¤Ërtc.conf¤Ç»ØÄꤷ¤¿¥Ý¡¼¥È¤òÀܳ¤¹¤ë
   # Îã:
-  # manager.components.preconnect: RTC0.port0:RTC0.port1(interface_type=corba_cdr&dataflow_type=pull&~),~
+  # manager.components.preconnect: RTC0.port0^RTC0.port1(interface_type=corba_cdr&dataflow_type=pull&~),~
   # @param self
   # @else
   #
@@ -3076,10 +3076,10 @@
         self._rtcout.RTC_ERROR("Invalid format for pre-connection.")
         continue
       conn_prop[1] = conn_prop[1].replace(")","")
-      comp_ports = conn_prop[0].split(":")
+      comp_ports = conn_prop[0].split("^")
       if len(comp_ports) != 2:
         self._rtcout.RTC_ERROR("Invalid format for pre-connection.")
-        self._rtcout.RTC_ERROR("Format must be Comp0.port0:Comp1.port1()")
+        self._rtcout.RTC_ERROR("Format must be Comp0.port0^Comp1.port1()")
         continue
       
       comp0_name = comp_ports[0].split(".")[0]

Modified: branches/FSM4RTC/OpenRTM-aist-Python/OpenRTM_aist/RingBuffer.py
===================================================================
--- branches/FSM4RTC/OpenRTM-aist-Python/OpenRTM_aist/RingBuffer.py	2018-02-28 05:35:53 UTC (rev 953)
+++ branches/FSM4RTC/OpenRTM-aist-Python/OpenRTM_aist/RingBuffer.py	2018-03-02 01:40:49 UTC (rev 954)
@@ -15,6 +15,7 @@
 #         Advanced Industrial Science and Technology (AIST), Japan
 #     All rights reserved.
 
+import sys
 import threading
 import OpenRTM_aist
 
@@ -370,9 +371,19 @@
             nsec = self._wtimeout.usec() * 1000
 
           # true: signaled, false: timeout
-          if not self._full_cond.wait(sec + (nsec/1000000000.0)):
-            self._full_cond.release()
-            return OpenRTM_aist.BufferStatus.TIMEOUT
+          if sec != 0 or nsec != 0:
+            wait_time = sec + (nsec/1000000000.0)
+          else:
+            wait_time = None
+          ret = self._full_cond.wait(wait_time)
+          if sys.version_info[0] == 3:
+            if not ret:
+              self._full_cond.release()
+              return OpenRTM_aist.BufferStatus.TIMEOUT
+          else:
+            if self.full():
+              self._full_cond.release()
+              return OpenRTM_aist.BufferStatus.TIMEOUT
 
         else: # unknown condition
           self._full_cond.release()
@@ -617,9 +628,19 @@
           sec = self._rtimeout.sec()
           nsec = self._rtimeout.usec() * 1000
         #  true: signaled, false: timeout
-        if not self._empty_cond.wait(sec + (nsec/1000000000.0)):
-          self._empty_cond.release()
-          return OpenRTM_aist.BufferStatus.TIMEOUT
+        if sec != 0 or nsec != 0:
+          wait_time = sec + (nsec/1000000000.0)
+        else:
+          wait_time = None
+        ret = self._empty_cond.wait(wait_time)
+        if sys.version_info[0] == 3:
+          if not ret:
+            self._empty_cond.release()
+            return OpenRTM_aist.BufferStatus.TIMEOUT
+        else:
+          if self.empty():
+            self._empty_cond.release()
+            return OpenRTM_aist.BufferStatus.TIMEOUT
 
       else:                              # unknown condition
         self._empty_cond.release()



More information about the openrtm-commit mailing list