[openrtm-commit:01767] r667 - trunk/OpenRTM-aist-Python/OpenRTM_aist

openrtm @ openrtm.org openrtm @ openrtm.org
2016年 2月 26日 (金) 19:24:39 JST


Author: miyamoto
Date: 2016-02-26 19:24:39 +0900 (Fri, 26 Feb 2016)
New Revision: 667

Modified:
   trunk/OpenRTM-aist-Python/OpenRTM_aist/NamingManager.py
Log:
[compat,->RELENG_1_2] add string_to_component() to NamingOnCorba. refs #3401

Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/NamingManager.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/NamingManager.py	2016-02-26 10:23:02 UTC (rev 666)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/NamingManager.py	2016-02-26 10:24:39 UTC (rev 667)
@@ -256,10 +256,54 @@
 
 
 
+  ##
+  # @if jp
+  #
+  # @brief rtcname形式でRTCのオブジェクトリファレンスを取得する
+  # 
+  # @return RTCのオブジェクトリファレンス
+  #
+  # @else
+  #
+  # @brief 
+  # 
+  # @return 
+  #
+  # @endif
+  #
+  # virtual RTCList string_to_component(string name) = 0;
+  def string_to_component(self, name):
+    rtc_list = []
+    tmp = name.split("//")
+    if len(tmp) > 1:
+      if tmp[0] == "rtcname:":
+        tag = tmp[0]
+        url = tmp[1]
+        r = url.split("/")
+        if len(r) > 1:
+          host = r[0]
+          rtc_name = url.replace(host+"/","")
+          try:
+            if host == "*":
+              cns = self._cosnaming
+            else:
+              orb = OpenRTM_aist.Manager.instance().getORB()
+              cns = OpenRTM_aist.CorbaNaming(orb,host)
+            rtc_name += ".rtc"
+            obj = cns.resolveStr(rtc_name)
+            if CORBA.is_nil(obj):
+              return []
+            rtc_list.append(obj)
+            return rtc_list
+          except:
+            return []
 
 
+      
+    return rtc_list
 
 
+
 ##
 # @if jp
 #



More information about the openrtm-commit mailing list