RTC::ReturnCode_t RaspberryPiMouseController_DistanceSensor::onInitialize() { // Registration: InPort/OutPort/Service // <rtc-template block="registration"> // Set InPort buffers addInPort("target_velocity_in", m_target_velocity_inIn); addInPort("distance_sensor", m_distance_sensorIn); // Set OutPort buffer addOutPort("target_velocity_out", m_target_velocity_outOut); // Set service provider to Ports // Set service consumers to Ports // Set CORBA Service Ports // </rtc-template> // <rtc-template block="bind_config"> // Bind variables and configuration variable bindParameter("sensor_limit", m_sensor_limit, "10"); bindParameter("rotational_speed", m_rotational_speed, "1.6"); bindParameter("stop_velocity", m_stop_velocity, "0.01"); // </rtc-template> return RTC::RTC_OK; }
RTC::ReturnCode_t EchoCanceler::onInitialize() { RTC_DEBUG(("onInitialize start")); RTC_INFO(("EchoCanceler : Acoustic echo cancellation component using adaptive filter")); RTC_INFO((" Copyright (C) 2010-2011 Yosuke Matsusaka and AIST-OpenHRI development team")); RTC_INFO((" Version %s", VERSION)); // Registration: InPort/OutPort/Service // <rtc-template block="registration"> // Set InPort buffers addInPort("AudioDataIn", m_ninIn); addInPort("ReferenceAudioDataIn", m_finIn); /* setiing datalistener event */ m_ninIn.addConnectorDataListener(ON_BUFFER_WRITE, new DataListener("ON_BUFFER_WRITE_N", this)); m_ninIn.setDescription(_("Audio data input (from mic).")); m_finIn.addConnectorDataListener(ON_BUFFER_WRITE, new DataListener("ON_BUFFER_WRITE_F", this)); m_finIn.setDescription(_("Referenct audio data input (from AudioOuput component).")); // Set OutPort buffer registerOutPort("AudioDataOut", m_foutOut); m_foutOut.setDescription(_("Audio data output.")); // Set service provider to Ports // Set service consumers to Ports // Set CORBA Service Ports // </rtc-template> mp_sest = NULL; RTC_DEBUG(("onInitialize finish")); return RTC::RTC_OK; }
RTC::ReturnCode_t CollisionDetector::onInitialize() { std::cout << m_profile.instance_name << ": onInitialize()" << std::endl; // <rtc-template block="bind_config"> // Bind variables and configuration variable bindParameter("debugLevel", m_debugLevel, "0"); // </rtc-template> // Registration: InPort/OutPort/Service // <rtc-template block="registration"> // Set InPort buffers addInPort("qRef", m_qRefIn); addInPort("qCurrent", m_qCurrentIn); // Set OutPort buffer addOutPort("q", m_qOut); // Set service provider to Ports m_CollisionDetectorServicePort.registerProvider("service0", "CollisionDetectorService", m_service0); // Set service consumers to Ports // Set CORBA Service Ports addPort(m_CollisionDetectorServicePort); // </rtc-template> //RTC::Properties& prop = getProperties(); return RTC::RTC_OK; }
RTC::ReturnCode_t TabletTest::onInitialize() { // Registration: InPort/OutPort/Service // <rtc-template block="registration"> // Set InPort buffers addInPort("position", m_positionIn); addInPort("pressure", m_pressureIn); addInPort("orientation", m_orientationIn); addInPort("size", m_sizeIn); // Set OutPort buffer addOutPort("outputTabData", m_outputTabDataOut); // Set service provider to Ports // Set service consumers to Ports // Set CORBA Service Ports // </rtc-template> // <rtc-template block="bind_config"> // </rtc-template> return RTC::RTC_OK; }
RTC::ReturnCode_t footPlot::onInitialize() { // Registration: InPort/OutPort/Service // <rtc-template block="registration"> // Set InPort buffers addInPort("rightFootPos3dr", m_rightFootPos3drIn); addInPort("leftFootPos3dr", m_leftFootPos3drIn); addInPort("footUrg3d", m_footUrg3dIn); // Set OutPort buffer // Set service provider to Ports // Set service consumers to Ports // Set CORBA Service Ports // </rtc-template> // <rtc-template block="bind_config"> // </rtc-template> pv_x = new std::vector<double> ( 2 ); pv_y = new std::vector<double> ( 2 ); pv_r = new std::vector<double> ( 2 ); pv_footUrg3d = new std::vector<double> ( MAX_POINT_URG*3); return RTC::RTC_OK; }
RTC::ReturnCode_t sh_MT::onInitialize() { // Registration: InPort/OutPort/Service // <rtc-template block="registration"> // Set InPort buffers addInPort("input1", m_input1In); addInPort("input2", m_input2In); // Set OutPort buffer addOutPort("output1", m_output1Out); addOutPort("output2", m_output2Out); // Set service provider to Ports // Set service consumers to Ports // Set CORBA Service Ports // </rtc-template> // <rtc-template block="bind_config"> // </rtc-template> return RTC::RTC_OK; }
RTC::ReturnCode_t QController::onInitialize() { coil::Properties& ref = getProperties(); bindParameter("axisIds", m_axisIds, ref["conf.default.axisIds"].c_str()); bindParameter("axisScales", m_axisScales, ref["conf.default.axisScales"].c_str()); bindParameter("buttonIds", m_buttonIds, ref["conf.default.buttonIds"].c_str()); // Set InPort buffers addInPort("buttons", m_buttonsIn); addInPort("axes", m_axesIn); addInPort("angles", m_anglesIn); addInPort("vels", m_velsIn); // Set OutPort buffer addOutPort("torque", m_torqueOut); addOutPort("lightF", m_lightFOut); addOutPort("lightB", m_lightBOut); // ポート初期化 // m_torque.data.length(10); for (size_t i=0; i<m_torque.data.length(); i++){ m_torque.data[i] = 0; } m_lightF.data = m_lightB.data = true; for (int i=0; i<2; i++) m_qRef[i] = 0; return RTC::RTC_OK; }
RTC::ReturnCode_t AHViewer::onInitialize() { // Registration: InPort/OutPort/Service // <rtc-template block="registration"> // Set InPort buffers addInPort("PuckXY_in", m_puckXY_inIn); addInPort("MalletXY_in", m_malletXY_inIn); addInPort("ArmXY_in", m_armXY_inIn); // Set OutPort buffer // Set service provider to Ports // Set service consumers to Ports // Set CORBA Service Ports // </rtc-template> m_malletXY_in.data.length(2); m_armXY_in.data.length(2); m_puckXY_in.data.length(2); m_malletXY_in.data[0] = m_malletXY_in.data[1] = 0.0; m_armXY_in.data[0] = m_armXY_in.data[1] = 0.0; m_puckXY_in.data[0] = m_puckXY_in.data[1] = 0.0; cv::namedWindow(winName, CV_WINDOW_AUTOSIZE | CV_WINDOW_FREERATIO); cv::imshow(winName, frame); cv::waitKey(10); cv::waitKey(10); return RTC::RTC_OK; }
RTC::ReturnCode_t Gate::onInitialize() { RTC_DEBUG(("onInitialize start")); RTC_INFO(("Gate : Gate component")); RTC_INFO((" Copyright (C) 2010-2011 Yosuke Matsusaka and AIST-OpenHRI development team")); RTC_INFO((" Version %s", VERSION)); // Registration: InPort/OutPort/Service // <rtc-template block="registration"> // Set InPort buffers addInPort("AudioDataIn", m_inIn); m_inIn.setDescription(_("Audio data input.")); addInPort("GateIn", m_gateIn); m_gateIn.setDescription(_("Gate data input.")); // Set OutPort buffer addOutPort("AudioDataOut", m_outOut); m_outOut.setDescription(_("Audio data output.")); // Set service provider to Ports // Set service consumers to Ports // Set CORBA Service Ports // </rtc-template> RTC_DEBUG(("onInitialize finish")); return RTC::RTC_OK; }
RTC::ReturnCode_t PA10Controller::onInitialize() { // Set InPort buffers addInPort("angles", m_anglesIn); addInPort("vels", m_velsIn); // Set OutPort buffer addOutPort("torque", m_torqueOut); count = 0; m_qRef.data.length(9); m_qRef.data[0] = 0.0; m_qRef.data[1] = 0.8; m_qRef.data[2] = 0.0; m_qRef.data[3] = 0.8; m_qRef.data[4] = 0.0; m_qRef.data[5] = 0.8; m_qRef.data[6] = 1.57; m_qRef.data[7] = 0.0; m_qRef.data[8] = 0.0; m_torque.data.length(9); for (size_t i = 0; i < m_torque.data.length(); i++){ m_torque.data[i] = 0; } return RTC::RTC_OK; }
RTC::ReturnCode_t ForwardKinematics::onInitialize() { std::cerr << "[" << m_profile.instance_name << "] onInitialize()" << std::endl; // <rtc-template block="bind_config"> // Bind variables and configuration variable coil::Properties& ref = getProperties(); bindParameter("sensorAttachedLink", m_sensorAttachedLinkName, ref["conf.default.sensorAttachedLink"].c_str()); // </rtc-template> // Registration: InPort/OutPort/Service // <rtc-template block="registration"> // Set InPort buffers addInPort("q", m_qIn); addInPort("sensorRpy", m_sensorRpyIn); addInPort("qRef", m_qRefIn); addInPort("basePosRef", m_basePosRefIn); addInPort("baseRpyRef", m_baseRpyRefIn); // Set OutPort buffer // Set service provider to Ports m_ForwardKinematicsServicePort.registerProvider("service0", "ForwardKinematicsService", m_service0); addPort(m_ForwardKinematicsServicePort); m_service0.setComp(this); // Set service consumers to Ports // Set CORBA Service Ports // </rtc-template> RTC::Properties& prop = getProperties(); RTC::Manager& rtcManager = RTC::Manager::instance(); std::string nameServer = rtcManager.getConfig()["corba.nameservers"]; int comPos = nameServer.find(","); if (comPos < 0){ comPos = nameServer.length(); } nameServer = nameServer.substr(0, comPos); RTC::CorbaNaming naming(rtcManager.getORB(), nameServer.c_str()); m_refBody = hrp::BodyPtr(new hrp::Body()); if (!loadBodyFromModelLoader(m_refBody, prop["model"].c_str(), CosNaming::NamingContext::_duplicate(naming.getRootContext()))){ std::cerr << "[" << m_profile.instance_name << "] failed to load model[" << prop["model"] << "]" << std::endl; return RTC::RTC_ERROR; } m_actBody = hrp::BodyPtr(new hrp::Body()); if (!loadBodyFromModelLoader(m_actBody, prop["model"].c_str(), CosNaming::NamingContext::_duplicate(naming.getRootContext()))){ std::cerr << "[" << m_profile.instance_name << "] failed to load model[" << prop["model"] << "]" << std::endl; return RTC::RTC_ERROR; } m_refLink = m_refBody->rootLink(); m_actLink = m_actBody->rootLink(); return RTC::RTC_OK; }
RTC::ReturnCode_t MultiCameraViewer::onInitialize() { static InPort<RTC::CameraImage> m_imageIn2("camera2",m_image); addInPort("camera", m_imageIn); addInPort("camera2", m_imageIn2); bindParameter("port_num", m_port_num, "1"); return RTC::RTC_OK; }
RTC::ReturnCode_t ArmInverseKinematicsTest::onInitialize() { addInPort("qCur", m_qCurIn); addInPort("axes", m_axesIn); addInPort("button", m_buttonIn); addOutPort("qRef",m_qRefOut); arm = new Kinematics(ulink); SetJointInfo(ulink); return RTC::RTC_OK; }
RTC::ReturnCode_t SetKobukiVelo::onInitialize() { // Registration: InPort/OutPort/Service // <rtc-template block="registration"> // Set InPort buffers addInPort("ref_goal_pos", m_ref_goal_posIn); addInPort("ref_now_pos", m_ref_now_posIn); addInPort("ref_bumper", m_ref_bumperIn); // Set OutPort buffer addOutPort("out_velocity", m_out_velocityOut); // Set service provider to Ports // Set service consumers to Ports // Set CORBA Service Ports // </rtc-template> // <rtc-template block="bind_config"> // Bind variables and configuration variable bindParameter("cfg_goal_X", m_cfg_goal_X, "0"); bindParameter("cfg_goal_Y", m_cfg_goal_Y, "0"); bindParameter("cfg_goal_sita", m_cfg_goal_sita, "0"); bindParameter("cfg_velo_X", m_cfg_velo_X, "0"); bindParameter("cfg_velo_Y", m_cfg_velo_Y, "0"); bindParameter("cfg_velo_a", m_cfg_velo_a, "0"); bindParameter("set_max_speed", m_set_max_speed, "0.1"); bindParameter("bumper_react", m_bumper_react, "1"); bindParameter("set_max_revol", m_set_max_revol, "1.07"); std::cout<<"●RTMサマーキャンプ : SetKobukiVeloコンポーネント"; std::cout<<"\n 本コンポーネントは以下のポートから得られたデータを基に\n Kobukiに対し速度指令値をだす."; std::cout<<"\n\n●PortIn"; std::cout<<"\n ref_goal_pos : TimedPose2D型."; std::cout<<"\n kobukiが行きたい目標地点を入力するポート"; std::cout<<"\n ref_LRF : TimedDobuleSeq型."; std::cout<<"\n LRFのデータを入力するポート.一番近い障害物をよけようとする."; std::cout<<"\n 後述のコンフィギュレーションでシミュ用か実機用のモード変更ができる"; std::cout<<"\n ref_now_pos : TimedPose2D型.Kobukiの現在位置を入力するポート"; std::cout<<"\n\n●PortOut"; std::cout<<"\n out_velocity : TimedVelocity2D型.Kobukiに対し直進と回転の速度指令を与える."; std::cout<<"\n 直進速度は最大0.1m/sで回転は最大pi/2"; std::cout<<"\n\n●Configuration parameter"; std::cout<<"\n 目標座標および速度指令"; std::cout<<std::endl; std::cout<<"\nイニシャライズ完了"; // </rtc-template> return RTC::RTC_OK; }
RTC::ReturnCode_t PresentationCommentTimer::onInitialize() { // Registration: InPort/OutPort/Service // <rtc-template block="registration"> // Set InPort buffers addInPort("MeasurementTrigger", m_MeasurementTriggerIn); // Set OutPort buffer addOutPort("MeasuredTimeString", m_MeasuredTimeStringOut); // Set service provider to Ports // Set service consumers to Ports // Set CORBA Service Ports // </rtc-template> // <rtc-template block="bind_config"> // Bind variables and configuration variable bindParameter("OutputType", m_OutputType, "split"); bindParameter("PresentationTime", m_PresentationTime, "0.0"); // </rtc-template> return RTC::RTC_OK; }
FlowProbe::FlowProbe() { addInPort(ADD_PARAMETERS(in)); addOutPort(ADD_PARAMETERS(out)); addState("TotalFlow", &totalflow); addState("Flow", &flow); }
RTC::ReturnCode_t DataLogger::onInitialize() { std::cout << m_profile.instance_name << ": onInitialize()" << std::endl; // Registration: InPort/OutPort/Service // <rtc-template block="registration"> // Set InPort buffers addInPort("emergencySignal", m_emergencySignalIn); // Set OutPort buffer // Set service provider to Ports m_DataLoggerServicePort.registerProvider("service0", "DataLoggerService", m_service0); // Set service consumers to Ports // Set CORBA Service Ports addPort(m_DataLoggerServicePort); // </rtc-template> // <rtc-template block="bind_config"> // Bind variables and configuration variable // </rtc-template> return RTC::RTC_OK; }
RTC::ReturnCode_t Point2DtoPose2D::onInitialize() { // Registration: InPort/OutPort/Service // <rtc-template block="registration"> // Set InPort buffers addInPort("in", m_inIn); // Set OutPort buffer addOutPort("out", m_outOut); // Set service provider to Ports // Set service consumers to Ports // Set CORBA Service Ports // </rtc-template> // <rtc-template block="bind_config"> // Bind variables and configuration variable bindParameter("mode", m_mode, "0"); bindParameter("gain", m_gain, "1"); // </rtc-template> return RTC::RTC_OK; }
RTC::ReturnCode_t RangeDataViewer::onInitialize() { std::cout << m_profile.instance_name << ": onInitialize()" << std::endl; // <rtc-template block="bind_config"> // Bind variables and configuration variable bindParameter("maxRange", m_maxRange, "2.0"); // </rtc-template> // Registration: InPort/OutPort/Service // <rtc-template block="registration"> // Set InPort buffers addInPort("rangeIn", m_rangeIn); // Set OutPort buffer // Set service provider to Ports // Set service consumers to Ports // Set CORBA Service Ports // </rtc-template> RTC::Properties& prop = getProperties(); return RTC::RTC_OK; }
RTC::ReturnCode_t ConvertImage::onInitialize() { // Registration: InPort/OutPort/Service // <rtc-template block="registration"> // Set InPort buffers addInPort("imageIn", m_imageInIn); // Set OutPort buffer addOutPort("imageOut", m_imageOutOut); // Set service provider to Ports // Set service consumers to Ports // Set CORBA Service Ports // </rtc-template> // <rtc-template block="bind_config"> // Bind variables and configuration variable bindParameter("string_encode", m_string_encode, "off"); bindParameter("int_encode_quality", m_int_encode_quality, "75"); // </rtc-template> return RTC::RTC_OK; }
FileOut::FileOut() : Node(), stream(&file) { out_file_name = "out.txt"; addParameter(ADD_PARAMETERS(out_file_name)); addInPort(ADD_PARAMETERS(in)); addOutPort("out", &in); }
RTC::ReturnCode_t SamplePD_HG::onInitialize() { // <rtc-template block="bind_config"> // Bind variables and configuration variable if( CONTROLLER_BRIDGE_DEBUG ) { std::cout << "onInitialize" << std::endl; } // Set InPort buffers addInPort("angle_in", m_angle_inIn); // Set OutPort buffer addOutPort("torque", m_torqueOut); addOutPort("angle_out", m_angle_outOut); addOutPort("vel", m_velOut); addOutPort("acc", m_accOut); Pgain = new double[DOF]; Dgain = new double[DOF]; gain.open(GAIN_FILE); if (gain.is_open()){ for (int i=0; i<DOF; i++){ gain >> Pgain[i]; gain >> Dgain[i]; } gain.close(); }else{
RTC::ReturnCode_t JoyRTM2velROS::onInitialize() { // Registration: InPort/OutPort/Service // <rtc-template block="registration"> // Set InPort buffers addInPort("joy_input", m_joyInputIn); // Set OutPort buffer // Set service provider to Ports // Set service consumers to Ports // Set CORBA Service Ports // </rtc-template> // <rtc-template block="bind_config"> // Bind variables and configuration variable bindParameter("max_linear_velocity", m_max_linear_velocity, "0.2"); bindParameter("max_angular_velocity", m_max_angular_velocity, "0.4"); // </rtc-template> addRosOutPort("ros_velocity", m_rosVelOut); return RTC::RTC_OK; }
ImperviousRunoff::ImperviousRunoff() { addInPort(ADD_PARAMETERS(rain_in)); //in mm addOutPort(ADD_PARAMETERS(out_sw)); addParameter(ADD_PARAMETERS(area)); // in m2 addState(ADD_PARAMETERS(run_off)); }
RTC::ReturnCode_t HockeyArm::onInitialize() { // Registration: InPort/OutPort/Service // <rtc-template block="registration"> // Set InPort buffers addInPort("ArmXY_in", m_armXY_inIn); // Set OutPort buffer addOutPort("ArmXY_out", m_armXY_outOut); // Set service provider to Ports // Set service consumers to Ports m_AHServicePort.registerConsumer("AHCommonDataService", "AHCommon::AHCommonDataService", m_ahCommonDataService); // Set CORBA Service Ports addPort(m_AHServicePort); // </rtc-template> // 入力の初期化 m_armXY_in.data.length(2); m_armXY_in.data[0] = 0.0; m_armXY_in.data[1] = -HKY_H/2.0 - ARM_OFFSET + 400.0; // 出力の初期化 m_armXY_out.data.length(2); m_armXY_out.data[0] = 0.0; m_armXY_out.data[1] = -HKY_H/2.0 - ARM_OFFSET + 400.0; m_armXY_outOut.write(); return RTC::RTC_OK; }
RTC::ReturnCode_t makePattern_v2::onInitialize() { // Registration: InPort/OutPort/Service // <rtc-template block="registration"> // Set InPort buffers addInPort("val", m_valIn); // Set OutPort buffer addOutPort("pattern", m_patternOut); // Set service provider to Ports // Set service consumers to Ports // Set CORBA Service Ports // </rtc-template> // <rtc-template block="bind_config"> // Bind variables and configuration variable bindParameter("num", m_num, "8"); bindParameter("threshold", m_threshold, "0"); // </rtc-template> return RTC::RTC_OK; }
RTC::ReturnCode_t CaptureController::onInitialize() { std::cout << m_profile.instance_name << ": onInitialize()" << std::endl; // <rtc-template block="bind_config"> // Bind variables and configuration variable bindParameter("frameRate", m_frameRate, "1"); bindParameter("initialMode", m_initialMode, "sleep"); // </rtc-template> // Registration: InPort/OutPort/Service // <rtc-template block="registration"> // Set InPort buffers addInPort("imageIn", m_imageIn); // Set OutPort buffer addOutPort("imageOut", m_imageOut); // Set service provider to Ports m_CameraCaptureServicePort.registerProvider("service0", "CameraCaptureService", m_CameraCaptureService); // Set service consumers to Ports // Set CORBA Service Ports addPort(m_CameraCaptureServicePort); // </rtc-template> RTC::Properties& prop = getProperties(); return RTC::RTC_OK; }
RTC::ReturnCode_t JpegEncoder::onInitialize() { std::cout << m_profile.instance_name << ": onInitialize()" << std::endl; // <rtc-template block="bind_config"> // Bind variables and configuration variable bindParameter("quality", m_quality, "95"); // </rtc-template> // Registration: InPort/OutPort/Service // <rtc-template block="registration"> // Set InPort buffers addInPort("decodedIn", m_decodedIn); // Set OutPort buffer addOutPort("encodedOut", m_encodedOut); // Set service provider to Ports // Set service consumers to Ports // Set CORBA Service Ports // </rtc-template> //RTC::Properties& prop = getProperties(); return RTC::RTC_OK; }
RTC::ReturnCode_t RGB2Gray::onInitialize() { std::cout << m_profile.instance_name << ": onInitialize()" << std::endl; // <rtc-template block="bind_config"> // Bind variables and configuration variable // </rtc-template> // Registration: InPort/OutPort/Service // <rtc-template block="registration"> // Set InPort buffers addInPort("rgbIn", m_rgbIn); // Set OutPort buffer addOutPort("grayOut", m_grayOut); // Set service provider to Ports // Set service consumers to Ports // Set CORBA Service Ports // </rtc-template> //RTC::Properties& prop = getProperties(); return RTC::RTC_OK; }
/*! * コンポーネント自身の各種初期化処理 */ RTC::ReturnCode_t Flip::onInitialize() { // Registration: InPort/OutPort/Service // <rtc-template block="registration"> // Set InPort buffers addInPort("originalImage", m_originalImageIn); // Set OutPort buffer addOutPort("flippedImage", m_flippedImageOut); // Set service provider to Ports // Set service consumers to Ports // Set CORBA Service Ports // </rtc-template> // <rtc-template block="bind_config"> // Bind variables and configuration variable bindParameter("flipMode", m_flipMode, "0"); // </rtc-template> return RTC::RTC_OK; }