20 #include <yarp/os/all.h> 21 #include <yarp/sig/all.h> 22 #include <yarp/math/Math.h> 23 #include <yarp/math/SVD.h> 35 if (!yarp.checkNetwork())
37 yError()<<
"YARP network seems unavailable!";
41 ICubClient iCub(
"ARE_KARMAiCubClientExample",
"icubClient",
"example_ARE_KARMA.ini");
44 yError()<<
"[ARE_KARMAiCubClientExample] ARE and/or KARMA and/or OPC seems unavailabe!";
48 ResourceFinder rfClient;
49 rfClient.setVerbose(
true);
50 rfClient.setDefaultContext(
"icubClient");
51 rfClient.setDefaultConfigFile(
"example_ARE_KARMA.ini");
52 rfClient.configure(0,
nullptr);
61 if (rfClient.check(
"target")) {
62 target = rfClient.find(
"target").asString();
63 yInfo(
"target name set to %s", target.c_str());
66 yInfo(
"target name set to default, i.e. %s", target.c_str());
71 yInfo()<<
"try to pushFront with KARMA ...";
73 yInfo()<<(ok?
"success":
"failed");
78 yInfo()<<
"try to pull with KARMA...";
80 yInfo()<<(ok?
"success":
"failed");
88 yInfo()<<
"try to point using ARE...";
90 yInfo()<<(ok?
"success":
"failed");
94 yInfo()<<
"try to take from side using ARE...";
95 Bottle bOptions(
"side");
96 ok = iCub.
take(target, bOptions);
97 yInfo()<<(ok?
"success":
"failed");
101 yInfo()<<
"try to take from above using ARE...";
103 bOptions.addString(
"above");
104 ok = iCub.
take(target, bOptions);
105 yInfo()<<(ok?
"success":
"failed");
109 yInfo()<<
"try to push using ARE...";
110 ok = iCub.
push(target);
111 yInfo()<<(ok?
"success":
"failed");
115 yInfo()<<
"try to push away using ARE...";
117 bOptions.addString(
"away");
118 ok = iCub.
push(target,bOptions);
119 yInfo()<<(ok?
"success":
"failed");
124 yInfo()<<
"shutting down ... ";
bool point(const yarp::sig::VectorOf< double > &target, const yarp::os::Bottle &options=yarp::os::Bottle())
Point at a specified location from the iCub.
Grants access to high level motor commands (grasp, touch, look, goto, etc) of the robot as well as it...
bool connect(const std::string &opcName="OPC")
Try to connect all functionalities.
bool take(const std::string &oName, const yarp::os::Bottle &options=yarp::os::Bottle())
Take (grasp) an object.
bool home(const std::string &part="all")
Go in home position.
bool pushKarma(const yarp::sig::VectorOf< double > &targetCenter, const double &theta, const double &radius, const yarp::os::Bottle &options=yarp::os::Bottle())
pushKarma (KARMA): push to certain position, along a direction See the SubSystem_KARMA::push document...
bool push(const std::string &oLocation, const yarp::os::Bottle &options=yarp::os::Bottle())
Push at a specified location.
void close()
Properly closes all ports which were opened.
bool drawKarma(const yarp::sig::VectorOf< double > &targetCenter, const double &theta, const double &radius, const double &dist, const yarp::os::Bottle &options=yarp::os::Bottle())
drawKarma (KARMA): draw action, along the positive direction of the x-axis (in robot FoR) See the Sub...