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()<<
"[KARMA_OPC_Example] YARP network seems unavailable!";
41 ICubClient iCub(
"KARMA_OPC_Example",
"icubClient",
"example_KARMA_OPC.ini");
43 ResourceFinder rfClient;
44 rfClient.setVerbose(
true);
45 rfClient.setDefaultContext(
"icubClient");
46 rfClient.setDefaultConfigFile(
"example_KARMA_OPC.ini");
47 rfClient.configure(0,
nullptr);
50 if (rfClient.check(
"target"))
52 target = rfClient.find(
"target").asString();
53 yInfo(
"target name set to %s", target.c_str());
58 yInfo(
"target name set to default, i.e. %s", target.c_str());
66 yError()<<
"[KARMA_OPC_Example] KARMA seems unavailabe!";
71 yInfo()<<
"connected to OPC port";
72 yInfo()<<(connected?
"success":
"failed");
76 yInfo()<<
"[KARMA_OPC_Example] try to pushLeft target with KARMA ...";
79 yInfo()<<(ok?
"success":
"failed");
84 yInfo()<<
"[KARMA_OPC_Example] try to pushRight target with KARMA ...";
87 yInfo()<<(ok?
"success":
"failed");
92 yInfo()<<
"[KARMA_OPC_Example] try to pushFront target with KARMA ...";
95 yInfo()<<(ok?
"success":
"failed");
100 yInfo()<<
"[KARMA_OPC_Example] try to pullBack target with KARMA ...";
103 yInfo()<<(ok?
"success":
"failed");
108 yInfo()<<
"[KARMA_OPC_Example] shutting down ... ";
bool connectOPC(const std::string &opcName="OPC")
Try to connect to OPC.
Grants access to high level motor commands (grasp, touch, look, goto, etc) of the robot as well as it...
bool pushKarmaFront(const std::string &objName, const double &targetPosXFront, const std::string &armType="selectable", const yarp::os::Bottle &options=yarp::os::Bottle())
pushKarmaFront: push an object by name to front See the SubSystem_KARMA::pushFront documentation for ...
bool connectSubSystems()
Try to connect to all sub-systems.
bool home(const std::string &part="all")
Go in home position.
bool pushKarmaRight(const std::string &objName, const double &targetPosYRight, const std::string &armType="selectable", const yarp::os::Bottle &options=yarp::os::Bottle())
pushKarmaRight: push an object by name to right side See the SubSystem_KARMA::pushAside documentation...
void close()
Properly closes all ports which were opened.
bool pullKarmaBack(const std::string &objName, const double &targetPosXBack, const std::string &armType="selectable", const yarp::os::Bottle &options=yarp::os::Bottle())
pullKarmaBack: pull an object by name back See the SubSystem_KARMA::pullBack documentation for more d...
bool pushKarmaLeft(const std::string &objName, const double &targetPosYLeft, const std::string &armType="selectable", const yarp::os::Bottle &options=yarp::os::Bottle())
pushKarmaLeft: push an object by name to left side See the SubSystem_KARMA::pushAside documentation f...