|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
46 constexpr
double DIAGNOSTIC_THREAD_PERIOD = 1.000;
68 std::string ownerName;
83 if (owner->getIterations() > 100)
89 owner->getEstFrequency(it, av, min, max);
92 "%s: %d msgs av:%.2lf min:%.2lf max:%.2lf [ms]",
110 if (axes >= 0 && ok) {
126 rpc_p.write(cmd, reply);
154 "Expecting protocol %d %d %d, but the device we are connecting to has protocol version %d %d %d",
158 protocolVersion.major,
159 protocolVersion.minor,
160 protocolVersion.tweak);
182 if (config.
check(
"timeout"))
184 extendedIntputStatePort.setTimeout(config.
find(
"timeout").
asFloat64());
188 if (config.
check(
"local_qos")) {
190 if(qos.
check(
"thread_priority"))
192 if(qos.
check(
"thread_policy"))
194 if(qos.
check(
"packet_priority"))
199 if (config.
check(
"remote_qos")) {
201 if(qos.
check(
"thread_priority"))
203 if(qos.
check(
"thread_policy"))
205 if(qos.
check(
"packet_priority"))
209 bool writeStrict_isFound = config.
check(
"writeStrict");
210 if(writeStrict_isFound)
212 Value &gotStrictVal = config.
find(
"writeStrict");
215 writeStrict_singleJoint =
true;
216 writeStrict_moreJoints =
true;
219 else if(gotStrictVal.
asString() ==
"off")
221 writeStrict_singleJoint =
false;
222 writeStrict_moreJoints =
false;
239 std::string carrier =
240 config.
check(
"carrier",
242 "default carrier for streaming robot state").asString();
244 bool portProblem =
false;
246 std::string s1 = local;
248 if (!rpc_p.open(s1)) { portProblem =
true; }
251 if (!command_p.open(s1)) { portProblem =
true; }
254 if (!extendedIntputStatePort.open(s1)) { portProblem =
true; }
257 extendedIntputStatePort.useCallback();
261 bool connectionProblem =
false;
262 if (remote !=
"" && !portProblem)
264 std::string s1 = remote;
266 std::string s2 = local;
272 ok=rpc_p.addOutput(s1);
275 connectionProblem =
true;
284 ok = command_p.addOutput(s1, carrier);
287 connectionProblem =
true;
290 if (config.
check(
"local_qos") || config.
check(
"remote_qos"))
302 if (config.
check(
"local_qos") || config.
check(
"remote_qos"))
308 connectionProblem =
true;
312 if (connectionProblem||portProblem) {
316 extendedIntputStatePort.close();
320 state_buffer.setStrict(
false);
321 command_buffer.attach(command_p);
323 if (!checkProtocolVersion(config.
check(
"ignoreProtocolCheck")))
326 command_buffer.detach();
329 extendedIntputStatePort.close();
336 command_buffer.detach();
339 extendedIntputStatePort.close();
344 if (config.
check(
"diagnostic"))
347 diagnosticThread->setOwner(&extendedIntputStatePort);
348 diagnosticThread->start();
351 diagnosticThread=
nullptr;
355 last_singleJoint.jointPosition.resize(1);
356 last_singleJoint.jointVelocity.resize(1);
357 last_singleJoint.jointAcceleration.resize(1);
358 last_singleJoint.motorPosition.resize(1);
359 last_singleJoint.motorVelocity.resize(1);
360 last_singleJoint.motorAcceleration.resize(1);
361 last_singleJoint.torque.resize(1);
362 last_singleJoint.pwmDutycycle.resize(1);
363 last_singleJoint.current.resize(1);
364 last_singleJoint.controlMode.resize(1);
365 last_singleJoint.interactionMode.resize(1);
368 last_wholePart.jointPosition.resize(nj);
369 last_wholePart.jointVelocity.resize(nj);
370 last_wholePart.jointAcceleration.resize(nj);
371 last_wholePart.motorPosition.resize(nj);
372 last_wholePart.motorVelocity.resize(nj);
373 last_wholePart.motorAcceleration.resize(nj);
374 last_wholePart.torque.resize(nj);
375 last_wholePart.current.resize(nj);
376 last_wholePart.pwmDutycycle.resize(nj);
377 last_wholePart.controlMode.resize(nj);
378 last_wholePart.interactionMode.resize(nj);
384 if (diagnosticThread!=
nullptr)
386 diagnosticThread->stop();
387 delete diagnosticThread;
391 command_p.interrupt();
392 extendedIntputStatePort.interrupt();
396 extendedIntputStatePort.close();
406 bool ok=rpc_p.write(cmd, response);
407 if (CHECK_FAIL(ok, response)) {
418 bool ok=rpc_p.write(cmd, response);
419 if (CHECK_FAIL(ok, response)) {
431 bool ok=rpc_p.write(cmd, response);
432 if (CHECK_FAIL(ok, response)) {
443 bool ok=rpc_p.write(cmd, response);
444 if (CHECK_FAIL(ok, response)) {
457 bool ok=rpc_p.write(cmd, response);
458 if (CHECK_FAIL(ok, response)) {
470 bool ok = rpc_p.write(cmd, response);
471 return CHECK_FAIL(ok, response);
481 bool ok = rpc_p.write(cmd, response);
483 return CHECK_FAIL(ok, response);
493 bool ok = rpc_p.write(cmd, response);
495 return CHECK_FAIL(ok, response);
505 bool ok = rpc_p.write(cmd, response);
507 if (CHECK_FAIL(ok, response)) {
511 getTimeStamp(response, lastStamp);
525 bool ok = rpc_p.write(cmd, response);
527 if (CHECK_FAIL(ok, response)) {
531 getTimeStamp(response, lastStamp);
545 bool ok = rpc_p.write(cmd, response);
546 return CHECK_FAIL(ok, response);
558 bool ok = rpc_p.write(cmd, response);
559 return CHECK_FAIL(ok, response);
564 if (!isLive())
return false;
569 for (
size_t i = 0; i < nj; i++)
571 bool ok = rpc_p.write(cmd, response);
572 return CHECK_FAIL(ok, response);
577 if (!isLive())
return false;
583 for (
size_t i = 0; i < nj; i++)
585 bool ok = rpc_p.write(cmd, response);
586 return CHECK_FAIL(ok, response);
591 if (!isLive())
return false;
597 for (
size_t i = 0; i < nj; i++)
600 for (
size_t i = 0; i < nj; i++)
602 bool ok = rpc_p.write(cmd, response);
603 return CHECK_FAIL(ok, response);
608 if (!isLive())
return false;
615 for (i = 0; i < len; i++)
618 for (i = 0; i < len; i++)
620 bool ok = rpc_p.write(cmd, response);
621 return CHECK_FAIL(ok, response);
632 bool ok = rpc_p.write(cmd, response);
633 return CHECK_FAIL(ok, response);
638 if (!isLive())
return false;
646 bool ok = rpc_p.write(cmd, response);
647 return CHECK_FAIL(ok, response);
652 if (!isLive())
return false;
659 for (
size_t i = 0; i < nj; i++)
661 bool ok = rpc_p.write(cmd, response);
662 return CHECK_FAIL(ok, response);
673 bool ok = rpc_p.write(cmd, response);
675 if (CHECK_FAIL(ok, response))
678 getTimeStamp(response, lastStamp);
686 if (!isLive())
return false;
692 bool ok = rpc_p.write(cmd, response);
693 if (CHECK_FAIL(ok, response))
700 for (
size_t i = 0; i < nj; i++)
702 getTimeStamp(response, lastStamp);
715 bool ok = rpc_p.write(cmd, response);
716 return CHECK_FAIL(ok, response);
725 bool ok = rpc_p.write(cmd, response);
727 if (CHECK_FAIL(ok, response)) {
731 getTimeStamp(response, lastStamp);
743 bool ok = rpc_p.write(cmd, response);
744 if (CHECK_FAIL(ok, response)) {
748 getTimeStamp(response, lastStamp);
761 bool ok = rpc_p.write(cmd, response);
763 if (CHECK_FAIL(ok, response)) {
767 getTimeStamp(response, lastStamp);
780 bool ok = rpc_p.write(cmd, response);
781 if (CHECK_FAIL(ok, response)) {
786 getTimeStamp(response, lastStamp);
799 bool ok = rpc_p.write(cmd, response);
801 if (CHECK_FAIL(ok, response)) {
815 bool ok = rpc_p.write(cmd, response);
816 if (CHECK_FAIL(ok, response)) {
818 getTimeStamp(response, lastStamp);
831 for (
int i = 0; i < len; i++)
834 bool ok = rpc_p.write(cmd, response);
836 if (CHECK_FAIL(ok, response)) {
838 getTimeStamp(response, lastStamp);
847 if (!isLive())
return false;
855 for (
int i = 0; i < n_joints; i++)
858 bool ok = rpc_p.write(cmd, response);
860 if (CHECK_FAIL(ok, response))
866 if (list.
size() != (
size_t )n_joints)
869 "%s length of response does not match: expected %d, received %zu\n ",
870 functionName.c_str(),
877 for (i = 0; i < n_joints; i++)
892 bool ok = rpc_p.write(cmd, response);
893 if (CHECK_FAIL(ok, response)) {
895 getTimeStamp(response, lastStamp);
903 if (!isLive())
return false;
907 bool ok = rpc_p.write(cmd, response);
908 if (CHECK_FAIL(ok, response)) {
914 for (
size_t i = 0; i < nj; i++)
917 getTimeStamp(response, lastStamp);
926 if (!isLive())
return false;
930 bool ok = rpc_p.write(cmd, response);
931 if (CHECK_FAIL(ok, response)) {
937 for (
size_t i = 0; i < nj; i++)
940 getTimeStamp(response, lastStamp);
949 if (!isLive())
return false;
953 bool ok = rpc_p.write(cmd, response);
955 if (CHECK_FAIL(ok, response)) {
961 for (
size_t i = 0; i < nj; i++)
964 getTimeStamp(response, lastStamp);
972 if (!isLive())
return false;
977 bool ok = rpc_p.write(cmd, response);
979 if (CHECK_FAIL(ok, response)) {
985 for (
size_t i = 0; i < nj; i++)
988 getTimeStamp(response, lastStamp);
996 if (!isLive())
return false;
1001 bool ok = rpc_p.write(cmd, response);
1002 if (CHECK_FAIL(ok, response)) {
1012 size_t nj1 = l1.
size();
1013 size_t nj2 = l2.
size();
1017 for (
size_t i = 0; i < nj1; i++)
1019 for (
size_t i = 0; i < nj2; i++)
1022 getTimeStamp(response, lastStamp);
1034 bool ok = rpc_p.write(cmd, response);
1036 if (CHECK_FAIL(ok, response)) {
1046 if(!isLive())
return false;
1053 for(
int i = 0; i < len; i++)
1056 bool ok = rpc_p.write(cmd, response);
1058 if (CHECK_FAIL(ok, response)) {
1064 size_t nj2 = l2.
size();
1065 if(nj2 != (
unsigned)len)
1070 for (
size_t i = 0; i < nj2; i++)
1073 getTimeStamp(response, lastStamp);
1107 bool ok = rpc_p.write(cmd, response);
1108 return CHECK_FAIL(ok, response);
1113 if (!isLive())
return false;
1120 for (
size_t i = 0; i < nj; i++) {
1134 bool ok = rpc_p.write(cmd, response);
1135 return CHECK_FAIL(ok, response);
1140 return setValWithPidType(
VOCAB_REF, pidtype, j, ref);
1145 return setValWithPidType(
VOCAB_REFS, pidtype, refs);
1150 return setValWithPidType(
VOCAB_LIM, pidtype, j, limit);
1155 return setValWithPidType(
VOCAB_LIMS, pidtype, limits);
1160 return getValWithPidType(
VOCAB_ERR, pidtype, j, err);
1165 return getValWithPidType(
VOCAB_ERRS, pidtype, errs);
1176 bool ok = rpc_p.write(cmd, response);
1177 if (CHECK_FAIL(ok, response)) {
1199 if (!isLive())
return false;
1205 bool ok = rpc_p.write(cmd, response);
1206 if (CHECK_FAIL(ok, response))
1213 for (
size_t i = 0; i < nj; i++)
1236 return getValWithPidType(
VOCAB_REF, pidtype, j, ref);
1241 return getValWithPidType(
VOCAB_REFS, pidtype, refs);
1246 return getValWithPidType(
VOCAB_LIM, pidtype, j, limit);
1251 return getValWithPidType(
VOCAB_LIMS, pidtype, limits);
1256 if (!isLive())
return false;
1263 bool ok = rpc_p.write(cmd, response);
1264 return CHECK_FAIL(ok, response);
1269 if (!isLive())
return false;
1276 bool ok = rpc_p.write(cmd, response);
1277 return CHECK_FAIL(ok, response);
1282 if (!isLive())
return false;
1289 bool ok = rpc_p.write(cmd, response);
1290 return CHECK_FAIL(ok, response);
1301 bool ok = rpc_p.write(cmd, response);
1302 if (CHECK_FAIL(ok, response))
1312 return getValWithPidType(
VOCAB_OUTPUT, pidtype, j, out);
1351 double localArrivalTime = 0.0;
1353 extendedPortMutex.lock();
1354 bool ret = extendedIntputStatePort.getLastSingle(j,
VOCAB_ENCODER, v, lastStamp, localArrivalTime);
1355 extendedPortMutex.unlock();
1361 double localArrivalTime = 0.0;
1363 extendedPortMutex.lock();
1364 bool ret = extendedIntputStatePort.getLastSingle(j,
VOCAB_ENCODER, v, lastStamp, localArrivalTime);
1365 *
t=lastStamp.getTime();
1366 extendedPortMutex.unlock();
1372 double localArrivalTime = 0.0;
1374 extendedPortMutex.lock();
1375 bool ret = extendedIntputStatePort.getLastVector(
VOCAB_ENCODERS, encs, lastStamp, localArrivalTime);
1376 extendedPortMutex.unlock();
1383 double localArrivalTime=0.0;
1385 extendedPortMutex.lock();
1386 bool ret = extendedIntputStatePort.getLastVector(
VOCAB_ENCODERS, encs, lastStamp, localArrivalTime);
1387 std::fill_n(ts, nj, lastStamp.getTime());
1388 extendedPortMutex.unlock();
1394 double localArrivalTime=0.0;
1396 extendedPortMutex.lock();
1397 bool ret = extendedIntputStatePort.getLastSingle(j,
VOCAB_ENCODER_SPEED, sp, lastStamp, localArrivalTime);
1398 extendedPortMutex.unlock();
1404 double localArrivalTime=0.0;
1406 extendedPortMutex.lock();
1408 extendedPortMutex.unlock();
1414 double localArrivalTime=0.0;
1415 extendedPortMutex.lock();
1417 extendedPortMutex.unlock();
1423 double localArrivalTime=0.0;
1424 extendedPortMutex.lock();
1426 extendedPortMutex.unlock();
1441 bool ok = rpc_p.write(cmd, response);
1442 if (CHECK_FAIL(ok, response))
1459 bool ok = rpc_p.write(cmd, response);
1461 return CHECK_FAIL(ok, response);
1471 bool ok = rpc_p.write(cmd, response);
1473 if (CHECK_FAIL(ok, response))
1475 *listOfKeys = *(response.
get(2).
asList());
1557 double localArrivalTime = 0.0;
1559 extendedPortMutex.lock();
1560 bool ret = extendedIntputStatePort.getLastSingle(j,
VOCAB_MOTOR_ENCODER, v, lastStamp, localArrivalTime);
1561 extendedPortMutex.unlock();
1567 double localArrivalTime = 0.0;
1569 extendedPortMutex.lock();
1570 bool ret = extendedIntputStatePort.getLastSingle(j,
VOCAB_MOTOR_ENCODER, v, lastStamp, localArrivalTime);
1571 *
t=lastStamp.getTime();
1572 extendedPortMutex.unlock();
1578 double localArrivalTime=0.0;
1580 extendedPortMutex.lock();
1582 extendedPortMutex.unlock();
1589 double localArrivalTime=0.0;
1591 extendedPortMutex.lock();
1593 std::fill_n(ts, nj, lastStamp.getTime());
1594 extendedPortMutex.unlock();
1600 double localArrivalTime=0.0;
1601 extendedPortMutex.lock();
1603 extendedPortMutex.unlock();
1609 double localArrivalTime=0.0;
1610 extendedPortMutex.lock();
1612 extendedPortMutex.unlock();
1618 double localArrivalTime=0.0;
1619 extendedPortMutex.lock();
1621 extendedPortMutex.unlock();
1627 double localArrivalTime=0.0;
1628 extendedPortMutex.lock();
1630 extendedPortMutex.unlock();
1787 if (!isLive())
return false;
1794 for (i = 0; i < len; i++)
1797 bool ok = rpc_p.write(cmd, response);
1798 return CHECK_FAIL(ok, response);
1813 if (!isLive())
return false;
1819 memcpy(&(c.
body[0]), &v,
sizeof(
double));
1820 command_buffer.write(writeStrict_singleJoint);
1826 if (!isLive())
return false;
1831 memcpy(&(c.
body[0]), v,
sizeof(
double)*nj);
1832 command_buffer.write(writeStrict_moreJoints);
1892 double localArrivalTime = 0.0;
1893 extendedPortMutex.lock();
1895 extendedPortMutex.unlock();
1986 bool ok = rpc_p.write(cmd, response);
1988 if (CHECK_FAIL(ok, response)) {
2006 bool ok = rpc_p.write(cmd, response);
2008 if (CHECK_FAIL(ok, response)) {
2037 if (!isLive())
return false;
2044 memcpy(c.
body.data(),
t,
sizeof(
double) * nj);
2046 command_buffer.write(writeStrict_moreJoints);
2054 if (!isLive())
return false;
2064 command_buffer.write(writeStrict_singleJoint);
2072 if (!isLive())
return false;
2077 c.
head.addInt32(n_joint);
2079 for (
int i = 0; i < n_joint; i++)
2081 c.
body.resize(n_joint);
2082 memcpy(&(c.
body[0]),
t,
sizeof(
double)*n_joint);
2083 command_buffer.write(writeStrict_moreJoints);
2099 bool ok = rpc_p.write(cmd, response);
2100 return CHECK_FAIL(ok, response);
2110 bool ok = rpc_p.write(cmd, response);
2111 if (CHECK_FAIL(ok, response)) {
2132 double localArrivalTime=0.0;
2133 extendedPortMutex.lock();
2134 bool ret = extendedIntputStatePort.getLastSingle(j,
VOCAB_TRQ,
t, lastStamp, localArrivalTime);
2135 extendedPortMutex.unlock();
2141 double localArrivalTime=0.0;
2142 extendedPortMutex.lock();
2143 bool ret = extendedIntputStatePort.getLastVector(
VOCAB_TRQS,
t, lastStamp, localArrivalTime);
2144 extendedPortMutex.unlock();
2169 bool ok = rpc_p.write(cmd, response);
2170 if (CHECK_FAIL(ok, response)) {
2189 bool ok = rpc_p.write(cmd, response);
2190 if (CHECK_FAIL(ok, response)) {
2213 bool ok = rpc_p.write(cmd, response);
2214 return CHECK_FAIL(ok, response);
2228 bool ok = rpc_p.write(cmd, response);
2229 return CHECK_FAIL(ok, response);
2239 bool ok = rpc_p.write(cmd, response);
2240 if (CHECK_FAIL(ok, response)) {
2260 double localArrivalTime=0.0;
2261 extendedPortMutex.lock();
2263 extendedPortMutex.unlock();
2269 double localArrivalTime=0.0;
2270 extendedPortMutex.lock();
2272 extendedPortMutex.unlock();
2278 double localArrivalTime=0.0;
2280 extendedPortMutex.lock();
2281 bool ret = extendedIntputStatePort.getLastVector(
VOCAB_CM_CONTROL_MODES, last_wholePart.controlMode.data(), lastStamp, localArrivalTime);
2284 for (
int i = 0; i < n_joint; i++)
2285 modes[i] = last_wholePart.controlMode[joints[i]];
2290 extendedPortMutex.unlock();
2296 if (!isLive())
return false;
2304 bool ok = rpc_p.write(cmd, response);
2305 return CHECK_FAIL(ok, response);
2310 if (!isLive())
return false;
2318 for (i = 0; i < n_joint; i++)
2322 for (i = 0; i < n_joint; i++)
2325 bool ok = rpc_p.write(cmd, response);
2326 return CHECK_FAIL(ok, response);
2331 if (!isLive())
return false;
2338 for (
size_t i = 0; i < nj; i++)
2341 bool ok = rpc_p.write(cmd, response);
2342 return CHECK_FAIL(ok, response);
2351 if (!isLive())
return false;
2357 memcpy(&(c.
body[0]), &ref,
sizeof(
double));
2358 command_buffer.write(writeStrict_singleJoint);
2364 if (!isLive())
return false;
2368 c.
head.addInt32(n_joint);
2370 for (
int i = 0; i < n_joint; i++)
2372 c.
body.resize(n_joint);
2373 memcpy(&(c.
body[0]), refs,
sizeof(
double)*n_joint);
2374 command_buffer.write(writeStrict_moreJoints);
2380 if (!isLive())
return false;
2385 memcpy(&(c.
body[0]), refs,
sizeof(
double)*nj);
2386 command_buffer.write(writeStrict_moreJoints);
2417 c.
head.addInt32(n_joint);
2419 for (
int i = 0; i < n_joint; i++)
2421 c.
body.resize(n_joint);
2422 memcpy(&(c.
body[0]), spds,
sizeof(
double)*n_joint);
2423 command_buffer.write(writeStrict_moreJoints);
2448 double localArrivalTime=0.0;
2449 extendedPortMutex.lock();
2450 bool ret = extendedIntputStatePort.getLastSingle(axis,
VOCAB_INTERACTION_MODE, (
int*) mode, lastStamp, localArrivalTime);
2451 extendedPortMutex.unlock();
2457 double localArrivalTime=0.0;
2459 extendedPortMutex.lock();
2460 bool ret = extendedIntputStatePort.getLastVector(
VOCAB_INTERACTION_MODES, last_wholePart.interactionMode.data(), lastStamp, localArrivalTime);
2463 for (
int i = 0; i < n_joints; i++)
2469 extendedPortMutex.unlock();
2475 double localArrivalTime=0.0;
2476 extendedPortMutex.lock();
2478 extendedPortMutex.unlock();
2485 if (!isLive())
return false;
2493 bool ok = rpc_p.write(cmd, response);
2494 return CHECK_FAIL(ok, response);
2500 if (!isLive())
return false;
2508 for (
int i = 0; i < n_joints; i++)
2512 for (
int i = 0; i < n_joints; i++)
2516 bool ok = rpc_p.write(cmd, response);
2517 return CHECK_FAIL(ok, response);
2523 if (!isLive())
return false;
2530 for (
size_t i = 0; i < nj; i++)
2533 bool ok = rpc_p.write(cmd, response);
2534 return CHECK_FAIL(ok, response);
2547 bool ok = rpc_p.write(cmd, response);
2553 return CHECK_FAIL(ok, response);
2567 bool ok = rpc_p.write(cmd, response);
2568 return CHECK_FAIL(ok, response);
2582 bool ok = rpc_p.write(cmd, response);
2584 return CHECK_FAIL(ok, response);
2598 bool ok = rpc_p.write(cmd, response);
2599 return CHECK_FAIL(ok, response);
2608 bool ok = rpc_p.write(cmd, response);
2609 return CHECK_FAIL(ok, response);
2618 bool ok = rpc_p.write(cmd, response);
2619 return CHECK_FAIL(ok, response);
2638 if (!isLive())
return false;
2644 memcpy(&(c.
body[0]), refs,
sizeof(
double)*nj);
2645 command_buffer.write(writeStrict_moreJoints);
2651 if (!isLive())
return false;
2658 memcpy(&(c.
body[0]), &ref,
sizeof(
double));
2659 command_buffer.write(writeStrict_singleJoint);
2665 if (!isLive())
return false;
2670 c.
head.addInt32(n_joint);
2672 for (
int i = 0; i < n_joint; i++)
2674 c.
body.resize(n_joint);
2675 memcpy(&(c.
body[0]), refs,
sizeof(
double)*n_joint);
2676 command_buffer.write(writeStrict_moreJoints);
2682 double localArrivalTime=0.0;
2683 extendedPortMutex.lock();
2684 bool ret = extendedIntputStatePort.getLastVector(
VOCAB_AMP_CURRENTS, vals, lastStamp, localArrivalTime);
2685 extendedPortMutex.unlock();
2691 double localArrivalTime=0.0;
2692 extendedPortMutex.lock();
2693 bool ret = extendedIntputStatePort.getLastSingle(j,
VOCAB_AMP_CURRENT, val, lastStamp, localArrivalTime);
2694 extendedPortMutex.unlock();
2714 if (!isLive())
return false;
2725 command_buffer.write(writeStrict_singleJoint);
2732 if (!isLive())
return false;
2740 memcpy(&(c.
body[0]), v,
sizeof(
double)*nj);
2742 command_buffer.write(writeStrict_moreJoints);
2756 bool ok = rpc_p.write(cmd, response);
2758 if (CHECK_FAIL(ok, response))
2763 getTimeStamp(response, lastStamp);
2777 double localArrivalTime = 0.0;
2778 extendedPortMutex.lock();
2780 extendedPortMutex.unlock();
2786 double localArrivalTime = 0.0;
2787 extendedPortMutex.lock();
2789 extendedPortMutex.unlock();
constexpr yarp::conf::vocab32_t VOCAB_TEMPERATURE
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_RANGE
constexpr yarp::conf::vocab32_t VOCAB_TEMPERATURES
void setOwner(StateExtendedInputPort *o)
bool getJointType(int j, yarp::dev::JointTypeEnum &type) override
bool getRemoteVariable(std::string key, yarp::os::Bottle &val) override
constexpr yarp::conf::vocab32_t VOCAB_VARIABLE
bool abortCalibration() override
A simple collection of objects that can be described and transmitted in a portable way.
bool setRemoteVariable(std::string key, const yarp::os::Bottle &val) override
virtual std::int32_t asVocab() const
Get vocabulary identifier as an integer.
bool send2V(int v1, int v2)
constexpr yarp::conf::vocab32_t VOCAB_AMP_PEAK_CURRENT
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODERS
constexpr yarp::conf::vocab32_t VOCAB_RELATIVE_MOVE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_LIM
bool getMotorEncoder(int j, double *v) override
Read the value of a motor encoder.
bool getMotorEncoderCountsPerRevolution(int m, double *cpr) override
Gets number of counts per revolution for motor encoder m.
bool disableAmp(int j) override
Disable the amplifier on a specific joint.
bool getRefPositions(double *refs) override
Get the last position reference for all axes.
bool getTemperatureLimit(int m, double *val) override
Retreives the current temperature limit for a specific motor.
constexpr yarp::conf::vocab32_t VOCAB_STOP
bool getTargetPositions(double *refs) override
Get the last position reference for all axes.
void clear()
Empties the bottle of any objects it contains.
constexpr yarp::conf::vocab32_t VOCAB_HOMING_WHOLE_PART
bool getImpedance(int j, double *stiffness, double *damping) override
Get current impedance gains (stiffness,damping,offset) for a specific joint.
constexpr yarp::conf::vocab32_t VOCAB_AMP_CURRENT
bool get1V1DA(int v1, double *val)
Helper method to get an array of double from the remote peer.
bool setEncoders(const double *vals) override
Set the value of all encoders.
bool send3V1I(int v1, int v2, int v3, int j)
A base class for nested structures that can be searched.
double stiction_up_val
up stiction offset added to the pid output
static bool setConnectionQos(const std::string &src, const std::string &dest, const QosStyle &srcStyle, const QosStyle &destStyle, bool quiet=true)
Adjust the Qos preferences of a connection.
Preferences for the port's Quality of Service.
Group a pair of objects to be sent and received together.
bool getPidErrorLimit(const PidControlTypeEnum &pidtype, int j, double *limit) override
Get the error limit for the controller on a specific joint.
size_type size() const
Gets the number of elements in the bottle.
constexpr yarp::conf::vocab32_t VOCAB_ENABLE
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE_SINGLE_JOINT
bool enableAmp(int j) override
Enable the amplifier on a specific joint.
constexpr yarp::conf::vocab32_t VOCAB_INTERACTION_MODES
bool setPids(const PidControlTypeEnum &pidtype, const Pid *pids) override
Set new pid value on multiple axes.
constexpr yarp::conf::vocab32_t VOCAB_ENCODER_SPEEDS
BODY body
An object of the second type (BODY).
void run() override
Loop function.
bool getRefCurrent(int j, double *t) override
Get the reference value of the current for a single motor.
constexpr yarp::conf::vocab32_t VOCAB_ENCODER_ACCELERATIONS
bool resetEncoder(int j) override
Reset encoder, single joint.
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE_JOINT_PARAMS
constexpr yarp::conf::vocab32_t VOCAB_AMP_VOLTAGE_SUPPLY
double max_output
max output
bool getAxes(int *ax) override
Get the number of controlled axes.
constexpr yarp::conf::vocab32_t VOCAB_AMP_PWM_LIMIT
constexpr yarp::conf::vocab32_t VOCAB_TEMPERATURE_LIMIT
bool getMotorEncoderTimed(int j, double *v, double *t) override
Read the instantaneous position of a motor encoder.
bool calibrateRobot() override
Calibrate robot by using an external calibrator.
bool setPidReferences(const PidControlTypeEnum &pidtype, const double *refs) override
Set the controller reference, multiple axes.
virtual Bottle & findGroup(const std::string &key) const =0
Gets a list corresponding to a given keyword.
#define yCWarning(component,...)
bool calibrationDone(int j) override
Check if the calibration is terminated, on a particular joint.
constexpr yarp::conf::vocab32_t VOCAB_AMP_STATUS
bool resetPid(const PidControlTypeEnum &pidtype, int j) override
Reset the controller of a given joint, usually sets the current status of the joint as the reference ...
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_REF_GROUP
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_REF_PWMS
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODER_SPEED
bool setRefTorque(int j, double v) override
Set the reference value of the torque for a given joint.
bool getMotorEncodersTimed(double *encs, double *ts) override
Read the instantaneous position of all motor encoders.
bool getTargetPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
constexpr yarp::conf::vocab32_t VOCAB_INTERACTION_MODE
constexpr yarp::conf::vocab32_t VOCAB_POSITION_MOVES
constexpr yarp::conf::vocab32_t VOCAB_AMP_NOMINAL_CURRENT
bool resetMotorEncoders() override
Reset motor encoders.
constexpr yarp::conf::vocab32_t VOCAB_MOTION_DONE_GROUP
bool getDutyCycle(int j, double *out) override
Gets the current dutycycle of the output of the amplifier (i.e.
constexpr yarp::conf::vocab32_t VOCAB_TORQUES_DIRECT
bool isPidEnabled(const PidControlTypeEnum &pidtype, int j, bool *enabled) override
Get the current status (enabled/disabled) of the pid.
bool getRefAcceleration(int j, double *acc) override
Get reference acceleration for a joint.
constexpr yarp::conf::vocab32_t VOCAB_AMP_MAXCURRENT
bool getPeakCurrent(int m, double *val) override
constexpr yarp::conf::vocab32_t VOCAB_ENCODER
constexpr yarp::conf::vocab32_t VOCAB_GET
constexpr yarp::conf::vocab32_t VOCAB_TORQUES_DIRECTS
bool getRefTorques(double *t) override
Get the reference value of the torque for all joints.
constexpr yarp::conf::vocab32_t VOCAB_RELATIVE_MOVES
bool getCurrentRange(int j, double *min, double *max) override
Get the full scale of the current measurement for a given motor (e.g.
constexpr yarp::conf::vocab32_t VOCAB_AMP_DISABLE
constexpr yarp::conf::vocab32_t VOCAB_RANGES
bool getDutyCycles(double *outs) override
Gets the current dutycycle of the output of the amplifier (i.e.
constexpr yarp::conf::vocab32_t VOCAB_AMP_CURRENTS
const yarp::os::LogComponent & REMOTECONTROLBOARD()
bool setMotorEncoder(int j, const double val) override
Set the value of the motor encoder for a given motor.
bool setPid(const PidControlTypeEnum &pidtype, int j, const Pid &pid) override
Set new pid value for a joint axis.
PeriodicThread(double period, ShouldUseSystemClock useSystemClock=ShouldUseSystemClock::No)
Constructor.
constexpr yarp::conf::vocab32_t VOCAB_POSITION_DIRECTS
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE_WHOLE_PART
bool relativeMove(int j, double delta) override
Set relative position.
bool getPidErrorLimits(const PidControlTypeEnum &pidtype, double *limits) override
Get the error limit for all controllers.
constexpr yarp::conf::vocab32_t VOCAB_REMOTE_CALIBRATOR_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_RESET
bool setMotorEncoders(const double *vals) override
Set the value of all motor encoders.
bool getRefSpeed(int j, double *ref) override
Get reference speed for a joint.
double scale
scale for the pid output
double ki
integrative gain
bool getPidOutputs(const PidControlTypeEnum &pidtype, double *outs) override
Get the output of the controllers (e.g.
bool set1V1I1IA1DA(int v, const int len, const int *val1, const double *val2)
bool quitCalibrate() override
quitCalibrate: interrupt the calibration procedure
constexpr yarp::conf::vocab32_t VOCAB_REF
bool getLimits(int axis, double *min, double *max) override
Get the software limits for a particular axis.
bool getPidError(const PidControlTypeEnum &pidtype, int j, double *err) override
Get the current error for a joint.
constexpr yarp::conf::vocab32_t VOCAB_E_RESET
bool get2V1DA(int v1, int v2, double *val)
Helper method to get an array of double from the remote peer.
bool get2V1I1IA1DA(int v1, int v2, const int n_joints, const int *joints, double *retVals, std::string functionName="")
bool getCurrent(int j, double *val) override
bool getTemperature(int m, double *val) override
Get temperature of a motor.
define control board standard interfaces
bool getRefVelocity(const int joint, double *vel) override
Get the last reference speed set by velocityMove for single joint.
bool getRefDutyCycles(double *refs) override
Gets the last reference sent using the setRefDutyCycles function.
void addFloat64(yarp::conf::float64_t x)
Places a 64-bit floating point number in the bottle, at the end of the list.
bool getCurrents(double *vals) override
constexpr yarp::conf::vocab32_t VOCAB_TRQ
constexpr yarp::conf::vocab32_t VOCAB_OFFSET
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
An interface for the device drivers.
bool quitPark() override
quitPark: interrupt the park procedure
bool setMotorTorqueParams(int j, const MotorTorqueParameters params) override
Set a subset of motor parameters (bemf, ktau etc) useful for torque control.
constexpr yarp::conf::vocab32_t VOCAB_TORQUES_DIRECT_GROUP
bool velocityMove(int j, double v) override
Start motion at a given speed, single joint.
bool parkSingleJoint(int j, bool _wait=true) override
parkSingleJoint(): start the parking procedure for the single joint
bool setPacketPriority(const std::string &priority)
sets the packet priority from a string.
bool getPidReferences(const PidControlTypeEnum &pidtype, double *refs) override
Get the current reference of all pid controllers.
bool getRefCurrents(double *t) override
Get the reference value of the currents for all motors.
bool setRefSpeeds(const int n_joint, const int *joints, const double *spds) override
Set reference speed on all joints.
bool setPidOffset(const PidControlTypeEnum &pidtype, int j, double v) override
Set offset value for a given controller.
bool getVelLimits(int axis, double *min, double *max) override
Get the software speed limits for a particular axis.
bool get1VIA(int v, int *val)
Helper method to get an array of integers from the remote peer.
constexpr yarp::conf::vocab32_t VOCAB_VELOCITY_MOVES
bool setTemperatureLimit(int m, const double val) override
Set the temperature limit for a specific motor.
bool getCurrentImpedanceLimit(int j, double *min_stiff, double *max_stiff, double *min_damp, double *max_damp) override
Get the current impedandance limits for a specific joint.
constexpr yarp::conf::vocab32_t VOCAB_TRQS
bool setValWithPidType(int voc, PidControlTypeEnum type, int axis, double val)
constexpr yarp::conf::vocab32_t VOCAB_REF_SPEED_GROUP
bool getTemperatures(double *vals) override
Get temperature of all the motors.
constexpr yarp::conf::vocab32_t VOCAB_ENCODER_SPEED
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODE
bool check(const std::string &key) const override
Check if there exists a property of the given name.
bool getPids(const PidControlTypeEnum &pidtype, Pid *pids) override
Get current pid value for a specific joint.
bool getRefVelocities(double *vels) override
Get the last reference speed set by velocityMove for all joints.
bool getPidErrors(const PidControlTypeEnum &pidtype, double *errs) override
Get the error of all joints.
bool set1V(int code)
Send a SET command without parameters and wait for a reply.
bool getEncoderTimed(int j, double *v, double *t) override
Read the instantaneous acceleration of all axes.
constexpr yarp::conf::vocab32_t VOCAB_PARK
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODER_ACCELERATION
bool get2V1I1D(int v1, int v2, int j, double *val)
bool setLimits(int axis, double min, double max) override
Set the software limits for a particular axis, the behavior of the control card when these limits are...
bool getPid(const PidControlTypeEnum &pidtype, int j, Pid *pid) override
Get current pid value for a specific joint.
bool setControlModes(const int n_joint, const int *joints, int *modes) override
Set the current control mode for a subset of axes.
constexpr yarp::conf::vocab32_t VOCAB_AXES
bool setPidReference(const PidControlTypeEnum &pidtype, int j, double ref) override
Set the controller reference for a given axis.
bool set1V1I1D(int code, int j, double val)
Helper method to set a double value to a single axis.
bool get2V1I2D(int v1, int v2, int j, double *val1, double *val2)
double offset
pwm offset added to the pid output
bool getGearboxRatio(int m, double *val) override
Get the gearbox ratio for a specific motor.
bool set1VDA(int v, const double *val)
Helper method used to set an array of double to all axes.
bool getMaxCurrent(int j, double *v) override
Returns the maximum electric current allowed for a given motor.
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE_DONE
bool getNumberOfMotors(int *num) override
Retrieves the number of controlled axes from the current physical interface.
double max_int
saturation threshold for the integrator
constexpr yarp::conf::vocab32_t VOCAB_SET
bool setNominalCurrent(int m, const double val) override
constexpr yarp::conf::vocab32_t VOCAB_INTERFACE_INTERACTION_MODE
bool getValWithPidType(int voc, PidControlTypeEnum type, int j, double *val)
bool getPWM(int m, double *val) override
bool setMaxCurrent(int j, double v) override
bool setPositions(const int n_joint, const int *joints, const double *refs) override
Set new reference point for all axes.
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODER_NUMBER
constexpr yarp::conf::vocab32_t VOCAB_REFS
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
bool getRefSpeeds(const int n_joint, const int *joints, double *spds) override
Get reference speed of all joints.
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODER
bool getNominalCurrent(int m, double *val) override
Bottle & addList()
Places an empty nested list in the bottle, at the end of the list.
bool setPWMLimit(int m, const double val) override
bool calibrateSingleJoint(int j) override
calibrateSingleJoint: call the calibration procedure for the single joint
constexpr yarp::conf::vocab32_t VOCAB_INTERACTION_MODE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_AMP_ENABLE
constexpr yarp::conf::vocab32_t VOCAB_OUTPUT
bool setImpedanceOffset(int j, double offset) override
Set current force Offset for a specific joint.
constexpr yarp::conf::vocab32_t VOCAB_REF_SPEEDS
constexpr yarp::conf::vocab32_t VOCAB_QUIT_CALIBRATE
bool setEncoder(int j, double val) override
Set the value of the encoder for a given joint.
bool setRefCurrents(const double *refs) override
Set the reference value of the currents for all motors.
bool get1V1B(int v, bool &val)
bool send1V1I(int v, int axis)
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_REFS
bool getEncoders(double *encs) override
Read the position of all axes.
bool get1V1I1B(int v, int j, bool &val)
Helper method used to get a double value from the remote peer.
bool park(bool wait=true) override
constexpr yarp::conf::vocab32_t VOCAB_REMOTE_VARIABILE_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_GEARBOX_RATIO
constexpr yarp::conf::vocab32_t VOCAB_RANGE
virtual bool asBool() const
Get boolean value.
virtual std::string asString() const
Get string value.
static bool connect(const std::string &src, const std::string &dest, const std::string &carrier="", bool quiet=true)
Request that an output port connect to an input port.
constexpr yarp::conf::vocab32_t VOCAB_POSITION_MOVE_GROUP
constexpr int PROTOCOL_VERSION_MINOR
bool getPidOutput(const PidControlTypeEnum &pidtype, int j, double *out) override
Get the output of the controller (e.g.
double kp
proportional gain
bool checkProtocolVersion(bool ignore)
constexpr yarp::conf::vocab32_t VOCAB_ABORTCALIB
constexpr yarp::conf::vocab32_t VOCAB_IMP_PARAM
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
bool getControlModes(int *modes) override
Get the current control mode (multiple joints).
bool getInteractionMode(int axis, yarp::dev::InteractionModeEnum *mode) override
Get the current interaction mode of the robot, values can be stiff or compliant.
double kff
feedforward gain
constexpr yarp::conf::vocab32_t VOCAB_POSITION_DIRECT
bool setRefTorques(const double *t) override
Set the reference value of the torque for all joints.
bool set1V2D(int code, double v)
Send a SET command and an additional double valued variable and then wait for a reply.
bool setPeakCurrent(int m, const double val) override
bool getMotorEncoderSpeeds(double *spds) override
Read the instantaneous speed of all motor encoders.
bool abortPark() override
bool calibrateAxisWithParams(int j, unsigned int ui, double v1, double v2, double v3) override
Start calibration, this method is very often platform specific.
bool getPidReference(const PidControlTypeEnum &pidtype, int j, double *ref) override
Get the current reference of the pid controller for a specific joint.
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
void addInt32(std::int32_t x)
Places a 32-bit integer in the bottle, at the end of the list.
void setThreadPriority(int priority)
sets the communication thread priority level
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODER_SPEEDS
bool getMotorEncoderAcceleration(int j, double *acc) override
Read the instantaneous acceleration of a motor encoder.
constexpr yarp::conf::vocab32_t VOCAB_IMPEDANCE
bool open(Searchable &config) override
Open the DeviceDriver.
bool setPidErrorLimit(const PidControlTypeEnum &pidtype, int j, double limit) override
Set the error limit for the controller on a specifi joint.
bool isCalibratorDevicePresent(bool *isCalib) override
isCalibratorDevicePresent: check if a calibrator device has been set
bool setRefDutyCycles(const double *v) override
Sets the reference dutycycle for all the motors.
bool stop() override
Stop motion, multiple joints.
bool setGearboxRatio(int m, const double val) override
Set the gearbox ratio for a specific motor.
bool get2V2DA(int v1, int v2, double *val1, double *val2)
bool setRefAccelerations(const int n_joint, const int *joints, const double *accs) override
Set reference acceleration on all joints.
bool disablePid(const PidControlTypeEnum &pidtype, int j) override
Disable the pid computation for a joint.
bool enablePid(const PidControlTypeEnum &pidtype, int j) override
Enable the pid computation for a joint.
std::string getName() const override
Get name of port.
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_PWM_OUTPUT
void addString(const char *str)
Places a string in the bottle, at the end of the list.
bool getTorque(int j, double *t) override
Get the value of the torque on a given joint (this is the feedback if you have a torque sensor).
bool getPWMLimit(int m, double *val) override
bool setControlMode(const int j, const int mode) override
Set the current control mode.
bool resetEncoders() override
Reset encoders.
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_PARAMS
double stiction_down_val
down stiction offset added to the pid output
An abstraction for a periodic thread.
bool send2V1I(int v1, int v2, int axis)
constexpr yarp::conf::vocab32_t VOCAB_ENCODER_ACCELERATION
bool getRefAccelerations(const int n_joint, const int *joints, double *accs) override
Get reference acceleration for a joint.
void addVocab(int x)
Places a vocabulary item in the bottle, at the end of the list.
bool getTorques(double *t) override
Get the value of the torque for all joints (this is the feedback if you have torque sensors).
bool getRefTorque(int j, double *t) override
Get the reference value of the torque for a given joint.
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODES
constexpr yarp::conf::vocab32_t VOCAB_DISABLE
Stamp getLastInputStamp() override
Get the time stamp for the last read data.
bool getEncodersTimed(double *encs, double *ts) override
Read the instantaneous acceleration of all axes.
constexpr int PROTOCOL_VERSION_TWEAK
bool setRefDutyCycle(int j, double v) override
Sets the reference dutycycle to a single motor.
bool get1V1I1IA1DA(int v, const int len, const int *val1, double *val2)
#define yCAssert(component, x)
bool get1V1I1S(int code, int j, std::string &name)
constexpr yarp::conf::vocab32_t VOCAB_ENCODERS
constexpr yarp::conf::vocab32_t VOCAB_VEL_LIMITS
bool getEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all axes.
constexpr yarp::conf::vocab32_t VOCAB_ERR
bool getEncoder(int j, double *v) override
Read the value of an encoder.
bool getRefPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
constexpr yarp::conf::vocab32_t VOCAB_PIDS
constexpr yarp::conf::vocab32_t VOCAB_HOMING_SINGLE_JOINT
bool getMotorEncoderSpeed(int j, double *sp) override
Read the istantaneous speed of a motor encoder.
constexpr int PROTOCOL_VERSION_MAJOR
void setThreadPolicy(int policy)
sets the communication thread scheduling policy
bool get1V1I1I(int v, int j, int *val)
Helper method used to get an integer value from the remote peer.
bool checkMotionDone(int j, bool *flag) override
Check if the current trajectory is terminated.
bool positionMove(int j, double ref) override
Set new reference point for a single axis.
bool getMotorEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all motor encoders.
bool set1V1I(int code, int v)
Send a SET command with an additional integer valued variable and then wait for a reply.
An abstraction for a time stamp and/or sequence number.
bool getInteractionModes(int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override
Get the current interaction mode of the robot for a set of joints, values can be stiff or compliant.
#define yCError(component,...)
bool get1V1I(int code, int &v) const
Send a GET command expecting an integer value in return.
constexpr yarp::conf::vocab32_t VOCAB_CURRENTCONTROL_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_INFO_NAME
constexpr yarp::conf::vocab32_t VOCAB_RELATIVE_MOVE
virtual std::int32_t asInt32() const
Get 32-bit integer value.
constexpr yarp::conf::vocab32_t VOCAB_TORQUE
constexpr yarp::conf::vocab32_t VOCAB_QUIT_PARK
constexpr yarp::conf::vocab32_t VOCAB_AMP_STATUS_SINGLE
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_CPR
HEAD head
An object of the first type (HEAD).
constexpr yarp::conf::vocab32_t VOCAB_ERRS
constexpr yarp::conf::vocab32_t VOCAB_MOTION_DONES
constexpr yarp::conf::vocab32_t VOCAB_LIMS
bool getEncoderSpeeds(double *spds) override
Read the instantaneous speed of all axes.
#define yCInfo(component,...)
bool calibrateWholePart() override
calibrateWholePart: call the procedure for calibrating the whole device
constexpr yarp::conf::vocab32_t VOCAB_IMP_OFFSET
An interface to the operating system, including Port based communication.
#define yCDebug(component,...)
bool setMotorEncoderCountsPerRevolution(int m, const double cpr) override
Sets number of counts per revolution for motor encoder m.
bool getTorqueRange(int j, double *min, double *max) override
Get the full scale of the torque sensor of a given joint.
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE_JOINT
constexpr yarp::conf::vocab32_t VOCAB_E_RESETS
constexpr yarp::conf::vocab32_t VOCAB_OUTPUTS
bool setRefAcceleration(int j, double acc) override
Set reference acceleration for a joint.
bool set2V1I1D(int v1, int v2, int axis, double val)
bool getMotorEncoders(double *encs) override
Read the position of all motor encoders.
constexpr yarp::conf::vocab32_t VOCAB_PROTOCOL_VERSION
bool setPidErrorLimits(const PidControlTypeEnum &pidtype, const double *limits) override
Get the error limit for the controller on all joints.
constexpr yarp::conf::vocab32_t VOCAB_INFO_TYPE
constexpr yarp::conf::vocab32_t VOCAB_PID
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_E_RESETS
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_E_RESET
constexpr yarp::conf::vocab32_t VOCAB_LIST_VARIABLES
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODE_GROUP
bool getRefDutyCycle(int j, double *ref) override
Gets the last reference sent using the setRefDutyCycle function.
bool getPowerSupplyVoltage(int m, double *val) override
virtual Bottle * asList() const
Get list value.
bool getAxisName(int j, std::string &name) override
Contains the parameters for a PID.
constexpr yarp::conf::vocab32_t VOCAB_PARK_WHOLE_PART
bool getAmpStatus(int *st) override
constexpr yarp::conf::vocab32_t VOCAB_PARK_SINGLE_JOINT
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_RANGES
bool set2V2DA(int v1, int v2, const double *val1, const double *val2)
constexpr yarp::conf::vocab32_t VOCAB_REF_ACCELERATION_GROUP
bool setImpedance(int j, double stiffness, double damping) override
Set current impedance gains (stiffness,damping) for a specific joint.
bool getEncoderSpeed(int j, double *sp) override
Read the istantaneous speed of an axis.
bool getRemoteVariablesList(yarp::os::Bottle *listOfKeys) override
bool close() override
Close the device driver and stop the port connections.
constexpr yarp::conf::vocab32_t VOCAB_LIMITS
constexpr yarp::conf::vocab32_t VOCAB_ICONTROLMODE
bool getNumberOfMotorEncoders(int *num) override
Get the number of available motor encoders.
A single value (typically within a Bottle).
bool setInteractionMode(int axis, yarp::dev::InteractionModeEnum mode) override
Set the interaction mode of the robot, values can be stiff or compliant.
bool parkWholePart() override
parkWholePart: start the parking procedure for the whole part
bool getTorqueRanges(double *min, double *max) override
Get the full scale of the torque sensors of all joints.
constexpr yarp::conf::vocab32_t VOCAB_VELOCITY_MOVE
bool setVelLimits(int axis, double min, double max) override
Set the software speed limits for a particular axis, the behavior of the control card when these limi...
constexpr yarp::conf::vocab32_t VOCAB_MOTORS_NUMBER
constexpr yarp::conf::vocab32_t VOCAB_STOP_GROUP
bool set2V1DA(int v1, int v2, const double *val)
bool set2V1I(int v1, int v2, int axis)
bool get1V1D(int code, double &v) const
Send a GET command expecting a double value in return.
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_REF_PWM
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_PWM_OUTPUTS
bool getImpedanceOffset(int j, double *offset) override
Get current force Offset for a specific joint.
constexpr yarp::conf::vocab32_t VOCAB_REF_ACCELERATIONS
virtual yarp::conf::float64_t asFloat64() const
Get 64-bit floating point value.
constexpr yarp::conf::vocab32_t VOCAB_TIMESTAMP
bool homingWholePart() override
homingWholePart: call the homing procedure for a the whole part/device
bool set1V1I2D(int code, int j, double val1, double val2)
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_REF
constexpr yarp::conf::vocab32_t VOCAB_MOTION_DONE
constexpr yarp::conf::vocab32_t VOCAB_REF_SPEED
bool get1V1I2D(int code, int axis, double *v1, double *v2)
bool getMotorTorqueParams(int j, MotorTorqueParameters *params) override
Get a subset of motor parameters (bemf, ktau etc) useful for torque control.
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_INTERFACE
bool setInteractionModes(int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override
Set the interaction mode of the robot for a set of joints, values can be stiff or compliant.
bool setRefCurrent(int j, double ref) override
Set the reference value of the current for a single motor.
bool homingSingleJoint(int j) override
homingSingleJoint: call the homing procedure for a single joint
bool get1V1I1D(int v, int j, double *val)
Helper method used to get a double value from the remote peer.
constexpr yarp::conf::vocab32_t VOCAB_STOPS
bool setRefSpeed(int j, double sp) override
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
bool get1VDA(int v, double *val)
Helper method to get an array of double from the remote peer.
constexpr yarp::conf::vocab32_t VOCAB_IS_CALIBRATOR_PRESENT
bool getControlMode(int j, int *mode) override
Get the current control mode.
bool resetMotorEncoder(int j) override
Reset motor encoder, single motor.
bool setPosition(int j, double ref) override
Set new position for a single axis.
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE
constexpr yarp::conf::vocab32_t VOCAB_VELOCITY_MOVE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_ABORTPARK
void append(const Bottle &alt)
Append the content of the given bottle to the current list.
bool get1V1I1IA1B(int v, const int len, const int *val1, bool &retVal)
bool setCalibrationParameters(int j, const CalibrationParameters ¶ms) override
Start calibration, this method is very often platform specific.
constexpr yarp::conf::vocab32_t VOCAB_POSITION_MOVE
constexpr yarp::conf::vocab32_t VOCAB_POSITION_DIRECT_GROUP
bool getCurrentRanges(double *min, double *max) override
Get the full scale of the current measurements for all motors motor (e.g.
bool getEncoderAcceleration(int j, double *acc) override
Read the instantaneous acceleration of an axis.
constexpr yarp::conf::vocab32_t VOCAB_REF_ACCELERATION