当前位置: 首页>>代码示例>>C++>>正文


C++ Network::checkNetwork方法代码示例

本文整理汇总了C++中Network::checkNetwork方法的典型用法代码示例。如果您正苦于以下问题:C++ Network::checkNetwork方法的具体用法?C++ Network::checkNetwork怎么用?C++ Network::checkNetwork使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Network的用法示例。


在下文中一共展示了Network::checkNetwork方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main(int argc, char * argv[])
{
    /* initialize yarp network */

    Network yarp;
    if ( !yarp.checkNetwork() )
        return -1;


    /* prepare and configure the resource finder */

    ResourceFinder rf;
    rf.setVerbose(true);
    rf.setDefaultConfigFile("onlineLearnerModule.ini"); //overridden by --from parameter
//    rf.setDefaultContext("onlineLearnerModule/conf");   //overridden by --context parameter
    rf.configure("ICUB_ROOT", argc, argv);

    /* create your module */

    OnlineLearnerModule onlineLearnerModule;

    /* run the module: runModule() calls configure first and, if successful, it then runs */

    onlineLearnerModule.runModule(rf);

    return 0;
}
开发者ID:bdamas,项目名称:IMLE,代码行数:27,代码来源:onlineLearnerMain.cpp

示例2: main

int main(int argc, char *argv[])
{
    ResourceFinder rf;
    rf.setVerbose(true);
    rf.setDefaultContext("navigation");
    rf.setDefaultConfigFile("baseCtrl.ini");
    rf.configure(argc,argv);

    if (rf.check("help"))
    {
        yInfo("Possible options: ");
        yInfo("'rate <r>' sets the threads rate (default 20ms).");
        yInfo("'no_filter' disables command filtering.");
        yInfo("'no_motors' motor interface will not be opened.");
        yInfo("'no_start' do not automatically enables pwm.");
        yInfo("'joystick_connect' tries to automatically connect to the joystickCtrl output.");
        yInfo("'skip_robot_interface_check' does not connect to robotInterface/rpc (useful for simulator)");
        return 0;
    }

    //Initialize Yarp network
    Network yarp;

    if (!yarp.checkNetwork())
    {
        yError("Sorry YARP network does not seem to be available, is the yarp server available?\n");
        return -1;
    }

    //Starts the control module
    CtrlModule mod;
    return mod.runModule(rf);
}
开发者ID:robotology,项目名称:navigation,代码行数:33,代码来源:main.cpp

示例3: main

int main(int argc, char *argv[]) {
    using yarp::os::Network;
    using yarp::os::ResourceFinder;
    using iCub::interactionForces::FingerForceModule;

    // Initialise device driver list
    YARP_REGISTER_DEVICES(icubmod);

    // Open network
    Network yarp;
    if (!yarp.checkNetwork()) {
         fprintf(stdout, "Error: yarp server is not available.\n");
         return -1;
    }     

    // Using modules
    FingerForceModule mod;

    // Create resource finder
    ResourceFinder rf;
    rf.setVerbose();
    rf.setDefaultConfigFile("confFingertipsRight.ini");
    rf.setDefaultContext("fingerForce");
    rf.configure("ICUB_ROOT", argc, argv);

    // Configure and run module
    mod.configure(rf);
    mod.runModule();

    return 0;
}
开发者ID:JoErNanO,项目名称:icub-interactionforces,代码行数:31,代码来源:main.cpp

示例4: main

int main(int argc, char *argv[])
{
    Network yarp;

    ResourceFinder rf;
    rf.setVerbose(true);
    rf.setDefaultContext("poeticon");    // overridden by --context
    rf.setDefaultConfigFile("geometricGrounding.ini");  // overridden by --from
    rf.configure(argc, argv);

    if(rf.check("help"))
    {
        yInfo("Options available:");
        yInfo(" --prerules <filename> (pre-rules file, default: pre_rules.dat)");
        return 0; // EXIT_SUCCESS
    }

    if(! yarp.checkNetwork() )
    {
        yError("yarp server does not seem available");
        return 1; // EXIT_FAILURE
    }

    geoGround module;
    return module.runModule(rf);
}
开发者ID:robotology,项目名称:poeticon,代码行数:26,代码来源:geometricGroundingMain.cpp

示例5: main

int main(int argc, char * argv[])
{
    ResourceFinder rf;
    rf.setVerbose(true);
    rf.configure(argc,argv);
    //rf.setDefaultContext("empty");
    //rf.setDefaultConfigFile("empty");

    if (rf.check("help"))
    {
        //help here
    }

    //initialize yarp network
    Network yarp;

    if (!yarp.checkNetwork())
    {
        fprintf(stderr, "Sorry YARP network does not seem to be available, is the yarp server available?\n");
        return -1;
    }

    YARP_REGISTER_DEVICES(icubmod)

    CtrlModule mod;

    return mod.runModule(rf);
}
开发者ID:apaikan,项目名称:icub-main,代码行数:28,代码来源:main.cpp

示例6: main

/**
* Main function.
*/
int main(int argc, char * argv[])
{
    YARP_REGISTER_DEVICES(icubmod)

    ResourceFinder rf;
    rf.setVerbose(true);
    rf.setDefaultContext("demoINNOROBO");
    rf.setDefaultConfigFile("demoINNOROBO.ini");
    rf.configure(argc,argv);

    if (rf.check("help"))
    {    
        cout << endl << "Options:" << endl;
        cout << "   --context    path:  where to find the called resource" << endl;
        cout << "   --from       from:  the name of the .ini file." << endl;
        cout << "   --name       name:  the name of the module (default demoINNOROBO)." << endl;
        cout << "   --robot      robot: the name of the robot. Default icub." << endl;
        cout << "   --rate       rate:  the period used by the thread. Default 100ms." << endl;
        cout << "   --verbosity  int:   verbosity level (default 1)." << endl;
        cout << endl;
        return 0;
    }

    Network yarp;
    if (!yarp.checkNetwork())
    {
        printf("No Network!!!\n");
        return -1;
    }

    demoINNOROBO chEyeTest;
    return chEyeTest.runModule(rf);
}
开发者ID:alecive,项目名称:demoINNOROBO,代码行数:36,代码来源:demoINNOROBO.cpp

示例7: main

int main()
{
	Network yarp;
	if (!yarp.checkNetwork())
        return -1;

	
//	PMPmodule myPMPmodule;
	PMPnetwork_server myPMPmodule;

	Property opt;
    opt.put("Context","pmp_network_test/conf");
	myPMPmodule.openInterface(opt);

	return myPMPmodule.runModule();
/*
	ResourceFinder rf;
	rf.setVerbose(true); // print to a console conf info
	rf.setDefaultConfigFile("PMPnetworkConfiguration.ini");
	rf.setDefaultContext("conf/PMP_network"); // dove sono i file .ini
	bool ok = rf.configure("ICUB_ROOT",0,NULL);

	if(ok)	myPMPmodule.runModule(rf);
*/
	//myPMPmodule.test();
}
开发者ID:xufango,项目名称:contrib_bk,代码行数:26,代码来源:main.cpp

示例8: main

//********************************************
int main(int argc, char * argv[])
{
    Network yarp;

    ResourceFinder rf;
    rf.setVerbose(false);
    rf.setDefaultContext("periPersonalSpace");
    rf.setDefaultConfigFile("ppsAggregEventsForiCubGui.ini");
    rf.configure(argc,argv);
   
    if (rf.check("help"))
    {    
        yInfo(" ");
        yInfo("Options:");
        yInfo("   --context     path:  where to find the called resource (default periPersonalSpace).");
        yInfo("   --from        from:  the name of the .ini file (default ppsAggregEventsForiCubGui.ini).");
        yInfo("   --name        name:  the name of the module (default ppsAggregEventsForiCubGui).");
        yInfo("   --verbosity   verbosity:  verbosity level.");
        yInfo("   --autoConnect flag:  if to auto connect the ports or not. Default no.");
        yInfo("   --tactile    flag:  if enabled, the tactile aggreg events will be prepared for iCubGui visualization.");
        yInfo("   --pps       flag:  if enabled, the peripersonal space aggreg events will be prepared for iCubGui visualization.");
        yInfo("   --gain     gain:  the multiplication vector for the visualization of normalized event magnitude.");
        yInfo(" ");
        return 0;
    }

    if (!yarp.checkNetwork())
    {
        yError("No Network!!!");
        return -1;
    }
      
    ppsAggregEventsForiCubGui module;
    return module.runModule(rf);   
}
开发者ID:vicentepedro,项目名称:peripersonal-space,代码行数:36,代码来源:ppsAggregEventsForiCubGui.cpp

示例9: main

int main(int argc, char *argv[])
{
    ResourceFinder rf;
    rf.setVerbose(true);
    rf.setDefaultContext("ctpService/conf");
    rf.configure("ICUB_ROOT",argc,argv);

    if (rf.check("help"))
    {
        yInfo() << "Options:";
        yInfo() << "\t--joints       <n>:          number of joints, default 6";
        yInfo() << "\t--name         <moduleName>: set new module name";
        yInfo() << "\t--robot        <robotname>:  robot name";
        yInfo() << "\t--part         <robotname>:  part name";
        yInfo() << "\t--filename     <filename>:   the positions file";
        yInfo() << "\t--execute      activate the iPid->setReference() control";
        yInfo() << "\t--period       <period>: the period in ms of the internal thread (default 5)";
        yInfo() << "\t--verbose      to display additional infos";
        return 0;
    }

    Network yarp;

    if (!yarp.checkNetwork())
    {
        yError() << "yarp.checkNetwork() failed.";
        return -1;
    }

    scriptModule mod;
 
    return mod.runModule(rf);
}
开发者ID:kt10aan,项目名称:icub-main,代码行数:33,代码来源:main.cpp

示例10: main

/**
* Main function.
*/
int main(int argc, char * argv[])
{
    Network yarp;

    ResourceFinder rf;
    rf.setVerbose(true);
    rf.setDefaultContext("periPersonalSpace");
    rf.setDefaultConfigFile("skinEventsAggregation.ini");
    rf.configure(argc,argv);

    if (rf.check("help"))
    {   
        yInfo(" "); 
        yInfo("Options:");
        yInfo(" ");
        yInfo("  --context    path:  where to find the called resource");
        yInfo("  --from       from:  the name of the .ini file.");
        yInfo("  --general::name      name:  the name of the module (default virtualContactGeneration).");
        yInfo("  --general::robot     robot: the name of the robot. Default icubSim.");
        yInfo("  --general::rate      rate:  the period used by the thread. Default 100ms.");
        yInfo("  --general::verbosity int:   verbosity level (default 0).");
        yInfo(" ");
        return 0;
    }
    
    if (!yarp.checkNetwork())
    {
        printf("No Network!!!\n");
        return -1;
    }

    skinEventsAggregator sEA;
    return sEA.runModule(rf);
}
开发者ID:vicentepedro,项目名称:peripersonal-space,代码行数:37,代码来源:skinEventsAggregator.cpp

示例11: main

int main(int argc, char *argv[])
{
    ResourceFinder rf;
    rf.setVerbose(true);
    rf.setDefaultContext("cer");
    rf.setDefaultConfigFile("robotJoystickCtrl.ini");
    rf.configure(argc,argv);

    if (rf.check("help"))
    {
        yInfo("Possible options: ");
        yInfo("'robot <name>' the robot name for remote connection.");
        yInfo("'local <name>' the local port name.");
        yInfo("'rate <r>' sets the threads rate (default 20ms).");
        yInfo("'no_motors' motor interface will not be opened.");
        yInfo("'joystick_connect' tries to automatically connect to the joystickCtrl output.");
        yInfo("'skip_robot_interface_check' does not connect to robotInterface/rpc (useful for simulator)");

        yInfo("''");
        yInfo("example: robotJoystickCtrl --robot SIM_CER_ROBOT --joystick_connect --skip_robot_interface_check ");
        return 0;
    }

    Network yarp;

    if (!yarp.checkNetwork())
    {
        yError("Sorry YARP network does not seem to be available, is the yarp server available?\n");
        return -1;
    }

    CtrlModule mod;

    return mod.runModule(rf);
}
开发者ID:robotology,项目名称:cer,代码行数:35,代码来源:main.cpp

示例12: main

int main(int argc, char *argv[]) 
{
    Network yarp;

    if (!yarp.checkNetwork())
    {
        printf("No yarp network, quitting\n");
        return 1;
    }


    ControlThread myThread(4.0); //period is 4s

    myThread.start();

    bool done=false;
    double startTime=Time::now();
    while(!done)
    {
        if ((Time::now()-startTime)>5)
            done=true;
    }
    
    myThread.stop();

    return 0;
}
开发者ID:robotology,项目名称:icub-tutorials,代码行数:27,代码来源:tutorial_periodic_thread.cpp

示例13: main

int main(int argc, char *argv[]){

	Network yarp;
	if(!yarp.checkNetwork()){
		printf("Yarp network failed!\n");
		return -1;
	}

	/*DriverCreator *kinect_factoryClient = new DriverCreatorOf<yarp::dev::KinectDeviceDriverClient>("KinectDeviceClient","","");
	DriverCreator *kinect_factoryServer = new DriverCreatorOf<yarp::dev::KinectDeviceDriverServer>("KinectDeviceServer","","");
	Drivers::factory().add(kinect_factoryClient);
	Drivers::factory().add(kinect_factoryServer);*/

	//Property config("(device KinectDeviceClient) (remotePortPrefix /kinect) (localPortPrefix /kinectSkeletonClient) (userDetection)");
	//Property config("(device KinectDeviceLocal) (portPrefix /kinectSkeletonServer) (openPorts)");
	Property config("(device KinectDeviceLocal) (portPrefix /kinectSkeletonServer) (userDetection)");
	//Property config("(device KinectDeviceLocal) (portPrefix /kinectSkeletonServer)");
	PolyDriver dd(config);
	IKinectDeviceDriver *grabber;
	dd.view(grabber);
	if (grabber==NULL) { return 0; } // failed

	GLWindow *glWindow = new GLWindow(argc,argv);

	KinectThread kinectThread(grabber,glWindow);
	kinectThread.start();

	glWindow->runGLWindow();

	return 1;
}
开发者ID:JoErNanO,项目名称:yarp,代码行数:31,代码来源:main.cpp

示例14: main

//********************************************
int main(int argc, char * argv[])
{
    Network yarp;

    ResourceFinder moduleRF;
    moduleRF.setVerbose(false);
    moduleRF.setDefaultContext("periPersonalSpace");
    moduleRF.setDefaultConfigFile("demoAvoidance.ini");
    moduleRF.configure(argc,argv);

    if (moduleRF.check("help"))
    {
        yInfo(" ");
        yInfo("Options:");
        yInfo("   --context     path:  where to find the called resource (default periPersonalSpace).");
        yInfo("   --from        from:  the name of the .ini file (default demoAvoidance.ini).");
        yInfo("   --name        name:  the name of the module (default avoidance).");
        yInfo("   --autoConnect flag:  if to auto connect the ports or not. Default no.");
        yInfo("   --catching    flag:  if enabled, the robot will catch the target instead of avoiding it.");
        yInfo("   --stiff       flag:  if enabled, the robot will perform movements in stiff mode instead of compliant.");
        yInfo("   --noLeftArm   flag:  if enabled, the robot will perform movements without the left arm.");
        yInfo("   --noRightArm  flag:  if enabled, the robot will perform movements without the rihgt arm.");
        yInfo(" ");
        return 0;
    }

    if (!yarp.checkNetwork())
    {
        yError("No Network!!!");
        return -1;
    }

    Avoidance module;
    return module.runModule(moduleRF);
}
开发者ID:robotology,项目名称:peripersonal-space,代码行数:36,代码来源:demoAvoidance.cpp

示例15: main

int main (int argc, char * argv[])
{
    YARP_REGISTER_DEVICES(icubmod)
    
    Network yarp;
    if (!yarp.checkNetwork())
    {
        cout<<"YARP network not available. Aborting."<<endl;
        return -1;
    }
    
    ResourceFinder rf;
    rf.setVerbose(true);
    rf.setDefaultConfigFile("defaultSim.ini");         
    rf.setDefaultContext("reachComBalance/conf"); 
    rf.configure("ICUB_ROOT",argc,argv);
    
    if (rf.check("help"))
    {
        cout<< "Possible parameters"                                                                                                                                          << endl << endl;
        cout<< "\t--context          :Where to find an user defined .ini file "                                   <<endl;
        cout<< "\t--from             :Name of the file.ini to be used for calibration."                                                                                       <<endl;
        
        cout<<"The list of parameters is huge: please fill the configuration file.ini"<<endl;
        
        return 0;
    }
    
    //Creating the module
    ISIR_Balancer balancerModule;
    balancerModule.runModule(rf);
    
    return 0;
}
开发者ID:arocchi,项目名称:codyco,代码行数:34,代码来源:main_reachComBalance.cpp


注:本文中的Network::checkNetwork方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。