def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_torques = RTC.TimedDoubleSeq(RTC.Time(0, 0), []) """ """ self._torquesIn = OpenRTM_aist.InPort("torques", self._d_torques) self._d_velocities = RTC.TimedDoubleSeq(RTC.Time(0, 0), []) """ """ self._velocitiesIn = OpenRTM_aist.InPort( "velocities", self._d_velocities) self._d_lightSwitch = RTC.TimedBooleanSeq(RTC.Time(0, 0), []) """ """ self._lightSwitchIn = OpenRTM_aist.InPort( "lightSwitch", self._d_lightSwitch) self._d_angles = RTC.TimedDoubleSeq(RTC.Time(0, 0), []) """ """ self._anglesOut = OpenRTM_aist.OutPort("angles", self._d_angles) self.body = None
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) sign_arg = [None] * ((len(RTC._d_TimedString) - 4) / 2) self._d_sign = RTC.TimedString(RTC.Time(0, 0), "") """ """ self._signIn = OpenRTM_aist.InPort("sign", self._d_sign) sensor_arg = [None] * ((len(RTC._d_TimedFloatSeq) - 4) / 2) self._d_sensor = RTC.TimedFloatSeq(RTC.Time(0, 0), []) """ """ self._sensorIn = OpenRTM_aist.InPort("sensor", self._d_sensor) fin_arg = [None] * ((len(RTC._d_TimedString) - 4) / 2) self._d_fin = RTC.TimedString(RTC.Time(0, 0), "") """ """ self._finIn = OpenRTM_aist.InPort("fin", self._d_fin) self._switch = "on" self._first = "true" self._fin = [] self._start = 0 self._nexttime = 0 self._today = datetime.date.today() self._today_str = str(self._today) self._t = 0
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_m_SlideNumin = RTC.TimedShort(RTC.Time(0,0),0) self._m_SlideNumIn = OpenRTM_aist.InPort("SlideNumberIn", self._d_m_SlideNumin) self._d_m_EffectNum = RTC.TimedShort(RTC.Time(0,0),0) self._m_EffectNumIn = OpenRTM_aist.InPort("EffectNumberIn", self._d_m_EffectNum) self._d_m_SlideNumout = RTC.TimedShort(RTC.Time(0,0),0) self._m_SlideNumOut = OpenRTM_aist.OutPort("SlideNumberOut", self._d_m_SlideNumout) self._d_m_Pen = RTC.TimedShortSeq(RTC.Time(0,0),[]) self._m_PenIn = OpenRTM_aist.InPort("Pen", self._d_m_Pen) self.SlideFileInitialNumber = [0] self.SlideNumberInRelative = [1] return
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_status = ogata_lab.CarStatus( ogata_lab.CameraData(0, 0, []), ogata_lab.CameraData(0, 0, []), ogata_lab.CameraData(0, 0, []), RTC.Velocity3D(0, 0, 0, 0, 0, 0), RTC.AngularVelocity3D(0, 0, 0), RTC.Acceleration3D(0, 0, 0), RTC.AngularAcceleration3D(0, 0, 0)) """ """ self._statusIn = OpenRTM_aist.InPort("status", self._d_status) self._d_simulator = ogata_lab.SimulatorStatus( RTC.Time(0, 0), RTC.Pose3D(RTC.Point3D(0, 0, 0), RTC.Orientation3D(0, 0, 0))) """ """ self._simulatorIn = OpenRTM_aist.InPort("simulator", self._d_simulator) self._d_command = ogata_lab.CarCommand(RTC.Time(0, 0), 0, 0, 0) """ """ self._commandOut = OpenRTM_aist.OutPort("command", self._d_command) # initialize of configuration-data. # <rtc-template block="init_conf_param"> """ - Name: debug - DefaultValue: 0 """ self._debug = [0]
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_stop = OpenRTM_aist.instantiateDataType(RTC.TimedBoolean) """ stop signal """ self._stopIn = OpenRTM_aist.InPort("stop", self._d_stop) self._d_status = OpenRTM_aist.instantiateDataType(RTC.TimedLong) """ time """ self._statusIn = OpenRTM_aist.InPort("status", self._d_status) self._d_in = OpenRTM_aist.instantiateDataType(RTC.TimedBoolean) """ timer start """ self._inOut = OpenRTM_aist.OutPort("in", self._d_in) # initialize of configuration-data. # <rtc-template block="init_conf_param"> """ - Name: play_time - DefaultValue: 120 """ self._play_time = [120]
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_target_pose = RTC.TimedPose2D( RTC.Time(0, 0), RTC.Pose2D(RTC.Point2D(0.0, 0.0), 0.0)) """ """ self._target_poseIn = OpenRTM_aist.InPort("target_pose", self._d_target_pose) self._d_target_velocity = RTC.TimedVelocity2D( RTC.Time(0, 0), RTC.Velocity2D(0.0, 0.0, 0.0)) """ """ self._target_velocityIn = OpenRTM_aist.InPort("target_velocity", self._d_target_velocity) self._d_kobuki_pose = RTC.TimedPose2D( RTC.Time(0, 0), RTC.Pose2D(RTC.Point2D(0.0, 0.0), 0.0)) """ """ self._kobuki_poseIn = OpenRTM_aist.InPort("kobuki_pose", self._d_kobuki_pose) self._d_flag = RTC.TimedBoolean(RTC.Time(0, 0), False) """ """ self._flagOut = OpenRTM_aist.OutPort("flag", self._d_flag) self._d_kobuki_velocity = RTC.TimedVelocity2D( RTC.Time(0, 0), RTC.Velocity2D(0.0, 0.0, 0.0)) """ """ self._kobuki_velocityOut = OpenRTM_aist.OutPort( "kobuki_velocity", self._d_kobuki_velocity)
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 __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_vIn = RTC.TimedFloat(RTC.Time(0, 0), 0) self._d_dp_vSeqIn = RTC.TimedFloatSeq(RTC.Time(0, 0), []) self._InIn = OpenRTM_aist.InPort( "in", self._d_dp_vIn, OpenRTM_aist.RingBuffer(8)) self._SeqInIn = OpenRTM_aist.InPort( "seqin", self._d_dp_vSeqIn, OpenRTM_aist.RingBuffer(8)) # Set InPort buffers self.addInPort("in", self._InIn) self.addInPort("seqin", self._SeqInIn) # Set OutPort buffers self._MyServicePort = OpenRTM_aist.CorbaPort("MyService") #self._myservice0_var = MyService_i() # initialization of Provider self._myservice0_var = MyServiceSVC_impl() # Set service provider to Ports self._MyServicePort.registerProvider( "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_image = RTC.CameraImage(RTC.Time(0, 0), 0, 0, 0, [], 0, []) self._imageIn = OpenRTM_aist.InPort("image", self._d_image) self._d_sensor = RTC.TimedShortSeq(RTC.Time(0, 0), []) self._sensorIn = OpenRTM_aist.InPort("sensor", self._d_sensor)
def onInitialize(self): OpenRTM_aist.DataFlowComponentBase.onInitialize(self) self._logger = OpenRTM_aist.Manager.instance().getLogbuf( self._properties.getProperty("instance_name")) self._logger.RTC_INFO("JuliusRTC version " + __version__) self._logger.RTC_INFO("Copyright (C) 2010-2011 Yosuke Matsusaka") # create inport for audio stream self._indata = RTC.TimedOctetSeq(RTC.Time(0, 0), None) self._inport = OpenRTM_aist.InPort("data", self._indata) self._inport.appendProperty( 'description', _('Audio data (in packets) to be recognized.').encode('UTF-8')) self._inport.addConnectorDataListener( OpenRTM_aist.ConnectorDataListenerType.ON_BUFFER_WRITE, DataListener("data", self, RTC.TimedOctetSeq)) self.registerInPort(self._inport._name, self._inport) # create inport for active grammar self._grammardata = RTC.TimedString(RTC.Time(0, 0), "") self._grammarport = OpenRTM_aist.InPort("activegrammar", self._grammardata) self._grammarport.appendProperty( 'description', _('Grammar ID to be activated.').encode('UTF-8')) self._grammarport.addConnectorDataListener( OpenRTM_aist.ConnectorDataListenerType.ON_BUFFER_WRITE, DataListener("activegrammar", self, RTC.TimedString)) self.registerInPort(self._grammarport._name, self._grammarport) # create outport for status self._statusdata = RTC.TimedString(RTC.Time(0, 0), "") self._statusport = OpenRTM_aist.OutPort("status", self._statusdata) self._statusport.appendProperty( 'description', _('Status of the recognizer (one of "LISTEN [accepting speech]", "STARTREC [start recognition process]", "ENDREC [end recognition process]", "REJECTED [rejected speech input]")' ).encode('UTF-8')) self.registerOutPort(self._statusport._name, self._statusport) # create outport for result self._outdata = RTC.TimedString(RTC.Time(0, 0), "") self._outport = OpenRTM_aist.OutPort("result", self._outdata) self._outport.appendProperty( 'description', _('Recognition result in XML format.').encode('UTF-8')) self.registerOutPort(self._outport._name, self._outport) # create outport for log self._logdata = RTC.TimedOctetSeq(RTC.Time(0, 0), None) self._logport = OpenRTM_aist.OutPort("log", self._logdata) self._logport.appendProperty('description', _('Log of audio data.').encode('UTF-8')) self.registerOutPort(self._logport._name, self._logport) self._logger.RTC_INFO( "This component depends on following softwares and datas:") self._logger.RTC_INFO('') for c in self._copyrights: for l in c.strip('\n').split('\n'): self._logger.RTC_INFO(' ' + l) self._logger.RTC_INFO('') return RTC.RTC_OK
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_odometry = OpenRTM_aist.instantiateDataType( RTC.TimedVelocity2D) """ """ self._odometryIn = OpenRTM_aist.InPort("odometry", self._d_odometry) self._d_currentPose = OpenRTM_aist.instantiateDataType(RTC.TimedPose2D) """ """ self._currentPoseIn = OpenRTM_aist.InPort("currentPose", self._d_currentPose) self._d_targetVelocity = OpenRTM_aist.instantiateDataType( RTC.TimedVelocity2D) """ """ self._targetVelocityOut = OpenRTM_aist.OutPort("targetVelocity", self._d_targetVelocity) # initialize of configuration-data. # <rtc-template block="init_conf_param"> """ - Name: max_acc - DefaultValue: 1 """ self._max_acc = [1] """ - Name: max_rot_acc - DefaultValue: 1 """ self._max_rot_acc = [1] """ - Name: max_vel - DefaultValue: 1 """ self._max_vel = [1] """ - Name: max_rot_vel - DefaultValue: 1 """ self._max_rot_vel = [1] """ - Name: host - DefaultValue: localhost """ self._host = ['localhost'] """ - Name: port - DefaultValue: 54323 """ self._port = ['54323']
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) inImage_arg = [None] * ((len(Img._d_TimedCameraImage) - 4) / 2) self._d_inImage = Img.TimedCameraImage(*inImage_arg) """ """ self._inImageIn = OpenRTM_aist.InPort("inImage", self._d_inImage) self._d_inString = OpenRTM_aist.instantiateDataType(RTC.TimedString) """ """ self._inStringIn = OpenRTM_aist.InPort("inString", self._d_inString) outImage_arg = [None] * ((len(Img._d_TimedCameraImage) - 4) / 2) self._d_outImage = Img.TimedCameraImage( RTC.Time(0, 0), Img.CameraImage(RTC.Time(0, 0), Img.ImageData(0, 0, 0, []), Img.CameraIntrinsicParameter([], []), []), 0) """ """ self._outImageOut = OpenRTM_aist.OutPort("outImage", self._d_outImage) self._d_outObjectParam = OpenRTM_aist.instantiateDataType( ObjectRecognition.TimedObjectParamSeq) """ """ self._outObjectParamOut = OpenRTM_aist.OutPort("outObjectParam", self._d_outObjectParam) self._d_outFlag = OpenRTM_aist.instantiateDataType(RTC.TimedLong) """ """ self._outFlagOut = OpenRTM_aist.OutPort("outFlag", self._d_outFlag) # initialize of configuration-data. # <rtc-template block="init_conf_param"> """ - Name: dataset - DefaultValue: karuta """ self._dataset = ['karuta'] """ - Name: mode - DefaultValue: gpu """ self._mode = ['gpu'] """ - Name: net - DefaultValue: vgg16 """ self._net = ['vgg16'] """ - Name: recognitionRate - DefaultValue: 0.8 """ self._recognitionRate = [0.8]
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_joints = RTC.TimedFloatSeq(RTC.Time(0, 0), []) self._jointsIn = OpenRTM_aist.InPort("joints", self._d_joints) self._d_mode = RTC.TimedOctet(RTC.Time(0, 0), 0) self._modeIn = OpenRTM_aist.InPort("mode", self._d_mode) self._d_status = RTC.TimedOctet(RTC.Time(0, 0), 0) self._statusOut = OpenRTM_aist.OutPort("status", self._d_status) self._d_out_joints = RTC.TimedFloatSeq(RTC.Time(0, 0), []) self._out_jointsOut = OpenRTM_aist.OutPort("out_joints", self._d_out_joints) self._d_out_vel = RTC.TimedFloatSeq(RTC.Time(0, 0), []) self._out_velOut = OpenRTM_aist.OutPort("out_vel", self._d_out_vel) self._d_out_trq = RTC.TimedFloatSeq(RTC.Time(0, 0), []) self._out_trqOut = OpenRTM_aist.OutPort("out_trq", self._d_out_trq) self._d_out_cur = RTC.TimedFloatSeq(RTC.Time(0, 0), []) self._out_curOut = OpenRTM_aist.OutPort("out_cur", self._d_out_cur) self._d_out_tmp = RTC.TimedFloatSeq(RTC.Time(0, 0), []) self._out_tmpOut = OpenRTM_aist.OutPort("out_tmp", self._d_out_tmp) self._d_is_moving = RTC.TimedBoolean(RTC.Time(0, 0), False) self._is_movingOut = OpenRTM_aist.OutPort("is_moving", self._d_is_moving) self._commonPort = OpenRTM_aist.CorbaPort("common") self._common = ManipulatorCommonInterface_Common_i() self._middlePort = OpenRTM_aist.CorbaPort("middle") self._middle = ManipulatorCommonInterface_Middle_i() # initialize of configuration-data. # <rtc-template block="init_conf_param"> """ - Name: stub_mode - DefaultValue: off """ self._stub_mode = ['off'] # </rtc-template> self._controller = ToroboArmController.ToroboArmController() self._monitor = ToroboArmMonitor.ToroboArmMonitor() self._log = OpenRTM_aist.Manager.instance().getLogbuf("ToroboArmController")
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)
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_velocities = RTC.TimedVelocity2D( RTC.Time(0, 0), RTC.Velocity2D(0.0, 0.0, 0.0)) """ 車体の目標速度 - Type: RTC::TimedVelocity2D - Unit: m/s, rad/s """ self._velocitiesIn = OpenRTM_aist.InPort( "velocities", self._d_velocities) self._d_torques = RTC.TimedDoubleSeq(RTC.Time(0, 0), []) """ アームのトルクを入力 - Type: RTC::TimedDoubleSeq - Number: 2 - Unit: N・m """ self._torquesIn = OpenRTM_aist.InPort("torques", self._d_torques) self._d_lightSwitch = RTC.TimedBooleanSeq(RTC.Time(0, 0), []) """ ライトのオンオフ - Type: RTC::TimedBooleanSeq """ self._lightSwitchIn = OpenRTM_aist.InPort( "lightSwitch", self._d_lightSwitch) self._d_angles = RTC.PanTiltAngles(RTC.Time(0, 0), 0.0, 0.0) """ カメラの角度 - Type: RTC::PanTiltAngles - Unit: rad """ self._anglesOut = OpenRTM_aist.OutPort("angles", self._d_angles) self.body = None """ 車輪半径 - Name: wheel_radius wheel_radius - DefaultValue: 0.05 - Unit: m """ self._wheel_radius = [0.05] """ 車輪間の距離 - Name: wheel_distance wheel_distance - DefaultValue: 0.2 - Unit: m """ self._wheel_distance = [0.2]
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) judge_arg = [None] * ((len(RTC._d_TimedLong) - 4) / 2) self._d_judge = RTC.TimedLong(RTC.Time(0,0), 0) """ """ self._judgeIn = OpenRTM_aist.InPort("judge", self._d_judge) balance_arg = [None] * ((len(RTC._d_TimedLong) - 4) / 2) self._d_balance = RTC.TimedLong(RTC.Time(0,0), 0) """ """ self._balanceIn = OpenRTM_aist.InPort("balance", self._d_balance) count_arg = [None] * ((len(RTC._d_TimedLong) - 4) / 2) self._d_count = RTC.TimedLong(RTC.Time(0,0), 0) """ """ self._countIn = OpenRTM_aist.InPort("count", self._d_count) fin_arg = [None] * ((len(RTC._d_TimedString) - 4) / 2) self._d_fin = RTC.TimedString(RTC.Time(0,0), "") """ """ self._finOut = OpenRTM_aist.OutPort("fin", self._d_fin) self._count = 0 self._start = "yet" self._starttime = 0 self._endtime = 5 self._time = 5 self._count_number = 0 self._data = 3 self._FSR_left_front = 0 self._FSR_right_front = 0 self._balance = 0 standtime = self._endtime - self._starttime # initialize of configuration-data. # <rtc-template block="init_conf_param"> """ - Name: NAO_IPaddress - DefaultValue: 127.0.0.1 """ self._NAO_IPaddress = ['127.0.0.1'] """ - Name: NAO_Port - DefaultValue: 9559 """ self._NAO_Port = [9559]
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._last_sensor_data = [False, False] velocity_in_arg = [None] * ((len(RTC._d_TimedVelocity2D) - 4) / 2) #self._d_velocity_in = RTC.TimedVelocity2D(*velocity_in_arg) self._d_velocity_in = RTC.TimedVelocity2D(RTC.Time(0, 0), RTC.Velocity2D(0, 0, 0)) """ 補正前の目標速度 - Type: RTC::TimedVelocity2D - Unit: m/s, rad/s """ self._velocity_inIn = OpenRTM_aist.InPort("velocity_in", self._d_velocity_in) touch_arg = [None] * ((len(RTC._d_TimedBooleanSeq) - 4) / 2) #self._d_touch = RTC.TimedBooleanSeq(*touch_arg) self._d_touch = RTC.TimedBooleanSeq(RTC.Time(0, 0), []) """ タッチセンサのオンオフ - Type: RTC::TimedBooleanSeq - Number: 2 """ self._touchIn = OpenRTM_aist.InPort("touch", self._d_touch) velocity_out_arg = [None] * ((len(RTC._d_TimedVelocity2D) - 4) / 2) #self._d_velocity_out = RTC.TimedVelocity2D(*velocity_out_arg) self._d_velocity_out = RTC.TimedVelocity2D(RTC.Time(0, 0), RTC.Velocity2D(0, 0, 0)) """ 補正後の目標速度 - Type: RTC::TimedVelocity2D - Unit: m/s, rad/s """ self._velocity_outOut = OpenRTM_aist.OutPort("velocity_out", self._d_velocity_out) sound_arg = [None] * ((len(RTC._d_TimedString) - 4) / 2) #self._d_sound = RTC.TimedString(*sound_arg) self._d_sound = RTC.TimedString(RTC.Time(0, 0), "") """ 音声出力 - Type: RTC::TimedString """ self._soundOut = OpenRTM_aist.OutPort("sound", self._d_sound) # initialize of configuration-data. # <rtc-template block="init_conf_param"> """ 停止した時に鳴らす音 - Name: sound_output sound_output - DefaultValue: beep """ self._sound_output = ['beep']
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._last_sensor_data = [0, 0, 0, 0] velocity_in_arg = [None] * ((len(RTC._d_TimedVelocity2D) - 4) / 2) #self._d_velocity_in = RTC.TimedVelocity2D(*velocity_in_arg) self._d_velocity_in = RTC.TimedVelocity2D(RTC.Time(0,0),RTC.Velocity2D(0,0,0)) """ 補正前の目標速度 - Type: RTC::TimedVelocity2D - Unit: m/s, rad/s """ self._velocity_inIn = OpenRTM_aist.InPort("velocity_in", self._d_velocity_in) distance_sensor_arg = [None] * ((len(RTC._d_TimedShortSeq) - 4) / 2) #self._d_distance_sensor = RTC.TimedShortSeq(*distance_sensor_arg) self._d_distance_sensor = RTC.TimedShortSeq(RTC.Time(0,0),[]) """ 距離センサの計測値 - Type: RTC::TimedShortSeq - Number: 4 """ self._distance_sensorIn = OpenRTM_aist.InPort("distance_sensor", self._d_distance_sensor) velocity_out_arg = [None] * ((len(RTC._d_TimedVelocity2D) - 4) / 2) #self._d_velocity_out = RTC.TimedVelocity2D(*velocity_out_arg) self._d_velocity_out = RTC.TimedVelocity2D(RTC.Time(0,0),RTC.Velocity2D(0,0,0)) """ 補正後の目標速度 - Type: RTC::TimedVelocity2D - Unit: m/s, rad/s """ self._velocity_outOut = OpenRTM_aist.OutPort("velocity_out", self._d_velocity_out) buzzer_arg = [None] * ((len(RTC._d_TimedShort) - 4) / 2) #self._d_buzzer = RTC.TimedShort(*buzzer_arg) self._d_buzzer = RTC.TimedShort(RTC.Time(0,0),0) """ ブザーの周波数 - Type: RTC::TimedShort """ self._buzzerOut = OpenRTM_aist.OutPort("buzzer", self._d_buzzer) # initialize of configuration-data. # <rtc-template block="init_conf_param"> """ 距離センサの計測値がこの値以下になった場合に停止する - Name: stop_distance stop_distance - DefaultValue: 50 """ self._stop_distance = [50]
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_mode = RTC.TimedOctet(RTC.Time(0, 0), 0) self._modeIn = OpenRTM_aist.InPort("mode", self._d_mode) self._d_in_joint = RTC.TimedFloatSeq(RTC.Time(0, 0), []) self._in_jointIn = OpenRTM_aist.InPort("in_joint", self._d_in_joint) self._d_in_pose = RTC.TimedPose3D( RTC.Time(0, 0), RTC.Pose3D(RTC.Point3D(0, 0, 0), RTC.Orientation3D(0, 0, 0))) self._in_poseIn = OpenRTM_aist.InPort("in_pose", self._d_in_pose) self._d_grip = RTC.TimedOctet(RTC.Time(0, 0), 0) self._gripIn = OpenRTM_aist.InPort("grip", self._d_grip) self._d_out_joint = RTC.TimedFloatSeq(RTC.Time(0, 0), []) self._out_jointOut = OpenRTM_aist.OutPort("out_joint", self._d_out_joint) self._d_out_pose = RTC.TimedPose3D( RTC.Time(0, 0), RTC.Pose3D(RTC.Point3D(0, 0, 0), RTC.Orientation3D(0, 0, 0))) self._out_poseOut = OpenRTM_aist.OutPort("out_pose", self._d_out_pose) self._d_is_moving = RTC.TimedBoolean(RTC.Time(0, 0), False) self._is_movingOut = OpenRTM_aist.OutPort("is_moving", self._d_is_moving) self._d_force = RTC.TimedFloatSeq(RTC.Time(0, 0), []) self._forceOut = OpenRTM_aist.OutPort("force", self._d_force) self._middlePort = OpenRTM_aist.CorbaPort("middle") self._commonPort = OpenRTM_aist.CorbaPort("common") self._middle = ManipulatorCommonInterface_Middle_i() self._common = ManipulatorCommonInterface_Common_i() # initialize of configuration-data. # <rtc-template block="init_conf_param"> """ - Name: ip_address - DefaultValue: 192.168.1.101 """ self._ip_address = ['192.168.1.101'] # </rtc-template> self._controller = None instance = OpenRTM_aist.Manager.instance() self._log = instance.getLogbuf("URRobotController")
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_RGBcameraImage = RTC.CameraImage(RTC.Time(0,0),0,0,0,'',1.0,[]) """ """ self._RGBcameraImageIn = OpenRTM_aist.InPort("RGBcameraImage", self._d_RGBcameraImage) self._d_checkPoint = RTC.TimedBoolean(RTC.Time(0,0),0) """ """ self._checkPointIn = OpenRTM_aist.InPort("checkPoint", self._d_checkPoint)
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) Button_arg = [None] * ((len(RTC._d_TimedULong) - 4) / 2) self._d_Button = RTC.TimedULong(*Button_arg) """ """ self._ButtonIn = OpenRTM_aist.InPort("Button", self._d_Button) Analog_arg = [None] * ((len(RTC._d_TimedDoubleSeq) - 4) / 2) self._d_Analog = RTC.TimedDoubleSeq(*Analog_arg) """ """ self._AnalogIn = OpenRTM_aist.InPort("Analog", self._d_Analog)
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_Axis = RTC.TimedDoubleSeq(RTC.Time(0, 0), []) """ """ self._AxisIn = OpenRTM_aist.InPort("Axis", self._d_Axis) self._d_Button = RTC.TimedBooleanSeq(RTC.Time(0, 0), []) """ """ self._ButtonIn = OpenRTM_aist.InPort("Button", self._d_Button) self._d_Velocity = RTC.TimedVelocity2D(RTC.Time(0, 0), 0) """ """ self._VelocityOut = OpenRTM_aist.OutPort("Velocity", self._d_Velocity) # initialize of configuration-data. # <rtc-template block="init_conf_param"> """ - Name: VXGain - DefaultValue: 1.0 """ self._VXGain = [-1.0] """ - Name: VAGain - DefaultValue: 1.0 """ self._VAGain = [1.0] """ - Name: PivotButtonN - DefaultValue: 0 """ self._PivotButtonN = [0] """ - Name: VXAxisN - DefaultValue: 0 """ self._VXAxisN = [1] """ - Name: VAAxisN - DefaultValue: 1 """ self._VAAxisN = [0] # </rtc-template> self.Pivot = False
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_vel = OpenRTM_aist.instantiateDataType(RTC.TimedVelocity2D) """ 前後進と左右 """ self._velIn = OpenRTM_aist.InPort("vel", self._d_vel) self._d_arm = OpenRTM_aist.instantiateDataType(RTC.TimedBoolean) """ armのopen/close """ self._armIn = OpenRTM_aist.InPort("arm", self._d_arm) self._d_camera = OpenRTM_aist.instantiateDataType(RTC.TimedBoolean) """ camera 1 or 2 """ self._cameraIn = OpenRTM_aist.InPort("camera", self._d_camera) self._d_display = OpenRTM_aist.instantiateDataType(RTC.TimedBoolean) """ 距離表示 あり or なし """ self._displayIn = OpenRTM_aist.InPort("display", self._d_display) self._d_in = OpenRTM_aist.instantiateDataType(RTC.TimedBooleanSeq) """ Joy stickからの入力 それぞれのボタンの情報がboolの配列で """ self._inOut = OpenRTM_aist.OutPort("in", self._d_in) self._d_stop = OpenRTM_aist.instantiateDataType(RTC.TimedBoolean) """ 終わったらTrueが返ってくる """ self._stopOut = OpenRTM_aist.OutPort("stop", self._d_stop) # initialize of configuration-data. # <rtc-template block="init_conf_param"> """ 移動速度 - Name: speed_x speed_x - DefaultValue: 0.1 """ self._speed_x = [0.1] """ 回転速度 - Name: speed_r speed_r - DefaultValue: 0.5 """ self._speed_r = [0.5]
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_number = OpenRTM_aist.instantiateDataType(RTC.TimedLong) """ """ self._numberIn = OpenRTM_aist.InPort("number", self._d_number) self._d_denom = OpenRTM_aist.instantiateDataType(RTC.TimedLong) """ """ self._denomIn = OpenRTM_aist.InPort("denom", self._d_denom) self._d_result = OpenRTM_aist.instantiateDataType(RTC.TimedLong) """ """ self._resultOut = OpenRTM_aist.OutPort("result", self._d_result)
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) self._d_out = OpenRTM_aist.instantiateDataType(RTC.CameraImage) """ """ self._outIn = OpenRTM_aist.InPort("out", self._d_out)
def __init__(self, manager): OpenRTM_aist.DataFlowComponentBase.__init__(self, manager) _pose3D = RTC.Pose3D(RTC.Point3D(0.0, 0.0, 0.0), RTC.Orientation3D(0.0, 0.0, 0.0)) _size3D = RTC.Size3D(0.0, 0.0, 0.0) _geometry3D = RTC.Geometry3D(_pose3D, _size3D) _rangerConfig = RTC.RangerConfig(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) self._d_Range_data = RTC.RangeData(RTC.Time(0, 0), [], RTC.RangerGeometry(_geometry3D, []), _rangerConfig) """ """ self._Range_dataIn = OpenRTM_aist.InPort("Range_data", self._d_Range_data) self._d_human_data_XY = RTC.TimedLongSeq(RTC.Time(0, 0), [0] * 2) """ """ self._human_data_XYOut = OpenRTM_aist.OutPort("human_data_XY", self._d_human_data_XY) """ - Name: LRF_range - DefaultValue:4 """ self._LRF_range = [4] self.diff_x0 = np.zeros(681) #背景差分初期値 self.diff_y0 = np.zeros(681) self.x_seq = [] self.y_seq = [] self.first_flag = False
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 onInitialize(self): # DataPorts initialization # <rtc-template block="data_ports"> self._d_vel = RTC.TimedFloatSeq(RTC.Time(0, 0), []) self._velIn = OpenRTM_aist.InPort("vel", self._d_vel) self.addInPort("vel", self._velIn) self._d_pos = RTC.TimedFloatSeq(RTC.Time(0, 0), []) self._posOut = OpenRTM_aist.OutPort("pos", self._d_pos) self.addOutPort("pos", self._posOut) self._d_sens = RTC.TimedFloatSeq(RTC.Time(0, 0), []) self._sensOut = OpenRTM_aist.OutPort("sens", self._d_sens) self.addOutPort("sens", self._sensOut) # Bind variables and configuration variable # <rtc-template block="bind_config"> self.bindParameter("map", self._map, "A,B") # create NXTBrick object try: print("Connecting to NXT brick ....") self._nxtbrick = NXTBrick20.NXTBrick() print("Connection established.") except: print("NXTBrick connection failed.") return RTC.RTC_ERROR return RTC.RTC_OK
def update_ports(self, in_topic, out_topic): for topic in out_topic: port = topic.lstrip('/').replace('/','_') topic_type = idlman.topicinfo.get(topic, None) _data = idlman.get_rtmobj(topic_type) if topic in self.inports.keys() or not topic_type or not _data: rospy.loginfo('Failed to add InPort "%s"', port) continue rospy.loginfo('Add InPort "%s"[%s]', port, topic_type) _inport = OpenRTM_aist.InPort(port, _data) self.registerInPort(port, _inport) self.inports[topic] = (_inport, _data) self.add_pub(topic) for topic in in_topic: port = topic.lstrip('/').replace('/','_') topic_type = idlman.topicinfo.get(topic, None) _data = idlman.get_rtmobj(topic_type) if (topic in self.outports.keys()) or not topic_type or not _data: rospy.loginfo('Failed to add OutPort "%s"', port) continue rospy.loginfo('Add OutPort "%s"[%s]', port, topic_type) _outport = OpenRTM_aist.OutPort(port, _data) self.registerOutPort(port, _outport) self.outports[topic] = (_outport, _data) self.add_sub(topic) return