def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_vel_out = OpenRTM_aist.instantiateDataType(RTC.TimedVelocity2D) """ """ self._vel_outIn = OpenRTM_aist.InPort("vel_out", self._d_vel_out) self._d_vel_in = OpenRTM_aist.instantiateDataType(RTC.TimedVelocity2D) """ """ self._vel_inOut = OpenRTM_aist.OutPort("vel_in", self._d_vel_in) """ """ self._gameStateSwitcherPort = OpenRTM_aist.CorbaPort("gameStateSwitcher") """ """ self._colorSwitcherPort = OpenRTM_aist.CorbaPort("colorSwitcher") """ """ self._gameStateSwitcherService = OpenRTM_aist.CorbaConsumer(interfaceType=KanamuraRobotics.VelocitySwitcherService) """ """ self._colorSwitcherService = OpenRTM_aist.CorbaConsumer(interfaceType=KanamuraRobotics.VelocitySwitcherService)
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) """ """ self._NAO_motionSrvPort = OpenRTM_aist.CorbaPort("NAO_motion") self._NAO_speechSrvPort = OpenRTM_aist.CorbaPort("NAO_speech") """ """ self._motion = OpenRTM_aist.CorbaConsumer(interfaceType=ssr.ALMotion) """ """ self._textToSpeech = OpenRTM_aist.CorbaConsumer( interfaceType=ssr.ALTextToSpeech) """ """ #self._behaviorManager = OpenRTM_aist.CorbaConsumer(interfaceType=ssr.ALBehaviorManager) """ """ self._videoDevice = OpenRTM_aist.CorbaConsumer( interfaceType=ssr.ALVideoDevice) """ """ self._memory = OpenRTM_aist.CorbaConsumer(interfaceType=ssr.ALMemory) """ """ self._leds = OpenRTM_aist.CorbaConsumer(interfaceType=ssr.ALLeds)
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_stringdata = OpenRTM_aist.instantiateDataType(RTC.TimedString) """ """ self._stringoutIn = OpenRTM_aist.InPort("stringout", self._d_stringdata) """ """ self._speechmanagePort = OpenRTM_aist.CorbaPort("speechmanage") """ """ self._actionmanagePort = OpenRTM_aist.CorbaPort("actionmanage") """ """ self._interactivemanagePort = OpenRTM_aist.CorbaPort( "interactivemanage") """ """ self._LiftermanagePort = OpenRTM_aist.CorbaPort("Liftermanage") """ """ self._ActionManageRequire = ActionManage_i() """ """ self._lifterRequired = LifterPoseInterface_i() """ """ self._SpeechManageProvider = OpenRTM_aist.CorbaConsumer( interfaceType=Manage.SpeechManage) """ """ self._InteractiveManageProvider = OpenRTM_aist.CorbaConsumer( interfaceType=Manage.InteractiveManage)
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) camera_arg = [None] * ((len(Img._d_TimedCameraImage) - 4) / 2) self._d_camera = Img.TimedCameraImage(*camera_arg) """ """ self._cameraIn = OpenRTM_aist.InPort("camera", self._d_camera) """ """ self._manipCommonPort = OpenRTM_aist.CorbaPort("manipCommon") """ """ self._manipMiddlePort = OpenRTM_aist.CorbaPort("manipMiddle") """ """ self._manipCommon = OpenRTM_aist.CorbaConsumer( interfaceType=JARA_ARM.ManipulatorCommonInterface_Common) """ """ self._manipMiddle = OpenRTM_aist.CorbaConsumer( interfaceType=JARA_ARM.ManipulatorCommonInterface_Middle) # initialize of configuration-data. # <rtc-template block="init_conf_param"> """ - Name: debug - DefaultValue: 1 """ self._debug = [1] self._model = None """ - Name: gripper_close_ratio - DefaultValue: 0.1 """ self._gripper_close_ratio = [0.1] #self._model = None # the position for taking a picture self._camera_jointPos0 = [1.57076] self._camera_jointPos1 = [0] self._camera_jointPos2 = [1.57076] self._camera_jointPos3 = [0] self._camera_jointPos4 = [1.57076] self._camera_jointPos5 = [0] #the initial position self._initial_jointPos0 = [1.57076] self._initial_jointPos1 = [0] self._initial_jointPos2 = [1.57076] self._initial_jointPos3 = [0] self._initial_jointPos4 = [1.57076] self._initial_jointPos5 = [0]
def main(): # subscription type subs_type = "Flush" # initialization of ORB orb = CORBA.ORB_init(sys.argv) # get NamingService naming = OpenRTM_aist.CorbaNaming(orb, "localhost") sl = OpenRTM_aist.CorbaConsumer() tkm = OpenRTM_aist.CorbaConsumer() # find TkMotorComp0 component tkm.setObject(naming.resolve("TkMotorComp0.rtc")) # get ports inobj = tkm.getObject()._narrow(RTC.RTObject) pin = inobj.get_ports() pin[0].disconnect_all() # find SliderComp0 component sl.setObject(naming.resolve("SliderComp0.rtc")) # get ports outobj = sl.getObject()._narrow(RTC.RTObject) pout = outobj.get_ports() pout[0].disconnect_all() # connect ports conprof = RTC.ConnectorProfile("connector0", "", [pin[0],pout[0]], []) OpenRTM_aist.CORBA_SeqUtil.push_back(conprof.properties, OpenRTM_aist.NVUtil.newNV("dataport.interface_type", "corba_cdr")) OpenRTM_aist.CORBA_SeqUtil.push_back(conprof.properties, OpenRTM_aist.NVUtil.newNV("dataport.dataflow_type", "push")) OpenRTM_aist.CORBA_SeqUtil.push_back(conprof.properties, OpenRTM_aist.NVUtil.newNV("dataport.subscription_type", subs_type)) ret = pin[0].connect(conprof) # activate TkMotorComp0 eclistin = inobj.get_owned_contexts() eclistin[0].activate_component(inobj) # activate SliderComp0 eclistout = outobj.get_owned_contexts() eclistout[0].activate_component(outobj)
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) camera_arg = [None] * ((len(Img._d_TimedCameraImage) - 4) / 2) self._d_camera = Img.TimedCameraImage(*camera_arg) """ """ self._cameraIn = OpenRTM_aist.InPort("camera", self._d_camera) """ """ self._manipCommon_RPort = OpenRTM_aist.CorbaPort("manipCommon_R") """ """ self._manipMiddle_RPort = OpenRTM_aist.CorbaPort("manipMiddle_R") self._manipCommon_LPort = OpenRTM_aist.CorbaPort("manipCommon_L") """ """ self._manipMiddle_LPort = OpenRTM_aist.CorbaPort("manipMiddle_L") """ """ self._manipCommon_R = OpenRTM_aist.CorbaConsumer( interfaceType=JARA_ARM.ManipulatorCommonInterface_Common) """ """ self._manipMiddle_R = OpenRTM_aist.CorbaConsumer( interfaceType=JARA_ARM.ManipulatorCommonInterface_Middle) """ """ self._manipCommon_L = OpenRTM_aist.CorbaConsumer( interfaceType=JARA_ARM_LEFT.ManipulatorCommonInterface_Common) """ """ self._manipMiddle_L = OpenRTM_aist.CorbaConsumer( interfaceType=JARA_ARM_LEFT.ManipulatorCommonInterface_Middle) # initialize of configuration-data. # <rtc-template block="init_conf_param"> """ - Name: debug - DefaultValue: 1 """ self._debug = [1] self._model = None """ - Name: gripper_close_ratio - DefaultValue: 0.1 """ self._gripper_close_ratio = [0.1] self._model = None
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_Facedetectionposition = RTC.TimedDoubleSeq(RTC.Time(0, 0), "") """ """ self._FacedetectionpositionIn = OpenRTM_aist.InPort( "Facedetectionposition", self._d_Facedetectionposition) self._d_presentationop = RTC.TimedShort(RTC.Time(0, 0), "") """ """ self._presentationopOut = OpenRTM_aist.OutPort("presentationop", self._d_presentationop) self._d_waistmovement = RTC.TimedDouble(RTC.Time(0, 0), "") """ """ self._waistmovementOut = OpenRTM_aist.OutPort("waistmovement", self._d_waistmovement) """ """ self._actionmanagePort = OpenRTM_aist.CorbaPort("actionmanage") """ """ self._speechconsumerPort = OpenRTM_aist.CorbaPort("speechconsumer") """ """ self._speechproviderPort = OpenRTM_aist.CorbaPort("speechprovider") """ """ self._SpeechConsumerProvider = SpeechConsumer_i() """ """ self._ActionManageRequire = OpenRTM_aist.CorbaConsumer( interfaceType=Action.ActionManage) """ """ self._SpeechProviderRequire = OpenRTM_aist.CorbaConsumer( interfaceType=Provider.SpeechProvider) # initialize of configuration-data. # <rtc-template block="init_conf_param"> """ - Name: PresentationMode - DefaultValue: OneSet """ self._PresentationMode = ['OneSet'] """ - Name: PresemtationData - DefaultValue: data.csv """ self._PresemtationData = ['data.csv']
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) """ """ self._sv_namePort = OpenRTM_aist.CorbaPort("sv_name") """ """ self._if_name1 = OpenRTM_aist.CorbaConsumer( interfaceType=SimpleService.MyService) """ """ self._if_name2 = OpenRTM_aist.CorbaConsumer( interfaceType=_GlobalIDL.DAQService)
def main(): # initialization of ORB orb = CORBA.ORB_init(sys.argv) # get NamingService naming = OpenRTM_aist.CorbaNaming(orb, "localhost") consumer = OpenRTM_aist.CorbaConsumer() provider = OpenRTM_aist.CorbaConsumer() for _ in range(100): try: # find MyServiceConsumer0 component consumer.setObject(naming.resolve("MyServiceConsumer0.rtc")) # get ports consobj = consumer.getObject()._narrow(RTC.RTObject) pcons = consobj.get_ports() break except: time.sleep(0.1) pcons[0].disconnect_all() for _ in range(100): try: # find MyServiceProvider0 component provider.setObject(naming.resolve("MyServiceProvider0.rtc")) # get ports provobj = provider.getObject()._narrow(RTC.RTObject) prov = provobj.get_ports() break except: time.sleep(0.1) prov[0].disconnect_all() # connect ports conprof = RTC.ConnectorProfile("connector0", "", [pcons[0], prov[0]], []) ret = pcons[0].connect(conprof) # activate ConsoleIn0 eclistin = consobj.get_owned_contexts() eclistin[0].activate_component(consobj) # activate ConsoleOut0 eclistout = provobj.get_owned_contexts() eclistout[0].activate_component(provobj)
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) """ """ self._DataBasePort = OpenRTM_aist.CorbaPort("DataBase") """ """ self._database = OpenRTM_aist.CorbaConsumer( interfaceType=DataBase.mDataBase) # initialize of configuration-data. # <rtc-template block="init_conf_param"> # </rtc-template> self._d_m_in = RTC.TimedString(RTC.Time(0, 0), 0) self._m_inIn = OpenRTM_aist.InPort("in", self._d_m_in) self._d_m_out = RTC.TimedStringSeq(RTC.Time(0, 0), 0) self._m_outOut = OpenRTM_aist.OutPort("out", self._d_m_out) self.DataBase_Name = ["None"] self.Table_Name = ["None"] self.row_out = ["None"] self.row_in = ["None"] self.OutPortDataType = ["TimedStringSeq"] self.InPortDataType = ["TimedString"] self.conditional = ["="] self.currentOutPortDataType = "TimedStringSeq" self.currentInPortDataType = "TimedString" self.DSName = "None"
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_cameraImage = OpenRTM_aist.instantiateDataType(Img.TimedCameraImage) """ """ self._cameraImageIn = OpenRTM_aist.InPort("cameraImage", self._d_cameraImage) self._d_color = OpenRTM_aist.instantiateDataType(RTC.TimedLong) """ """ self._colorOut = OpenRTM_aist.OutPort("color", self._d_color) """ """ self._colorSwitcherPort = OpenRTM_aist.CorbaPort("colorSwitcher") """ """ self._colorSwitcherService = OpenRTM_aist.CorbaConsumer(interfaceType=KanamuraRobotics.VelocitySwitcherService) # initialize of configuration-data. # <rtc-template block="init_conf_param"> """ - Name: team_color - DefaultValue: red """ self._team_color = ["red"]
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_camera = OpenRTM_aist.instantiateDataType(Img.CameraImage) """ """ self._cameraOut = OpenRTM_aist.OutPort("camera", self._d_camera) """ """ self._manipCommonPort = OpenRTM_aist.CorbaPort("manipCommon") """ """ self._manipMiddlePort = OpenRTM_aist.CorbaPort("manipMiddle") """ """ self._pickerPort = OpenRTM_aist.CorbaPort("picker") """ """ self._manipCommon = ManipulatorCommonInterface_Common_i() """ """ self._manipMiddle = ManipulatorCommonInterface_Middle_i() """ """ self._TidyUpManager = OpenRTM_aist.CorbaConsumer( interfaceType=ogata.Picker) # initialize of configuration-data. # <rtc-template block="init_conf_param"> """ - Name: debug - DefaultValue: 1 """ self._debug = [1]
def __init__(self, manager, rtc_dataports, rtc_services, rtc_params): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._dataports = rtc_dataports self._services = rtc_services self._params = rtc_params # # set dataport for k in self._dataports.keys(): _d, _p = init_dataport(k, self._dataports) if self._dataports[k]['direction'] == 'in': self.__dict__['_d_' + k] = _d self.__dict__['_' + k + 'In'] = _p elif self._dataports[k]['direction'] == 'out': self.__dict__['_d_' + k] = _d self.__dict__['_' + k + 'Out'] = _p else: pass # set service port for k in self._services.keys(): if self._services[k]['direction'] == 'provider': self.__dict__['_' + k + 'Port'] = OpenRTM_aist.CorbaPort(k) self.__dict__['_' + k + '_service'] = self._services[k]['impl']() elif self._services[k]['direction'] == 'consumer': self.__dict__['_' + k + 'Port'] = OpenRTM_aist.CorbaPort(k) self.__dict__['_' + k + '_service'] = OpenRTM_aist.CorbaConsumer( interfaceType=self._services[k]['if_type']) # initialize of configuration-data. for x in init_params(self._params): self.__dict__['_' + x[0]] = [x[1]]
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_InP1 = OpenRTM_aist.instantiateDataType(RTC.TimedShort) """ """ self._InP1In = OpenRTM_aist.InPort("InP1", self._d_InP1) self._d_InP2 = OpenRTM_aist.instantiateDataType(RTC.TimedLong) """ """ self._InP2In = OpenRTM_aist.InPort("InP2", self._d_InP2) self._d_OutP1 = OpenRTM_aist.instantiateDataType(RTC.TimedInt) """ """ self._OutP1Out = OpenRTM_aist.OutPort("OutP1", self._d_OutP1) self._d_OutP2 = OpenRTM_aist.instantiateDataType(RTC.TimedFloat) """ """ self._OutP2Out = OpenRTM_aist.OutPort("OutP2", self._d_OutP2) """ """ self._svPortPort = OpenRTM_aist.CorbaPort("svPort") """ """ self._cmPortPort = OpenRTM_aist.CorbaPort("cmPort") """ """ self._acc = MyService_i() """ """ self._rate = OpenRTM_aist.CorbaConsumer( interfaceType=_GlobalIDL.DAQService)
def onInitialize(self): self._d_dp_vOut = RTC.TimedFloat(RTC.Time(0, 0), 0) self._d_dp_vSeqOut = RTC.TimedFloatSeq(RTC.Time(0, 0), []) self._OutOut = OpenRTM_aist.OutPort("out", self._d_dp_vOut, OpenRTM_aist.RingBuffer(8)) self._SeqOutOut = OpenRTM_aist.OutPort("seqout", self._d_dp_vSeqOut, OpenRTM_aist.RingBuffer(8)) # Set OutPort buffers self.addOutPort("out", self._OutOut) self.addOutPort("seqout", self._SeqOutOut) self._MyServicePort = OpenRTM_aist.CorbaPort("MyService") self._myservice0_var = OpenRTM_aist.CorbaConsumer( interfaceType=AutoTest.MyService) # Set service consumers to Ports self._MyServicePort.registerConsumer("myservice0", "MyService", self._myservice0_var) # Set CORBA Service Ports self.addPort(self._MyServicePort) return RTC.RTC_OK
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_Instruction = RTC.TimedString(RTC.Time(0, 0), 0) """ """ self._InstructionIn = OpenRTM_aist.InPort("Instruction", self._d_Instruction) self._d_LEDState = RTC.TimedChar(RTC.Time(0, 0), 0) """ """ self._LEDStateIn = OpenRTM_aist.InPort("LEDState", self._d_LEDState) self._d_Speechout = RTC.TimedString(RTC.Time(0, 0), 0) """ """ self._SpeechoutOut = OpenRTM_aist.OutPort("Speechout", self._d_Speechout) self._d_IRSignal = RTC.TimedLongSeq(RTC.Time(0, 0), []) """ """ self._IRSignalOut = OpenRTM_aist.OutPort("IRSignal", self._d_IRSignal) """ """ self._ModelPort = OpenRTM_aist.CorbaPort("Model") """ """ self._ModelAcceptor = OpenRTM_aist.CorbaConsumer( interfaceType=_GlobalIDL.AcceptModelService)
def createConsumerPort(self, name, if_name, type_name, if_type): self._ConsumerPort[name] = OpenRTM_aist.CorbaPort(name) self._consumer[name] = OpenRTM_aist.CorbaConsumer( interfaceType=if_type) self._ConsumerPort[name].registerConsumer(if_name, type_name, self._consumer[name]) self.addPort(self._ConsumerPort[name]) return RTC_OK
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_in = RTC.TimedLong(RTC.Time(0, 0), 0) self._inIn = OpenRTM_aist.InPort("in", self._d_in) self._servicePort_required = OpenRTM_aist.CorbaPort("service") self._Service_required = OpenRTM_aist.CorbaConsumer( interfaceType=OpenRTM.InPortCdr) self._d_topic_in = RTC.TimedLong(RTC.Time(0, 0), 0) self._topic_inIn = OpenRTM_aist.InPort("topic_in", self._d_topic_in) self._topic_servicePort_required = OpenRTM_aist.CorbaPort( "topic_service") self._topic_Service_required = OpenRTM_aist.CorbaConsumer( interfaceType=OpenRTM.InPortCdr) return
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) """ """ self._switcherTestPort = OpenRTM_aist.CorbaPort("switcherTest") """ """ self._switcherTestService = OpenRTM_aist.CorbaConsumer( interfaceType=KanamuraRobotics.VelocitySwitcherService)
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) """ """ self._rtcconfPort = OpenRTM_aist.CorbaPort("rtcconf") """ """ self._rtcconf = OpenRTM_aist.CorbaConsumer( interfaceType=RTCConfData.ConfDataInterface)
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) camera_arg = [None] * ((len(RGBDCamera._d_TimedRGBDCameraImage) - 4) // 2) self._d_camera = RGBDCamera.TimedRGBDCameraImage(*camera_arg) """ """ self._cameraIn = OpenRTM_aist.InPort("camera", self._d_camera) """ """ self._manipCommonPort = OpenRTM_aist.CorbaPort("manipCommon") """ """ self._manipMiddlePort = OpenRTM_aist.CorbaPort("manipMiddle") """ """ self._pickerPort = OpenRTM_aist.CorbaPort("picker") """ """ self._TidyUpManager = Picker_i() # ここでRTCの参照を設定する self._TidyUpManager.set_rtc(self) """ """ self._manipCommon = OpenRTM_aist.CorbaConsumer(interfaceType=JARA_ARM.ManipulatorCommonInterface_Common) """ """ self._manipMiddle = OpenRTM_aist.CorbaConsumer(interfaceType=JARA_ARM.ManipulatorCommonInterface_Middle) # initialize of configuration-data. # <rtc-template block="init_conf_param"> """ - Name: debug - DefaultValue: 1 """ self._debug = [1]
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) """ """ self._ManipulatorCommonInterface_MiddlePortPort = OpenRTM_aist.CorbaPort( "ManipulatorCommonInterface_MiddlePort") """ """ self._ManipulatorCommonInterface_Middle = OpenRTM_aist.CorbaConsumer( interfaceType=JARA_ARM.ManipulatorCommonInterface_Middle)
def setUp(self): orb = CORBA.ORB_init(sys.argv) poa = orb.resolve_initial_references("RootPOA") poa._get_the_POAManager().activate() self._mysvc = MyService_impl() self._mycon = OpenRTM_aist.CorbaConsumer() #self._mysvc._this() self._cpSvc = CorbaPort("MyService") self._cpCon = CorbaPort("MyService")
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) """ """ self._MyServiceProviderPort = OpenRTM_aist.CorbaPort("MyServiceProvider") """ """ self._MyServiceRequirePort = OpenRTM_aist.CorbaPort("MyServiceRequire") """ """ self._MyServiceProvider = MyServiceChild_i() """ """ self._MyServiceProvider2 = MyServiceWithTypeChild_i() """ """ self._MyServiceRequire = OpenRTM_aist.CorbaConsumer(interfaceType=_GlobalIDL.MyServiceChild) """ """ self._MyServiceRequire2 = OpenRTM_aist.CorbaConsumer(interfaceType=_GlobalIDL.MyServiceWithTypeChild)
def ListRecursive(context, rtclist, name): m_blLength = 100 bl = context.list(m_blLength) cont = True while cont: for i in bl[0]: if i.binding_type == CosNaming.ncontext: next_context = context.resolve(i.binding_name) name_buff = name[:] name.append(i.binding_name[0].id) ListRecursive(next_context,rtclist,name) name = name_buff elif i.binding_type == CosNaming.nobject: if len(rtclist) > m_blLength: break if i.binding_name[0].kind == 'rtc': name_buff = name[:] name_buff.append(i.binding_name[0].id) tkm = OpenRTM_aist.CorbaConsumer() tkm.setObject(context.resolve(i.binding_name)) inobj = tkm.getObject()._narrow(RTC.RTObject) pin = inobj.get_ports() for p in pin: name_buff2 = name_buff[:] profile = p.get_port_profile() props = nvlist_to_dict(profile.properties) tp_n = profile.name.split('.')[1] name_buff2.append(tp_n) rtclist.append([name_buff2,p]) else: pass if CORBA.is_nil(bl[1]): cont = False else: bl = i.next_n(m_blLength)
def setServicePort(self, name, interface_name, interface_dir, idl_file, interface_type, idl_path): guard = OpenRTM_aist.ScopedLock(self.exec_mutex) data_name = "_i_" + interface_name port_name = "_" + interface_name + "Port" dir_path = os.path.dirname(idl_file) filelist,classlist = self.getServiceNameList(idl_file, dir_path, idl_path) if len(filelist) == 0: return "","",[],{},[] self.idlCompile(filelist, idl_path, dir_path, self.workdir) idl_name, ext = os.path.splitext(os.path.basename(idl_file)) module_name = "_GlobalIDL" spif = interface_type.split(".") interface_class = spif[0] if len(spif) >= 2: module_name = spif[0] interface_class = spif[1] import_name = {} #s = "idl/ManipulatorCommonInterface_MiddleLevel_idl.py" #name, ext = os.path.splitext(os.path.basename(s)) #sys.path.append("idl") import_name["idl"] = idl_name+"_idl" import_name["module"] = module_name import_name["module__POA"] = module_name+"__POA" interface_idl = importlib.import_module(import_name["idl"]) module_obj = importlib.import_module(import_name["module"]) module_obj__POA = importlib.import_module(import_name["module__POA"]) #import ManipulatorCommonInterface_MiddleLevel_idl #import JARA_ARM, JARA_ARM__POA self.__dict__[port_name] = OpenRTM_aist.CorbaPort(name) if interface_dir == "Required": self.__dict__[data_name] = OpenRTM_aist.CorbaConsumer(interfaceType=module_obj.__dict__[interface_class]) elif interface_dir == "Provided": pass resname = interface_type.replace(".",":") self.__dict__[port_name].registerConsumer(name, resname, self.__dict__[data_name]) self.addPort(self.__dict__[port_name]) return data_name, port_name, filelist, classlist, import_name
def reinit(self, profile): if not self._observer._ptr()._is_equivalent(profile.service): tmp = OpenRTM_aist.CorbaConsumer(interfaceType=OpenRTM.ComponentObserver) if not tmp.setObject(profile.service): return False self._observer.releaseObject() self._observer.setObject(profile.service) self._profile= profile prop = OpenRTM_aist.Properties() OpenRTM_aist.NVUtil.copyToProperties(prop, profile.properties) self.setHeartbeat(prop) self.setListeners(prop) return True
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_textIn = RTC.TimedStringSeq(RTC.Time(0, 0), "") """ """ self._textInIn = OpenRTM_aist.InPort("textIn", self._d_textIn) """ """ self._interactivemanagePort = OpenRTM_aist.CorbaPort( "interactivemanage") """ """ self._InteractiveManageRequire = OpenRTM_aist.CorbaConsumer( interfaceType=Manage.InteractiveManage)
def onInitialize(self): # initialization of CORBA Port self._myServicePort = OpenRTM_aist.CorbaPort("MyService") # initialization of Consumer self._myservice0 = OpenRTM_aist.CorbaConsumer( interfaceType=SimpleService.MyService) # Set service consumers to Ports self._myServicePort.registerConsumer("myservice0", "MyService", self._myservice0) # Set CORBA Service Ports self.addPort(self._myServicePort) return RTC.RTC_OK
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_in = OpenRTM_aist.instantiateDataType(RTC.TimedFloatSeq) """ """ self._inIn = OpenRTM_aist.InPort("in", self._d_in) self._d_out = OpenRTM_aist.instantiateDataType(RTC.TimedFloatSeq) """ """ self._outOut = OpenRTM_aist.OutPort("out", self._d_out) """ """ self._MySVConPort = OpenRTM_aist.CorbaPort("MySVCon") """ """ self._myservice = OpenRTM_aist.CorbaConsumer( interfaceType=_GlobalIDL.MyService)