[openrtm-commit:00697] r260 - in trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource: . Python Python/AIST1 Python/AIST1/_GlobalIDL Python/AIST1/_GlobalIDL__POA Python/AIST2 Python/AIST2/_GlobalIDL Python/AIST2/_GlobalIDL__POA Python/AIST3 Python/AIST3/_GlobalIDL Python/AIST3/_GlobalIDL__POA Python/AIST4 Python/AIST4/_GlobalIDL Python/AIST4/_GlobalIDL__POA Python/AIST6 Python/AIST6/work Python/type Python/type/_GlobalIDL Python/type/_GlobalIDL__POA Python/type2 Python/type2/_GlobalIDL Python/type2/_GlobalIDL__POA
openrtm @ openrtm.org
openrtm @ openrtm.org
2012年 2月 11日 (土) 02:02:45 JST
Author: sakamoto
Date: 2012-02-11 02:02:45 +0900 (Sat, 11 Feb 2012)
New Revision: 260
Added:
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/MyService.idl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/MyService_idl.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/MyService_idl_example.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/README.test
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/_GlobalIDL/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/_GlobalIDL/__init__.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/_GlobalIDL__POA/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/_GlobalIDL__POA/__init__.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/test.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/MyService.idl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/MyService_idl.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/README.test
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/_GlobalIDL/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/_GlobalIDL/__init__.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/_GlobalIDL__POA/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/_GlobalIDL__POA/__init__.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/gen.sh
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/test.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/MyService.idl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/MyService_idl.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/MyService_idl_example.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/README.test
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/_GlobalIDL/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/_GlobalIDL/__init__.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/_GlobalIDL__POA/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/_GlobalIDL__POA/__init__.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/test.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/MyService.idl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/MyService_idl.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/MyService_idl_example.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/README.test
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/_GlobalIDL/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/_GlobalIDL/__init__.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/_GlobalIDL__POA/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/_GlobalIDL__POA/__init__.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/test.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST6/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST6/README.test
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST6/test.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST6/work/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST6/work/MyService.idl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST6/work/MyServiceAIST.idl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/MyService.idl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/MyService_idl.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/MyService_idl_example.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/README.test
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/_GlobalIDL/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/_GlobalIDL/__init__.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/_GlobalIDL__POA/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/_GlobalIDL__POA/__init__.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/test.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/MyService.idl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/MyService_idl.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/MyService_idl_example.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/README.test
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/_GlobalIDL/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/_GlobalIDL/__init__.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/_GlobalIDL__POA/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/_GlobalIDL__POA/__init__.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/test.py
Log:
Update CMakeList.txt #2300
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/MyService.idl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/MyService.idl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/MyService.idl 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,11 @@
+typedef sequence<string> EchoList;
+typedef sequence<float> ValueList;
+
+interface MyService
+{
+ string echo(in string msg);
+ EchoList get_echo_history();
+ void set_value(in float value);
+ float get_value();
+ ValueList get_value_history();
+};
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/MyService_idl.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/MyService_idl.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/MyService_idl.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,119 @@
+# Python stubs generated by omniidl from MyService.idl
+
+import omniORB, _omnipy
+from omniORB import CORBA, PortableServer
+_0_CORBA = CORBA
+
+_omnipy.checkVersion(2,0, __file__)
+
+try:
+ _omniORB_StructBase = omniORB.StructBase
+except AttributeError:
+ class _omniORB_StructBase: pass
+
+
+#
+# Start of module "_GlobalIDL"
+#
+__name__ = "_GlobalIDL"
+_0__GlobalIDL = omniORB.openModule("_GlobalIDL", r"MyService.idl")
+_0__GlobalIDL__POA = omniORB.openModule("_GlobalIDL__POA", r"MyService.idl")
+
+
+# typedef ... ValueList
+class ValueList:
+ _NP_RepositoryId = "IDL:ValueList:1.0"
+ def __init__(self, *args, **kw):
+ raise RuntimeError("Cannot construct objects of this type.")
+_0__GlobalIDL.ValueList = ValueList
+_0__GlobalIDL._d_ValueList = (omniORB.tcInternal.tv_sequence, omniORB.tcInternal.tv_float, 0)
+_0__GlobalIDL._ad_ValueList = (omniORB.tcInternal.tv_alias, ValueList._NP_RepositoryId, "ValueList", (omniORB.tcInternal.tv_sequence, omniORB.tcInternal.tv_float, 0))
+_0__GlobalIDL._tc_ValueList = omniORB.tcInternal.createTypeCode(_0__GlobalIDL._ad_ValueList)
+omniORB.registerType(ValueList._NP_RepositoryId, _0__GlobalIDL._ad_ValueList, _0__GlobalIDL._tc_ValueList)
+del ValueList
+
+# typedef ... EchoList
+class EchoList:
+ _NP_RepositoryId = "IDL:EchoList:1.0"
+ def __init__(self, *args, **kw):
+ raise RuntimeError("Cannot construct objects of this type.")
+_0__GlobalIDL.EchoList = EchoList
+_0__GlobalIDL._d_EchoList = (omniORB.tcInternal.tv_sequence, (omniORB.tcInternal.tv_string,0), 0)
+_0__GlobalIDL._ad_EchoList = (omniORB.tcInternal.tv_alias, EchoList._NP_RepositoryId, "EchoList", (omniORB.tcInternal.tv_sequence, (omniORB.tcInternal.tv_string,0), 0))
+_0__GlobalIDL._tc_EchoList = omniORB.tcInternal.createTypeCode(_0__GlobalIDL._ad_EchoList)
+omniORB.registerType(EchoList._NP_RepositoryId, _0__GlobalIDL._ad_EchoList, _0__GlobalIDL._tc_EchoList)
+del EchoList
+
+# interface MyService
+_0__GlobalIDL._d_MyService = (omniORB.tcInternal.tv_objref, "IDL:MyService:1.0", "MyService")
+omniORB.typeMapping["IDL:MyService:1.0"] = _0__GlobalIDL._d_MyService
+_0__GlobalIDL.MyService = omniORB.newEmptyClass()
+class MyService :
+ _NP_RepositoryId = _0__GlobalIDL._d_MyService[1]
+
+ def __init__(self, *args, **kw):
+ raise RuntimeError("Cannot construct objects of this type.")
+
+ _nil = CORBA.Object._nil
+
+
+_0__GlobalIDL.MyService = MyService
+_0__GlobalIDL._tc_MyService = omniORB.tcInternal.createTypeCode(_0__GlobalIDL._d_MyService)
+omniORB.registerType(MyService._NP_RepositoryId, _0__GlobalIDL._d_MyService, _0__GlobalIDL._tc_MyService)
+
+# MyService operations and attributes
+MyService._d_echo = (((omniORB.tcInternal.tv_string,0), ), ((omniORB.tcInternal.tv_string,0), ), None)
+MyService._d_get_echo_history = ((), (omniORB.typeMapping["IDL:EchoList:1.0"], ), None)
+MyService._d_set_value = ((omniORB.tcInternal.tv_float, ), (), None)
+MyService._d_get_value = ((), (omniORB.tcInternal.tv_float, ), None)
+MyService._d_get_value_history = ((), (omniORB.typeMapping["IDL:ValueList:1.0"], ), None)
+
+# MyService object reference
+class _objref_MyService (CORBA.Object):
+ _NP_RepositoryId = MyService._NP_RepositoryId
+
+ def __init__(self):
+ CORBA.Object.__init__(self)
+
+ def echo(self, *args):
+ return _omnipy.invoke(self, "echo", _0__GlobalIDL.MyService._d_echo, args)
+
+ def get_echo_history(self, *args):
+ return _omnipy.invoke(self, "get_echo_history", _0__GlobalIDL.MyService._d_get_echo_history, args)
+
+ def set_value(self, *args):
+ return _omnipy.invoke(self, "set_value", _0__GlobalIDL.MyService._d_set_value, args)
+
+ def get_value(self, *args):
+ return _omnipy.invoke(self, "get_value", _0__GlobalIDL.MyService._d_get_value, args)
+
+ def get_value_history(self, *args):
+ return _omnipy.invoke(self, "get_value_history", _0__GlobalIDL.MyService._d_get_value_history, args)
+
+ __methods__ = ["echo", "get_echo_history", "set_value", "get_value", "get_value_history"] + CORBA.Object.__methods__
+
+omniORB.registerObjref(MyService._NP_RepositoryId, _objref_MyService)
+_0__GlobalIDL._objref_MyService = _objref_MyService
+del MyService, _objref_MyService
+
+# MyService skeleton
+__name__ = "_GlobalIDL__POA"
+class MyService (PortableServer.Servant):
+ _NP_RepositoryId = _0__GlobalIDL.MyService._NP_RepositoryId
+
+
+ _omni_op_d = {"echo": _0__GlobalIDL.MyService._d_echo, "get_echo_history": _0__GlobalIDL.MyService._d_get_echo_history, "set_value": _0__GlobalIDL.MyService._d_set_value, "get_value": _0__GlobalIDL.MyService._d_get_value, "get_value_history": _0__GlobalIDL.MyService._d_get_value_history}
+
+MyService._omni_skeleton = MyService
+_0__GlobalIDL__POA.MyService = MyService
+del MyService
+__name__ = "_GlobalIDL"
+
+#
+# End of module "_GlobalIDL"
+#
+__name__ = "MyService_idl"
+
+_exported_modules = ( "_GlobalIDL", )
+
+# The end.
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/MyService_idl_example.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/MyService_idl_example.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/MyService_idl_example.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,92 @@
+#!/usr/bin/env python
+
+"""
+ \file MyService_idl_examplefile.py
+ \brief Python example implementations generated from MyService.idl
+ \date $Date$
+
+
+"""
+
+import CORBA, PortableServer
+
+# Import the Python stub modules so type definitions are available.
+
+import _GlobalIDL
+
+# Import the Python Skeleton modules so skeleton base classes are available.
+
+import _GlobalIDL__POA
+
+
+class MyService_i (_GlobalIDL__POA.MyService):
+ """
+ \class MyService_i
+ Example class implementing IDL interface MyService
+ """
+
+ def __init__(self):
+ """
+ \brief standard constructor
+ Initialise member variables here
+ """
+ pass
+
+ # string echo(in string msg)
+ def echo(self, msg):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result
+
+ # EchoList get_echo_history()
+ def get_echo_history(self):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result
+
+ # void set_value(in float value)
+ def set_value(self, value):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: None
+
+ # float get_value()
+ def get_value(self):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result
+
+ # ValueList get_value_history()
+ def get_value_history(self):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result
+
+
+if __name__ == "__main__":
+ import sys
+
+ # Initialise the ORB
+ orb = CORBA.ORB_init(sys.argv)
+
+ # As an example, we activate an object in the Root POA
+ poa = orb.resolve_initial_references("RootPOA")
+
+ # Create an instance of a servant class
+ servant = MyService_i()
+
+ # Activate it in the Root POA
+ poa.activate_object(servant)
+
+ # Get the object reference to the object
+ objref = servant._this()
+
+ # Print a stringified IOR for it
+ print orb.object_to_string(objref)
+
+ # Activate the Root POA's manager
+ poa._get_the_POAManager().activate()
+
+ # Run the ORB, blocking this thread
+ orb.run()
+
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/README.test
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/README.test (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/README.test 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,73 @@
+======================================================================
+ RTComponent: test specificatioin
+ OpenRTM-aist-0.4.2
+ Date: $Date$
+ This file is generated by rtc-template with the following argments.
+# rtc-template -bpython --module-name=test
+# --module-desc='test component' --module-version=1.0.0 --module-vendor=S.Kurihara
+# --module-category=exmple --module-comp-type=STATIC
+# --module-act-type=PERIODIC --module-max-inst=1
+# --service=MySVPro:myservice:MyService
+======================================================================
+ Basic Information
+======================================================================
+# <rtc-template block="module">
+Module Name: test
+Description: test component
+Version: 1.0.0
+Vendor: S.Kurihara
+Category: exmple
+Comp. Type: STATIC
+Act. Type: PERIODIC
+MAX Inst.: 1
+Lang: Python
+Lang Type:
+# </rtc-template>
+======================================================================
+ Activity definition
+======================================================================
+[on_initialize]
+[on_finalize]
+[on_startup]
+[on_shutdown]
+[on_activated]
+[on_deactivated]
+[on_execute]
+[on_aborting]
+[on_error]
+[on_reset]
+[on_state_update]
+[on_rate_changed]
+======================================================================
+ InPorts definition
+======================================================================
+# <rtc-template block="inport">
+# </rtc-template>
+======================================================================
+ OutPorts definition
+======================================================================
+# <rtc-template block="outport">
+# </rtc-template>
+======================================================================
+ Service Port definition
+======================================================================
+# <rtc-template block="serviceport">
+ PortName: MySVPro
+ Description:
+ Interface:
+ [Service Provider Interfaces]
+ Name: myservice
+ Type: MyService
+ Description:
+ Argument:
+ Return Value:
+ Exception:
+ PreCondition:
+ PostCondition:
+# </rtc-template>
+======================================================================
+ Configuration definition
+======================================================================
+# <rtc-template block="configuration">
+# </rtc-template>
+This area is reserved for future OpenRTM.
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/_GlobalIDL/__init__.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/_GlobalIDL/__init__.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/_GlobalIDL/__init__.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,10 @@
+# DO NOT EDIT THIS FILE!
+#
+# Python module _GlobalIDL generated by omniidl
+
+# ** 1. Stub files contributing to this module
+import MyService_idl
+
+# ** 2. Sub-modules
+
+# ** 3. End
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/_GlobalIDL__POA/__init__.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/_GlobalIDL__POA/__init__.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/_GlobalIDL__POA/__init__.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,10 @@
+# DO NOT EDIT THIS FILE!
+#
+# Python module _GlobalIDL__POA generated by omniidl
+
+# ** 1. Stub files contributing to this module
+import MyService_idl
+
+# ** 2. Sub-modules
+
+# ** 3. End
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/test.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/test.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST1/test.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,282 @@
+#!/usr/bin/env python
+# -*- Python -*-
+
+"""
+ \file test.py
+ \brief test component
+ \date $Date$
+
+
+"""
+import sys
+import time
+sys.path.append(".")
+
+# Import RTM module
+import OpenRTM
+import RTC
+
+# Import Service implementation class
+# <rtc-template block="service_impl">
+from MyService_idl_example import *
+
+# </rtc-template>
+
+# Import Service stub modules
+# <rtc-template block="consumer_import">
+# </rtc-template>
+
+
+# This module's spesification
+# <rtc-template block="module_spec">
+test_spec = ["implementation_id", "test",
+ "type_name", "test",
+ "description", "test component",
+ "version", "1.0.0",
+ "vendor", "S.Kurihara",
+ "category", "exmple",
+ "activity_type", "STATIC",
+ "max_instance", "1",
+ "language", "Python",
+ "lang_type", "SCRIPT",
+ ""]
+# </rtc-template>
+
+class test(OpenRTM.DataFlowComponentBase):
+
+ """
+ \class test
+ \brief test component
+
+ """
+ def __init__(self, manager):
+ """
+ \brief constructor
+ \param manager Maneger Object
+ """
+ OpenRTM.DataFlowComponentBase.__init__(self, manager)
+
+
+
+ # Set InPort buffers
+
+ # Set OutPort buffers
+
+
+ """
+ """
+ self._MySVProPort = OpenRTM.CorbaPort("MySVPro")
+
+
+ """
+ """
+ self._myservice = MyService_i()
+
+
+
+ # Set service provider to Ports
+ self._MySVProPort.registerProvider("myservice", "MyService", self._myservice)
+
+ # Set service consumers to Ports
+
+ # Set CORBA Service Ports
+ self.registerPort(self._MySVProPort)
+
+
+ # initialize of configuration-data.
+ # <rtc-template block="init_conf_param">
+
+ # </rtc-template>
+
+
+
+ def onInitialize(self):
+ """
+
+ The initialize action (on CREATED->ALIVE transition)
+ formaer rtc_init_entry()
+
+ \return RTC::ReturnCode_t
+
+ """
+ # Bind variables and configuration variable
+
+ return RTC.RTC_OK
+
+
+
+ #def onFinalize(self, ec_id):
+ # """
+ #
+ # The finalize action (on ALIVE->END transition)
+ # formaer rtc_exiting_entry()
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onStartup(self, ec_id):
+ # """
+ #
+ # The startup action when ExecutionContext startup
+ # former rtc_starting_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onShutdown(self, ec_id):
+ # """
+ #
+ # The shutdown action when ExecutionContext stop
+ # former rtc_stopping_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onActivated(self, ec_id):
+ # """
+ #
+ # The activated action (Active state entry action)
+ # former rtc_active_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onDeactivated(self, ec_id):
+ # """
+ #
+ # The deactivated action (Active state exit action)
+ # former rtc_active_exit()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onExecute(self, ec_id):
+ # """
+ #
+ # The execution action that is invoked periodically
+ # former rtc_active_do()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onAborting(self, ec_id):
+ # """
+ #
+ # The aborting action when main logic error occurred.
+ # former rtc_aborting_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onError(self, ec_id):
+ # """
+ #
+ # The error action in ERROR state
+ # former rtc_error_do()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onReset(self, ec_id):
+ # """
+ #
+ # The reset action that is invoked resetting
+ # This is same but different the former rtc_init_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onStateUpdate(self, ec_id):
+ # """
+ #
+ # The state update action that is invoked after onExecute() action
+ # no corresponding operation exists in OpenRTm-aist-0.2.0
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onRateChanged(self, ec_id):
+ # """
+ #
+ # The action that is invoked when execution context's rate is changed
+ # no corresponding operation exists in OpenRTm-aist-0.2.0
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+
+
+
+def MyModuleInit(manager):
+ profile = OpenRTM.Properties(defaults_str=test_spec)
+ manager.registerFactory(profile,
+ test,
+ OpenRTM.Delete)
+
+ # Create a component
+ comp = manager.createComponent("test")
+
+
+
+def main():
+ mgr = OpenRTM.Manager.init(len(sys.argv), sys.argv)
+ mgr.setModuleInitProc(MyModuleInit)
+ mgr.activateManager()
+ mgr.runManager()
+
+if __name__ == "__main__":
+ main()
+
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/MyService.idl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/MyService.idl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/MyService.idl 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,11 @@
+typedef sequence<string> EchoList;
+typedef sequence<float> ValueList;
+
+interface MyService
+{
+ string echo(in string msg);
+ EchoList get_echo_history();
+ void set_value(in float value);
+ float get_value();
+ ValueList get_value_history();
+};
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/MyService_idl.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/MyService_idl.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/MyService_idl.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,119 @@
+# Python stubs generated by omniidl from MyService.idl
+
+import omniORB, _omnipy
+from omniORB import CORBA, PortableServer
+_0_CORBA = CORBA
+
+_omnipy.checkVersion(2,0, __file__)
+
+try:
+ _omniORB_StructBase = omniORB.StructBase
+except AttributeError:
+ class _omniORB_StructBase: pass
+
+
+#
+# Start of module "_GlobalIDL"
+#
+__name__ = "_GlobalIDL"
+_0__GlobalIDL = omniORB.openModule("_GlobalIDL", r"MyService.idl")
+_0__GlobalIDL__POA = omniORB.openModule("_GlobalIDL__POA", r"MyService.idl")
+
+
+# typedef ... ValueList
+class ValueList:
+ _NP_RepositoryId = "IDL:ValueList:1.0"
+ def __init__(self, *args, **kw):
+ raise RuntimeError("Cannot construct objects of this type.")
+_0__GlobalIDL.ValueList = ValueList
+_0__GlobalIDL._d_ValueList = (omniORB.tcInternal.tv_sequence, omniORB.tcInternal.tv_float, 0)
+_0__GlobalIDL._ad_ValueList = (omniORB.tcInternal.tv_alias, ValueList._NP_RepositoryId, "ValueList", (omniORB.tcInternal.tv_sequence, omniORB.tcInternal.tv_float, 0))
+_0__GlobalIDL._tc_ValueList = omniORB.tcInternal.createTypeCode(_0__GlobalIDL._ad_ValueList)
+omniORB.registerType(ValueList._NP_RepositoryId, _0__GlobalIDL._ad_ValueList, _0__GlobalIDL._tc_ValueList)
+del ValueList
+
+# typedef ... EchoList
+class EchoList:
+ _NP_RepositoryId = "IDL:EchoList:1.0"
+ def __init__(self, *args, **kw):
+ raise RuntimeError("Cannot construct objects of this type.")
+_0__GlobalIDL.EchoList = EchoList
+_0__GlobalIDL._d_EchoList = (omniORB.tcInternal.tv_sequence, (omniORB.tcInternal.tv_string,0), 0)
+_0__GlobalIDL._ad_EchoList = (omniORB.tcInternal.tv_alias, EchoList._NP_RepositoryId, "EchoList", (omniORB.tcInternal.tv_sequence, (omniORB.tcInternal.tv_string,0), 0))
+_0__GlobalIDL._tc_EchoList = omniORB.tcInternal.createTypeCode(_0__GlobalIDL._ad_EchoList)
+omniORB.registerType(EchoList._NP_RepositoryId, _0__GlobalIDL._ad_EchoList, _0__GlobalIDL._tc_EchoList)
+del EchoList
+
+# interface MyService
+_0__GlobalIDL._d_MyService = (omniORB.tcInternal.tv_objref, "IDL:MyService:1.0", "MyService")
+omniORB.typeMapping["IDL:MyService:1.0"] = _0__GlobalIDL._d_MyService
+_0__GlobalIDL.MyService = omniORB.newEmptyClass()
+class MyService :
+ _NP_RepositoryId = _0__GlobalIDL._d_MyService[1]
+
+ def __init__(self, *args, **kw):
+ raise RuntimeError("Cannot construct objects of this type.")
+
+ _nil = CORBA.Object._nil
+
+
+_0__GlobalIDL.MyService = MyService
+_0__GlobalIDL._tc_MyService = omniORB.tcInternal.createTypeCode(_0__GlobalIDL._d_MyService)
+omniORB.registerType(MyService._NP_RepositoryId, _0__GlobalIDL._d_MyService, _0__GlobalIDL._tc_MyService)
+
+# MyService operations and attributes
+MyService._d_echo = (((omniORB.tcInternal.tv_string,0), ), ((omniORB.tcInternal.tv_string,0), ), None)
+MyService._d_get_echo_history = ((), (omniORB.typeMapping["IDL:EchoList:1.0"], ), None)
+MyService._d_set_value = ((omniORB.tcInternal.tv_float, ), (), None)
+MyService._d_get_value = ((), (omniORB.tcInternal.tv_float, ), None)
+MyService._d_get_value_history = ((), (omniORB.typeMapping["IDL:ValueList:1.0"], ), None)
+
+# MyService object reference
+class _objref_MyService (CORBA.Object):
+ _NP_RepositoryId = MyService._NP_RepositoryId
+
+ def __init__(self):
+ CORBA.Object.__init__(self)
+
+ def echo(self, *args):
+ return _omnipy.invoke(self, "echo", _0__GlobalIDL.MyService._d_echo, args)
+
+ def get_echo_history(self, *args):
+ return _omnipy.invoke(self, "get_echo_history", _0__GlobalIDL.MyService._d_get_echo_history, args)
+
+ def set_value(self, *args):
+ return _omnipy.invoke(self, "set_value", _0__GlobalIDL.MyService._d_set_value, args)
+
+ def get_value(self, *args):
+ return _omnipy.invoke(self, "get_value", _0__GlobalIDL.MyService._d_get_value, args)
+
+ def get_value_history(self, *args):
+ return _omnipy.invoke(self, "get_value_history", _0__GlobalIDL.MyService._d_get_value_history, args)
+
+ __methods__ = ["echo", "get_echo_history", "set_value", "get_value", "get_value_history"] + CORBA.Object.__methods__
+
+omniORB.registerObjref(MyService._NP_RepositoryId, _objref_MyService)
+_0__GlobalIDL._objref_MyService = _objref_MyService
+del MyService, _objref_MyService
+
+# MyService skeleton
+__name__ = "_GlobalIDL__POA"
+class MyService (PortableServer.Servant):
+ _NP_RepositoryId = _0__GlobalIDL.MyService._NP_RepositoryId
+
+
+ _omni_op_d = {"echo": _0__GlobalIDL.MyService._d_echo, "get_echo_history": _0__GlobalIDL.MyService._d_get_echo_history, "set_value": _0__GlobalIDL.MyService._d_set_value, "get_value": _0__GlobalIDL.MyService._d_get_value, "get_value_history": _0__GlobalIDL.MyService._d_get_value_history}
+
+MyService._omni_skeleton = MyService
+_0__GlobalIDL__POA.MyService = MyService
+del MyService
+__name__ = "_GlobalIDL"
+
+#
+# End of module "_GlobalIDL"
+#
+__name__ = "MyService_idl"
+
+_exported_modules = ( "_GlobalIDL", )
+
+# The end.
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/README.test
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/README.test (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/README.test 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,108 @@
+======================================================================
+ RTComponent: test specificatioin
+ OpenRTM-aist-0.4.2
+ Date: $Date$
+ This file is generated by rtc-template with the following argments.
+# rtc-template -bpython --module-name=test
+# --module-desc='test component' --module-version=1.0.0 --module-vendor=S.Kurihara
+# --module-category=example --module-comp-type=STATIC
+# --module-act-type=PERIODIC --module-max-inst=1
+# --inport=in:RTC::TimedFloatSeq --outport=out:RTC::TimedFloatSeq
+# --consumer=MySVCon:myservice:MyService
+======================================================================
+ Basic Information
+======================================================================
+# <rtc-template block="module">
+Module Name: test
+Description: test component
+Version: 1.0.0
+Vendor: S.Kurihara
+Category: example
+Comp. Type: STATIC
+Act. Type: PERIODIC
+MAX Inst.: 1
+Lang: Python
+Lang Type:
+# </rtc-template>
+======================================================================
+ Activity definition
+======================================================================
+[on_initialize]
+[on_finalize]
+[on_startup]
+[on_shutdown]
+[on_activated]
+[on_deactivated]
+[on_execute]
+[on_aborting]
+[on_error]
+[on_reset]
+[on_state_update]
+[on_rate_changed]
+======================================================================
+ InPorts definition
+======================================================================
+# <rtc-template block="inport">
+ Name: in
+ PortNumber: 0
+ Description:
+ PortType:
+ DataType: RTC::TimedFloatSeq
+ MaxOut:
+ [Data Elements]
+ Name:
+ Type:
+ Number:
+ Semantics:
+ Unit:
+ Frequency:
+ Operation Cycle:
+ RangeLow:
+ RangeHigh:
+ DefaultValue:
+# </rtc-template>
+======================================================================
+ OutPorts definition
+======================================================================
+# <rtc-template block="outport">
+ Name: out
+ PortNumber: 0
+ Description:
+ PortType:
+ DataType: RTC::TimedFloatSeq
+ MaxOut:
+ [Data Elements]
+ Name:
+ Type:
+ Number:
+ Semantics:
+ Unit:
+ Frequency:
+ Operation Cycle:
+ RangeLow:
+ RangeHigh:
+ DefaultValue:
+# </rtc-template>
+======================================================================
+ Service Port definition
+======================================================================
+# <rtc-template block="serviceport">
+ PortName: MySVCon
+ Description:
+ Interface:
+ [Service Consumer Interfaces]
+ Name: myservice
+ Type: MyService
+ Description:
+ Argument:
+ Return Value:
+ Exception:
+ PreCondition:
+ PostCondition:
+# </rtc-template>
+======================================================================
+ Configuration definition
+======================================================================
+# <rtc-template block="configuration">
+# </rtc-template>
+This area is reserved for future OpenRTM.
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/_GlobalIDL/__init__.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/_GlobalIDL/__init__.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/_GlobalIDL/__init__.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,10 @@
+# DO NOT EDIT THIS FILE!
+#
+# Python module _GlobalIDL generated by omniidl
+
+# ** 1. Stub files contributing to this module
+import MyService_idl
+
+# ** 2. Sub-modules
+
+# ** 3. End
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/_GlobalIDL__POA/__init__.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/_GlobalIDL__POA/__init__.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/_GlobalIDL__POA/__init__.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,10 @@
+# DO NOT EDIT THIS FILE!
+#
+# Python module _GlobalIDL__POA generated by omniidl
+
+# ** 1. Stub files contributing to this module
+import MyService_idl
+
+# ** 2. Sub-modules
+
+# ** 3. End
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/gen.sh
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/gen.sh (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/gen.sh 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1 @@
+rtc-template -bpython --module-name=test --module-desc='test component' --module-version=1.0.0 --module-vendor=S.Kurihara --module-category=example --module-comp-type=STATIC --module-act-type=PERIODIC --module-max-inst=1 --inport=in:TimedFloatSeq --outport=out:TimedFloatSeq --consumer-idl=MyService.idl --consumer=MySVCon:myservice:MyService
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/test.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/test.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST2/test.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,293 @@
+#!/usr/bin/env python
+# -*- Python -*-
+
+"""
+ \file test.py
+ \brief test component
+ \date $Date$
+
+
+"""
+import sys
+import time
+sys.path.append(".")
+
+# Import RTM module
+import OpenRTM
+import RTC
+
+# Import Service implementation class
+# <rtc-template block="service_impl">
+
+# </rtc-template>
+
+# Import Service stub modules
+# <rtc-template block="consumer_import">
+import _GlobalIDL, _GlobalIDL__POA
+
+# </rtc-template>
+
+
+# This module's spesification
+# <rtc-template block="module_spec">
+test_spec = ["implementation_id", "test",
+ "type_name", "test",
+ "description", "test component",
+ "version", "1.0.0",
+ "vendor", "S.Kurihara",
+ "category", "example",
+ "activity_type", "STATIC",
+ "max_instance", "1",
+ "language", "Python",
+ "lang_type", "SCRIPT",
+ ""]
+# </rtc-template>
+
+class test(OpenRTM.DataFlowComponentBase):
+
+ """
+ \class test
+ \brief test component
+
+ """
+ def __init__(self, manager):
+ """
+ \brief constructor
+ \param manager Maneger Object
+ """
+ OpenRTM.DataFlowComponentBase.__init__(self, manager)
+
+ self._d_in = RTC.TimedFloatSeq(RTC.Time(0,0),[])
+ """
+ """
+ self._inIn = OpenRTM.InPort("in", self._d_in, OpenRTM.RingBuffer(8))
+ self._d_out = RTC.TimedFloatSeq(RTC.Time(0,0),[])
+ """
+ """
+ self._outOut = OpenRTM.OutPort("out", self._d_out, OpenRTM.RingBuffer(8))
+
+
+ # Set InPort buffers
+ self.registerInPort("in",self._inIn)
+
+ # Set OutPort buffers
+ self.registerOutPort("out",self._outOut)
+
+
+ """
+ """
+ self._MySVConPort = OpenRTM.CorbaPort("MySVCon")
+
+
+
+
+ """
+ """
+ self._myservice = OpenRTM.CorbaConsumer(interfaceType=_GlobalIDL.MyService)
+
+ # Set service provider to Ports
+
+ # Set service consumers to Ports
+ self._MySVConPort.registerConsumer("myservice", "MyService", self._myservice)
+
+ # Set CORBA Service Ports
+ self.registerPort(self._MySVConPort)
+
+
+ # initialize of configuration-data.
+ # <rtc-template block="init_conf_param">
+
+ # </rtc-template>
+
+
+
+ def onInitialize(self):
+ """
+
+ The initialize action (on CREATED->ALIVE transition)
+ formaer rtc_init_entry()
+
+ \return RTC::ReturnCode_t
+
+ """
+ # Bind variables and configuration variable
+
+ return RTC.RTC_OK
+
+
+
+ #def onFinalize(self, ec_id):
+ # """
+ #
+ # The finalize action (on ALIVE->END transition)
+ # formaer rtc_exiting_entry()
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onStartup(self, ec_id):
+ # """
+ #
+ # The startup action when ExecutionContext startup
+ # former rtc_starting_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onShutdown(self, ec_id):
+ # """
+ #
+ # The shutdown action when ExecutionContext stop
+ # former rtc_stopping_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onActivated(self, ec_id):
+ # """
+ #
+ # The activated action (Active state entry action)
+ # former rtc_active_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onDeactivated(self, ec_id):
+ # """
+ #
+ # The deactivated action (Active state exit action)
+ # former rtc_active_exit()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onExecute(self, ec_id):
+ # """
+ #
+ # The execution action that is invoked periodically
+ # former rtc_active_do()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onAborting(self, ec_id):
+ # """
+ #
+ # The aborting action when main logic error occurred.
+ # former rtc_aborting_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onError(self, ec_id):
+ # """
+ #
+ # The error action in ERROR state
+ # former rtc_error_do()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onReset(self, ec_id):
+ # """
+ #
+ # The reset action that is invoked resetting
+ # This is same but different the former rtc_init_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onStateUpdate(self, ec_id):
+ # """
+ #
+ # The state update action that is invoked after onExecute() action
+ # no corresponding operation exists in OpenRTm-aist-0.2.0
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onRateChanged(self, ec_id):
+ # """
+ #
+ # The action that is invoked when execution context's rate is changed
+ # no corresponding operation exists in OpenRTm-aist-0.2.0
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+
+
+
+def MyModuleInit(manager):
+ profile = OpenRTM.Properties(defaults_str=test_spec)
+ manager.registerFactory(profile,
+ test,
+ OpenRTM.Delete)
+
+ # Create a component
+ comp = manager.createComponent("test")
+
+
+
+def main():
+ mgr = OpenRTM.Manager.init(len(sys.argv), sys.argv)
+ mgr.setModuleInitProc(MyModuleInit)
+ mgr.activateManager()
+ mgr.runManager()
+
+if __name__ == "__main__":
+ main()
+
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/MyService.idl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/MyService.idl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/MyService.idl 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,11 @@
+typedef sequence<string> EchoList;
+typedef sequence<float> ValueList;
+
+interface MyService
+{
+ string echo(in string msg);
+ EchoList get_echo_history();
+ void set_value(in float value);
+ float get_value();
+ ValueList get_value_history();
+};
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/MyService_idl.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/MyService_idl.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/MyService_idl.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,119 @@
+# Python stubs generated by omniidl from MyService.idl
+
+import omniORB, _omnipy
+from omniORB import CORBA, PortableServer
+_0_CORBA = CORBA
+
+_omnipy.checkVersion(2,0, __file__)
+
+try:
+ _omniORB_StructBase = omniORB.StructBase
+except AttributeError:
+ class _omniORB_StructBase: pass
+
+
+#
+# Start of module "_GlobalIDL"
+#
+__name__ = "_GlobalIDL"
+_0__GlobalIDL = omniORB.openModule("_GlobalIDL", r"MyService.idl")
+_0__GlobalIDL__POA = omniORB.openModule("_GlobalIDL__POA", r"MyService.idl")
+
+
+# typedef ... ValueList
+class ValueList:
+ _NP_RepositoryId = "IDL:ValueList:1.0"
+ def __init__(self, *args, **kw):
+ raise RuntimeError("Cannot construct objects of this type.")
+_0__GlobalIDL.ValueList = ValueList
+_0__GlobalIDL._d_ValueList = (omniORB.tcInternal.tv_sequence, omniORB.tcInternal.tv_float, 0)
+_0__GlobalIDL._ad_ValueList = (omniORB.tcInternal.tv_alias, ValueList._NP_RepositoryId, "ValueList", (omniORB.tcInternal.tv_sequence, omniORB.tcInternal.tv_float, 0))
+_0__GlobalIDL._tc_ValueList = omniORB.tcInternal.createTypeCode(_0__GlobalIDL._ad_ValueList)
+omniORB.registerType(ValueList._NP_RepositoryId, _0__GlobalIDL._ad_ValueList, _0__GlobalIDL._tc_ValueList)
+del ValueList
+
+# typedef ... EchoList
+class EchoList:
+ _NP_RepositoryId = "IDL:EchoList:1.0"
+ def __init__(self, *args, **kw):
+ raise RuntimeError("Cannot construct objects of this type.")
+_0__GlobalIDL.EchoList = EchoList
+_0__GlobalIDL._d_EchoList = (omniORB.tcInternal.tv_sequence, (omniORB.tcInternal.tv_string,0), 0)
+_0__GlobalIDL._ad_EchoList = (omniORB.tcInternal.tv_alias, EchoList._NP_RepositoryId, "EchoList", (omniORB.tcInternal.tv_sequence, (omniORB.tcInternal.tv_string,0), 0))
+_0__GlobalIDL._tc_EchoList = omniORB.tcInternal.createTypeCode(_0__GlobalIDL._ad_EchoList)
+omniORB.registerType(EchoList._NP_RepositoryId, _0__GlobalIDL._ad_EchoList, _0__GlobalIDL._tc_EchoList)
+del EchoList
+
+# interface MyService
+_0__GlobalIDL._d_MyService = (omniORB.tcInternal.tv_objref, "IDL:MyService:1.0", "MyService")
+omniORB.typeMapping["IDL:MyService:1.0"] = _0__GlobalIDL._d_MyService
+_0__GlobalIDL.MyService = omniORB.newEmptyClass()
+class MyService :
+ _NP_RepositoryId = _0__GlobalIDL._d_MyService[1]
+
+ def __init__(self, *args, **kw):
+ raise RuntimeError("Cannot construct objects of this type.")
+
+ _nil = CORBA.Object._nil
+
+
+_0__GlobalIDL.MyService = MyService
+_0__GlobalIDL._tc_MyService = omniORB.tcInternal.createTypeCode(_0__GlobalIDL._d_MyService)
+omniORB.registerType(MyService._NP_RepositoryId, _0__GlobalIDL._d_MyService, _0__GlobalIDL._tc_MyService)
+
+# MyService operations and attributes
+MyService._d_echo = (((omniORB.tcInternal.tv_string,0), ), ((omniORB.tcInternal.tv_string,0), ), None)
+MyService._d_get_echo_history = ((), (omniORB.typeMapping["IDL:EchoList:1.0"], ), None)
+MyService._d_set_value = ((omniORB.tcInternal.tv_float, ), (), None)
+MyService._d_get_value = ((), (omniORB.tcInternal.tv_float, ), None)
+MyService._d_get_value_history = ((), (omniORB.typeMapping["IDL:ValueList:1.0"], ), None)
+
+# MyService object reference
+class _objref_MyService (CORBA.Object):
+ _NP_RepositoryId = MyService._NP_RepositoryId
+
+ def __init__(self):
+ CORBA.Object.__init__(self)
+
+ def echo(self, *args):
+ return _omnipy.invoke(self, "echo", _0__GlobalIDL.MyService._d_echo, args)
+
+ def get_echo_history(self, *args):
+ return _omnipy.invoke(self, "get_echo_history", _0__GlobalIDL.MyService._d_get_echo_history, args)
+
+ def set_value(self, *args):
+ return _omnipy.invoke(self, "set_value", _0__GlobalIDL.MyService._d_set_value, args)
+
+ def get_value(self, *args):
+ return _omnipy.invoke(self, "get_value", _0__GlobalIDL.MyService._d_get_value, args)
+
+ def get_value_history(self, *args):
+ return _omnipy.invoke(self, "get_value_history", _0__GlobalIDL.MyService._d_get_value_history, args)
+
+ __methods__ = ["echo", "get_echo_history", "set_value", "get_value", "get_value_history"] + CORBA.Object.__methods__
+
+omniORB.registerObjref(MyService._NP_RepositoryId, _objref_MyService)
+_0__GlobalIDL._objref_MyService = _objref_MyService
+del MyService, _objref_MyService
+
+# MyService skeleton
+__name__ = "_GlobalIDL__POA"
+class MyService (PortableServer.Servant):
+ _NP_RepositoryId = _0__GlobalIDL.MyService._NP_RepositoryId
+
+
+ _omni_op_d = {"echo": _0__GlobalIDL.MyService._d_echo, "get_echo_history": _0__GlobalIDL.MyService._d_get_echo_history, "set_value": _0__GlobalIDL.MyService._d_set_value, "get_value": _0__GlobalIDL.MyService._d_get_value, "get_value_history": _0__GlobalIDL.MyService._d_get_value_history}
+
+MyService._omni_skeleton = MyService
+_0__GlobalIDL__POA.MyService = MyService
+del MyService
+__name__ = "_GlobalIDL"
+
+#
+# End of module "_GlobalIDL"
+#
+__name__ = "MyService_idl"
+
+_exported_modules = ( "_GlobalIDL", )
+
+# The end.
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/MyService_idl_example.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/MyService_idl_example.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/MyService_idl_example.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,92 @@
+#!/usr/bin/env python
+
+"""
+ \file MyService_idl_examplefile.py
+ \brief Python example implementations generated from MyService.idl
+ \date $Date$
+
+
+"""
+
+import CORBA, PortableServer
+
+# Import the Python stub modules so type definitions are available.
+
+import _GlobalIDL
+
+# Import the Python Skeleton modules so skeleton base classes are available.
+
+import _GlobalIDL__POA
+
+
+class MyService_i (_GlobalIDL__POA.MyService):
+ """
+ \class MyService_i
+ Example class implementing IDL interface MyService
+ """
+
+ def __init__(self):
+ """
+ \brief standard constructor
+ Initialise member variables here
+ """
+ pass
+
+ # string echo(in string msg)
+ def echo(self, msg):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result
+
+ # EchoList get_echo_history()
+ def get_echo_history(self):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result
+
+ # void set_value(in float value)
+ def set_value(self, value):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: None
+
+ # float get_value()
+ def get_value(self):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result
+
+ # ValueList get_value_history()
+ def get_value_history(self):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result
+
+
+if __name__ == "__main__":
+ import sys
+
+ # Initialise the ORB
+ orb = CORBA.ORB_init(sys.argv)
+
+ # As an example, we activate an object in the Root POA
+ poa = orb.resolve_initial_references("RootPOA")
+
+ # Create an instance of a servant class
+ servant = MyService_i()
+
+ # Activate it in the Root POA
+ poa.activate_object(servant)
+
+ # Get the object reference to the object
+ objref = servant._this()
+
+ # Print a stringified IOR for it
+ print orb.object_to_string(objref)
+
+ # Activate the Root POA's manager
+ poa._get_the_POAManager().activate()
+
+ # Run the ORB, blocking this thread
+ orb.run()
+
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/README.test
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/README.test (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/README.test 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,121 @@
+======================================================================
+ RTComponent: test specificatioin
+ OpenRTM-aist-0.4.2
+ Date: $Date$
+ This file is generated by rtc-template with the following argments.
+# rtc-template -bpython --module-name=test
+# --module-desc='test component' --module-version=1.0.0 --module-vendor=S.Kurihara
+# --module-category=example --module-comp-type=STATIC
+# --module-act-type=PERIODIC --module-max-inst=1
+# --inport=in:RTC::TimedFloatSeq --outport=out:RTC::TimedFloatSeq
+# --service=MySVPro:myservice0:MyService
+# --consumer=MySVCon:myservice1:MyService
+======================================================================
+ Basic Information
+======================================================================
+# <rtc-template block="module">
+Module Name: test
+Description: test component
+Version: 1.0.0
+Vendor: S.Kurihara
+Category: example
+Comp. Type: STATIC
+Act. Type: PERIODIC
+MAX Inst.: 1
+Lang: Python
+Lang Type:
+# </rtc-template>
+======================================================================
+ Activity definition
+======================================================================
+[on_initialize]
+[on_finalize]
+[on_startup]
+[on_shutdown]
+[on_activated]
+[on_deactivated]
+[on_execute]
+[on_aborting]
+[on_error]
+[on_reset]
+[on_state_update]
+[on_rate_changed]
+======================================================================
+ InPorts definition
+======================================================================
+# <rtc-template block="inport">
+ Name: in
+ PortNumber: 0
+ Description:
+ PortType:
+ DataType: RTC::TimedFloatSeq
+ MaxOut:
+ [Data Elements]
+ Name:
+ Type:
+ Number:
+ Semantics:
+ Unit:
+ Frequency:
+ Operation Cycle:
+ RangeLow:
+ RangeHigh:
+ DefaultValue:
+# </rtc-template>
+======================================================================
+ OutPorts definition
+======================================================================
+# <rtc-template block="outport">
+ Name: out
+ PortNumber: 0
+ Description:
+ PortType:
+ DataType: RTC::TimedFloatSeq
+ MaxOut:
+ [Data Elements]
+ Name:
+ Type:
+ Number:
+ Semantics:
+ Unit:
+ Frequency:
+ Operation Cycle:
+ RangeLow:
+ RangeHigh:
+ DefaultValue:
+# </rtc-template>
+======================================================================
+ Service Port definition
+======================================================================
+# <rtc-template block="serviceport">
+ PortName: MySVPro
+ Description:
+ Interface:
+ [Service Provider Interfaces]
+ Name: myservice0
+ Type: MyService
+ Description:
+ Argument:
+ Return Value:
+ Exception:
+ PreCondition:
+ PostCondition:
+ PortName: MySVCon
+ Description:
+ Interface:
+ [Service Consumer Interfaces]
+ Name: myservice1
+ Type: MyService
+ Description:
+ Argument:
+ Return Value:
+ Exception:
+ PreCondition:
+ PostCondition:
+# </rtc-template>
+======================================================================
+ Configuration definition
+======================================================================
+# <rtc-template block="configuration">
+# </rtc-template>
+This area is reserved for future OpenRTM.
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/_GlobalIDL/__init__.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/_GlobalIDL/__init__.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/_GlobalIDL/__init__.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,10 @@
+# DO NOT EDIT THIS FILE!
+#
+# Python module _GlobalIDL generated by omniidl
+
+# ** 1. Stub files contributing to this module
+import MyService_idl
+
+# ** 2. Sub-modules
+
+# ** 3. End
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/_GlobalIDL__POA/__init__.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/_GlobalIDL__POA/__init__.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/_GlobalIDL__POA/__init__.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,10 @@
+# DO NOT EDIT THIS FILE!
+#
+# Python module _GlobalIDL__POA generated by omniidl
+
+# ** 1. Stub files contributing to this module
+import MyService_idl
+
+# ** 2. Sub-modules
+
+# ** 3. End
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/test.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/test.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST3/test.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,302 @@
+#!/usr/bin/env python
+# -*- Python -*-
+
+"""
+ \file test.py
+ \brief test component
+ \date $Date$
+
+
+"""
+import sys
+import time
+sys.path.append(".")
+
+# Import RTM module
+import OpenRTM
+import RTC
+
+# Import Service implementation class
+# <rtc-template block="service_impl">
+from MyService_idl_example import *
+
+# </rtc-template>
+
+# Import Service stub modules
+# <rtc-template block="consumer_import">
+import _GlobalIDL, _GlobalIDL__POA
+
+# </rtc-template>
+
+
+# This module's spesification
+# <rtc-template block="module_spec">
+test_spec = ["implementation_id", "test",
+ "type_name", "test",
+ "description", "test component",
+ "version", "1.0.0",
+ "vendor", "S.Kurihara",
+ "category", "example",
+ "activity_type", "STATIC",
+ "max_instance", "1",
+ "language", "Python",
+ "lang_type", "SCRIPT",
+ ""]
+# </rtc-template>
+
+class test(OpenRTM.DataFlowComponentBase):
+
+ """
+ \class test
+ \brief test component
+
+ """
+ def __init__(self, manager):
+ """
+ \brief constructor
+ \param manager Maneger Object
+ """
+ OpenRTM.DataFlowComponentBase.__init__(self, manager)
+
+ self._d_in = RTC.TimedFloatSeq(RTC.Time(0,0),[])
+ """
+ """
+ self._inIn = OpenRTM.InPort("in", self._d_in, OpenRTM.RingBuffer(8))
+ self._d_out = RTC.TimedFloatSeq(RTC.Time(0,0),[])
+ """
+ """
+ self._outOut = OpenRTM.OutPort("out", self._d_out, OpenRTM.RingBuffer(8))
+
+
+ # Set InPort buffers
+ self.registerInPort("in",self._inIn)
+
+ # Set OutPort buffers
+ self.registerOutPort("out",self._outOut)
+
+
+ """
+ """
+ self._MySVProPort = OpenRTM.CorbaPort("MySVPro")
+ """
+ """
+ self._MySVConPort = OpenRTM.CorbaPort("MySVCon")
+
+
+ """
+ """
+ self._myservice0 = MyService_i()
+
+
+ """
+ """
+ self._myservice1 = OpenRTM.CorbaConsumer(interfaceType=_GlobalIDL.MyService)
+
+ # Set service provider to Ports
+ self._MySVProPort.registerProvider("myservice0", "MyService", self._myservice0)
+
+ # Set service consumers to Ports
+ self._MySVConPort.registerConsumer("myservice1", "MyService", self._myservice1)
+
+ # Set CORBA Service Ports
+ self.registerPort(self._MySVProPort)
+ self.registerPort(self._MySVConPort)
+
+
+ # initialize of configuration-data.
+ # <rtc-template block="init_conf_param">
+
+ # </rtc-template>
+
+
+
+ def onInitialize(self):
+ """
+
+ The initialize action (on CREATED->ALIVE transition)
+ formaer rtc_init_entry()
+
+ \return RTC::ReturnCode_t
+
+ """
+ # Bind variables and configuration variable
+
+ return RTC.RTC_OK
+
+
+
+ #def onFinalize(self, ec_id):
+ # """
+ #
+ # The finalize action (on ALIVE->END transition)
+ # formaer rtc_exiting_entry()
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onStartup(self, ec_id):
+ # """
+ #
+ # The startup action when ExecutionContext startup
+ # former rtc_starting_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onShutdown(self, ec_id):
+ # """
+ #
+ # The shutdown action when ExecutionContext stop
+ # former rtc_stopping_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onActivated(self, ec_id):
+ # """
+ #
+ # The activated action (Active state entry action)
+ # former rtc_active_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onDeactivated(self, ec_id):
+ # """
+ #
+ # The deactivated action (Active state exit action)
+ # former rtc_active_exit()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onExecute(self, ec_id):
+ # """
+ #
+ # The execution action that is invoked periodically
+ # former rtc_active_do()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onAborting(self, ec_id):
+ # """
+ #
+ # The aborting action when main logic error occurred.
+ # former rtc_aborting_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onError(self, ec_id):
+ # """
+ #
+ # The error action in ERROR state
+ # former rtc_error_do()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onReset(self, ec_id):
+ # """
+ #
+ # The reset action that is invoked resetting
+ # This is same but different the former rtc_init_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onStateUpdate(self, ec_id):
+ # """
+ #
+ # The state update action that is invoked after onExecute() action
+ # no corresponding operation exists in OpenRTm-aist-0.2.0
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onRateChanged(self, ec_id):
+ # """
+ #
+ # The action that is invoked when execution context's rate is changed
+ # no corresponding operation exists in OpenRTm-aist-0.2.0
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+
+
+
+def MyModuleInit(manager):
+ profile = OpenRTM.Properties(defaults_str=test_spec)
+ manager.registerFactory(profile,
+ test,
+ OpenRTM.Delete)
+
+ # Create a component
+ comp = manager.createComponent("test")
+
+
+
+def main():
+ mgr = OpenRTM.Manager.init(len(sys.argv), sys.argv)
+ mgr.setModuleInitProc(MyModuleInit)
+ mgr.activateManager()
+ mgr.runManager()
+
+if __name__ == "__main__":
+ main()
+
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/MyService.idl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/MyService.idl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/MyService.idl 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,11 @@
+typedef sequence<string> EchoList;
+typedef sequence<float> ValueList;
+
+interface MyService
+{
+ string echo(in string msg);
+ EchoList get_echo_history();
+ void set_value(in float value);
+ float get_value();
+ ValueList get_value_history();
+};
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/MyService_idl.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/MyService_idl.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/MyService_idl.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,119 @@
+# Python stubs generated by omniidl from MyService.idl
+
+import omniORB, _omnipy
+from omniORB import CORBA, PortableServer
+_0_CORBA = CORBA
+
+_omnipy.checkVersion(2,0, __file__)
+
+try:
+ _omniORB_StructBase = omniORB.StructBase
+except AttributeError:
+ class _omniORB_StructBase: pass
+
+
+#
+# Start of module "_GlobalIDL"
+#
+__name__ = "_GlobalIDL"
+_0__GlobalIDL = omniORB.openModule("_GlobalIDL", r"MyService.idl")
+_0__GlobalIDL__POA = omniORB.openModule("_GlobalIDL__POA", r"MyService.idl")
+
+
+# typedef ... ValueList
+class ValueList:
+ _NP_RepositoryId = "IDL:ValueList:1.0"
+ def __init__(self, *args, **kw):
+ raise RuntimeError("Cannot construct objects of this type.")
+_0__GlobalIDL.ValueList = ValueList
+_0__GlobalIDL._d_ValueList = (omniORB.tcInternal.tv_sequence, omniORB.tcInternal.tv_float, 0)
+_0__GlobalIDL._ad_ValueList = (omniORB.tcInternal.tv_alias, ValueList._NP_RepositoryId, "ValueList", (omniORB.tcInternal.tv_sequence, omniORB.tcInternal.tv_float, 0))
+_0__GlobalIDL._tc_ValueList = omniORB.tcInternal.createTypeCode(_0__GlobalIDL._ad_ValueList)
+omniORB.registerType(ValueList._NP_RepositoryId, _0__GlobalIDL._ad_ValueList, _0__GlobalIDL._tc_ValueList)
+del ValueList
+
+# typedef ... EchoList
+class EchoList:
+ _NP_RepositoryId = "IDL:EchoList:1.0"
+ def __init__(self, *args, **kw):
+ raise RuntimeError("Cannot construct objects of this type.")
+_0__GlobalIDL.EchoList = EchoList
+_0__GlobalIDL._d_EchoList = (omniORB.tcInternal.tv_sequence, (omniORB.tcInternal.tv_string,0), 0)
+_0__GlobalIDL._ad_EchoList = (omniORB.tcInternal.tv_alias, EchoList._NP_RepositoryId, "EchoList", (omniORB.tcInternal.tv_sequence, (omniORB.tcInternal.tv_string,0), 0))
+_0__GlobalIDL._tc_EchoList = omniORB.tcInternal.createTypeCode(_0__GlobalIDL._ad_EchoList)
+omniORB.registerType(EchoList._NP_RepositoryId, _0__GlobalIDL._ad_EchoList, _0__GlobalIDL._tc_EchoList)
+del EchoList
+
+# interface MyService
+_0__GlobalIDL._d_MyService = (omniORB.tcInternal.tv_objref, "IDL:MyService:1.0", "MyService")
+omniORB.typeMapping["IDL:MyService:1.0"] = _0__GlobalIDL._d_MyService
+_0__GlobalIDL.MyService = omniORB.newEmptyClass()
+class MyService :
+ _NP_RepositoryId = _0__GlobalIDL._d_MyService[1]
+
+ def __init__(self, *args, **kw):
+ raise RuntimeError("Cannot construct objects of this type.")
+
+ _nil = CORBA.Object._nil
+
+
+_0__GlobalIDL.MyService = MyService
+_0__GlobalIDL._tc_MyService = omniORB.tcInternal.createTypeCode(_0__GlobalIDL._d_MyService)
+omniORB.registerType(MyService._NP_RepositoryId, _0__GlobalIDL._d_MyService, _0__GlobalIDL._tc_MyService)
+
+# MyService operations and attributes
+MyService._d_echo = (((omniORB.tcInternal.tv_string,0), ), ((omniORB.tcInternal.tv_string,0), ), None)
+MyService._d_get_echo_history = ((), (omniORB.typeMapping["IDL:EchoList:1.0"], ), None)
+MyService._d_set_value = ((omniORB.tcInternal.tv_float, ), (), None)
+MyService._d_get_value = ((), (omniORB.tcInternal.tv_float, ), None)
+MyService._d_get_value_history = ((), (omniORB.typeMapping["IDL:ValueList:1.0"], ), None)
+
+# MyService object reference
+class _objref_MyService (CORBA.Object):
+ _NP_RepositoryId = MyService._NP_RepositoryId
+
+ def __init__(self):
+ CORBA.Object.__init__(self)
+
+ def echo(self, *args):
+ return _omnipy.invoke(self, "echo", _0__GlobalIDL.MyService._d_echo, args)
+
+ def get_echo_history(self, *args):
+ return _omnipy.invoke(self, "get_echo_history", _0__GlobalIDL.MyService._d_get_echo_history, args)
+
+ def set_value(self, *args):
+ return _omnipy.invoke(self, "set_value", _0__GlobalIDL.MyService._d_set_value, args)
+
+ def get_value(self, *args):
+ return _omnipy.invoke(self, "get_value", _0__GlobalIDL.MyService._d_get_value, args)
+
+ def get_value_history(self, *args):
+ return _omnipy.invoke(self, "get_value_history", _0__GlobalIDL.MyService._d_get_value_history, args)
+
+ __methods__ = ["echo", "get_echo_history", "set_value", "get_value", "get_value_history"] + CORBA.Object.__methods__
+
+omniORB.registerObjref(MyService._NP_RepositoryId, _objref_MyService)
+_0__GlobalIDL._objref_MyService = _objref_MyService
+del MyService, _objref_MyService
+
+# MyService skeleton
+__name__ = "_GlobalIDL__POA"
+class MyService (PortableServer.Servant):
+ _NP_RepositoryId = _0__GlobalIDL.MyService._NP_RepositoryId
+
+
+ _omni_op_d = {"echo": _0__GlobalIDL.MyService._d_echo, "get_echo_history": _0__GlobalIDL.MyService._d_get_echo_history, "set_value": _0__GlobalIDL.MyService._d_set_value, "get_value": _0__GlobalIDL.MyService._d_get_value, "get_value_history": _0__GlobalIDL.MyService._d_get_value_history}
+
+MyService._omni_skeleton = MyService
+_0__GlobalIDL__POA.MyService = MyService
+del MyService
+__name__ = "_GlobalIDL"
+
+#
+# End of module "_GlobalIDL"
+#
+__name__ = "MyService_idl"
+
+_exported_modules = ( "_GlobalIDL", )
+
+# The end.
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/MyService_idl_example.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/MyService_idl_example.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/MyService_idl_example.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,92 @@
+#!/usr/bin/env python
+
+"""
+ \file MyService_idl_examplefile.py
+ \brief Python example implementations generated from MyService.idl
+ \date $Date$
+
+
+"""
+
+import CORBA, PortableServer
+
+# Import the Python stub modules so type definitions are available.
+
+import _GlobalIDL
+
+# Import the Python Skeleton modules so skeleton base classes are available.
+
+import _GlobalIDL__POA
+
+
+class MyService_i (_GlobalIDL__POA.MyService):
+ """
+ \class MyService_i
+ Example class implementing IDL interface MyService
+ """
+
+ def __init__(self):
+ """
+ \brief standard constructor
+ Initialise member variables here
+ """
+ pass
+
+ # string echo(in string msg)
+ def echo(self, msg):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result
+
+ # EchoList get_echo_history()
+ def get_echo_history(self):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result
+
+ # void set_value(in float value)
+ def set_value(self, value):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: None
+
+ # float get_value()
+ def get_value(self):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result
+
+ # ValueList get_value_history()
+ def get_value_history(self):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result
+
+
+if __name__ == "__main__":
+ import sys
+
+ # Initialise the ORB
+ orb = CORBA.ORB_init(sys.argv)
+
+ # As an example, we activate an object in the Root POA
+ poa = orb.resolve_initial_references("RootPOA")
+
+ # Create an instance of a servant class
+ servant = MyService_i()
+
+ # Activate it in the Root POA
+ poa.activate_object(servant)
+
+ # Get the object reference to the object
+ objref = servant._this()
+
+ # Print a stringified IOR for it
+ print orb.object_to_string(objref)
+
+ # Activate the Root POA's manager
+ poa._get_the_POAManager().activate()
+
+ # Run the ORB, blocking this thread
+ orb.run()
+
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/README.test
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/README.test (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/README.test 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,86 @@
+======================================================================
+ RTComponent: test specificatioin
+ OpenRTM-aist-0.4.2
+ Date: $Date$
+ This file is generated by rtc-template with the following argments.
+# rtc-template -bpython --module-name=test
+# --module-desc='test component' --module-version=1.0.0 --module-vendor=S.Kurihara
+# --module-category=sample --module-comp-type=STATIC
+# --module-act-type=PERIODIC --module-max-inst=1
+# --service=MySVPro0:myservice0:MyService
+# --service=MySVPro1:myservice:MyService
+======================================================================
+ Basic Information
+======================================================================
+# <rtc-template block="module">
+Module Name: test
+Description: test component
+Version: 1.0.0
+Vendor: S.Kurihara
+Category: sample
+Comp. Type: STATIC
+Act. Type: PERIODIC
+MAX Inst.: 1
+Lang: Python
+Lang Type:
+# </rtc-template>
+======================================================================
+ Activity definition
+======================================================================
+[on_initialize]
+[on_finalize]
+[on_startup]
+[on_shutdown]
+[on_activated]
+[on_deactivated]
+[on_execute]
+[on_aborting]
+[on_error]
+[on_reset]
+[on_state_update]
+[on_rate_changed]
+======================================================================
+ InPorts definition
+======================================================================
+# <rtc-template block="inport">
+# </rtc-template>
+======================================================================
+ OutPorts definition
+======================================================================
+# <rtc-template block="outport">
+# </rtc-template>
+======================================================================
+ Service Port definition
+======================================================================
+# <rtc-template block="serviceport">
+ PortName: MySVPro0
+ Description:
+ Interface:
+ [Service Provider Interfaces]
+ Name: myservice0
+ Type: MyService
+ Description:
+ Argument:
+ Return Value:
+ Exception:
+ PreCondition:
+ PostCondition:
+ PortName: MySVPro1
+ Description:
+ Interface:
+ [Service Provider Interfaces]
+ Name: myservice
+ Type: MyService
+ Description:
+ Argument:
+ Return Value:
+ Exception:
+ PreCondition:
+ PostCondition:
+# </rtc-template>
+======================================================================
+ Configuration definition
+======================================================================
+# <rtc-template block="configuration">
+# </rtc-template>
+This area is reserved for future OpenRTM.
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/_GlobalIDL/__init__.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/_GlobalIDL/__init__.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/_GlobalIDL/__init__.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,10 @@
+# DO NOT EDIT THIS FILE!
+#
+# Python module _GlobalIDL generated by omniidl
+
+# ** 1. Stub files contributing to this module
+import MyService_idl
+
+# ** 2. Sub-modules
+
+# ** 3. End
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/_GlobalIDL__POA/__init__.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/_GlobalIDL__POA/__init__.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/_GlobalIDL__POA/__init__.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,10 @@
+# DO NOT EDIT THIS FILE!
+#
+# Python module _GlobalIDL__POA generated by omniidl
+
+# ** 1. Stub files contributing to this module
+import MyService_idl
+
+# ** 2. Sub-modules
+
+# ** 3. End
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/test.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/test.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST4/test.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,290 @@
+#!/usr/bin/env python
+# -*- Python -*-
+
+"""
+ \file test.py
+ \brief test component
+ \date $Date$
+
+
+"""
+import sys
+import time
+sys.path.append(".")
+
+# Import RTM module
+import OpenRTM
+import RTC
+
+# Import Service implementation class
+# <rtc-template block="service_impl">
+from MyService_idl_example import *
+
+# </rtc-template>
+
+# Import Service stub modules
+# <rtc-template block="consumer_import">
+# </rtc-template>
+
+
+# This module's spesification
+# <rtc-template block="module_spec">
+test_spec = ["implementation_id", "test",
+ "type_name", "test",
+ "description", "test component",
+ "version", "1.0.0",
+ "vendor", "S.Kurihara",
+ "category", "sample",
+ "activity_type", "STATIC",
+ "max_instance", "1",
+ "language", "Python",
+ "lang_type", "SCRIPT",
+ ""]
+# </rtc-template>
+
+class test(OpenRTM.DataFlowComponentBase):
+
+ """
+ \class test
+ \brief test component
+
+ """
+ def __init__(self, manager):
+ """
+ \brief constructor
+ \param manager Maneger Object
+ """
+ OpenRTM.DataFlowComponentBase.__init__(self, manager)
+
+
+
+ # Set InPort buffers
+
+ # Set OutPort buffers
+
+
+ """
+ """
+ self._MySVPro0Port = OpenRTM.CorbaPort("MySVPro0")
+ """
+ """
+ self._MySVPro1Port = OpenRTM.CorbaPort("MySVPro1")
+
+
+ """
+ """
+ self._myservice0 = MyService_i()
+ """
+ """
+ self._myservice = MyService_i()
+
+
+
+ # Set service provider to Ports
+ self._MySVPro0Port.registerProvider("myservice0", "MyService", self._myservice0)
+ self._MySVPro1Port.registerProvider("myservice", "MyService", self._myservice)
+
+ # Set service consumers to Ports
+
+ # Set CORBA Service Ports
+ self.registerPort(self._MySVPro0Port)
+ self.registerPort(self._MySVPro1Port)
+
+
+ # initialize of configuration-data.
+ # <rtc-template block="init_conf_param">
+
+ # </rtc-template>
+
+
+
+ def onInitialize(self):
+ """
+
+ The initialize action (on CREATED->ALIVE transition)
+ formaer rtc_init_entry()
+
+ \return RTC::ReturnCode_t
+
+ """
+ # Bind variables and configuration variable
+
+ return RTC.RTC_OK
+
+
+
+ #def onFinalize(self, ec_id):
+ # """
+ #
+ # The finalize action (on ALIVE->END transition)
+ # formaer rtc_exiting_entry()
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onStartup(self, ec_id):
+ # """
+ #
+ # The startup action when ExecutionContext startup
+ # former rtc_starting_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onShutdown(self, ec_id):
+ # """
+ #
+ # The shutdown action when ExecutionContext stop
+ # former rtc_stopping_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onActivated(self, ec_id):
+ # """
+ #
+ # The activated action (Active state entry action)
+ # former rtc_active_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onDeactivated(self, ec_id):
+ # """
+ #
+ # The deactivated action (Active state exit action)
+ # former rtc_active_exit()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onExecute(self, ec_id):
+ # """
+ #
+ # The execution action that is invoked periodically
+ # former rtc_active_do()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onAborting(self, ec_id):
+ # """
+ #
+ # The aborting action when main logic error occurred.
+ # former rtc_aborting_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onError(self, ec_id):
+ # """
+ #
+ # The error action in ERROR state
+ # former rtc_error_do()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onReset(self, ec_id):
+ # """
+ #
+ # The reset action that is invoked resetting
+ # This is same but different the former rtc_init_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onStateUpdate(self, ec_id):
+ # """
+ #
+ # The state update action that is invoked after onExecute() action
+ # no corresponding operation exists in OpenRTm-aist-0.2.0
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onRateChanged(self, ec_id):
+ # """
+ #
+ # The action that is invoked when execution context's rate is changed
+ # no corresponding operation exists in OpenRTm-aist-0.2.0
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+
+
+
+def MyModuleInit(manager):
+ profile = OpenRTM.Properties(defaults_str=test_spec)
+ manager.registerFactory(profile,
+ test,
+ OpenRTM.Delete)
+
+ # Create a component
+ comp = manager.createComponent("test")
+
+
+
+def main():
+ mgr = OpenRTM.Manager.init(len(sys.argv), sys.argv)
+ mgr.setModuleInitProc(MyModuleInit)
+ mgr.activateManager()
+ mgr.runManager()
+
+if __name__ == "__main__":
+ main()
+
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST6/README.test
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST6/README.test (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST6/README.test 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,60 @@
+======================================================================
+ RTComponent: test specificatioin
+ OpenRTM-aist-0.4.2
+ Date: $Date$
+ This file is generated by rtc-template with the following argments.
+# rtc-template -bpython --module-name=test
+# --module-desc='test component' --module-version=1.0.0 --module-vendor=S.Kurihara
+# --module-category=sample --module-comp-type=STATIC
+# --module-act-type=PERIODIC --module-max-inst=1
+======================================================================
+ Basic Information
+======================================================================
+# <rtc-template block="module">
+Module Name: test
+Description: test component
+Version: 1.0.0
+Vendor: S.Kurihara
+Category: sample
+Comp. Type: STATIC
+Act. Type: PERIODIC
+MAX Inst.: 1
+Lang: Python
+Lang Type:
+# </rtc-template>
+======================================================================
+ Activity definition
+======================================================================
+[on_initialize]
+[on_finalize]
+[on_startup]
+[on_shutdown]
+[on_activated]
+[on_deactivated]
+[on_execute]
+[on_aborting]
+[on_error]
+[on_reset]
+[on_state_update]
+[on_rate_changed]
+======================================================================
+ InPorts definition
+======================================================================
+# <rtc-template block="inport">
+# </rtc-template>
+======================================================================
+ OutPorts definition
+======================================================================
+# <rtc-template block="outport">
+# </rtc-template>
+======================================================================
+ Service Port definition
+======================================================================
+# <rtc-template block="serviceport">
+# </rtc-template>
+======================================================================
+ Configuration definition
+======================================================================
+# <rtc-template block="configuration">
+# </rtc-template>
+This area is reserved for future OpenRTM.
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST6/test.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST6/test.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST6/test.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,273 @@
+#!/usr/bin/env python
+# -*- Python -*-
+
+"""
+ \file test.py
+ \brief test component
+ \date $Date$
+
+
+"""
+import sys
+import time
+sys.path.append(".")
+
+# Import RTM module
+import OpenRTM
+import RTC
+
+# Import Service implementation class
+# <rtc-template block="service_impl">
+
+# </rtc-template>
+
+# Import Service stub modules
+# <rtc-template block="consumer_import">
+# </rtc-template>
+
+
+# This module's spesification
+# <rtc-template block="module_spec">
+test_spec = ["implementation_id", "test",
+ "type_name", "test",
+ "description", "test component",
+ "version", "1.0.0",
+ "vendor", "S.Kurihara",
+ "category", "sample",
+ "activity_type", "STATIC",
+ "max_instance", "1",
+ "language", "Python",
+ "lang_type", "SCRIPT",
+ ""]
+# </rtc-template>
+
+class test(OpenRTM.DataFlowComponentBase):
+
+ """
+ \class test
+ \brief test component
+
+ """
+ def __init__(self, manager):
+ """
+ \brief constructor
+ \param manager Maneger Object
+ """
+ OpenRTM.DataFlowComponentBase.__init__(self, manager)
+
+
+
+ # Set InPort buffers
+
+ # Set OutPort buffers
+
+
+
+
+
+
+
+ # Set service provider to Ports
+
+ # Set service consumers to Ports
+
+ # Set CORBA Service Ports
+
+
+ # initialize of configuration-data.
+ # <rtc-template block="init_conf_param">
+
+ # </rtc-template>
+
+
+
+ def onInitialize(self):
+ """
+
+ The initialize action (on CREATED->ALIVE transition)
+ formaer rtc_init_entry()
+
+ \return RTC::ReturnCode_t
+
+ """
+ # Bind variables and configuration variable
+
+ return RTC.RTC_OK
+
+
+
+ #def onFinalize(self, ec_id):
+ # """
+ #
+ # The finalize action (on ALIVE->END transition)
+ # formaer rtc_exiting_entry()
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onStartup(self, ec_id):
+ # """
+ #
+ # The startup action when ExecutionContext startup
+ # former rtc_starting_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onShutdown(self, ec_id):
+ # """
+ #
+ # The shutdown action when ExecutionContext stop
+ # former rtc_stopping_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onActivated(self, ec_id):
+ # """
+ #
+ # The activated action (Active state entry action)
+ # former rtc_active_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onDeactivated(self, ec_id):
+ # """
+ #
+ # The deactivated action (Active state exit action)
+ # former rtc_active_exit()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onExecute(self, ec_id):
+ # """
+ #
+ # The execution action that is invoked periodically
+ # former rtc_active_do()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onAborting(self, ec_id):
+ # """
+ #
+ # The aborting action when main logic error occurred.
+ # former rtc_aborting_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onError(self, ec_id):
+ # """
+ #
+ # The error action in ERROR state
+ # former rtc_error_do()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onReset(self, ec_id):
+ # """
+ #
+ # The reset action that is invoked resetting
+ # This is same but different the former rtc_init_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onStateUpdate(self, ec_id):
+ # """
+ #
+ # The state update action that is invoked after onExecute() action
+ # no corresponding operation exists in OpenRTm-aist-0.2.0
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onRateChanged(self, ec_id):
+ # """
+ #
+ # The action that is invoked when execution context's rate is changed
+ # no corresponding operation exists in OpenRTm-aist-0.2.0
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+
+
+
+def MyModuleInit(manager):
+ profile = OpenRTM.Properties(defaults_str=test_spec)
+ manager.registerFactory(profile,
+ test,
+ OpenRTM.Delete)
+
+ # Create a component
+ comp = manager.createComponent("test")
+
+
+
+def main():
+ mgr = OpenRTM.Manager.init(len(sys.argv), sys.argv)
+ mgr.setModuleInitProc(MyModuleInit)
+ mgr.activateManager()
+ mgr.runManager()
+
+if __name__ == "__main__":
+ main()
+
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST6/work/MyService.idl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST6/work/MyService.idl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST6/work/MyService.idl 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,6 @@
+interface MyService
+{
+ void setGain(in float gain);
+ float getGain();
+};
+
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST6/work/MyServiceAIST.idl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST6/work/MyServiceAIST.idl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/AIST6/work/MyServiceAIST.idl 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,11 @@
+typedef sequence<string> EchoList;
+typedef sequence<float> ValueList;
+
+interface MyService2
+{
+ string echo(in string msg);
+ EchoList get_echo_history();
+ void set_value(in float value);
+ float get_value();
+ ValueList get_value_history();
+};
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/MyService.idl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/MyService.idl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/MyService.idl 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,19 @@
+interface MyService
+{
+ short echo01(in short ss, out short ss2, inout short ss3);
+ long echo02(in long ss, out long ss2, inout long ss3);
+ long long echo03(in long long ss, out long long ss2, inout long long ss3);
+ unsigned long echo04(in unsigned long ss, out unsigned long ss2, inout unsigned long ss3);
+ unsigned long long echo05(in unsigned long long ss, out unsigned long long ss2, inout unsigned long long ss3);
+ unsigned short echo06(in unsigned short ss, out unsigned short ss2, inout unsigned short ss3);
+ float echo07(in float ss, out float ss2, inout float ss3);
+ double echo08(in double ss, out double ss2, inout double ss3);
+// long double echo09(in long double ss, out long double ss2, inout long double ss3);
+ char echo10(in char ss, out char ss2, inout char ss3);
+ wchar echo11(in wchar ss, out wchar ss2, inout wchar ss3);
+ octet echo12(in octet ss, out octet ss2, inout octet ss3);
+ boolean echo13(in boolean ss, out boolean ss2, inout boolean ss3);
+ string echo14(in string ss, out string ss2, inout string ss3);
+ wstring echo15(in wstring ss, out wstring ss2, inout wstring ss3);
+ any echo16(in any ss, out any ss2, inout any ss3);
+};
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/MyService_idl.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/MyService_idl.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/MyService_idl.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,135 @@
+# Python stubs generated by omniidl from MyService.idl
+
+import omniORB, _omnipy
+from omniORB import CORBA, PortableServer
+_0_CORBA = CORBA
+
+_omnipy.checkVersion(2,0, __file__)
+
+try:
+ _omniORB_StructBase = omniORB.StructBase
+except AttributeError:
+ class _omniORB_StructBase: pass
+
+
+#
+# Start of module "_GlobalIDL"
+#
+__name__ = "_GlobalIDL"
+_0__GlobalIDL = omniORB.openModule("_GlobalIDL", r"MyService.idl")
+_0__GlobalIDL__POA = omniORB.openModule("_GlobalIDL__POA", r"MyService.idl")
+
+
+# interface MyService
+_0__GlobalIDL._d_MyService = (omniORB.tcInternal.tv_objref, "IDL:MyService:1.0", "MyService")
+omniORB.typeMapping["IDL:MyService:1.0"] = _0__GlobalIDL._d_MyService
+_0__GlobalIDL.MyService = omniORB.newEmptyClass()
+class MyService :
+ _NP_RepositoryId = _0__GlobalIDL._d_MyService[1]
+
+ def __init__(self, *args, **kw):
+ raise RuntimeError("Cannot construct objects of this type.")
+
+ _nil = CORBA.Object._nil
+
+
+_0__GlobalIDL.MyService = MyService
+_0__GlobalIDL._tc_MyService = omniORB.tcInternal.createTypeCode(_0__GlobalIDL._d_MyService)
+omniORB.registerType(MyService._NP_RepositoryId, _0__GlobalIDL._d_MyService, _0__GlobalIDL._tc_MyService)
+
+# MyService operations and attributes
+MyService._d_echo01 = ((omniORB.tcInternal.tv_short, omniORB.tcInternal.tv_short), (omniORB.tcInternal.tv_short, omniORB.tcInternal.tv_short, omniORB.tcInternal.tv_short), None)
+MyService._d_echo02 = ((omniORB.tcInternal.tv_long, omniORB.tcInternal.tv_long), (omniORB.tcInternal.tv_long, omniORB.tcInternal.tv_long, omniORB.tcInternal.tv_long), None)
+MyService._d_echo03 = ((omniORB.tcInternal.tv_longlong, omniORB.tcInternal.tv_longlong), (omniORB.tcInternal.tv_longlong, omniORB.tcInternal.tv_longlong, omniORB.tcInternal.tv_longlong), None)
+MyService._d_echo04 = ((omniORB.tcInternal.tv_ulong, omniORB.tcInternal.tv_ulong), (omniORB.tcInternal.tv_ulong, omniORB.tcInternal.tv_ulong, omniORB.tcInternal.tv_ulong), None)
+MyService._d_echo05 = ((omniORB.tcInternal.tv_ulonglong, omniORB.tcInternal.tv_ulonglong), (omniORB.tcInternal.tv_ulonglong, omniORB.tcInternal.tv_ulonglong, omniORB.tcInternal.tv_ulonglong), None)
+MyService._d_echo06 = ((omniORB.tcInternal.tv_ushort, omniORB.tcInternal.tv_ushort), (omniORB.tcInternal.tv_ushort, omniORB.tcInternal.tv_ushort, omniORB.tcInternal.tv_ushort), None)
+MyService._d_echo07 = ((omniORB.tcInternal.tv_float, omniORB.tcInternal.tv_float), (omniORB.tcInternal.tv_float, omniORB.tcInternal.tv_float, omniORB.tcInternal.tv_float), None)
+MyService._d_echo08 = ((omniORB.tcInternal.tv_double, omniORB.tcInternal.tv_double), (omniORB.tcInternal.tv_double, omniORB.tcInternal.tv_double, omniORB.tcInternal.tv_double), None)
+MyService._d_echo10 = ((omniORB.tcInternal.tv_char, omniORB.tcInternal.tv_char), (omniORB.tcInternal.tv_char, omniORB.tcInternal.tv_char, omniORB.tcInternal.tv_char), None)
+MyService._d_echo11 = ((omniORB.tcInternal.tv_wchar, omniORB.tcInternal.tv_wchar), (omniORB.tcInternal.tv_wchar, omniORB.tcInternal.tv_wchar, omniORB.tcInternal.tv_wchar), None)
+MyService._d_echo12 = ((omniORB.tcInternal.tv_octet, omniORB.tcInternal.tv_octet), (omniORB.tcInternal.tv_octet, omniORB.tcInternal.tv_octet, omniORB.tcInternal.tv_octet), None)
+MyService._d_echo13 = ((omniORB.tcInternal.tv_boolean, omniORB.tcInternal.tv_boolean), (omniORB.tcInternal.tv_boolean, omniORB.tcInternal.tv_boolean, omniORB.tcInternal.tv_boolean), None)
+MyService._d_echo14 = (((omniORB.tcInternal.tv_string,0), (omniORB.tcInternal.tv_string,0)), ((omniORB.tcInternal.tv_string,0), (omniORB.tcInternal.tv_string,0), (omniORB.tcInternal.tv_string,0)), None)
+MyService._d_echo15 = (((omniORB.tcInternal.tv_wstring,0), (omniORB.tcInternal.tv_wstring,0)), ((omniORB.tcInternal.tv_wstring,0), (omniORB.tcInternal.tv_wstring,0), (omniORB.tcInternal.tv_wstring,0)), None)
+MyService._d_echo16 = ((omniORB.tcInternal.tv_any, omniORB.tcInternal.tv_any), (omniORB.tcInternal.tv_any, omniORB.tcInternal.tv_any, omniORB.tcInternal.tv_any), None)
+
+# MyService object reference
+class _objref_MyService (CORBA.Object):
+ _NP_RepositoryId = MyService._NP_RepositoryId
+
+ def __init__(self):
+ CORBA.Object.__init__(self)
+
+ def echo01(self, *args):
+ return _omnipy.invoke(self, "echo01", _0__GlobalIDL.MyService._d_echo01, args)
+
+ def echo02(self, *args):
+ return _omnipy.invoke(self, "echo02", _0__GlobalIDL.MyService._d_echo02, args)
+
+ def echo03(self, *args):
+ return _omnipy.invoke(self, "echo03", _0__GlobalIDL.MyService._d_echo03, args)
+
+ def echo04(self, *args):
+ return _omnipy.invoke(self, "echo04", _0__GlobalIDL.MyService._d_echo04, args)
+
+ def echo05(self, *args):
+ return _omnipy.invoke(self, "echo05", _0__GlobalIDL.MyService._d_echo05, args)
+
+ def echo06(self, *args):
+ return _omnipy.invoke(self, "echo06", _0__GlobalIDL.MyService._d_echo06, args)
+
+ def echo07(self, *args):
+ return _omnipy.invoke(self, "echo07", _0__GlobalIDL.MyService._d_echo07, args)
+
+ def echo08(self, *args):
+ return _omnipy.invoke(self, "echo08", _0__GlobalIDL.MyService._d_echo08, args)
+
+ def echo10(self, *args):
+ return _omnipy.invoke(self, "echo10", _0__GlobalIDL.MyService._d_echo10, args)
+
+ def echo11(self, *args):
+ return _omnipy.invoke(self, "echo11", _0__GlobalIDL.MyService._d_echo11, args)
+
+ def echo12(self, *args):
+ return _omnipy.invoke(self, "echo12", _0__GlobalIDL.MyService._d_echo12, args)
+
+ def echo13(self, *args):
+ return _omnipy.invoke(self, "echo13", _0__GlobalIDL.MyService._d_echo13, args)
+
+ def echo14(self, *args):
+ return _omnipy.invoke(self, "echo14", _0__GlobalIDL.MyService._d_echo14, args)
+
+ def echo15(self, *args):
+ return _omnipy.invoke(self, "echo15", _0__GlobalIDL.MyService._d_echo15, args)
+
+ def echo16(self, *args):
+ return _omnipy.invoke(self, "echo16", _0__GlobalIDL.MyService._d_echo16, args)
+
+ __methods__ = ["echo01", "echo02", "echo03", "echo04", "echo05", "echo06", "echo07", "echo08", "echo10", "echo11", "echo12", "echo13", "echo14", "echo15", "echo16"] + CORBA.Object.__methods__
+
+omniORB.registerObjref(MyService._NP_RepositoryId, _objref_MyService)
+_0__GlobalIDL._objref_MyService = _objref_MyService
+del MyService, _objref_MyService
+
+# MyService skeleton
+__name__ = "_GlobalIDL__POA"
+class MyService (PortableServer.Servant):
+ _NP_RepositoryId = _0__GlobalIDL.MyService._NP_RepositoryId
+
+
+ _omni_op_d = {"echo01": _0__GlobalIDL.MyService._d_echo01, "echo02": _0__GlobalIDL.MyService._d_echo02, "echo03": _0__GlobalIDL.MyService._d_echo03, "echo04": _0__GlobalIDL.MyService._d_echo04, "echo05": _0__GlobalIDL.MyService._d_echo05, "echo06": _0__GlobalIDL.MyService._d_echo06, "echo07": _0__GlobalIDL.MyService._d_echo07, "echo08": _0__GlobalIDL.MyService._d_echo08, "echo10": _0__GlobalIDL.MyService._d_echo10, "echo11": _0__GlobalIDL.MyService._d_echo11, "echo12": _0__GlobalIDL.MyService._d_echo12, "echo13": _0__GlobalIDL.MyService._d_echo13, "echo14": _0__GlobalIDL.MyService._d_echo14, "echo15": _0__GlobalIDL.MyService._d_echo15, "echo16": _0__GlobalIDL.MyService._d_echo16}
+
+MyService._omni_skeleton = MyService
+_0__GlobalIDL__POA.MyService = MyService
+del MyService
+__name__ = "_GlobalIDL"
+
+#
+# End of module "_GlobalIDL"
+#
+__name__ = "MyService_idl"
+
+_exported_modules = ( "_GlobalIDL", )
+
+# The end.
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/MyService_idl_example.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/MyService_idl_example.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/MyService_idl_example.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,152 @@
+#!/usr/bin/env python
+
+"""
+ \file MyService_idl_examplefile.py
+ \brief Python example implementations generated from MyService.idl
+ \date $Date$
+
+
+"""
+
+import CORBA, PortableServer
+
+# Import the Python stub modules so type definitions are available.
+
+import _GlobalIDL
+
+# Import the Python Skeleton modules so skeleton base classes are available.
+
+import _GlobalIDL__POA
+
+
+class MyService_i (_GlobalIDL__POA.MyService):
+ """
+ \class MyService_i
+ Example class implementing IDL interface MyService
+ """
+
+ def __init__(self):
+ """
+ \brief standard constructor
+ Initialise member variables here
+ """
+ pass
+
+ # short echo01(in short ss, out short ss2, inout short ss3)
+ def echo01(self, ss, ss3):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result, ss2, ss3
+
+ # long echo02(in long ss, out long ss2, inout long ss3)
+ def echo02(self, ss, ss3):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result, ss2, ss3
+
+ # long long echo03(in long long ss, out long long ss2, inout long long ss3)
+ def echo03(self, ss, ss3):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result, ss2, ss3
+
+ # unsigned long echo04(in unsigned long ss, out unsigned long ss2, inout unsigned long ss3)
+ def echo04(self, ss, ss3):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result, ss2, ss3
+
+ # unsigned long long echo05(in unsigned long long ss, out unsigned long long ss2, inout unsigned long long ss3)
+ def echo05(self, ss, ss3):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result, ss2, ss3
+
+ # unsigned short echo06(in unsigned short ss, out unsigned short ss2, inout unsigned short ss3)
+ def echo06(self, ss, ss3):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result, ss2, ss3
+
+ # float echo07(in float ss, out float ss2, inout float ss3)
+ def echo07(self, ss, ss3):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result, ss2, ss3
+
+ # double echo08(in double ss, out double ss2, inout double ss3)
+ def echo08(self, ss, ss3):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result, ss2, ss3
+
+ # char echo10(in char ss, out char ss2, inout char ss3)
+ def echo10(self, ss, ss3):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result, ss2, ss3
+
+ # wchar echo11(in wchar ss, out wchar ss2, inout wchar ss3)
+ def echo11(self, ss, ss3):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result, ss2, ss3
+
+ # octet echo12(in octet ss, out octet ss2, inout octet ss3)
+ def echo12(self, ss, ss3):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result, ss2, ss3
+
+ # boolean echo13(in boolean ss, out boolean ss2, inout boolean ss3)
+ def echo13(self, ss, ss3):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result, ss2, ss3
+
+ # string echo14(in string ss, out string ss2, inout string ss3)
+ def echo14(self, ss, ss3):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result, ss2, ss3
+
+ # wstring echo15(in wstring ss, out wstring ss2, inout wstring ss3)
+ def echo15(self, ss, ss3):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result, ss2, ss3
+
+ # any echo16(in any ss, out any ss2, inout any ss3)
+ def echo16(self, ss, ss3):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result, ss2, ss3
+
+
+if __name__ == "__main__":
+ import sys
+
+ # Initialise the ORB
+ orb = CORBA.ORB_init(sys.argv)
+
+ # As an example, we activate an object in the Root POA
+ poa = orb.resolve_initial_references("RootPOA")
+
+ # Create an instance of a servant class
+ servant = MyService_i()
+
+ # Activate it in the Root POA
+ poa.activate_object(servant)
+
+ # Get the object reference to the object
+ objref = servant._this()
+
+ # Print a stringified IOR for it
+ print orb.object_to_string(objref)
+
+ # Activate the Root POA's manager
+ poa._get_the_POAManager().activate()
+
+ # Run the ORB, blocking this thread
+ orb.run()
+
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/README.test
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/README.test (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/README.test 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,73 @@
+======================================================================
+ RTComponent: test specificatioin
+ OpenRTM-aist-0.4.2
+ Date: $Date$
+ This file is generated by rtc-template with the following argments.
+# rtc-template -bpython --module-name=test
+# --module-desc='test component' --module-version=1.0.0 --module-vendor=S.Kurihara
+# --module-category=exmple --module-comp-type=STATIC
+# --module-act-type=PERIODIC --module-max-inst=1
+# --service=MySVPro:myservice:MyService
+======================================================================
+ Basic Information
+======================================================================
+# <rtc-template block="module">
+Module Name: test
+Description: test component
+Version: 1.0.0
+Vendor: S.Kurihara
+Category: exmple
+Comp. Type: STATIC
+Act. Type: PERIODIC
+MAX Inst.: 1
+Lang: Python
+Lang Type:
+# </rtc-template>
+======================================================================
+ Activity definition
+======================================================================
+[on_initialize]
+[on_finalize]
+[on_startup]
+[on_shutdown]
+[on_activated]
+[on_deactivated]
+[on_execute]
+[on_aborting]
+[on_error]
+[on_reset]
+[on_state_update]
+[on_rate_changed]
+======================================================================
+ InPorts definition
+======================================================================
+# <rtc-template block="inport">
+# </rtc-template>
+======================================================================
+ OutPorts definition
+======================================================================
+# <rtc-template block="outport">
+# </rtc-template>
+======================================================================
+ Service Port definition
+======================================================================
+# <rtc-template block="serviceport">
+ PortName: MySVPro
+ Description:
+ Interface:
+ [Service Provider Interfaces]
+ Name: myservice
+ Type: MyService
+ Description:
+ Argument:
+ Return Value:
+ Exception:
+ PreCondition:
+ PostCondition:
+# </rtc-template>
+======================================================================
+ Configuration definition
+======================================================================
+# <rtc-template block="configuration">
+# </rtc-template>
+This area is reserved for future OpenRTM.
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/_GlobalIDL/__init__.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/_GlobalIDL/__init__.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/_GlobalIDL/__init__.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,10 @@
+# DO NOT EDIT THIS FILE!
+#
+# Python module _GlobalIDL generated by omniidl
+
+# ** 1. Stub files contributing to this module
+import MyService_idl
+
+# ** 2. Sub-modules
+
+# ** 3. End
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/_GlobalIDL__POA/__init__.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/_GlobalIDL__POA/__init__.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/_GlobalIDL__POA/__init__.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,10 @@
+# DO NOT EDIT THIS FILE!
+#
+# Python module _GlobalIDL__POA generated by omniidl
+
+# ** 1. Stub files contributing to this module
+import MyService_idl
+
+# ** 2. Sub-modules
+
+# ** 3. End
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/test.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/test.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type/test.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,282 @@
+#!/usr/bin/env python
+# -*- Python -*-
+
+"""
+ \file test.py
+ \brief test component
+ \date $Date$
+
+
+"""
+import sys
+import time
+sys.path.append(".")
+
+# Import RTM module
+import OpenRTM
+import RTC
+
+# Import Service implementation class
+# <rtc-template block="service_impl">
+from MyService_idl_example import *
+
+# </rtc-template>
+
+# Import Service stub modules
+# <rtc-template block="consumer_import">
+# </rtc-template>
+
+
+# This module's spesification
+# <rtc-template block="module_spec">
+test_spec = ["implementation_id", "test",
+ "type_name", "test",
+ "description", "test component",
+ "version", "1.0.0",
+ "vendor", "S.Kurihara",
+ "category", "exmple",
+ "activity_type", "STATIC",
+ "max_instance", "1",
+ "language", "Python",
+ "lang_type", "SCRIPT",
+ ""]
+# </rtc-template>
+
+class test(OpenRTM.DataFlowComponentBase):
+
+ """
+ \class test
+ \brief test component
+
+ """
+ def __init__(self, manager):
+ """
+ \brief constructor
+ \param manager Maneger Object
+ """
+ OpenRTM.DataFlowComponentBase.__init__(self, manager)
+
+
+
+ # Set InPort buffers
+
+ # Set OutPort buffers
+
+
+ """
+ """
+ self._MySVProPort = OpenRTM.CorbaPort("MySVPro")
+
+
+ """
+ """
+ self._myservice = MyService_i()
+
+
+
+ # Set service provider to Ports
+ self._MySVProPort.registerProvider("myservice", "MyService", self._myservice)
+
+ # Set service consumers to Ports
+
+ # Set CORBA Service Ports
+ self.registerPort(self._MySVProPort)
+
+
+ # initialize of configuration-data.
+ # <rtc-template block="init_conf_param">
+
+ # </rtc-template>
+
+
+
+ def onInitialize(self):
+ """
+
+ The initialize action (on CREATED->ALIVE transition)
+ formaer rtc_init_entry()
+
+ \return RTC::ReturnCode_t
+
+ """
+ # Bind variables and configuration variable
+
+ return RTC.RTC_OK
+
+
+
+ #def onFinalize(self, ec_id):
+ # """
+ #
+ # The finalize action (on ALIVE->END transition)
+ # formaer rtc_exiting_entry()
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onStartup(self, ec_id):
+ # """
+ #
+ # The startup action when ExecutionContext startup
+ # former rtc_starting_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onShutdown(self, ec_id):
+ # """
+ #
+ # The shutdown action when ExecutionContext stop
+ # former rtc_stopping_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onActivated(self, ec_id):
+ # """
+ #
+ # The activated action (Active state entry action)
+ # former rtc_active_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onDeactivated(self, ec_id):
+ # """
+ #
+ # The deactivated action (Active state exit action)
+ # former rtc_active_exit()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onExecute(self, ec_id):
+ # """
+ #
+ # The execution action that is invoked periodically
+ # former rtc_active_do()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onAborting(self, ec_id):
+ # """
+ #
+ # The aborting action when main logic error occurred.
+ # former rtc_aborting_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onError(self, ec_id):
+ # """
+ #
+ # The error action in ERROR state
+ # former rtc_error_do()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onReset(self, ec_id):
+ # """
+ #
+ # The reset action that is invoked resetting
+ # This is same but different the former rtc_init_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onStateUpdate(self, ec_id):
+ # """
+ #
+ # The state update action that is invoked after onExecute() action
+ # no corresponding operation exists in OpenRTm-aist-0.2.0
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onRateChanged(self, ec_id):
+ # """
+ #
+ # The action that is invoked when execution context's rate is changed
+ # no corresponding operation exists in OpenRTm-aist-0.2.0
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+
+
+
+def MyModuleInit(manager):
+ profile = OpenRTM.Properties(defaults_str=test_spec)
+ manager.registerFactory(profile,
+ test,
+ OpenRTM.Delete)
+
+ # Create a component
+ comp = manager.createComponent("test")
+
+
+
+def main():
+ mgr = OpenRTM.Manager.init(len(sys.argv), sys.argv)
+ mgr.setModuleInitProc(MyModuleInit)
+ mgr.activateManager()
+ mgr.runManager()
+
+if __name__ == "__main__":
+ main()
+
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/MyService.idl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/MyService.idl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/MyService.idl 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,9 @@
+interface MyService
+{
+ short echo01(in short ss, out short ss2, inout short ss3);
+ void echo02(in short ss, out short ss2, inout short ss3);
+ short echo03(in short ss, in short ss2, in short ss3);
+ short echo04(out short ss, out short ss2, out short ss3);
+ short echo05(inout short ss, inout short ss2, inout short ss3);
+
+};
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/MyService_idl.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/MyService_idl.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/MyService_idl.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,95 @@
+# Python stubs generated by omniidl from MyService.idl
+
+import omniORB, _omnipy
+from omniORB import CORBA, PortableServer
+_0_CORBA = CORBA
+
+_omnipy.checkVersion(2,0, __file__)
+
+try:
+ _omniORB_StructBase = omniORB.StructBase
+except AttributeError:
+ class _omniORB_StructBase: pass
+
+
+#
+# Start of module "_GlobalIDL"
+#
+__name__ = "_GlobalIDL"
+_0__GlobalIDL = omniORB.openModule("_GlobalIDL", r"MyService.idl")
+_0__GlobalIDL__POA = omniORB.openModule("_GlobalIDL__POA", r"MyService.idl")
+
+
+# interface MyService
+_0__GlobalIDL._d_MyService = (omniORB.tcInternal.tv_objref, "IDL:MyService:1.0", "MyService")
+omniORB.typeMapping["IDL:MyService:1.0"] = _0__GlobalIDL._d_MyService
+_0__GlobalIDL.MyService = omniORB.newEmptyClass()
+class MyService :
+ _NP_RepositoryId = _0__GlobalIDL._d_MyService[1]
+
+ def __init__(self, *args, **kw):
+ raise RuntimeError("Cannot construct objects of this type.")
+
+ _nil = CORBA.Object._nil
+
+
+_0__GlobalIDL.MyService = MyService
+_0__GlobalIDL._tc_MyService = omniORB.tcInternal.createTypeCode(_0__GlobalIDL._d_MyService)
+omniORB.registerType(MyService._NP_RepositoryId, _0__GlobalIDL._d_MyService, _0__GlobalIDL._tc_MyService)
+
+# MyService operations and attributes
+MyService._d_echo01 = ((omniORB.tcInternal.tv_short, omniORB.tcInternal.tv_short), (omniORB.tcInternal.tv_short, omniORB.tcInternal.tv_short, omniORB.tcInternal.tv_short), None)
+MyService._d_echo02 = ((omniORB.tcInternal.tv_short, omniORB.tcInternal.tv_short), (omniORB.tcInternal.tv_short, omniORB.tcInternal.tv_short), None)
+MyService._d_echo03 = ((omniORB.tcInternal.tv_short, omniORB.tcInternal.tv_short, omniORB.tcInternal.tv_short), (omniORB.tcInternal.tv_short, ), None)
+MyService._d_echo04 = ((), (omniORB.tcInternal.tv_short, omniORB.tcInternal.tv_short, omniORB.tcInternal.tv_short, omniORB.tcInternal.tv_short), None)
+MyService._d_echo05 = ((omniORB.tcInternal.tv_short, omniORB.tcInternal.tv_short, omniORB.tcInternal.tv_short), (omniORB.tcInternal.tv_short, omniORB.tcInternal.tv_short, omniORB.tcInternal.tv_short, omniORB.tcInternal.tv_short), None)
+
+# MyService object reference
+class _objref_MyService (CORBA.Object):
+ _NP_RepositoryId = MyService._NP_RepositoryId
+
+ def __init__(self):
+ CORBA.Object.__init__(self)
+
+ def echo01(self, *args):
+ return _omnipy.invoke(self, "echo01", _0__GlobalIDL.MyService._d_echo01, args)
+
+ def echo02(self, *args):
+ return _omnipy.invoke(self, "echo02", _0__GlobalIDL.MyService._d_echo02, args)
+
+ def echo03(self, *args):
+ return _omnipy.invoke(self, "echo03", _0__GlobalIDL.MyService._d_echo03, args)
+
+ def echo04(self, *args):
+ return _omnipy.invoke(self, "echo04", _0__GlobalIDL.MyService._d_echo04, args)
+
+ def echo05(self, *args):
+ return _omnipy.invoke(self, "echo05", _0__GlobalIDL.MyService._d_echo05, args)
+
+ __methods__ = ["echo01", "echo02", "echo03", "echo04", "echo05"] + CORBA.Object.__methods__
+
+omniORB.registerObjref(MyService._NP_RepositoryId, _objref_MyService)
+_0__GlobalIDL._objref_MyService = _objref_MyService
+del MyService, _objref_MyService
+
+# MyService skeleton
+__name__ = "_GlobalIDL__POA"
+class MyService (PortableServer.Servant):
+ _NP_RepositoryId = _0__GlobalIDL.MyService._NP_RepositoryId
+
+
+ _omni_op_d = {"echo01": _0__GlobalIDL.MyService._d_echo01, "echo02": _0__GlobalIDL.MyService._d_echo02, "echo03": _0__GlobalIDL.MyService._d_echo03, "echo04": _0__GlobalIDL.MyService._d_echo04, "echo05": _0__GlobalIDL.MyService._d_echo05}
+
+MyService._omni_skeleton = MyService
+_0__GlobalIDL__POA.MyService = MyService
+del MyService
+__name__ = "_GlobalIDL"
+
+#
+# End of module "_GlobalIDL"
+#
+__name__ = "MyService_idl"
+
+_exported_modules = ( "_GlobalIDL", )
+
+# The end.
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/MyService_idl_example.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/MyService_idl_example.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/MyService_idl_example.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,92 @@
+#!/usr/bin/env python
+
+"""
+ \file MyService_idl_examplefile.py
+ \brief Python example implementations generated from MyService.idl
+ \date $Date$
+
+
+"""
+
+import CORBA, PortableServer
+
+# Import the Python stub modules so type definitions are available.
+
+import _GlobalIDL
+
+# Import the Python Skeleton modules so skeleton base classes are available.
+
+import _GlobalIDL__POA
+
+
+class MyService_i (_GlobalIDL__POA.MyService):
+ """
+ \class MyService_i
+ Example class implementing IDL interface MyService
+ """
+
+ def __init__(self):
+ """
+ \brief standard constructor
+ Initialise member variables here
+ """
+ pass
+
+ # short echo01(in short ss, out short ss2, inout short ss3)
+ def echo01(self, ss, ss3):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result, ss2, ss3
+
+ # void echo02(in short ss, out short ss2, inout short ss3)
+ def echo02(self, ss, ss3):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: ss2, ss3
+
+ # short echo03(in short ss, in short ss2, in short ss3)
+ def echo03(self, ss, ss2, ss3):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result
+
+ # short echo04(out short ss, out short ss2, out short ss3)
+ def echo04(self):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result, ss, ss2, ss3
+
+ # short echo05(inout short ss, inout short ss2, inout short ss3)
+ def echo05(self, ss, ss2, ss3):
+ raise CORBA.NO_IMPLEMENT(0, CORBA.COMPLETED_NO)
+ # *** Implement me
+ # Must return: result, ss, ss2, ss3
+
+
+if __name__ == "__main__":
+ import sys
+
+ # Initialise the ORB
+ orb = CORBA.ORB_init(sys.argv)
+
+ # As an example, we activate an object in the Root POA
+ poa = orb.resolve_initial_references("RootPOA")
+
+ # Create an instance of a servant class
+ servant = MyService_i()
+
+ # Activate it in the Root POA
+ poa.activate_object(servant)
+
+ # Get the object reference to the object
+ objref = servant._this()
+
+ # Print a stringified IOR for it
+ print orb.object_to_string(objref)
+
+ # Activate the Root POA's manager
+ poa._get_the_POAManager().activate()
+
+ # Run the ORB, blocking this thread
+ orb.run()
+
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/README.test
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/README.test (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/README.test 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,73 @@
+======================================================================
+ RTComponent: test specificatioin
+ OpenRTM-aist-0.4.2
+ Date: $Date$
+ This file is generated by rtc-template with the following argments.
+# rtc-template -bpython --module-name=test
+# --module-desc='test component' --module-version=1.0.0 --module-vendor=S.Kurihara
+# --module-category=exmple --module-comp-type=STATIC
+# --module-act-type=PERIODIC --module-max-inst=1
+# --service=MySVPro:myservice:MyService
+======================================================================
+ Basic Information
+======================================================================
+# <rtc-template block="module">
+Module Name: test
+Description: test component
+Version: 1.0.0
+Vendor: S.Kurihara
+Category: exmple
+Comp. Type: STATIC
+Act. Type: PERIODIC
+MAX Inst.: 1
+Lang: Python
+Lang Type:
+# </rtc-template>
+======================================================================
+ Activity definition
+======================================================================
+[on_initialize]
+[on_finalize]
+[on_startup]
+[on_shutdown]
+[on_activated]
+[on_deactivated]
+[on_execute]
+[on_aborting]
+[on_error]
+[on_reset]
+[on_state_update]
+[on_rate_changed]
+======================================================================
+ InPorts definition
+======================================================================
+# <rtc-template block="inport">
+# </rtc-template>
+======================================================================
+ OutPorts definition
+======================================================================
+# <rtc-template block="outport">
+# </rtc-template>
+======================================================================
+ Service Port definition
+======================================================================
+# <rtc-template block="serviceport">
+ PortName: MySVPro
+ Description:
+ Interface:
+ [Service Provider Interfaces]
+ Name: myservice
+ Type: MyService
+ Description:
+ Argument:
+ Return Value:
+ Exception:
+ PreCondition:
+ PostCondition:
+# </rtc-template>
+======================================================================
+ Configuration definition
+======================================================================
+# <rtc-template block="configuration">
+# </rtc-template>
+This area is reserved for future OpenRTM.
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/_GlobalIDL/__init__.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/_GlobalIDL/__init__.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/_GlobalIDL/__init__.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,10 @@
+# DO NOT EDIT THIS FILE!
+#
+# Python module _GlobalIDL generated by omniidl
+
+# ** 1. Stub files contributing to this module
+import MyService_idl
+
+# ** 2. Sub-modules
+
+# ** 3. End
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/_GlobalIDL__POA/__init__.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/_GlobalIDL__POA/__init__.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/_GlobalIDL__POA/__init__.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,10 @@
+# DO NOT EDIT THIS FILE!
+#
+# Python module _GlobalIDL__POA generated by omniidl
+
+# ** 1. Stub files contributing to this module
+import MyService_idl
+
+# ** 2. Sub-modules
+
+# ** 3. End
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/test.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/test.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/Python/type2/test.py 2012-02-10 17:02:45 UTC (rev 260)
@@ -0,0 +1,282 @@
+#!/usr/bin/env python
+# -*- Python -*-
+
+"""
+ \file test.py
+ \brief test component
+ \date $Date$
+
+
+"""
+import sys
+import time
+sys.path.append(".")
+
+# Import RTM module
+import OpenRTM
+import RTC
+
+# Import Service implementation class
+# <rtc-template block="service_impl">
+from MyService_idl_example import *
+
+# </rtc-template>
+
+# Import Service stub modules
+# <rtc-template block="consumer_import">
+# </rtc-template>
+
+
+# This module's spesification
+# <rtc-template block="module_spec">
+test_spec = ["implementation_id", "test",
+ "type_name", "test",
+ "description", "test component",
+ "version", "1.0.0",
+ "vendor", "S.Kurihara",
+ "category", "exmple",
+ "activity_type", "STATIC",
+ "max_instance", "1",
+ "language", "Python",
+ "lang_type", "SCRIPT",
+ ""]
+# </rtc-template>
+
+class test(OpenRTM.DataFlowComponentBase):
+
+ """
+ \class test
+ \brief test component
+
+ """
+ def __init__(self, manager):
+ """
+ \brief constructor
+ \param manager Maneger Object
+ """
+ OpenRTM.DataFlowComponentBase.__init__(self, manager)
+
+
+
+ # Set InPort buffers
+
+ # Set OutPort buffers
+
+
+ """
+ """
+ self._MySVProPort = OpenRTM.CorbaPort("MySVPro")
+
+
+ """
+ """
+ self._myservice = MyService_i()
+
+
+
+ # Set service provider to Ports
+ self._MySVProPort.registerProvider("myservice", "MyService", self._myservice)
+
+ # Set service consumers to Ports
+
+ # Set CORBA Service Ports
+ self.registerPort(self._MySVProPort)
+
+
+ # initialize of configuration-data.
+ # <rtc-template block="init_conf_param">
+
+ # </rtc-template>
+
+
+
+ def onInitialize(self):
+ """
+
+ The initialize action (on CREATED->ALIVE transition)
+ formaer rtc_init_entry()
+
+ \return RTC::ReturnCode_t
+
+ """
+ # Bind variables and configuration variable
+
+ return RTC.RTC_OK
+
+
+
+ #def onFinalize(self, ec_id):
+ # """
+ #
+ # The finalize action (on ALIVE->END transition)
+ # formaer rtc_exiting_entry()
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onStartup(self, ec_id):
+ # """
+ #
+ # The startup action when ExecutionContext startup
+ # former rtc_starting_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onShutdown(self, ec_id):
+ # """
+ #
+ # The shutdown action when ExecutionContext stop
+ # former rtc_stopping_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onActivated(self, ec_id):
+ # """
+ #
+ # The activated action (Active state entry action)
+ # former rtc_active_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onDeactivated(self, ec_id):
+ # """
+ #
+ # The deactivated action (Active state exit action)
+ # former rtc_active_exit()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onExecute(self, ec_id):
+ # """
+ #
+ # The execution action that is invoked periodically
+ # former rtc_active_do()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onAborting(self, ec_id):
+ # """
+ #
+ # The aborting action when main logic error occurred.
+ # former rtc_aborting_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onError(self, ec_id):
+ # """
+ #
+ # The error action in ERROR state
+ # former rtc_error_do()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onReset(self, ec_id):
+ # """
+ #
+ # The reset action that is invoked resetting
+ # This is same but different the former rtc_init_entry()
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onStateUpdate(self, ec_id):
+ # """
+ #
+ # The state update action that is invoked after onExecute() action
+ # no corresponding operation exists in OpenRTm-aist-0.2.0
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+ #def onRateChanged(self, ec_id):
+ # """
+ #
+ # The action that is invoked when execution context's rate is changed
+ # no corresponding operation exists in OpenRTm-aist-0.2.0
+ #
+ # \param ec_id target ExecutionContext Id
+ #
+ # \return RTC::ReturnCode_t
+ #
+ # """
+ #
+ # return RTC.RTC_OK
+
+
+
+
+def MyModuleInit(manager):
+ profile = OpenRTM.Properties(defaults_str=test_spec)
+ manager.registerFactory(profile,
+ test,
+ OpenRTM.Delete)
+
+ # Create a component
+ comp = manager.createComponent("test")
+
+
+
+def main():
+ mgr = OpenRTM.Manager.init(len(sys.argv), sys.argv)
+ mgr.setModuleInitProc(MyModuleInit)
+ mgr.activateManager()
+ mgr.runManager()
+
+if __name__ == "__main__":
+ main()
+
openrtm-commit メーリングリストの案内