7 from_sensation_port_name =
"None";
9 homeoPort =
"/homeostasis/rpc";
11 port_to_homeo_name =
"/"+behaviorName+
"/toHomeo:o";
12 port_to_homeo.open(port_to_homeo_name);
16 yInfo() <<
"recognitionOrder::run";
18 if (!Network::isConnected(port_to_homeo_name,homeoPort)){
19 if (!Network::connect(port_to_homeo_name,homeoPort)){
20 yWarning()<<
"Port to Homeostasis not available. Could not freeze the drives...";
23 if (Network::isConnected(port_to_homeo_name,homeoPort)){
24 yInfo()<<
"freezing drives";
27 cmd.addString(
"freeze");
30 port_to_homeo.write(cmd, rply);
33 yDebug() <<
"send rpc to SAM";
35 if (iCub->getSAMClient())
37 Bottle SAMreply = iCub->getSAMClient()->askXLabel(
"action");
38 if(SAMreply.get(0).asString() ==
"true") {
39 toSay = SAMreply.get(1).asString();
41 toSay =
"Sorry. I did not recognise that action.";
44 toSay =
"Sorry. It seems like I have difficulties recognising actions today.";
46 iCub->lookAtPartner();
49 yInfo() <<
"Recognising ends";
51 if (!manual && Network::isConnected(port_to_homeo_name, homeoPort)){
52 yInfo()<<
"unfreezing drives";
55 cmd.addString(
"unfreeze");
57 port_to_homeo.write(cmd, rply);
void run(const yarp::os::Bottle &args)