43 constexpr
double DIAGNOSTIC_THREAD_PERIOD = 1.000;
65 std::string ownerName;
80 if (owner->getIterations() > 100)
86 owner->getEstFrequency(it, av, min, max);
89 "%s: %d msgs av:%.2lf min:%.2lf max:%.2lf [ms]",
107 if (axes >= 0 && ok) {
123 rpc_p.write(cmd, reply);
126 if (reply.
size() != 5) {
156 "Expecting protocol %d %d %d, but the device we are connecting to has protocol version %d %d %d",
160 protocolVersion.major,
161 protocolVersion.minor,
162 protocolVersion.tweak);
184 if (config.
check(
"timeout"))
186 extendedIntputStatePort.setTimeout(config.
find(
"timeout").
asFloat64());
190 if (config.
check(
"local_qos")) {
192 if (qos.
check(
"thread_priority")) {
195 if (qos.
check(
"thread_policy")) {
198 if (qos.
check(
"packet_priority")) {
204 if (config.
check(
"remote_qos")) {
206 if (qos.
check(
"thread_priority")) {
209 if (qos.
check(
"thread_policy")) {
212 if (qos.
check(
"packet_priority")) {
217 bool writeStrict_isFound = config.
check(
"writeStrict");
218 if(writeStrict_isFound)
220 Value &gotStrictVal = config.
find(
"writeStrict");
223 writeStrict_singleJoint =
true;
224 writeStrict_moreJoints =
true;
227 else if(gotStrictVal.
asString() ==
"off")
229 writeStrict_singleJoint =
false;
230 writeStrict_moreJoints =
false;
247 std::string carrier =
248 config.
check(
"carrier",
250 "default carrier for streaming robot state").asString();
252 bool portProblem =
false;
254 std::string s1 = local;
256 if (!rpc_p.open(s1)) { portProblem =
true; }
259 if (!command_p.open(s1)) { portProblem =
true; }
262 if (!extendedIntputStatePort.open(s1)) { portProblem =
true; }
265 extendedIntputStatePort.useCallback();
269 bool connectionProblem =
false;
270 if (remote !=
"" && !portProblem)
272 std::string s1 = remote;
274 std::string s2 = local;
280 ok=rpc_p.addOutput(s1);
283 connectionProblem =
true;
292 ok = command_p.addOutput(s1, carrier);
295 connectionProblem =
true;
298 if (config.
check(
"local_qos") || config.
check(
"remote_qos")) {
311 if (config.
check(
"local_qos") || config.
check(
"remote_qos")) {
318 connectionProblem =
true;
322 if (connectionProblem||portProblem) {
326 extendedIntputStatePort.close();
330 state_buffer.setStrict(
false);
331 command_buffer.attach(command_p);
333 if (!checkProtocolVersion(config.
check(
"ignoreProtocolCheck")))
336 command_buffer.detach();
339 extendedIntputStatePort.close();
346 command_buffer.detach();
349 extendedIntputStatePort.close();
354 if (config.
check(
"diagnostic"))
357 diagnosticThread->setOwner(&extendedIntputStatePort);
358 diagnosticThread->start();
360 diagnosticThread =
nullptr;
365 last_singleJoint.jointPosition.resize(1);
366 last_singleJoint.jointVelocity.resize(1);
367 last_singleJoint.jointAcceleration.resize(1);
368 last_singleJoint.motorPosition.resize(1);
369 last_singleJoint.motorVelocity.resize(1);
370 last_singleJoint.motorAcceleration.resize(1);
371 last_singleJoint.torque.resize(1);
372 last_singleJoint.pwmDutycycle.resize(1);
373 last_singleJoint.current.resize(1);
374 last_singleJoint.controlMode.resize(1);
375 last_singleJoint.interactionMode.resize(1);
378 last_wholePart.jointPosition.resize(nj);
379 last_wholePart.jointVelocity.resize(nj);
380 last_wholePart.jointAcceleration.resize(nj);
381 last_wholePart.motorPosition.resize(nj);
382 last_wholePart.motorVelocity.resize(nj);
383 last_wholePart.motorAcceleration.resize(nj);
384 last_wholePart.torque.resize(nj);
385 last_wholePart.current.resize(nj);
386 last_wholePart.pwmDutycycle.resize(nj);
387 last_wholePart.controlMode.resize(nj);
388 last_wholePart.interactionMode.resize(nj);
394 if (diagnosticThread!=
nullptr)
396 diagnosticThread->stop();
397 delete diagnosticThread;
401 command_p.interrupt();
402 extendedIntputStatePort.interrupt();
406 extendedIntputStatePort.close();
416 bool ok=rpc_p.write(cmd, response);
417 if (CHECK_FAIL(ok, response)) {
428 bool ok=rpc_p.write(cmd, response);
429 if (CHECK_FAIL(ok, response)) {
441 bool ok=rpc_p.write(cmd, response);
442 if (CHECK_FAIL(ok, response)) {
453 bool ok=rpc_p.write(cmd, response);
454 if (CHECK_FAIL(ok, response)) {
467 bool ok=rpc_p.write(cmd, response);
468 if (CHECK_FAIL(ok, response)) {
480 bool ok = rpc_p.write(cmd, response);
481 return CHECK_FAIL(ok, response);
491 bool ok = rpc_p.write(cmd, response);
493 return CHECK_FAIL(ok, response);
503 bool ok = rpc_p.write(cmd, response);
505 return CHECK_FAIL(ok, response);
515 bool ok = rpc_p.write(cmd, response);
517 if (CHECK_FAIL(ok, response)) {
521 getTimeStamp(response, lastStamp);
535 bool ok = rpc_p.write(cmd, response);
537 if (CHECK_FAIL(ok, response)) {
541 getTimeStamp(response, lastStamp);
555 bool ok = rpc_p.write(cmd, response);
556 return CHECK_FAIL(ok, response);
568 bool ok = rpc_p.write(cmd, response);
569 return CHECK_FAIL(ok, response);
581 for (
size_t i = 0; i < nj; i++) {
584 bool ok = rpc_p.write(cmd, response);
585 return CHECK_FAIL(ok, response);
598 for (
size_t i = 0; i < nj; i++) {
601 bool ok = rpc_p.write(cmd, response);
602 return CHECK_FAIL(ok, response);
615 for (
size_t i = 0; i < nj; i++) {
619 for (
size_t i = 0; i < nj; i++) {
622 bool ok = rpc_p.write(cmd, response);
623 return CHECK_FAIL(ok, response);
637 for (i = 0; i < len; i++) {
641 for (i = 0; i < len; i++) {
644 bool ok = rpc_p.write(cmd, response);
645 return CHECK_FAIL(ok, response);
656 bool ok = rpc_p.write(cmd, response);
657 return CHECK_FAIL(ok, response);
672 bool ok = rpc_p.write(cmd, response);
673 return CHECK_FAIL(ok, response);
687 for (
size_t i = 0; i < nj; i++) {
690 bool ok = rpc_p.write(cmd, response);
691 return CHECK_FAIL(ok, response);
702 bool ok = rpc_p.write(cmd, response);
704 if (CHECK_FAIL(ok, response))
707 getTimeStamp(response, lastStamp);
723 bool ok = rpc_p.write(cmd, response);
724 if (CHECK_FAIL(ok, response))
732 for (
size_t i = 0; i < nj; i++) {
735 getTimeStamp(response, lastStamp);
748 bool ok = rpc_p.write(cmd, response);
749 return CHECK_FAIL(ok, response);
758 bool ok = rpc_p.write(cmd, response);
760 if (CHECK_FAIL(ok, response)) {
764 getTimeStamp(response, lastStamp);
776 bool ok = rpc_p.write(cmd, response);
777 if (CHECK_FAIL(ok, response)) {
781 getTimeStamp(response, lastStamp);
794 bool ok = rpc_p.write(cmd, response);
796 if (CHECK_FAIL(ok, response)) {
800 getTimeStamp(response, lastStamp);
813 bool ok = rpc_p.write(cmd, response);
814 if (CHECK_FAIL(ok, response)) {
819 getTimeStamp(response, lastStamp);
832 bool ok = rpc_p.write(cmd, response);
834 if (CHECK_FAIL(ok, response)) {
848 bool ok = rpc_p.write(cmd, response);
849 if (CHECK_FAIL(ok, response)) {
851 getTimeStamp(response, lastStamp);
864 for (
int i = 0; i < len; i++) {
868 bool ok = rpc_p.write(cmd, response);
870 if (CHECK_FAIL(ok, response)) {
872 getTimeStamp(response, lastStamp);
891 for (
int i = 0; i < n_joints; i++) {
895 bool ok = rpc_p.write(cmd, response);
897 if (CHECK_FAIL(ok, response))
903 if (list.
size() != (
size_t )n_joints)
906 "%s length of response does not match: expected %d, received %zu\n ",
907 functionName.c_str(),
914 for (i = 0; i < n_joints; i++)
929 bool ok = rpc_p.write(cmd, response);
930 if (CHECK_FAIL(ok, response)) {
932 getTimeStamp(response, lastStamp);
946 bool ok = rpc_p.write(cmd, response);
947 if (CHECK_FAIL(ok, response)) {
954 for (
size_t i = 0; i < nj; i++) {
958 getTimeStamp(response, lastStamp);
973 bool ok = rpc_p.write(cmd, response);
974 if (CHECK_FAIL(ok, response)) {
981 for (
size_t i = 0; i < nj; i++) {
985 getTimeStamp(response, lastStamp);
1000 bool ok = rpc_p.write(cmd, response);
1002 if (CHECK_FAIL(ok, response)) {
1004 if (lp ==
nullptr) {
1009 for (
size_t i = 0; i < nj; i++) {
1013 getTimeStamp(response, lastStamp);
1028 bool ok = rpc_p.write(cmd, response);
1030 if (CHECK_FAIL(ok, response)) {
1032 if (lp ==
nullptr) {
1037 for (
size_t i = 0; i < nj; i++) {
1041 getTimeStamp(response, lastStamp);
1056 bool ok = rpc_p.write(cmd, response);
1057 if (CHECK_FAIL(ok, response)) {
1059 if (lp1 ==
nullptr) {
1064 if (lp2 ==
nullptr) {
1069 size_t nj1 = l1.
size();
1070 size_t nj2 = l2.
size();
1074 for (
size_t i = 0; i < nj1; i++) {
1077 for (
size_t i = 0; i < nj2; i++) {
1081 getTimeStamp(response, lastStamp);
1093 bool ok = rpc_p.write(cmd, response);
1095 if (CHECK_FAIL(ok, response)) {
1114 for (
int i = 0; i < len; i++) {
1118 bool ok = rpc_p.write(cmd, response);
1120 if (CHECK_FAIL(ok, response)) {
1122 if (lp2 ==
nullptr) {
1127 size_t nj2 = l2.
size();
1128 if(nj2 != (
unsigned)len)
1133 for (
size_t i = 0; i < nj2; i++) {
1137 getTimeStamp(response, lastStamp);
1171 bool ok = rpc_p.write(cmd, response);
1172 return CHECK_FAIL(ok, response);
1186 for (
size_t i = 0; i < nj; i++) {
1200 bool ok = rpc_p.write(cmd, response);
1201 return CHECK_FAIL(ok, response);
1206 return setValWithPidType(
VOCAB_REF, pidtype, j, ref);
1211 return setValWithPidType(
VOCAB_REFS, pidtype, refs);
1216 return setValWithPidType(
VOCAB_LIM, pidtype, j, limit);
1221 return setValWithPidType(
VOCAB_LIMS, pidtype, limits);
1226 return getValWithPidType(
VOCAB_ERR, pidtype, j, err);
1231 return getValWithPidType(
VOCAB_ERRS, pidtype, errs);
1242 bool ok = rpc_p.write(cmd, response);
1243 if (CHECK_FAIL(ok, response)) {
1245 if (lp ==
nullptr) {
1274 bool ok = rpc_p.write(cmd, response);
1275 if (CHECK_FAIL(ok, response))
1278 if (lp ==
nullptr) {
1283 for (
size_t i = 0; i < nj; i++)
1286 if (mp ==
nullptr) {
1307 return getValWithPidType(
VOCAB_REF, pidtype, j, ref);
1312 return getValWithPidType(
VOCAB_REFS, pidtype, refs);
1317 return getValWithPidType(
VOCAB_LIM, pidtype, j, limit);
1322 return getValWithPidType(
VOCAB_LIMS, pidtype, limits);
1336 bool ok = rpc_p.write(cmd, response);
1337 return CHECK_FAIL(ok, response);
1351 bool ok = rpc_p.write(cmd, response);
1352 return CHECK_FAIL(ok, response);
1366 bool ok = rpc_p.write(cmd, response);
1367 return CHECK_FAIL(ok, response);
1378 bool ok = rpc_p.write(cmd, response);
1379 if (CHECK_FAIL(ok, response))
1389 return getValWithPidType(
VOCAB_OUTPUT, pidtype, j, out);
1428 double localArrivalTime = 0.0;
1430 extendedPortMutex.lock();
1431 bool ret = extendedIntputStatePort.getLastSingle(j,
VOCAB_ENCODER, v, lastStamp, localArrivalTime);
1432 extendedPortMutex.unlock();
1438 double localArrivalTime = 0.0;
1440 extendedPortMutex.lock();
1441 bool ret = extendedIntputStatePort.getLastSingle(j,
VOCAB_ENCODER, v, lastStamp, localArrivalTime);
1442 *
t=lastStamp.getTime();
1443 extendedPortMutex.unlock();
1449 double localArrivalTime = 0.0;
1451 extendedPortMutex.lock();
1452 bool ret = extendedIntputStatePort.getLastVector(
VOCAB_ENCODERS, encs, lastStamp, localArrivalTime);
1453 extendedPortMutex.unlock();
1460 double localArrivalTime=0.0;
1462 extendedPortMutex.lock();
1463 bool ret = extendedIntputStatePort.getLastVector(
VOCAB_ENCODERS, encs, lastStamp, localArrivalTime);
1464 std::fill_n(ts, nj, lastStamp.getTime());
1465 extendedPortMutex.unlock();
1471 double localArrivalTime=0.0;
1473 extendedPortMutex.lock();
1474 bool ret = extendedIntputStatePort.getLastSingle(j,
VOCAB_ENCODER_SPEED, sp, lastStamp, localArrivalTime);
1475 extendedPortMutex.unlock();
1481 double localArrivalTime=0.0;
1483 extendedPortMutex.lock();
1485 extendedPortMutex.unlock();
1491 double localArrivalTime=0.0;
1492 extendedPortMutex.lock();
1494 extendedPortMutex.unlock();
1500 double localArrivalTime=0.0;
1501 extendedPortMutex.lock();
1503 extendedPortMutex.unlock();
1518 bool ok = rpc_p.write(cmd, response);
1519 if (CHECK_FAIL(ok, response))
1536 bool ok = rpc_p.write(cmd, response);
1538 return CHECK_FAIL(ok, response);
1548 bool ok = rpc_p.write(cmd, response);
1550 if (CHECK_FAIL(ok, response))
1552 *listOfKeys = *(response.
get(2).
asList());
1634 double localArrivalTime = 0.0;
1636 extendedPortMutex.lock();
1637 bool ret = extendedIntputStatePort.getLastSingle(j,
VOCAB_MOTOR_ENCODER, v, lastStamp, localArrivalTime);
1638 extendedPortMutex.unlock();
1644 double localArrivalTime = 0.0;
1646 extendedPortMutex.lock();
1647 bool ret = extendedIntputStatePort.getLastSingle(j,
VOCAB_MOTOR_ENCODER, v, lastStamp, localArrivalTime);
1648 *
t=lastStamp.getTime();
1649 extendedPortMutex.unlock();
1655 double localArrivalTime=0.0;
1657 extendedPortMutex.lock();
1659 extendedPortMutex.unlock();
1666 double localArrivalTime=0.0;
1668 extendedPortMutex.lock();
1670 std::fill_n(ts, nj, lastStamp.getTime());
1671 extendedPortMutex.unlock();
1677 double localArrivalTime=0.0;
1678 extendedPortMutex.lock();
1680 extendedPortMutex.unlock();
1686 double localArrivalTime=0.0;
1687 extendedPortMutex.lock();
1689 extendedPortMutex.unlock();
1695 double localArrivalTime=0.0;
1696 extendedPortMutex.lock();
1698 extendedPortMutex.unlock();
1704 double localArrivalTime=0.0;
1705 extendedPortMutex.lock();
1707 extendedPortMutex.unlock();
1873 for (i = 0; i < len; i++) {
1877 bool ok = rpc_p.write(cmd, response);
1878 return CHECK_FAIL(ok, response);
1901 memcpy(&(c.
body[0]), &v,
sizeof(
double));
1902 command_buffer.write(writeStrict_singleJoint);
1915 memcpy(&(c.
body[0]), v,
sizeof(
double)*nj);
1916 command_buffer.write(writeStrict_moreJoints);
1976 double localArrivalTime = 0.0;
1977 extendedPortMutex.lock();
1979 extendedPortMutex.unlock();
2070 bool ok = rpc_p.write(cmd, response);
2072 if (CHECK_FAIL(ok, response)) {
2090 bool ok = rpc_p.write(cmd, response);
2092 if (CHECK_FAIL(ok, response)) {
2130 memcpy(c.
body.data(),
t,
sizeof(
double) * nj);
2132 command_buffer.write(writeStrict_moreJoints);
2152 command_buffer.write(writeStrict_singleJoint);
2167 c.
head.addInt32(n_joint);
2169 for (
int i = 0; i < n_joint; i++) {
2172 c.
body.resize(n_joint);
2173 memcpy(&(c.
body[0]),
t,
sizeof(
double)*n_joint);
2174 command_buffer.write(writeStrict_moreJoints);
2190 bool ok = rpc_p.write(cmd, response);
2191 return CHECK_FAIL(ok, response);
2201 bool ok = rpc_p.write(cmd, response);
2202 if (CHECK_FAIL(ok, response)) {
2204 if (lp ==
nullptr) {
2224 double localArrivalTime=0.0;
2225 extendedPortMutex.lock();
2226 bool ret = extendedIntputStatePort.getLastSingle(j,
VOCAB_TRQ,
t, lastStamp, localArrivalTime);
2227 extendedPortMutex.unlock();
2233 double localArrivalTime=0.0;
2234 extendedPortMutex.lock();
2235 bool ret = extendedIntputStatePort.getLastVector(
VOCAB_TRQS,
t, lastStamp, localArrivalTime);
2236 extendedPortMutex.unlock();
2261 bool ok = rpc_p.write(cmd, response);
2262 if (CHECK_FAIL(ok, response)) {
2264 if (lp ==
nullptr) {
2282 bool ok = rpc_p.write(cmd, response);
2283 if (CHECK_FAIL(ok, response)) {
2285 if (lp ==
nullptr) {
2307 bool ok = rpc_p.write(cmd, response);
2308 return CHECK_FAIL(ok, response);
2322 bool ok = rpc_p.write(cmd, response);
2323 return CHECK_FAIL(ok, response);
2333 bool ok = rpc_p.write(cmd, response);
2334 if (CHECK_FAIL(ok, response)) {
2336 if (lp ==
nullptr) {
2355 double localArrivalTime=0.0;
2356 extendedPortMutex.lock();
2358 extendedPortMutex.unlock();
2364 double localArrivalTime=0.0;
2365 extendedPortMutex.lock();
2367 extendedPortMutex.unlock();
2373 double localArrivalTime=0.0;
2375 extendedPortMutex.lock();
2376 bool ret = extendedIntputStatePort.getLastVector(
VOCAB_CM_CONTROL_MODES, last_wholePart.controlMode.data(), lastStamp, localArrivalTime);
2379 for (
int i = 0; i < n_joint; i++) {
2380 modes[i] = last_wholePart.controlMode[joints[i]];
2386 extendedPortMutex.unlock();
2402 bool ok = rpc_p.write(cmd, response);
2403 return CHECK_FAIL(ok, response);
2418 for (i = 0; i < n_joint; i++) {
2423 for (i = 0; i < n_joint; i++) {
2427 bool ok = rpc_p.write(cmd, response);
2428 return CHECK_FAIL(ok, response);
2442 for (
size_t i = 0; i < nj; i++) {
2446 bool ok = rpc_p.write(cmd, response);
2447 return CHECK_FAIL(ok, response);
2464 memcpy(&(c.
body[0]), &ref,
sizeof(
double));
2465 command_buffer.write(writeStrict_singleJoint);
2477 c.
head.addInt32(n_joint);
2479 for (
int i = 0; i < n_joint; i++) {
2482 c.
body.resize(n_joint);
2483 memcpy(&(c.
body[0]), refs,
sizeof(
double)*n_joint);
2484 command_buffer.write(writeStrict_moreJoints);
2497 memcpy(&(c.
body[0]), refs,
sizeof(
double)*nj);
2498 command_buffer.write(writeStrict_moreJoints);
2530 c.
head.addInt32(n_joint);
2532 for (
int i = 0; i < n_joint; i++) {
2535 c.
body.resize(n_joint);
2536 memcpy(&(c.
body[0]), spds,
sizeof(
double)*n_joint);
2537 command_buffer.write(writeStrict_moreJoints);
2562 double localArrivalTime=0.0;
2563 extendedPortMutex.lock();
2564 bool ret = extendedIntputStatePort.getLastSingle(axis,
VOCAB_INTERACTION_MODE, (
int*) mode, lastStamp, localArrivalTime);
2565 extendedPortMutex.unlock();
2571 double localArrivalTime=0.0;
2573 extendedPortMutex.lock();
2574 bool ret = extendedIntputStatePort.getLastVector(
VOCAB_INTERACTION_MODES, last_wholePart.interactionMode.data(), lastStamp, localArrivalTime);
2577 for (
int i = 0; i < n_joints; i++) {
2584 extendedPortMutex.unlock();
2590 double localArrivalTime=0.0;
2591 extendedPortMutex.lock();
2593 extendedPortMutex.unlock();
2610 bool ok = rpc_p.write(cmd, response);
2611 return CHECK_FAIL(ok, response);
2627 for (
int i = 0; i < n_joints; i++) {
2632 for (
int i = 0; i < n_joints; i++)
2636 bool ok = rpc_p.write(cmd, response);
2637 return CHECK_FAIL(ok, response);
2652 for (
size_t i = 0; i < nj; i++) {
2656 bool ok = rpc_p.write(cmd, response);
2657 return CHECK_FAIL(ok, response);
2670 bool ok = rpc_p.write(cmd, response);
2676 return CHECK_FAIL(ok, response);
2690 bool ok = rpc_p.write(cmd, response);
2691 return CHECK_FAIL(ok, response);
2705 bool ok = rpc_p.write(cmd, response);
2707 return CHECK_FAIL(ok, response);
2721 bool ok = rpc_p.write(cmd, response);
2722 return CHECK_FAIL(ok, response);
2731 bool ok = rpc_p.write(cmd, response);
2732 return CHECK_FAIL(ok, response);
2741 bool ok = rpc_p.write(cmd, response);
2742 return CHECK_FAIL(ok, response);
2769 memcpy(&(c.
body[0]), refs,
sizeof(
double)*nj);
2770 command_buffer.write(writeStrict_moreJoints);
2785 memcpy(&(c.
body[0]), &ref,
sizeof(
double));
2786 command_buffer.write(writeStrict_singleJoint);
2799 c.
head.addInt32(n_joint);
2801 for (
int i = 0; i < n_joint; i++) {
2804 c.
body.resize(n_joint);
2805 memcpy(&(c.
body[0]), refs,
sizeof(
double)*n_joint);
2806 command_buffer.write(writeStrict_moreJoints);
2812 double localArrivalTime=0.0;
2813 extendedPortMutex.lock();
2814 bool ret = extendedIntputStatePort.getLastVector(
VOCAB_AMP_CURRENTS, vals, lastStamp, localArrivalTime);
2815 extendedPortMutex.unlock();
2821 double localArrivalTime=0.0;
2822 extendedPortMutex.lock();
2823 bool ret = extendedIntputStatePort.getLastSingle(j,
VOCAB_AMP_CURRENT, val, lastStamp, localArrivalTime);
2824 extendedPortMutex.unlock();
2857 command_buffer.write(writeStrict_singleJoint);
2874 memcpy(&(c.
body[0]), v,
sizeof(
double)*nj);
2876 command_buffer.write(writeStrict_moreJoints);
2890 bool ok = rpc_p.write(cmd, response);
2892 if (CHECK_FAIL(ok, response))
2897 getTimeStamp(response, lastStamp);
2911 double localArrivalTime = 0.0;
2912 extendedPortMutex.lock();
2914 extendedPortMutex.unlock();
2920 double localArrivalTime = 0.0;
2921 extendedPortMutex.lock();
2923 extendedPortMutex.unlock();
constexpr yarp::conf::vocab32_t VOCAB_PARK_SINGLE_JOINT
constexpr yarp::conf::vocab32_t VOCAB_REMOTE_CALIBRATOR_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_HOMING_WHOLE_PART
constexpr yarp::conf::vocab32_t VOCAB_PARK_WHOLE_PART
constexpr yarp::conf::vocab32_t VOCAB_QUIT_PARK
constexpr yarp::conf::vocab32_t VOCAB_IS_CALIBRATOR_PRESENT
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE_SINGLE_JOINT
constexpr yarp::conf::vocab32_t VOCAB_HOMING_SINGLE_JOINT
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE_WHOLE_PART
constexpr yarp::conf::vocab32_t VOCAB_QUIT_CALIBRATE
define control board standard interfaces
constexpr yarp::conf::vocab32_t VOCAB_TIMESTAMP
constexpr yarp::conf::vocab32_t VOCAB_VELOCITY_MOVE
constexpr yarp::conf::vocab32_t VOCAB_REF_SPEED
constexpr yarp::conf::vocab32_t VOCAB_STOPS
constexpr yarp::conf::vocab32_t VOCAB_MOTION_DONE
constexpr yarp::conf::vocab32_t VOCAB_STOP
constexpr yarp::conf::vocab32_t VOCAB_REF_ACCELERATIONS
constexpr yarp::conf::vocab32_t VOCAB_MOTION_DONES
constexpr yarp::conf::vocab32_t VOCAB_PROTOCOL_VERSION
constexpr yarp::conf::vocab32_t VOCAB_POSITION_MOVE
constexpr yarp::conf::vocab32_t VOCAB_REF_ACCELERATION
constexpr yarp::conf::vocab32_t VOCAB_VELOCITY_MOVES
constexpr yarp::conf::vocab32_t VOCAB_RELATIVE_MOVE
constexpr yarp::conf::vocab32_t VOCAB_REF_SPEEDS
constexpr yarp::conf::vocab32_t VOCAB_RELATIVE_MOVES
constexpr yarp::conf::vocab32_t VOCAB_POSITION_MOVES
constexpr int PROTOCOL_VERSION_TWEAK
constexpr int PROTOCOL_VERSION_MINOR
constexpr int PROTOCOL_VERSION_MAJOR
constexpr yarp::conf::vocab32_t VOCAB_LIM
constexpr yarp::conf::vocab32_t VOCAB_OUTPUTS
constexpr yarp::conf::vocab32_t VOCAB_ENABLE
constexpr yarp::conf::vocab32_t VOCAB_DISABLE
constexpr yarp::conf::vocab32_t VOCAB_REF
constexpr yarp::conf::vocab32_t VOCAB_ERRS
constexpr yarp::conf::vocab32_t VOCAB_GET
constexpr yarp::conf::vocab32_t VOCAB_OUTPUT
constexpr yarp::conf::vocab32_t VOCAB_ERR
constexpr yarp::conf::vocab32_t VOCAB_REFS
constexpr yarp::conf::vocab32_t VOCAB_RESET
constexpr yarp::conf::vocab32_t VOCAB_AXES
constexpr yarp::conf::vocab32_t VOCAB_SET
constexpr yarp::conf::vocab32_t VOCAB_OFFSET
constexpr yarp::conf::vocab32_t VOCAB_LIMS
constexpr yarp::conf::vocab32_t VOCAB_AMP_DISABLE
constexpr yarp::conf::vocab32_t VOCAB_AMP_PEAK_CURRENT
constexpr yarp::conf::vocab32_t VOCAB_AMP_ENABLE
constexpr yarp::conf::vocab32_t VOCAB_AMP_VOLTAGE_SUPPLY
constexpr yarp::conf::vocab32_t VOCAB_AMP_CURRENT
constexpr yarp::conf::vocab32_t VOCAB_AMP_MAXCURRENT
constexpr yarp::conf::vocab32_t VOCAB_AMP_STATUS_SINGLE
constexpr yarp::conf::vocab32_t VOCAB_AMP_STATUS
constexpr yarp::conf::vocab32_t VOCAB_AMP_NOMINAL_CURRENT
constexpr yarp::conf::vocab32_t VOCAB_AMP_CURRENTS
constexpr yarp::conf::vocab32_t VOCAB_AMP_PWM_LIMIT
constexpr yarp::conf::vocab32_t VOCAB_INFO_TYPE
constexpr yarp::conf::vocab32_t VOCAB_INFO_NAME
constexpr yarp::conf::vocab32_t VOCAB_ABORTCALIB
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE_JOINT_PARAMS
constexpr yarp::conf::vocab32_t VOCAB_ABORTPARK
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE_DONE
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE_JOINT
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE
constexpr yarp::conf::vocab32_t VOCAB_PARK
constexpr yarp::conf::vocab32_t VOCAB_LIMITS
constexpr yarp::conf::vocab32_t VOCAB_VEL_LIMITS
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODES
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODE
constexpr yarp::conf::vocab32_t VOCAB_ICONTROLMODE
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_REF_GROUP
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_REFS
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_RANGE
constexpr yarp::conf::vocab32_t VOCAB_CURRENTCONTROL_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_REF
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_RANGES
constexpr yarp::conf::vocab32_t VOCAB_E_RESET
constexpr yarp::conf::vocab32_t VOCAB_ENCODER_ACCELERATIONS
constexpr yarp::conf::vocab32_t VOCAB_ENCODER
constexpr yarp::conf::vocab32_t VOCAB_ENCODER_SPEEDS
constexpr yarp::conf::vocab32_t VOCAB_E_RESETS
constexpr yarp::conf::vocab32_t VOCAB_ENCODER_SPEED
constexpr yarp::conf::vocab32_t VOCAB_ENCODER_ACCELERATION
constexpr yarp::conf::vocab32_t VOCAB_ENCODERS
constexpr yarp::conf::vocab32_t VOCAB_IMPEDANCE
constexpr yarp::conf::vocab32_t VOCAB_INTERACTION_MODES
constexpr yarp::conf::vocab32_t VOCAB_INTERACTION_MODE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_INTERACTION_MODE
constexpr yarp::conf::vocab32_t VOCAB_INTERFACE_INTERACTION_MODE
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODER_SPEED
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODER_ACCELERATION
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODER
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODER_SPEEDS
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODER_NUMBER
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_E_RESETS
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_E_RESET
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODERS
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_CPR
constexpr yarp::conf::vocab32_t VOCAB_TEMPERATURES
constexpr yarp::conf::vocab32_t VOCAB_TEMPERATURE_LIMIT
constexpr yarp::conf::vocab32_t VOCAB_TEMPERATURE
constexpr yarp::conf::vocab32_t VOCAB_GEARBOX_RATIO
constexpr yarp::conf::vocab32_t VOCAB_MOTORS_NUMBER
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_PWM_OUTPUTS
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_REF_PWMS
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_REF_PWM
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_PWM_OUTPUT
constexpr yarp::conf::vocab32_t VOCAB_PIDS
constexpr yarp::conf::vocab32_t VOCAB_PID
constexpr yarp::conf::vocab32_t VOCAB_REF_ACCELERATION_GROUP
constexpr yarp::conf::vocab32_t VOCAB_STOP_GROUP
constexpr yarp::conf::vocab32_t VOCAB_RELATIVE_MOVE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_POSITION_MOVE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_MOTION_DONE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_REF_SPEED_GROUP
constexpr yarp::conf::vocab32_t VOCAB_POSITION_DIRECTS
constexpr yarp::conf::vocab32_t VOCAB_POSITION_DIRECT
constexpr yarp::conf::vocab32_t VOCAB_POSITION_DIRECT_GROUP
constexpr yarp::conf::vocab32_t VOCAB_LIST_VARIABLES
constexpr yarp::conf::vocab32_t VOCAB_VARIABLE
constexpr yarp::conf::vocab32_t VOCAB_REMOTE_VARIABILE_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_TORQUE
constexpr yarp::conf::vocab32_t VOCAB_TRQ
constexpr yarp::conf::vocab32_t VOCAB_TORQUES_DIRECTS
constexpr yarp::conf::vocab32_t VOCAB_TRQS
constexpr yarp::conf::vocab32_t VOCAB_RANGE
constexpr yarp::conf::vocab32_t VOCAB_IMP_OFFSET
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_PARAMS
constexpr yarp::conf::vocab32_t VOCAB_IMP_PARAM
constexpr yarp::conf::vocab32_t VOCAB_TORQUES_DIRECT_GROUP
constexpr yarp::conf::vocab32_t VOCAB_RANGES
constexpr yarp::conf::vocab32_t VOCAB_TORQUES_DIRECT
constexpr yarp::conf::vocab32_t VOCAB_VELOCITY_MOVE_GROUP
const yarp::os::LogComponent & REMOTECONTROLBOARD()
void run() override
Loop function.
void setOwner(StateExtendedInputPort *o)
bool setPidReferences(const PidControlTypeEnum &pidtype, const double *refs) override
Set the controller reference, multiple axes.
bool getTorques(double *t) override
Get the value of the torque for all joints (this is the feedback if you have torque sensors).
bool relativeMove(int j, double delta) override
Set relative position.
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.
bool getRefSpeeds(const int n_joint, const int *joints, double *spds) override
Get reference speed of all joints.
bool get1V1I1B(int v, int j, bool &val)
Helper method used to get a double value from the remote peer.
bool quitCalibrate() override
quitCalibrate: interrupt the calibration procedure
bool getRefPositions(double *refs) override
Get the last position reference for all axes.
bool get1V1I1IA1B(int v, const int len, const int *val1, bool &retVal)
bool open(Searchable &config) override
Open the DeviceDriver.
bool getEncoder(int j, double *v) override
Read the value of an encoder.
bool send2V1I(int v1, int v2, int axis)
bool setPositions(const int n_joint, const int *joints, const double *refs) override
Set new reference point for all axes.
bool setControlMode(const int j, const int mode) override
Set the current control mode.
bool isPidEnabled(const PidControlTypeEnum &pidtype, int j, bool *enabled) override
Get the current status (enabled/disabled) of the pid.
bool getPeakCurrent(int m, double *val) override
bool getLimits(int axis, double *min, double *max) override
Get the software limits for a particular axis.
bool getPWM(int m, double *val) override
bool get1VDA(int v, double *val)
Helper method to get an array of double from the remote peer.
bool set2V1DA(int v1, int v2, const double *val)
bool get1V1I(int code, int &v) const
Send a GET command expecting an integer value in return.
bool getNominalCurrent(int m, double *val) override
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 ...
bool setPeakCurrent(int m, const double val) override
bool getPidOutputs(const PidControlTypeEnum &pidtype, double *outs) override
Get the output of the controllers (e.g.
bool send2V(int v1, int v2)
bool set1V1I(int code, int v)
Send a SET command with an additional integer valued variable and then wait for a reply.
bool setInteractionMode(int axis, yarp::dev::InteractionModeEnum mode) override
Set the interaction mode of the robot, values can be stiff or compliant.
bool getTemperatureLimit(int m, double *val) override
Retreives the current temperature limit for a specific motor.
bool getPidError(const PidControlTypeEnum &pidtype, int j, double *err) override
Get the current error for a joint.
bool getPidReference(const PidControlTypeEnum &pidtype, int j, double *ref) override
Get the current reference of the pid controller for a specific joint.
bool homingSingleJoint(int j) override
homingSingleJoint: call the homing procedure for a single joint
bool checkMotionDone(int j, bool *flag) override
Check if the current trajectory is terminated.
bool getMotorEncoderCountsPerRevolution(int m, double *cpr) override
Gets number of counts per revolution for motor encoder m.
bool setMotorEncoderCountsPerRevolution(int m, const double cpr) override
Sets number of counts per revolution for motor encoder m.
bool set2V1I(int v1, int v2, int axis)
bool setRefDutyCycle(int j, double v) override
Sets the reference dutycycle to a single motor.
bool getRefAccelerations(const int n_joint, const int *joints, double *accs) override
Get reference acceleration for a joint.
bool setPidErrorLimit(const PidControlTypeEnum &pidtype, int j, double limit) override
Set the error limit for the controller on a specifi joint.
bool setMaxCurrent(int j, double v) override
bool getPowerSupplyVoltage(int m, double *val) override
bool getRefVelocity(const int joint, double *vel) override
Get the last reference speed set by velocityMove for single joint.
bool getPidOutput(const PidControlTypeEnum &pidtype, int j, double *out) override
Get the output of the controller (e.g.
bool get1V1I1IA1DA(int v, const int len, const int *val1, double *val2)
bool get1V1DA(int v1, double *val)
Helper method to get an array of double from the remote peer.
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 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 getRefCurrent(int j, double *t) override
Get the reference value of the current for a single motor.
bool getEncoders(double *encs) override
Read the position of all axes.
bool get1V1I1S(int code, int j, std::string &name)
bool set1V(int code)
Send a SET command without parameters and wait for a reply.
Stamp getLastInputStamp() override
Get the time stamp for the last read data.
bool getMotorEncoder(int j, double *v) override
Read the value of a motor encoder.
bool getTemperature(int m, double *val) override
Get temperature of a motor.
bool setPidReference(const PidControlTypeEnum &pidtype, int j, double ref) override
Set the controller reference for a given axis.
bool setImpedance(int j, double stiffness, double damping) override
Set current impedance gains (stiffness,damping) for a specific joint.
bool getMotorEncoderTimed(int j, double *v, double *t) override
Read the instantaneous position of a motor encoder.
bool getDutyCycles(double *outs) override
Gets the current dutycycle of the output of the amplifier (i.e.
bool setRefCurrent(int j, double ref) override
Set the reference value of the current for a single motor.
bool setControlModes(const int n_joint, const int *joints, int *modes) override
Set the current control mode for a subset of axes.
bool setPid(const PidControlTypeEnum &pidtype, int j, const Pid &pid) override
Set new pid value for a joint axis.
bool set1V1I2D(int code, int j, double val1, double val2)
bool getPidErrors(const PidControlTypeEnum &pidtype, double *errs) override
Get the error of all joints.
bool close() override
Close the device driver and stop the port connections.
bool parkSingleJoint(int j, bool _wait=true) override
parkSingleJoint(): start the parking procedure for the single joint
bool setMotorEncoders(const double *vals) override
Set the value of all motor encoders.
bool getTargetPositions(double *refs) override
Get the last position reference for all axes.
bool setEncoders(const double *vals) override
Set the value of all encoders.
bool set1VDA(int v, const double *val)
Helper method used to set an array of double to all axes.
bool getPid(const PidControlTypeEnum &pidtype, int j, Pid *pid) override
Get current pid value for a specific joint.
bool setPosition(int j, double ref) override
Set new position for a single axis.
bool get2V1I2D(int v1, int v2, int j, double *val1, double *val2)
bool getJointType(int j, yarp::dev::JointTypeEnum &type) override
bool resetMotorEncoder(int j) override
Reset motor encoder, single motor.
bool getEncoderSpeed(int j, double *sp) override
Read the istantaneous speed of an axis.
bool setGearboxRatio(int m, const double val) override
Set the gearbox ratio for a specific motor.
bool resetMotorEncoders() override
Reset motor encoders.
bool getCurrentRanges(double *min, double *max) override
Get the full scale of the current measurements for all motors motor (e.g.
bool getAmpStatus(int *st) override
bool setRefTorque(int j, double v) override
Set the reference value of the torque for a given joint.
bool enablePid(const PidControlTypeEnum &pidtype, int j) override
Enable the pid computation for a joint.
bool calibrateWholePart() override
calibrateWholePart: call the procedure for calibrating the whole device
bool getImpedance(int j, double *stiffness, double *damping) override
Get current impedance gains (stiffness,damping,offset) for a specific joint.
bool getPidErrorLimits(const PidControlTypeEnum &pidtype, double *limits) override
Get the error limit for all controllers.
bool getMotorEncoders(double *encs) override
Read the position of all motor encoders.
bool setPids(const PidControlTypeEnum &pidtype, const Pid *pids) override
Set new pid value on multiple axes.
bool setMotorEncoder(int j, const double val) override
Set the value of the motor encoder for a given motor.
bool velocityMove(int j, double v) override
Start motion at a given speed, single joint.
bool setRemoteVariable(std::string key, const yarp::os::Bottle &val) override
bool setPidErrorLimits(const PidControlTypeEnum &pidtype, const double *limits) override
Get the error limit for the controller on all joints.
bool calibrationDone(int j) override
Check if the calibration is terminated, on a particular joint.
bool setPidOffset(const PidControlTypeEnum &pidtype, int j, double v) override
Set offset value for a given controller.
bool get2V1I1D(int v1, int v2, int j, double *val)
bool abortCalibration() override
bool setRefCurrents(const double *refs) override
Set the reference value of the currents for all motors.
bool getMotorEncoderAcceleration(int j, double *acc) override
Read the instantaneous acceleration of a motor encoder.
bool setRefTorques(const double *t) override
Set the reference value of the torque for all joints.
bool getNumberOfMotors(int *num) override
Retrieves the number of controlled axes from the current physical interface.
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.
bool get1VIA(int v, int *val)
Helper method to get an array of integers from the remote peer.
bool set1V1I1IA1DA(int v, const int len, const int *val1, const double *val2)
bool getInteractionMode(int axis, yarp::dev::InteractionModeEnum *mode) override
Get the current interaction mode of the robot, values can be stiff or compliant.
bool getCurrentRange(int j, double *min, double *max) override
Get the full scale of the current measurement for a given motor (e.g.
bool getEncoderAcceleration(int j, double *acc) override
Read the instantaneous acceleration of an axis.
bool get1V1B(int v, bool &val)
bool getVelLimits(int axis, double *min, double *max) override
Get the software speed limits for a particular axis.
bool setEncoder(int j, double val) override
Set the value of the encoder for a given joint.
bool send1V1I(int v, int axis)
bool get1V1I2D(int code, int axis, double *v1, double *v2)
bool resetEncoders() override
Reset encoders.
bool checkProtocolVersion(bool ignore)
bool setImpedanceOffset(int j, double offset) override
Set current force Offset for a specific joint.
bool get2V1I1IA1DA(int v1, int v2, const int n_joints, const int *joints, double *retVals, std::string functionName="")
bool getGearboxRatio(int m, double *val) override
Get the gearbox ratio for a specific motor.
bool getRefAcceleration(int j, double *acc) override
Get reference acceleration for a joint.
bool getMaxCurrent(int j, double *v) override
Returns the maximum electric current allowed for a given motor.
bool set2V2DA(int v1, int v2, const double *val1, const double *val2)
bool get2V1DA(int v1, int v2, double *val)
Helper method to get an array of double from the remote peer.
bool setRefAccelerations(const int n_joint, const int *joints, const double *accs) override
Set reference acceleration on all joints.
bool setNominalCurrent(int m, const double val) override
bool getMotorTorqueParams(int j, MotorTorqueParameters *params) override
Get a subset of motor parameters (bemf, ktau etc) useful for torque control.
bool getRefTorques(double *t) override
Get the reference value of the torque for all joints.
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 getRemoteVariable(std::string key, yarp::os::Bottle &val) override
bool getRefDutyCycles(double *refs) override
Gets the last reference sent using the setRefDutyCycles function.
bool set1V2D(int code, double v)
Send a SET command and an additional double valued variable and then wait for a reply.
bool getRemoteVariablesList(yarp::os::Bottle *listOfKeys) override
bool getMotorEncoderSpeed(int j, double *sp) override
Read the istantaneous speed of a motor encoder.
bool getTemperatures(double *vals) override
Get temperature of all the motors.
bool get2V2DA(int v1, int v2, double *val1, double *val2)
bool get1V1D(int code, double &v) const
Send a GET command expecting a double value in return.
bool setRefSpeeds(const int n_joint, const int *joints, const double *spds) override
Set reference speed on all joints.
bool getControlMode(int j, int *mode) override
Get the current control mode.
bool isCalibratorDevicePresent(bool *isCalib) override
isCalibratorDevicePresent: check if a calibrator device has been set
bool homingWholePart() override
homingWholePart: call the homing procedure for a the whole part/device
bool set2V1I1D(int v1, int v2, int axis, double val)
bool parkWholePart() override
parkWholePart: start the parking procedure for the whole part
bool calibrateRobot() override
Calibrate robot by using an external calibrator.
bool getControlModes(int *modes) override
Get the current control mode (multiple joints).
bool getMotorEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all motor encoders.
bool resetEncoder(int j) override
Reset encoder, single joint.
bool getDutyCycle(int j, double *out) override
Gets the current dutycycle of the output of the amplifier (i.e.
bool getTargetPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
bool send3V1I(int v1, int v2, int v3, int j)
bool getRefVelocities(double *vels) override
Get the last reference speed set by velocityMove for all joints.
bool getCurrent(int j, double *val) override
bool getAxes(int *ax) override
Get the number of controlled axes.
bool abortPark() override
bool getPidErrorLimit(const PidControlTypeEnum &pidtype, int j, double *limit) override
Get the error limit for the controller on a specific joint.
bool stop() override
Stop motion, multiple joints.
bool setPWMLimit(int m, const double val) override
bool getRefSpeed(int j, double *ref) override
Get reference speed for a joint.
bool getRefPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
bool set1V1I1D(int code, int j, double val)
Helper method to set a double value to a single axis.
bool getEncoderTimed(int j, double *v, double *t) override
Read the instantaneous acceleration of all axes.
bool setCalibrationParameters(int j, const CalibrationParameters ¶ms) override
Start calibration, this method is very often platform specific.
bool getRefTorque(int j, double *t) override
Get the reference value of the torque for a given joint.
bool setTemperatureLimit(int m, const double val) override
Set the temperature limit for a specific motor.
bool setValWithPidType(int voc, PidControlTypeEnum type, int axis, double val)
bool calibrateSingleJoint(int j) override
calibrateSingleJoint: call the calibration procedure for the single joint
bool enableAmp(int j) override
Enable the amplifier on a specific joint.
bool getEncoderSpeeds(double *spds) override
Read the instantaneous speed of all axes.
bool getTorqueRanges(double *min, double *max) override
Get the full scale of the torque sensors of all joints.
bool park(bool wait=true) override
bool setRefAcceleration(int j, double acc) override
Set reference acceleration for a joint.
bool getRefDutyCycle(int j, double *ref) override
Gets the last reference sent using the setRefDutyCycle function.
bool getMotorEncodersTimed(double *encs, double *ts) override
Read the instantaneous position of all motor encoders.
bool getImpedanceOffset(int j, double *offset) override
Get current force Offset for a specific joint.
bool getValWithPidType(int voc, PidControlTypeEnum type, int j, double *val)
bool calibrateAxisWithParams(int j, unsigned int ui, double v1, double v2, double v3) override
Start calibration, this method is very often platform specific.
bool getNumberOfMotorEncoders(int *num) override
Get the number of available motor encoders.
bool disablePid(const PidControlTypeEnum &pidtype, int j) override
Disable the pid computation for a joint.
bool getMotorEncoderSpeeds(double *spds) override
Read the instantaneous speed of all motor encoders.
bool getPWMLimit(int m, double *val) override
bool getCurrents(double *vals) override
bool disableAmp(int j) override
Disable the amplifier on a specific joint.
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...
bool getEncodersTimed(double *encs, double *ts) override
Read the instantaneous acceleration of all axes.
bool getPids(const PidControlTypeEnum &pidtype, Pid *pids) override
Get current pid value for a specific joint.
bool get1V1I1D(int v, int j, double *val)
Helper method used to get a double value from the remote peer.
bool getEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all axes.
bool setMotorTorqueParams(int j, const MotorTorqueParameters params) override
Set a subset of motor parameters (bemf, ktau etc) useful for torque control.
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 getTorqueRange(int j, double *min, double *max) override
Get the full scale of the torque sensor of a given joint.
bool setRefDutyCycles(const double *v) override
Sets the reference dutycycle for all the motors.
bool positionMove(int j, double ref) override
Set new reference point for a single axis.
bool quitPark() override
quitPark: interrupt the park procedure
bool get1V1I1I(int v, int j, int *val)
Helper method used to get an integer value from the remote peer.
bool getAxisName(int j, std::string &name) override
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.
Contains the parameters for a PID.
double scale
scale for the pid output
double offset
pwm offset added to the pid output
double stiction_down_val
down stiction offset added to the pid output
double stiction_up_val
up stiction offset added to the pid output
double max_output
max output
double kff
feedforward gain
double ki
integrative gain
double max_int
saturation threshold for the integrator
double kp
proportional gain
A simple collection of objects that can be described and transmitted in a portable way.
void addVocab32(yarp::conf::vocab32_t x)
Places a vocabulary item in the bottle, at the end of the list.
void append(const Bottle &alt)
Append the content of the given bottle to the current list.
Bottle & addList()
Places an empty nested list in the bottle, at the end of the list.
size_type size() const
Gets the number of elements in the bottle.
void addFloat64(yarp::conf::float64_t x)
Places a 64-bit floating point number in the bottle, at the end of the list.
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
bool check(const std::string &key) const override
Check if there exists a property of the given name.
void clear()
Empties the bottle of any objects it contains.
void addInt32(std::int32_t x)
Places a 32-bit integer in the bottle, at the end of the list.
void addString(const char *str)
Places a string in the bottle, at the end of the list.
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
std::string getName() const override
Get name of port.
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.
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.
An abstraction for a periodic thread.
PeriodicThread(double period, ShouldUseSystemClock useSystemClock=ShouldUseSystemClock::No, PeriodicThreadClock clockAccuracy=PeriodicThreadClock::Relative)
Constructor.
Group a pair of objects to be sent and received together.
BODY body
An object of the second type (BODY).
HEAD head
An object of the first type (HEAD).
Preferences for the port's Quality of Service.
void setThreadPriority(int priority)
sets the communication thread priority level
bool setPacketPriority(const std::string &priority)
sets the packet priority from a string.
void setThreadPolicy(int policy)
sets the communication thread scheduling policy
A base class for nested structures that can be searched.
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
virtual Bottle & findGroup(const std::string &key) const =0
Gets a list corresponding to a given keyword.
An abstraction for a time stamp and/or sequence number.
A single value (typically within a Bottle).
virtual yarp::conf::float64_t asFloat64() const
Get 64-bit floating point value.
virtual yarp::conf::vocab32_t asVocab32() const
Get vocabulary identifier as an integer.
virtual bool asBool() const
Get boolean value.
virtual std::int32_t asInt32() const
Get 32-bit integer value.
virtual Bottle * asList() const
Get list value.
virtual std::string asString() const
Get string value.
#define yCInfo(component,...)
#define yCError(component,...)
#define yCAssert(component, x)
#define yCWarning(component,...)
#define yCDebug(component,...)
An interface for the device drivers.
An interface to the operating system, including Port based communication.