8 external_port_name =
"/proactiveTagging/rpc";
9 from_sensation_port_name =
"/opcSensation/known_entities:o";
13 yInfo() <<
"Pointing::run";
14 Bottle *sensation = sensation_port_in.read();
16 string obj_name, sentence;
17 bool no_objects =
true;
19 yDebug()<<args.toString() << args.size();
20 obj_name = args.get(0).asList()->get(0).asString();
21 yDebug() <<
"Object selected: " << obj_name;
22 sentence =
"Okay, this is the ";
25 if(sensation->size()==0) {
26 iCub->lookAtPartner();
27 iCub->say(
"There are no objects I can point at.");
31 int id = yarp::os::Random::uniform(0, sensation->size() - 1);
32 obj_name = sensation->get(
id).asList()->get(1).asString();
33 yDebug() <<
"Randomly selected: " <<
id <<
" " << obj_name;
34 sentence =
"I could point to the ";
37 yDebug() <<
"[pointing]: opc checkout";
39 iCub->say(sentence + obj_name,
false);
41 bool succeeded = iCub->point(obj_name);
43 bool look_success = iCub->lookAtPartner();
45 iCub->say(
"Do you know that this is a " + obj_name,
false);
47 iCub->say(
"I couldn't find the " + obj_name,
false);
50 yarp::os::Time::delay(1.5);
void run(const yarp::os::Bottle &args)