17 #include <yarp/os/Network.h>
18 #include <yarp/os/Port.h>
19 #include <yarp/os/Bottle.h>
20 #include <yarp/sig/Vector.h>
21 #include <yarp/math/Math.h>
28 using namespace yarp::os;
29 using namespace yarp::sig;
30 using namespace yarp::math;
39 if (!
yarp.checkNetwork())
47 options.put(
"robot",
"icubSim");
49 options.put(
"type",
"right");
51 options.put(
"pose",
"xyz");
53 options.put(
"verbosity",
"off");
56 if (!onlineSolver.
open(options))
61 in.open(
"/in");
out.open(
"/out"); rpc.open(
"/rpc");
62 Network::connect(
"/solver/out",in.getName());
63 Network::connect(
out.getName(),
"/solver/in");
64 Network::connect(rpc.getName(),
"/solver/rpc");
71 cout<<
"got dof: "<<reply.toString()<<endl;
77 cout<<
"got pose: "<<reply.toString()<<endl;
83 cout<<
"got mode: "<<reply.toString()<<endl;
92 cout<<
"switching to track mode...";
94 cout<<reply.toString()<<endl;
102 CartesianHelper::addTargetOption(
cmd,xd);
106 cout<<
"xd ="<<CartesianHelper::getTargetOption(reply)->toString()<<endl;
107 cout<<
"x ="<<CartesianHelper::getEndEffectorPoseOption(reply)->toString()<<endl;
108 cout<<
"q [deg] ="<<CartesianHelper::getJointsOption(reply)->toString()<<endl;
113 CartesianHelper::addDOFOption(
cmd,dof);
117 cout<<
"xd ="<<CartesianHelper::getTargetOption(reply)->toString()<<endl;
118 cout<<
"x ="<<CartesianHelper::getEndEffectorPoseOption(reply)->toString()<<endl;
119 cout<<
"q [deg] ="<<CartesianHelper::getJointsOption(reply)->toString()<<endl;
123 onlineSolver.
close();
virtual void close()
Stop the solver and dispose it.
Derived class which implements the on-line solver for the chain torso+arm.
virtual bool open(yarp::os::Searchable &options)
Configure the solver and start it up.
#define IKINSLV_VOCAB_OPT_DOF
#define IKINSLV_VOCAB_VAL_MODE_TRACK
#define IKINSLV_VOCAB_OPT_POSE
#define IKINSLV_VOCAB_OPT_MODE
#define IKINSLV_VOCAB_CMD_SET
#define IKINSLV_VOCAB_CMD_GET
int main(int argc, char *argv[])
Copyright (C) 2008 RobotCub Consortium.