4 for(
auto& sens : sensations) {
10 rpc_in_port.interrupt();
19 moduleName = rf.check(
"name",Value(
"SensationManager")).asString();
20 setName(moduleName.c_str());
21 cout<<moduleName<<
": finding configuration files..."<<endl;
22 period = rf.check(
"period",Value(0.1)).asDouble();
24 Bottle grp = rf.findGroup(
"SENSATIONS");
26 sensationList = *grp.find(
"sensations").asList();
27 for (
unsigned int i = 0; i < sensationList.size(); i++)
29 string sensation_name = sensationList.get(i).asString();
30 if (sensation_name ==
"opcSensation") {
32 }
else if (sensation_name ==
"test") {
35 yError() <<
"Sensation " + sensation_name +
" not implemented";
38 sensations.back()->configure();
41 yError()<<
"Didn't find any sensation. Please revise your configuration files...";
45 rpc_in_port.open(
"/" + moduleName +
"/rpc");
55 for(
auto& sensation : sensations) {
63 yInfo() <<
"RPC received in sensationsManager";
64 yDebug() << cmd.toString();
68 if (cmd.get(0).asString() ==
"help" )
70 help +=
" ['is' + entity_name + entity_tag] : Turns on/off manual mode (for manual control of drives) \n";
71 reply.addString(help);
73 else if (cmd.get(0).asString() ==
"is") {
74 for (
unsigned int i = 0; i < sensationList.size(); i++)
76 string sensation_name = sensationList.get(i).asString();
77 if (sensation_name ==
"opcSensation") {
78 rpl =
dynamic_cast<OpcSensation*
>(sensations[i])->get_property(cmd.get(1).asString(),cmd.get(2).asString());
79 reply.addString(
"ack");
86 reply.addString(
"nack");
89 reply.addString(
"nack");
90 reply.addString(
"Unknown rpc command");
bool configure(yarp::os::ResourceFinder &rf)
bool respond(const Bottle &cmd, Bottle &reply)