7 Bottle targetGroup = (
rf.findGroup(
"targetPos"));
8 target_pullback = targetGroup.check(
"backPos",Value(-0.25)).asDouble();
9 target_pushfront = targetGroup.check(
"frontPos",Value(-0.5)).asDouble();
10 target_pushleft = targetGroup.check(
"leftPos",Value(-0.2)).asDouble();
11 target_pushright = targetGroup.check(
"rightPos",Value(0.2)).asDouble();
15 yInfo() <<
"MoveObject::run";
18 string obj_name, move_type;
21 obj_name = args.get(0).asList()->get(0).asString();
22 move_type = args.get(0).asList()->get(1).asString();
24 yError() <<
"Wrong number of parameters, abort";
27 yInfo() <<
"received context from planner:" << move_type <<
"and" << obj_name;
29 if(move_type ==
"front") {
30 iCub->say(
"I will push the " + obj_name +
" to the front");
31 }
else if(move_type ==
"back") {
32 iCub->say(
"I will pull the " + obj_name +
" to the back");
33 }
else if(move_type ==
"left") {
34 iCub->say(
"I will push the " + obj_name +
" to the left");
35 }
else if(move_type ==
"right") {
36 iCub->say(
"I will push the " + obj_name +
" to the right");
38 yError() <<
"[moveObject] Wrong direction";
39 iCub->say(
"I don't know this direction");
43 iCub->opc->checkout();
45 if(move_type ==
"front") {
46 succeeded = iCub->pushKarmaFront(obj_name, target_pushfront);
47 }
else if(move_type ==
"back") {
48 succeeded = iCub->pullKarmaBack(obj_name, target_pullback);
49 }
else if(move_type ==
"left") {
50 succeeded = iCub->pushKarmaLeft(obj_name, target_pushleft);
51 }
else if(move_type ==
"right") {
52 succeeded = iCub->pushKarmaRight(obj_name, target_pushright);
54 yError() <<
"[moveObject] Wrong direction";
55 iCub->say(
"I don't know this direction");
60 iCub->lookAtPartner();
61 iCub->say(
"I could not move the object");
62 yError() <<
"Karma did not succeed moving the object";
void run(const yarp::os::Bottle &args)