[openrtm-commit:03340] r1031 - branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist
openrtm @ openrtm.org
openrtm @ openrtm.org
2018年 10月 9日 (火) 09:04:48 JST
Author: miyamoto
Date: 2018-10-09 09:04:48 +0900 (Tue, 09 Oct 2018)
New Revision: 1031
Modified:
branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/CORBA_RTCUtil.py
branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/ExecutionContextProfile.py
branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/Manager.py
Log:
[merge] r1030 has been merged from trunk.
Modified: branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/CORBA_RTCUtil.py
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/CORBA_RTCUtil.py 2018-10-08 00:15:05 UTC (rev 1030)
+++ branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/CORBA_RTCUtil.py 2018-10-09 00:04:48 UTC (rev 1031)
@@ -832,7 +832,10 @@
# RTC::ConnectorProfile_var create_connector(const std::string name,const coil::Properties prop_arg,const RTC::PortService_ptr port0,const RTC::PortService_ptr port1)
def create_connector(name, prop_arg, port0, port1):
prop = prop_arg
- conn_prof = RTC.ConnectorProfile(name, "", [port0, port1],[])
+ if CORBA.is_nil(port1):
+ conn_prof = RTC.ConnectorProfile(name, "", [port0],[])
+ else:
+ conn_prof = RTC.ConnectorProfile(name, "", [port0, port1],[])
@@ -912,10 +915,11 @@
def connect(name, prop, port0, port1):
if CORBA.is_nil(port0):
return RTC.BAD_PARAMETER
- if CORBA.is_nil(port1):
- return RTC.BAD_PARAMETER
- if port0._is_equivalent(port1):
- return RTC.BAD_PARAMETER
+ #if CORBA.is_nil(port1):
+ # return RTC.BAD_PARAMETER
+ if not CORBA.is_nil(port1):
+ if port0._is_equivalent(port1):
+ return RTC.BAD_PARAMETER
cprof = create_connector(name, prop, port0, port1)
return port0.connect(cprof)[0]
Modified: branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/ExecutionContextProfile.py
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/ExecutionContextProfile.py 2018-10-08 00:15:05 UTC (rev 1030)
+++ branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/ExecutionContextProfile.py 2018-10-09 00:04:48 UTC (rev 1031)
@@ -70,10 +70,10 @@
self._rtcout.RTC_DEBUG("Actual rate: %d [sec], %d [usec]",
(self._period.sec(), self._period.usec()))
self._profileMutex = threading.RLock()
- self._ref = None
+ self._ref = RTC.ExecutionContext._nil
self._profile = RTC.ExecutionContextProfile(RTC.PERIODIC,
(1.0/self._period.toDouble()),
- None, [], [])
+ RTC.DataFlowComponent._nil, [], [])
return
@@ -93,10 +93,10 @@
self._rtcout.RTC_TRACE("exit")
# cleanup EC's profile
- self._profile.owner = None
+ self._profile.owner = RTC.DataFlowComponent._nil
self._profile.participants = []
self._profile.properties = []
- self._ref = None
+ self._ref = RTC.ExecutionContext._nil
return
Modified: branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/Manager.py
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/Manager.py 2018-10-08 00:15:05 UTC (rev 1030)
+++ branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/Manager.py 2018-10-09 00:04:48 UTC (rev 1031)
@@ -3091,6 +3091,7 @@
ports = []
configs = {}
+
for k,p in param.items():
if k == "port":
ports.append(p)
@@ -3097,15 +3098,15 @@
continue
tmp = k.replace("port","")
v = [0]
- if OpenRTM_aist.stringTo(v, tmp):
+ if OpenRTM_aist.stringTo(v, tmp) and k.find("port") != -1:
ports.append(p)
continue
configs[k] = p
- if len(ports) == 0:
- self._rtcout.RTC_ERROR("Invalid format for pre-connection.")
- self._rtcout.RTC_ERROR("Format must be Comp0.port0?port=Comp1.port1")
- continue
+ #if len(ports) == 0:
+ # self._rtcout.RTC_ERROR("Invalid format for pre-connection.")
+ # self._rtcout.RTC_ERROR("Format must be Comp0.port0?port=Comp1.port1")
+ # continue
if not ("dataflow_type" in configs.keys()):
configs["dataflow_type"] = "push"
@@ -3145,6 +3146,17 @@
self._rtcout.RTC_DEBUG("port %s found: " % port0_str)
continue
+ if len(ports) == 0:
+ prop = OpenRTM_aist.Properties()
+
+ for k,v in configs.items():
+ k = k.strip()
+ v = v.strip()
+ prop.setProperty("dataport."+k,v)
+
+ if RTC.RTC_OK != OpenRTM_aist.CORBA_RTCUtil.connect(c, prop, port0_var, RTC.PortService._nil):
+ self._rtcout.RTC_ERROR("Connection error: %s" % c)
+
for port_str in ports:
tmp = port_str.split(".")
openrtm-commit メーリングリストの案内