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 cout<<
"YARP network seems unavailable!"<<endl;
41 ICubClient iCub(
"AREiCubClientExample",
"icubClient",
"example_ARE.ini");
43 ResourceFinder rfClient;
44 rfClient.setVerbose(
true);
45 rfClient.setDefaultContext(
"icubClient");
46 rfClient.setDefaultConfigFile(
"example_ARE.ini");
47 rfClient.configure(0,
nullptr);
51 yError()<<
"[ARE_KARMAiCubClientExample] ARE and/or OPC seems unavailabe!";
56 if (rfClient.check(
"target")) {
57 target = rfClient.find(
"target").asString();
58 yInfo(
"target name set to %s", target.c_str());
61 yInfo(
"target name set to default, i.e. %s", target.c_str());
73 yInfo()<<
"pointing at the object ... ";
74 Bottle options(
"right");
75 iCub.
point(x, options);
80 yInfo(
"try to grasp %s", target.c_str());
81 bool ok=iCub.
take(target,options);
82 yInfo()<<(ok?
"grasped!":
"missed!");
88 yInfo()<<
"releasing ... ";
93 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 release(const std::string &oLocation, const yarp::os::Bottle &options=yarp::os::Bottle())
Release the hand-held object on a given location.
void close()
Properly closes all ports which were opened.