[openrtm-commit:02153] r766 - trunk/OpenRTM-aist-Python/OpenRTM_aist
openrtm @ openrtm.org
openrtm @ openrtm.org
2016年 12月 2日 (金) 19:50:25 JST
Author: miyamoto
Date: 2016-12-02 19:50:25 +0900 (Fri, 02 Dec 2016)
New Revision: 766
Modified:
trunk/OpenRTM-aist-Python/OpenRTM_aist/ExecutionContextBase.py
trunk/OpenRTM-aist-Python/OpenRTM_aist/ManagerServant.py
trunk/OpenRTM-aist-Python/OpenRTM_aist/NamingManager.py
trunk/OpenRTM-aist-Python/OpenRTM_aist/PeriodicExecutionContext.py
trunk/OpenRTM-aist-Python/OpenRTM_aist/RTObject.py
Log:
[compat,bugfix,->RELENG_1_2] fixed bug.
Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/ExecutionContextBase.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/ExecutionContextBase.py 2016-12-01 06:54:37 UTC (rev 765)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/ExecutionContextBase.py 2016-12-02 10:50:25 UTC (rev 766)
@@ -736,6 +736,7 @@
(float(self._activationTimeout.toDouble()), self.getRate(), cycle_))
# Wating INACTIVE -> ACTIVE
starttime_ = OpenRTM_aist.Time().gettimeofday()
+
while rtobj.isCurrentState(RTC.INACTIVE_STATE):
ret_ = self.onWaitingActivated(rtobj, count_) # Template method
if ret_ != RTC.RTC_OK:
@@ -761,7 +762,7 @@
ret_ = self.onActivated(rtobj, count_) # Template method
if ret_ != RTC.RTC_OK:
self._rtcout.RTC_ERROR("onActivated() failed.")
-
+
self._rtcout.RTC_DEBUG("onActivated() done.")
return ret_
@@ -1477,7 +1478,34 @@
self._rtcout.RTC_DEBUG("Configuration %s not found.", key)
return False
+ def is_running(self):
+ self._rtcout.RTC_TRACE("is_running()")
+ return self.isRunning()
+ def get_rate(self):
+ return self.getRate()
+ def set_rate(self, rate):
+ return self.setRate(rate)
+ def activate_component(self, comp):
+ return self.activateComponent(comp)
+ def deactivate_component(self, comp):
+ return self.deactivateComponent(comp)
+ def reset_component(self, comp):
+ return self.resetComponent(comp)
+ def get_component_state(self, comp):
+ return self.getComponentState(comp)
+ def get_kind(self):
+ return self.getKind()
+ def add_component(self, comp):
+ return self.addComponent(comp)
+ def remove_component(self, comp):
+ return self.removeComponent(comp)
+ def get_profile(self):
+ return self.getProfile()
+
+
+
+
executioncontextfactory = None
class ExecutionContextFactory(OpenRTM_aist.Factory,ExecutionContextBase):
Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/ManagerServant.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/ManagerServant.py 2016-12-01 06:54:37 UTC (rev 765)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/ManagerServant.py 2016-12-02 10:50:25 UTC (rev 766)
@@ -414,13 +414,13 @@
if not CORBA.is_nil(self._slaves[i]):
srtcs = self._slaves[i].get_components()
OpenRTM_aist.CORBA_SeqUtil.push_back_list(crtcs, srtcs)
- continue
+
except:
- self._RTC_INFO("slave (%d) has disappeared.", i)
- self._slaves[i] = RTM.Manager._nil
+ self._rtcout.RTC_INFO("slave (%d) has disappeared.", i)
+ #self._slaves[i] = RTM.Manager._nil
- OpenRTM_aist.CORBA_SeqUtil.erase(self._slaves, i)
- i -= 1
+ OpenRTM_aist.CORBA_SeqUtil.erase(self._slaves, i)
+ i -= 1
return crtcs
@@ -458,13 +458,12 @@
if not CORBA.is_nil(self._slaves[i]):
sprofs = self._slaves[i].get_component_profiles()
OpenRTM_aist.CORBA_SeqUtil.push_back_list(cprofs, sprofs)
- continue
except:
self._rtcout.RTC_INFO("slave (%d) has disappeared.", i)
- self._slaves[i] = RTM.Manager._nil
+ #self._slaves[i] = RTM.Manager._nil
- OpenRTM_aist.CORBA_SeqUtil.erase(self._slaves, i)
- i -= 1
+ OpenRTM_aist.CORBA_SeqUtil.erase(self._slaves, i)
+ i -= 1
del guard
return cprofs
@@ -940,9 +939,7 @@
name = tmp[0]
rtc_name = name.split("/")
for rtc in rtcs:
- if len(rtc_name) == 0:
- pass
- elif len(rtc_name) == 1:
+ if len(rtc_name) == 1:
if rtc.getInstanceName() == rtc_name[0]:
crtcs.append(rtc.getObjRef())
else:
Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/NamingManager.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/NamingManager.py 2016-12-01 06:54:37 UTC (rev 765)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/NamingManager.py 2016-12-02 10:50:25 UTC (rev 766)
@@ -1036,7 +1036,7 @@
nsobj = 0
try:
nsobj = self.createNamingObj(ns.method, ns.nsname)
- if nsobj != 0: # if succeed
+ if nsobj is not None: # if succeed
self._rtcout.RTC_INFO("Connected to a name server: %s/%s",
(ns.method, ns.nsname))
ns.ns = nsobj
@@ -1049,7 +1049,7 @@
except:
self._rtcout.RTC_DEBUG("Name server: %s/%s disappeared again.",
(ns.method, ns.nsname))
- if nsobj != 0:
+ if nsobj is not None:
del ns.ns
ns.ns = 0
Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/PeriodicExecutionContext.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/PeriodicExecutionContext.py 2016-12-01 06:54:37 UTC (rev 765)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/PeriodicExecutionContext.py 2016-12-02 10:50:25 UTC (rev 766)
@@ -741,8 +741,8 @@
del guard
return RTC.RTC_OK
- return
+
# bool threadRunning()
def threadRunning(self):
guard = OpenRTM_aist.ScopedLock(self._svcmutex)
Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/RTObject.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/RTObject.py 2016-12-01 06:54:37 UTC (rev 765)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/RTObject.py 2016-12-02 10:50:25 UTC (rev 766)
@@ -653,7 +653,8 @@
for ec in self._ecOther:
if not CORBA.is_nil(ec):
# ec.stop()
- ec.remove_component(self._this())
+ ret = ec.remove_component(self._this())
+
self._exiting = True
return self.finalize()
More information about the openrtm-commit
mailing list