icub-client
main.cpp
Go to the documentation of this file.
1 /*
2 * Copyright(C) 2014 WYSIWYD Consortium, European Commission FP7 Project ICT - 612139
3 * Authors: Nguyen Dong Hai Phuong
4 * email : phuong.nguyen@iit.it
5 * Permission is granted to copy, distribute, and / or modify this program
6 * under the terms of the GNU General Public License, version 2 or any
7 * later version published by the Free Software Foundation.
8 *
9 * A copy of the license can be found at
10 * icub-client / license / gpl.txt
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the GNU General
15 * Public License for more details
16 */
17 
18 #include <yarp/os/all.h>
20 
21 int main() {
22  yarp::os::Network yarp;
23 
24  icubclient::ICubClient iCub("KARMA_Simple");
25  if(!iCub.connect()) { // connect to subsystems
26  return -1;
27  }
28 
29  // object name as recognized by object recognition
30  std::string objectName = "octopus";
31  double targetPositionX = -0.45;
32 
33  iCub.home();
34  bool ok = iCub.pushKarmaFront(objectName, targetPositionX);
35  yInfo()<<(ok?"Pushed successfully":"Failed");
36 
37  return 0;
38 }
Grants access to high level motor commands (grasp, touch, look, goto, etc) of the robot as well as it...
Definition: icubClient.h:66
bool connect(const std::string &opcName="OPC")
Try to connect all functionalities.
Definition: icubClient.cpp:132
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 home(const std::string &part="all")
Go in home position.
int main()
Definition: main.cpp:32