18 #include "robot_interfaces.h"
21 using namespace yarp::os;
22 using namespace yarp::dev;
23 using namespace iCub::skinDynLib;
25 robot_interfaces::robot_interfaces()
29 bodyParts[1] = LEFT_ARM;
30 bodyParts[2] = RIGHT_ARM;
31 bodyParts[3] = LEFT_LEG;
32 bodyParts[4] = RIGHT_LEG;
35 robot_interfaces::robot_interfaces(iCub::skinDynLib::BodyPart bp1)
41 robot_interfaces::robot_interfaces(iCub::skinDynLib::BodyPart bp1, iCub::skinDynLib::BodyPart bp2)
48 robot_interfaces::robot_interfaces(iCub::skinDynLib::BodyPart bp1, iCub::skinDynLib::BodyPart bp2, iCub::skinDynLib::BodyPart bp3)
56 robot_interfaces::robot_interfaces(iCub::skinDynLib::BodyPart bp1, iCub::skinDynLib::BodyPart bp2, iCub::skinDynLib::BodyPart bp3,
57 iCub::skinDynLib::BodyPart bp4)
66 robot_interfaces::robot_interfaces(iCub::skinDynLib::BodyPart bp1, iCub::skinDynLib::BodyPart bp2, iCub::skinDynLib::BodyPart bp3,
67 iCub::skinDynLib::BodyPart bp4, iCub::skinDynLib::BodyPart bp5)
77 robot_interfaces::robot_interfaces(iCub::skinDynLib::BodyPart *bps,
int size)
79 bodyParts.resize(size);
80 for(
int i=0; i<size; i++)
81 bodyParts[i] = bps[i];
84 bool robot_interfaces::init()
88 std::string localPort;
89 std::string remotePort;
94 for (
unsigned int iii=0; iii<bodyParts.size(); iii++)
110 part = BodyPart_s[i];
111 localPort =
"/demoForceControl/" + part;
112 remotePort =
"/" + robot +
"/" + part;
113 options[i].put(
"robot",robot);
114 options[i].put(
"part",part);
115 options[i].put(
"device",
"remote_controlboard");
116 options[i].put(
"local",localPort);
117 options[i].put(
"remote",remotePort);
119 dd[i] =
new PolyDriver(options[i]);
120 if(!dd[i] || !(dd[i]->isValid()))
122 yError(
"Problems instantiating the device driver %s\n", part.c_str());
125 ok = ok & dd[i]->view(ipos[i]);
126 ok = ok & dd[i]->view(itrq[i]);
127 ok = ok & dd[i]->view(iimp[i]);
128 ok = ok & dd[i]->view(icmd[i]);
129 ok = ok & dd[i]->view(ivel[i]);
130 ok = ok & dd[i]->view(ienc[i]);
131 ok = ok & dd[i]->view(ipid[i]);
132 ok = ok & dd[i]->view(iamp[i]);
133 ok = ok & dd[i]->view(iint[i]);
134 ok = ok & dd[i]->view(idir[i]);