Esempio n. 1
0
int
main (int argc, char *argv[])
{
  Network yarp;

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

  YARP_REGISTER_DEVICES(icubmod)

  ResourceFinder rf;
  rf.setVerbose (true);
  rf.setDefaultContext ("actionPrimitivesExample/conf");
  rf.setDefaultConfigFile ("config.ini");
  rf.setDefault ("part", "left_arm");
  rf.setDefault ("grasp_model_type", "tactile");
  rf.setDefault ("grasp_model_file", "grasp_model.ini");
  rf.setDefault ("hand_sequences_file", "hand_sequences.ini");
  rf.setDefault ("name", "actionPrimitivesMod");
  rf.setDefault ("sim", "off");
  rf.configure ("ICUB_ROOT", argc, argv);

  BehaviorModule mod;

  return mod.runModule (rf);
}
Esempio n. 2
0
int main(int argc, char** argv) {
    //yarp::os::Thread::setDefaultStackSize(3145728);
    yarp::os::Network yarp;
    if (!yarp.checkNetwork())
    {
        fprintf (stderr, "Error: could not initialize YARP network (is the nameserver running?)\n");
        return 1;
    }
    
    YARP_REGISTER_DEVICES(icubmod)
    yarp::os::Property options;
    options.fromCommand(argc,argv);

    // the "bundle" controls the implementation used for the simulation
    // (as opposed to the simulation interface).  The default is the
    // standard ODE/SDL implementation.  There is a "fake" do-nothing
    // simulation for test purposes that does nothing other than create
    // the standard ports (pass --fake to start this simulation).
    SimulationBundle *bundle = NULL;

    if (options.check("fake")) {
#ifdef ICUB_SIM_ENABLE_FAKE
        bundle = new FakeSimulationBundle;
#endif
    } else {
#ifdef ICUB_SIM_ENABLE_ODESDL
        bundle = new OdeSdlSimulationBundle;
#endif
    }
    if (options.check("verbose"))
    {
        bundle->verbose = true;
        fprintf(stdout, "Starting the simulator with verbose flag on\n");
    }
    if (bundle==NULL) {
        fprintf(stderr,"Failed to allocate simulator\n");
        return 1;
    }

    //SimulationRun main;
    //if (!main.run(bundle,argc,argv)) return 1;
    MainThread thread;
   thread.bundle = bundle;
   thread.argc = argc;
   thread.argv = argv;
#ifdef _WIN32
   //thread.setOptions(3145728);
#endif
   thread.start();
   thread.join();
   return thread.result?0:1;
    return 0;
}
Esempio n. 3
0
int main(int argc, char * argv[])
{
   YARP_REGISTER_DEVICES(icubmod)
   Network yarp;
   stereoCalibModule stereoModule; 
   ResourceFinder rf;
   rf.setVerbose(true);
   rf.setDefaultConfigFile("icubEyes.ini"); 
   rf.setDefaultContext("cameraCalibration");
   rf.configure(argc, argv);

   stereoModule.runModule(rf);
    return 1;
}
int main(int argc, char *argv[])
{
    Network yarp;

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

    YARP_REGISTER_DEVICES(icubmod)

    ResourceFinder rf;
    rf.setVerbose(true);
    rf.setDefaultContext("sceneFlowModule");
    rf.configure(argc,argv);
    sceneFlowModule mod;

    return mod.runModule(rf);
}
Esempio n. 5
0
int main(int argc, char *argv[])
{
    yarp::os::Network yarp;

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

    YARP_REGISTER_DEVICES(icubmod)

    yarp::os::ResourceFinder rf;
    rf.setVerbose(true);
    rf.setDefaultContext("power-grasp");
    rf.setDefaultConfigFile("config.ini");
    rf.configure(argc,argv);

    PowerGrasp mod;

    return mod.runModule(rf);
}
Esempio n. 6
0
int main(int argc, char *argv[]) 
{
    YARP_REGISTER_DEVICES(icubmod)

    Network::init();
    ResourceFinder rf;

    rf.setVerbose(true);
    rf.setDefaultContext("controlBoardDumper");
    rf.setDefaultConfigFile("controlBoardDumper.ini");

    rf.setDefault("part", "head");
    rf.setDefault("robot", "icub");
    rf.configure(argc, argv);

    Property p;
    DumpModule mod;
    p.fromString(rf.toString());

    if (!p.check("rate"))
        p.put("rate", 500);
    if (!p.check("joints"))
        {
            Value v;
            v.fromString("(0 1)");
            p.put("joints", v);
        }
    if (!p.check("dataToDump"))
        {
            Value v;
            v.fromString("(getEncoders getEncoderSpeeds getEncoderAccelerations getPositionErrors getOutputs getCurrents getTorques getTorqueErrors getPidReferences)");
            p.put("dataToDump", v);
        }

    fprintf(stderr, "Current configuration is: %s\n", p.toString().c_str());
    if (mod.open(p))
        return mod.runModule();
    else 
        return 0;

    Network::fini();
}
Esempio n. 7
0
bool Recognition::configure(yarp::os::ResourceFinder &rf) {    
    
	bool    bEveryThingisGood = true;

	//init the network
	Network::init();
	
	YARP_REGISTER_DEVICES(icubmod);

	//bEveryThingisGood = initRobotHead(rf);

	bEveryThingisGood = initGaze(rf);

	bEveryThingisGood = initPorts(rf);

	bEveryThingisGood = initBlobExtractor(rf);

	pastImg = currentImg = NULL;
	
	cameraT = NULL;
	
	return bEveryThingisGood ;     
}
Esempio n. 8
0
int main(int argc, char *argv[]) 
{
    YARP_REGISTER_DEVICES(icubmod)

    Network::init();
    ResourceFinder rf;

    rf.setVerbose(true);
    rf.setDefaultContext("controlBoardDumper");
    rf.setDefaultConfigFile("controlBoardDumper.ini");

    rf.setDefault("part", "head");
    rf.setDefault("robot", "icub");
    rf.configure(argc, argv);

    Property p;
    DumpModule mod;
    p.fromString(rf.toString());

    if (!p.check("rate"))
    {
        p.put("rate", 500);
    }
    if (!p.check("joints"))
    {
        Value v;
        v.fromString("(0)");
        p.put("joints", v);
    }
    if (!p.check("dataToDump"))
    {
        Value v;
        v.fromString("(getEncoders getEncoderSpeeds getEncoderAccelerations getPositionErrors getOutputs getCurrents getTorques getTorqueErrors getPidReferences)");
        p.put("dataToDump", v);
    }
    if (p.check("dataToDumpAll"))
    {
        Value v;
        v.fromString("(getEncoders getEncoderSpeeds getEncoderAccelerations getPositionErrors getOutputs getCurrents getTorques getTorqueErrors getPidReferences getRotorPositions getRotorSpeeds getRotorAccelerations)");
        p.put("dataToDump", v);
    }
    if (p.check("help"))
    {
        printf ("controlBoardDumper usage:\n");
        printf ("1) controlBoardDumper --robot icub --part left_arm --rate 10  --joints \"(0 1 2)\" --dataToDump \"(xxx)\"\n");
        printf (" where xxx can be one of the following:\n");
        printf (" getEncoders             (joint position)\n");
        printf (" getEncoderSpeeds        (joint velocity)\n");
        printf (" getEncoderAccelerations (joint acceleration)\n");
        printf (" getPositionErrors       (difference between desired and actual position)\n");
        printf (" getTorqueErrors         (difference between desired and measured torque, if available)\n");
        printf (" getOutputs              (voltage (PWM) given to the motor)\n");
        printf (" getCurrents             (current given to the motor)\n");
        printf (" getTorques              (joint torques, if available)\n");
        printf (" getRotorPositions       (hi-res rotor position, if available)\n");
        printf (" getRotorSpeeds          (hi-res rotor velocity, if available)\n");
        printf (" getRotorAccelerations   (hi-res rotor acceleration, if available)\n");
        printf ("\n2) controlBoardDumper --robot icub --part left_arm --rate 10  --joints \"(0 1 2)\" --dataToDumpAll\n");

        return 0;
    }

    fprintf(stderr, "Current configuration is: %s\n", p.toString().c_str());
    if (mod.open(p))
        return mod.runModule();
    else 
        return 0;

    Network::fini();
}