3 #include <yarp/os/Network.h>
4 #include <yarp/os/PeriodicThread.h>
5 #include <yarp/os/Time.h>
6 #include <yarp/os/Property.h>
7 #include <yarp/dev/ControlBoardInterfaces.h>
8 #include <yarp/dev/PolyDriver.h>
9 #include <yarp/sig/Vector.h>
14 using namespace yarp::os;
16 using namespace yarp::sig;
23 IVelocityControl *ivel;
34 printf(
"ControlThread:starting\n");
37 options.put(
"device",
"remote_controlboard");
38 options.put(
"local",
"/local/head");
41 options.put(
"remote",
"/icubSim/head");
48 if ( (!iencs) || (!ivel) )
53 iencs->getAxes(&joints);
55 encoders.resize(joints);
59 ivel->setRefAccelerations(
commands.data());
67 printf(
"ControlThread:stopping the robot\n");
73 printf(
"Done, goodbye from ControlThread\n");
79 iencs->getEncoders(encoders.data());
98 if (!
yarp.checkNetwork())
100 printf(
"No yarp network, quitting\n");
110 double startTime=Time::now();
113 if ((Time::now()-startTime)>5)
ControlThread(double period)
Copyright (C) 2008 RobotCub Consortium.
int main(int argc, char *argv[])