24using namespace yarp::os;
26using namespace yarp::sig;
38 printf(
"Opening Fake Motor Device Client ...\n");
40 string remote=config.check(
"remote",Value(
"/fakeyServer")).asString();
41 string local=config.check(
"local",Value(
"/fakeyClient")).asString();
48 ok&=Network::connect(remote+
"/state:o",
statePort.getName(),
"udp");
49 ok&=Network::connect(
cmdPort.getName(),remote+
"/cmd:i",
"udp");
50 ok&=Network::connect(
rpcPort.getName(),remote+
"/rpc",
"tcp");
56 printf(
"Fake Motor Device Client successfully open\n");
65 printf(
"Fake Motor Device Client failed to open\n");
73 printf(
"Closing Fake Motor Device Client ...\n");
85 printf(
"Fake Motor Device Client successfully closed\n");
96 cmd.addVocab32(
"lim");
97 cmd.addVocab32(
"get");
101 *min=reply.get(1).asFloat64();
102 *max=reply.get(2).asFloat64();
117 cmd.addVocab32(
"enc");
118 cmd.addVocab32(
"axes");
121 *ax=reply.get(1).asInt32();
134 lock_guard<mutex> lg(
mtx);
135 for (
size_t i=0; i<this->encs.length(); i++)
136 encs[i]=this->encs[i];
148 cmd.addVocab32(
"vel");
149 cmd.addVocab32(
"move");
165 cmd.addVocab32(
"vel");
166 cmd.addVocab32(
"acc");
182 cmd.addVocab32(
"vel");
183 cmd.addVocab32(
"stop");
void setOwner(fakeMotorDeviceClient *owner)
bool open(yarp::os::Searchable &config)
yarp::os::RpcClient rpcPort
bool setRefAcceleration(int j, double acc)
bool getEncoders(double *encs)
bool getLimits(int axis, double *min, double *max)
yarp::os::BufferedPort< yarp::os::Bottle > cmdPort
bool velocityMove(int j, double sp)