[openrtm-commit:03333] r1027 - trunk/OpenRTM-aist-Python/OpenRTM_aist

openrtm @ openrtm.org openrtm @ openrtm.org
2018年 9月 28日 (金) 14:45:02 JST


Author: miyamoto
Date: 2018-09-28 14:45:02 +0900 (Fri, 28 Sep 2018)
New Revision: 1027

Modified:
   trunk/OpenRTM-aist-Python/OpenRTM_aist/MultilayerCompositeEC.py
   trunk/OpenRTM-aist-Python/OpenRTM_aist/PeriodicECSharedComposite.py
Log:
[compat, bugfix] fixed bug.

Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/MultilayerCompositeEC.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/MultilayerCompositeEC.py	2018-09-25 10:13:42 UTC (rev 1026)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/MultilayerCompositeEC.py	2018-09-28 05:45:02 UTC (rev 1027)
@@ -69,6 +69,8 @@
 
   def exit(self, Task=OpenRTM_aist.Task):
     OpenRTM_aist.PeriodicExecutionContext.exit(self)
+    for task in self._tasklist:
+      task.finalize()
     return
 
   def init(self, props):
@@ -159,6 +161,13 @@
       return self._task.getPeriodStat()
     def getExecStat(self):
       return self._task.getExecStat()
+
+    def finalize(self):
+      self._task.resume()
+      self._task.finalize()
+
+      OpenRTM_aist.PeriodicTaskFactory.instance().deleteObject(self._task)
+      
     
   def addTask(self, owner, rtcs):
     prop = self._profile.getProperties().getNode("ec"+str(len(self._tasklist)))
@@ -252,6 +261,7 @@
       # Thread will stopped when all RTCs are INACTIVE.
       # Therefore WorkerPreDo(updating state) have to be invoked
       # before stopping thread.
+      
       guard = OpenRTM_aist.ScopedLock(self._workerthread._mutex)
       while not self._workerthread._running:
         self._workerthread._cond.wait()
@@ -259,6 +269,7 @@
 
       t0_ = OpenRTM_aist.Time()
       
+      
       #OpenRTM_aist.ExecutionContextBase.invokeWorkerDo(self)
       self._ownersm.workerDo()
       #OpenRTM_aist.ExecutionContextBase.invokeWorkerPostDo(self)
@@ -270,6 +281,7 @@
 
       #time.sleep(0.1)
       
+      
       for task in self._tasklist:
         task.join()
         #print task._task.getExecStat()._max_interval
@@ -282,6 +294,7 @@
       
 
       t1_ = OpenRTM_aist.Time()
+      
 
       period_ = self.getPeriod()
 

Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/PeriodicECSharedComposite.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/PeriodicECSharedComposite.py	2018-09-25 10:13:42 UTC (rev 1026)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/PeriodicECSharedComposite.py	2018-09-28 05:45:02 UTC (rev 1027)
@@ -859,7 +859,8 @@
     for sdo in sdos:
       rtc = sdo._narrow(RTC.RTObject)
       self.deactivateChildComp(rtc)
-
+      
+    
     return RTC.RTC_OK
 
 



openrtm-commit メーリングリストの案内