60 if (!rpc_IImpedance) {
77 *ok = rpc_IImpedance->setImpedance(cmd.
get(3).
asInt32(), stiff, damp);
85 *ok = rpc_IImpedance->setImpedanceOffset(cmd.
get(3).
asInt32(), offs);
101 *ok = rpc_IImpedance->getImpedance(cmd.
get(3).
asInt32(), &stiff, &damp);
108 *ok = rpc_IImpedance->getImpedanceOffset(cmd.
get(3).
asInt32(), &offs);
114 double min_stiff = 0;
115 double max_stiff = 0;
118 *ok = rpc_IImpedance->getCurrentImpedanceLimit(cmd.
get(3).
asInt32(), &min_stiff, &max_stiff, &min_damp, &max_damp);
128 lastRpcStamp.update();
144 if (!(rpc_iCtrlMode)) {
166 *ok = rpc_iCtrlMode->setControlMode(axis, cmd.
get(4).
asVocab());
178 int* js =
new int[n_joints];
179 int* modes =
new int[n_joints];
181 for (
int i = 0; i < n_joints; i++) {
185 for (
int i = 0; i < n_joints; i++) {
189 *ok = rpc_iCtrlMode->setControlModes(n_joints, js, modes);
202 if (modeList->
size() != controlledJoints) {
203 yCError(
CONTROLBOARDWRAPPER,
"received an invalid setControlMode message. Size of vector doesn´t match the number of controlled joints");
207 int* modes =
new int[controlledJoints];
208 for (
size_t i = 0; i < controlledJoints; i++) {
212 *ok = rpc_iCtrlMode->setControlModes(modes);
225 yCError(
CONTROLBOARDWRAPPER) <<
" Error, received a set control mode message using a legacy version, trying to be handle the message anyway "
226 <<
" but please update your client to be compatible with the IControlMode2 interface";
261 yCError(
CONTROLBOARDWRAPPER) <<
"The 'impedancePosition' control mode is deprecated. \nUse setInteractionMode(axis, VOCAB_IM_COMPLIANT) + setControlMode(axis, VOCAB_CM_POSITION) instead";
265 yCError(
CONTROLBOARDWRAPPER) <<
"The 'impedanceVelocity' control mode is deprecated. \nUse setInteractionMode(axis, VOCAB_IM_COMPLIANT) + setControlMode(axis, VOCAB_CM_VELOCITY) instead";
270 *ok = rpc_iCtrlMode->setControlMode(axis,
VOCAB_CM_PWM);
322 int* p =
new int[controlledJoints];
323 for (
size_t i = 0; i < controlledJoints; ++i) {
327 *ok = rpc_iCtrlMode->getControlModes(p);
334 for (
size_t i = 0; i < controlledJoints; i++) {
348 *ok = rpc_iCtrlMode->getControlMode(axis, &p);
365 int* js =
new int[n_joints];
366 int* modes =
new int[n_joints];
367 for (
int i = 0; i < n_joints; i++) {
372 *ok = rpc_iCtrlMode->getControlModes(n_joints, js, modes);
381 for (
int i = 0; i < n_joints; i++) {
397 lastRpcStamp.update();
442 if (b->
size() != 4) {
452 *ok = rpc_ITorque->setMotorTorqueParams(joint, params);
461 const size_t njs = b->
size();
462 if (njs == controlledJoints) {
463 auto* p =
new double[njs];
464 for (
size_t i = 0; i < njs; i++) {
467 *ok = rpc_ITorque->setRefTorques(p);
474 int* modes =
new int[controlledJoints];
475 for (
size_t i = 0; i < controlledJoints; i++) {
478 *ok = rpc_iCtrlMode->setControlModes(modes);
498 *ok = rpc_ITorque->getAxes(&tmp);
503 *ok = rpc_ITorque->getTorque(cmd.
get(3).
asInt32(), &dtmp);
512 *ok = rpc_ITorque->getMotorTorqueParams(joint, ¶ms);
523 *ok = rpc_ITorque->getTorqueRange(cmd.
get(3).
asInt32(), &dtmp, &dtmp2);
529 auto* p =
new double[controlledJoints];
530 *ok = rpc_ITorque->getTorques(p);
532 for (
size_t i = 0; i < controlledJoints; i++) {
539 auto* p1 =
new double[controlledJoints];
540 auto* p2 =
new double[controlledJoints];
541 *ok = rpc_ITorque->getTorqueRanges(p1, p2);
543 for (
size_t i = 0; i < controlledJoints; i++) {
547 for (
size_t i = 0; i < controlledJoints; i++) {
555 *ok = rpc_ITorque->getRefTorque(cmd.
get(3).
asInt32(), &dtmp);
560 auto* p =
new double[controlledJoints];
561 *ok = rpc_ITorque->getRefTorques(p);
563 for (
size_t i = 0; i < controlledJoints; i++) {
570 lastRpcStamp.update();
582 if (!rpc_IInteract) {
606 auto n_joints =
static_cast<size_t>(cmd.
get(3).
asInt32());
609 if ((jointList->
size() != n_joints) || (modeList->
size() != n_joints)) {
614 int* joints =
new int[n_joints];
616 for (
size_t i = 0; i < n_joints; i++) {
621 *ok = rpc_IInteract->setInteractionModes(n_joints, joints, modes);
631 if (modeList->
size() != controlledJoints) {
632 yCWarning(
CONTROLBOARDWRAPPER,
"Received an invalid setInteractionMode message. Size of vector doesn´t match the number of controlled joints");
637 for (
size_t i = 0; i < controlledJoints; i++) {
640 *ok = rpc_IInteract->setInteractionModes(modes);
659 *ok = rpc_IInteract->getInteractionMode(cmd.
get(3).
asInt32(), &mode);
669 if (jointList->
size() !=
static_cast<size_t>(n_joints)) {
674 int* joints =
new int[n_joints];
676 for (
int i = 0; i < n_joints; i++) {
679 *ok = rpc_IInteract->getInteractionModes(n_joints, joints, modes);
682 for (
int i = 0; i < n_joints; i++) {
696 *ok = rpc_IInteract->getInteractionModes(modes);
699 for (
size_t i = 0; i < controlledJoints; i++) {
708 lastRpcStamp.update();
771 *ok = rpc_ICurrent->getRefCurrent(cmd.
get(3).
asInt32(), &dtmp);
776 auto* p =
new double[controlledJoints];
777 *ok = rpc_ICurrent->getRefCurrents(p);
779 for (
size_t i = 0; i < controlledJoints; i++) {
787 *ok = rpc_ICurrent->getCurrentRange(cmd.
get(3).
asInt32(), &dtmp, &dtmp2);
793 auto* p1 =
new double[controlledJoints];
794 auto* p2 =
new double[controlledJoints];
795 *ok = rpc_ICurrent->getCurrentRanges(p1, p2);
798 for (
size_t i = 0; i < controlledJoints; i++) {
801 for (
size_t i = 0; i < controlledJoints; i++) {
852 *ok = rpc_IPid->setPidOffset(pidtype, j, v);
874 *ok = rpc_IPid->setPid(pidtype, j, p);
884 const size_t njs = b->
size();
885 if (njs == controlledJoints) {
890 for (
size_t i = 0; i < njs; i++) {
908 *ok = rpc_IPid->setPids(pidtype, p);
928 const size_t njs = b->
size();
929 if (njs == controlledJoints) {
930 auto* p =
new double[njs];
931 for (
size_t i = 0; i < njs; i++) {
934 *ok = rpc_IPid->setPidReferences(pidtype, p);
950 const size_t njs = b->
size();
951 if (njs == controlledJoints) {
952 auto* p =
new double[njs];
953 for (
size_t i = 0; i < njs; i++) {
956 *ok = rpc_IPid->setPidErrorLimits(pidtype, p);
962 *ok = rpc_IPid->resetPid(pidtype, cmd.
get(4).
asInt32());
966 *ok = rpc_IPid->disablePid(pidtype, cmd.
get(4).
asInt32());
970 *ok = rpc_IPid->enablePid(pidtype, cmd.
get(4).
asInt32());
984 auto* p =
new double[controlledJoints];
985 *ok = rpc_IPid->getPidErrorLimits(pidtype, p);
987 for (
size_t i = 0; i < controlledJoints; i++) {
994 bool booltmp =
false;
995 *ok = rpc_IPid->isPidEnabled(pidtype, cmd.
get(4).
asInt32(), &booltmp);
1000 *ok = rpc_IPid->getPidError(pidtype, cmd.
get(4).
asInt32(), &dtmp);
1005 auto* p =
new double[controlledJoints];
1006 *ok = rpc_IPid->getPidErrors(pidtype, p);
1008 for (
size_t i = 0; i < controlledJoints; i++) {
1015 *ok = rpc_IPid->getPidOutput(pidtype, cmd.
get(4).
asInt32(), &dtmp);
1020 auto* p =
new double[controlledJoints];
1021 *ok = rpc_IPid->getPidOutputs(pidtype, p);
1023 for (
size_t i = 0; i < controlledJoints; i++) {
1031 *ok = rpc_IPid->getPid(pidtype, cmd.
get(4).
asInt32(), &p);
1046 Pid* p =
new Pid[controlledJoints];
1047 *ok = rpc_IPid->getPids(pidtype, p);
1049 for (
size_t i = 0; i < controlledJoints; i++) {
1066 *ok = rpc_IPid->getPidReference(pidtype, cmd.
get(4).
asInt32(), &dtmp);
1071 auto* p =
new double[controlledJoints];
1072 *ok = rpc_IPid->getPidReferences(pidtype, p);
1074 for (
size_t i = 0; i < controlledJoints; i++) {
1081 *ok = rpc_IPid->getPidErrorLimit(pidtype, cmd.
get(4).
asInt32(), &dtmp);
1136 response.
add(cmd.
get(1));
1140 *ok = rpc_IPWM->getRefDutyCycle(cmd.
get(3).
asInt32(), &dtmp);
1145 auto* p =
new double[controlledJoints];
1146 *ok = rpc_IPWM->getRefDutyCycles(p);
1148 for (
size_t i = 0; i < controlledJoints; i++) {
1155 *ok = rpc_IPWM->getDutyCycle(cmd.
get(3).
asInt32(), &dtmp);
1160 auto* p =
new double[controlledJoints];
1161 *ok = rpc_IPWM->getRefDutyCycles(p);
1163 for (
size_t i = 0; i < controlledJoints; i++) {
1190 if (!rpc_IRemoteCalibrator) {
1207 *ok = rpc_IVar->setRemoteVariable(cmd.
get(3).
asString(), btail);
1223 response.
add(cmd.
get(1));
1228 *ok = rpc_IVar->getRemoteVariable(cmd.
get(3).
asString(), btmp);
1234 *ok = rpc_IVar->getRemoteVariablesList(&btmp);
1247 if (!rpc_IRemoteCalibrator) {
1264 *ok = rpc_IRemoteCalibrator->calibrateSingleJoint(cmd.
get(3).
asInt32());
1269 *ok = rpc_IRemoteCalibrator->calibrateWholePart();
1274 *ok = rpc_IRemoteCalibrator->homingSingleJoint(cmd.
get(3).
asInt32());
1280 *ok = rpc_IRemoteCalibrator->homingWholePart();
1285 *ok = rpc_IRemoteCalibrator->parkSingleJoint(cmd.
get(3).
asInt32());
1290 *ok = rpc_IRemoteCalibrator->parkWholePart();
1295 *ok = rpc_IRemoteCalibrator->quitCalibrate();
1300 *ok = rpc_IRemoteCalibrator->quitPark();
1314 response.
add(cmd.
get(1));
1320 *ok = rpc_IRemoteCalibrator->isCalibratorDevicePresent(&tmp);
1339 if (cmd.
size() < 2) {
1344 handlePidMsg(cmd, response, &rec, &ok);
1348 handleTorqueMsg(cmd, response, &rec, &ok);
1352 handleControlModeMsg(cmd, response, &rec, &ok);
1356 handleImpedanceMsg(cmd, response, &rec, &ok);
1360 handleInteractionModeMsg(cmd, response, &rec, &ok);
1364 handleProtocolVersionRequest(cmd, response, &rec, &ok);
1368 handleRemoteCalibratorMsg(cmd, response, &rec, &ok);
1372 handleRemoteVariablesMsg(cmd, response, &rec, &ok);
1376 handleCurrentMsg(cmd, response, &rec, &ok);
1380 handlePWMMsg(cmd, response, &rec, &ok);
1395 if (rpc_Icalib ==
nullptr) {
1398 ok = rpc_Icalib->calibrateAxisWithParams(j, ui, v1, v2, v3);
1413 if (rpc_Icalib ==
nullptr) {
1416 ok = rpc_Icalib->setCalibrationParameters(j, params);
1423 ok = rpc_Icalib->calibrateRobot();
1430 ok = rpc_Icalib->calibrationDone(j);
1437 ok = rpc_Icalib->park(flag ?
true :
false);
1456 const size_t njs = b->
size();
1457 if (njs != controlledJoints) {
1460 tmpVect.resize(njs);
1461 for (
size_t i = 0; i < njs; i++) {
1465 if (rpc_IPosCtrl !=
nullptr) {
1466 ok = rpc_IPosCtrl->positionMove(&tmpVect[0]);
1471 auto len =
static_cast<size_t>(cmd.
get(2).
asInt32());
1475 if (rpc_IPosCtrl ==
nullptr) {
1479 if (jlut ==
nullptr || pos_val ==
nullptr) {
1482 if (len != jlut->
size() || len != pos_val->
size()) {
1486 auto* j_tmp =
new int[len];
1487 auto* pos_tmp =
new double[len];
1488 for (
size_t i = 0; i < len; i++) {
1493 ok = rpc_IPosCtrl->positionMove(len, j_tmp, pos_tmp);
1505 const size_t njs = b->
size();
1506 if (njs != controlledJoints) {
1509 tmpVect.resize(njs);
1510 for (
size_t i = 0; i < njs; i++) {
1513 if (rpc_IVelCtrl !=
nullptr) {
1514 ok = rpc_IVelCtrl->velocityMove(&tmpVect[0]);
1524 auto len =
static_cast<size_t>(cmd.
get(2).
asInt32());
1528 if (rpc_IPosCtrl ==
nullptr) {
1532 if (jBottle_p ==
nullptr || posBottle_p ==
nullptr) {
1535 if (len != jBottle_p->
size() || len != posBottle_p->
size()) {
1539 int* j_tmp =
new int[len];
1540 auto* pos_tmp =
new double[len];
1542 for (
size_t i = 0; i < len; i++) {
1546 for (
size_t i = 0; i < len; i++) {
1550 ok = rpc_IPosCtrl->relativeMove(len, j_tmp, pos_tmp);
1563 const size_t njs = b->
size();
1564 if (njs != controlledJoints) {
1567 auto* p =
new double[njs];
1568 for (
size_t i = 0; i < njs; i++) {
1571 ok = rpc_IPosCtrl->relativeMove(p);
1580 auto len =
static_cast<size_t>(cmd.
get(2).
asInt32());
1584 if (rpc_IPosCtrl ==
nullptr) {
1588 if (jBottle_p ==
nullptr || velBottle_p ==
nullptr) {
1591 if (len != jBottle_p->
size() || len != velBottle_p->
size()) {
1595 int* j_tmp =
new int[len];
1596 auto* spds_tmp =
new double[len];
1598 for (
size_t i = 0; i < len; i++) {
1602 for (
size_t i = 0; i < len; i++) {
1606 ok = rpc_IPosCtrl->setRefSpeeds(len, j_tmp, spds_tmp);
1618 const size_t njs = b->
size();
1619 if (njs != controlledJoints) {
1622 auto* p =
new double[njs];
1623 for (
size_t i = 0; i < njs; i++) {
1626 ok = rpc_IPosCtrl->setRefSpeeds(p);
1635 auto len =
static_cast<size_t>(cmd.
get(2).
asInt32());
1639 if (rpc_IPosCtrl ==
nullptr) {
1643 if (jBottle_p ==
nullptr || accBottle_p ==
nullptr) {
1646 if (len != jBottle_p->
size() || len != accBottle_p->
size()) {
1650 int* j_tmp =
new int[len];
1651 auto* accs_tmp =
new double[len];
1653 for (
size_t i = 0; i < len; i++) {
1657 for (
size_t i = 0; i < len; i++) {
1661 ok = rpc_IPosCtrl->setRefAccelerations(len, j_tmp, accs_tmp);
1673 const size_t njs = b->
size();
1674 if (njs != controlledJoints) {
1677 auto* p =
new double[njs];
1678 for (
size_t i = 0; i < njs; i++) {
1681 ok = rpc_IPosCtrl->setRefAccelerations(p);
1686 ok = rpc_IPosCtrl->stop(cmd.
get(2).
asInt32());
1690 auto len =
static_cast<size_t>(cmd.
get(2).
asInt32());
1693 if (rpc_IPosCtrl ==
nullptr) {
1697 if (jBottle_p ==
nullptr) {
1700 if (len != jBottle_p->
size()) {
1704 int* j_tmp =
new int[len];
1706 for (
size_t i = 0; i < len; i++) {
1710 ok = rpc_IPosCtrl->stop(len, j_tmp);
1715 ok = rpc_IPosCtrl->stop();
1719 ok = rpc_IEncTimed->resetEncoder(cmd.
get(2).
asInt32());
1723 ok = rpc_IEncTimed->resetEncoders();
1737 const size_t njs = b->
size();
1738 if (njs != controlledJoints) {
1741 auto* p =
new double[njs];
1742 for (
size_t i = 0; i < njs; i++) {
1745 ok = rpc_IEncTimed->setEncoders(p);
1754 ok = rpc_IMotEnc->resetMotorEncoder(cmd.
get(2).
asInt32());
1758 ok = rpc_IMotEnc->resetMotorEncoders();
1772 const size_t njs = b->
size();
1773 if (njs != controlledJoints) {
1776 auto* p =
new double[njs];
1777 for (
size_t i = 0; i < njs; i++) {
1780 ok = rpc_IMotEnc->setMotorEncoders(p);
1785 ok = rcp_IAmp->enableAmp(cmd.
get(2).
asInt32());
1789 ok = rcp_IAmp->disableAmp(cmd.
get(2).
asInt32());
1840 response.
add(cmd.
get(1));
1845 ok = rpc_IMotor->getTemperatureLimit(cmd.
get(2).
asInt32(), &dtmp);
1850 ok = rpc_IMotor->getTemperature(cmd.
get(2).
asInt32(), &dtmp);
1855 ok = rpc_IMotor->getGearboxRatio(cmd.
get(2).
asInt32(), &dtmp);
1860 auto* p =
new double[controlledJoints];
1861 ok = rpc_IMotor->getTemperatures(p);
1863 for (
size_t i = 0; i < controlledJoints; i++) {
1870 ok = rcp_IAmp->getMaxCurrent(cmd.
get(2).
asInt32(), &dtmp);
1876 ok = rpc_IPosCtrl->getTargetPosition(cmd.
get(2).
asInt32(), &dtmp);
1885 int* jointList =
new int[len];
1886 auto* refs =
new double[len];
1888 for (
int j = 0; j < len; j++) {
1891 ok = rpc_IPosCtrl->getTargetPositions(len, jointList, refs);
1894 for (
int i = 0; i < len; i++) {
1903 auto* refs =
new double[controlledJoints];
1904 ok = rpc_IPosCtrl->getTargetPositions(refs);
1906 for (
size_t i = 0; i < controlledJoints; i++) {
1914 ok = rpc_IPosDirect->getRefPosition(cmd.
get(2).
asInt32(), &dtmp);
1923 int* jointList =
new int[len];
1924 auto* refs =
new double[len];
1926 for (
int j = 0; j < len; j++) {
1929 ok = rpc_IPosDirect->getRefPositions(len, jointList, refs);
1932 for (
int i = 0; i < len; i++) {
1941 auto* refs =
new double[controlledJoints];
1942 ok = rpc_IPosDirect->getRefPositions(refs);
1944 for (
size_t i = 0; i < controlledJoints; i++) {
1952 ok = rpc_IVelCtrl->getRefVelocity(cmd.
get(2).
asInt32(), &dtmp);
1963 int* jointList =
new int[len];
1964 auto* refs =
new double[len];
1966 for (
int j = 0; j < len; j++) {
1969 ok = rpc_IVelCtrl->getRefVelocities(len, jointList, refs);
1972 for (
int i = 0; i < len; i++) {
1983 auto* refs =
new double[controlledJoints];
1984 ok = rpc_IVelCtrl->getRefVelocities(refs);
1986 for (
size_t i = 0; i < controlledJoints; i++) {
1994 ok = rpc_IMotor->getNumberOfMotors(&tmp);
2000 ok = rpc_IPosCtrl->getAxes(&tmp);
2007 ok = rpc_IPosCtrl->checkMotionDone(cmd.
get(2).
asInt32(), &x);
2015 int* jointList =
new int[len];
2016 for (
int j = 0; j < len; j++) {
2019 if (rpc_IPosCtrl !=
nullptr) {
2020 ok = rpc_IPosCtrl->checkMotionDone(len, jointList, &x);
2029 ok = rpc_IPosCtrl->checkMotionDone(&x);
2034 ok = rpc_IPosCtrl->getRefSpeed(cmd.
get(2).
asInt32(), &dtmp);
2041 int* jointList =
new int[len];
2042 auto* speeds =
new double[len];
2044 for (
int j = 0; j < len; j++) {
2047 ok = rpc_IPosCtrl->getRefSpeeds(len, jointList, speeds);
2050 for (
int i = 0; i < len; i++) {
2059 auto* p =
new double[controlledJoints];
2060 ok = rpc_IPosCtrl->getRefSpeeds(p);
2062 for (
size_t i = 0; i < controlledJoints; i++) {
2069 ok = rpc_IPosCtrl->getRefAcceleration(cmd.
get(2).
asInt32(), &dtmp);
2076 int* jointList =
new int[len];
2077 auto* accs =
new double[len];
2079 for (
int j = 0; j < len; j++) {
2082 ok = rpc_IPosCtrl->getRefAccelerations(len, jointList, accs);
2085 for (
int i = 0; i < len; i++) {
2094 auto* p =
new double[controlledJoints];
2095 ok = rpc_IPosCtrl->getRefAccelerations(p);
2097 for (
size_t i = 0; i < controlledJoints; i++) {
2104 ok = rpc_IEncTimed->getEncoder(cmd.
get(2).
asInt32(), &dtmp);
2109 auto* p =
new double[controlledJoints];
2110 ok = rpc_IEncTimed->getEncoders(p);
2112 for (
size_t i = 0; i < controlledJoints; i++) {
2119 ok = rpc_IEncTimed->getEncoderSpeed(cmd.
get(2).
asInt32(), &dtmp);
2124 auto* p =
new double[controlledJoints];
2125 ok = rpc_IEncTimed->getEncoderSpeeds(p);
2127 for (
size_t i = 0; i < controlledJoints; i++) {
2134 ok = rpc_IEncTimed->getEncoderAcceleration(cmd.
get(2).
asInt32(), &dtmp);
2139 auto* p =
new double[controlledJoints];
2140 ok = rpc_IEncTimed->getEncoderAccelerations(p);
2142 for (
size_t i = 0; i < controlledJoints; i++) {
2149 ok = rpc_IMotEnc->getMotorEncoderCountsPerRevolution(cmd.
get(2).
asInt32(), &dtmp);
2154 ok = rpc_IMotEnc->getMotorEncoder(cmd.
get(2).
asInt32(), &dtmp);
2159 auto* p =
new double[controlledJoints];
2160 ok = rpc_IMotEnc->getMotorEncoders(p);
2162 for (
size_t i = 0; i < controlledJoints; i++) {
2169 ok = rpc_IMotEnc->getMotorEncoderSpeed(cmd.
get(2).
asInt32(), &dtmp);
2174 auto* p =
new double[controlledJoints];
2175 ok = rpc_IMotEnc->getMotorEncoderSpeeds(p);
2177 for (
size_t i = 0; i < controlledJoints; i++) {
2184 ok = rpc_IMotEnc->getMotorEncoderAcceleration(cmd.
get(2).
asInt32(), &dtmp);
2189 auto* p =
new double[controlledJoints];
2190 ok = rpc_IMotEnc->getMotorEncoderAccelerations(p);
2192 for (
size_t i = 0; i < controlledJoints; i++) {
2200 ok = rpc_IMotEnc->getNumberOfMotorEncoders(&num);
2205 ok = rcp_IAmp->getCurrent(cmd.
get(2).
asInt32(), &dtmp);
2210 auto* p =
new double[controlledJoints];
2211 ok = rcp_IAmp->getCurrents(p);
2213 for (
size_t i = 0; i < controlledJoints; i++) {
2220 int* p =
new int[controlledJoints];
2221 ok = rcp_IAmp->getAmpStatus(p);
2223 for (
size_t i = 0; i < controlledJoints; i++) {
2232 ok = rcp_IAmp->getAmpStatus(j, &itmp);
2238 ok = rcp_IAmp->getNominalCurrent(m, &dtmp);
2244 ok = rcp_IAmp->getPeakCurrent(m, &dtmp);
2250 ok = rcp_IAmp->getPWM(m, &dtmp);
2257 ok = rcp_IAmp->getPWMLimit(m, &dtmp);
2263 ok = rcp_IAmp->getPowerSupplyVoltage(m, &dtmp);
2270 ok = rcp_Ilim->getLimits(cmd.
get(2).
asInt32(), &min, &max);
2278 ok = rcp_Ilim->getVelLimits(cmd.
get(2).
asInt32(), &min, &max);
2284 std::string name =
"undocumented";
2285 ok = rpc_AxisInfo->getAxisName(cmd.
get(2).
asInt32(), name);
2291 ok = rpc_AxisInfo->getJointType(cmd.
get(2).
asInt32(), type);
2301 lastRpcStamp.update();
2309 ok = DeviceResponder::respond(cmd, response);
2330 ok = rpc_IPosCtrl->getAxes(&tmp_axes);
2331 controlledJoints =
static_cast<size_t>(tmp_axes);
2334 DeviceResponder::makeUsage();
2335 addUsage(
"[get] [axes]",
"get the number of axes");
2336 addUsage(
"[get] [name] $iAxisNumber",
"get a human-readable name for an axis, if available");
2337 addUsage(
"[set] [pos] $iAxisNumber $fPosition",
"command the position of an axis");
2338 addUsage(
"[set] [rel] $iAxisNumber $fPosition",
"command the relative position of an axis");
2339 addUsage(
"[set] [vmo] $iAxisNumber $fVelocity",
"command the velocity of an axis");
2340 addUsage(
"[get] [enc] $iAxisNumber",
"get the encoder value for an axis");
2343 for (
size_t i = 0; i < controlledJoints; i++) {
2350 addUsage((std::string(
"[set] [poss] (") + args +
")").c_str(),
2351 "command the position of all axes");
2352 addUsage((std::string(
"[set] [rels] (") + args +
")").c_str(),
2353 "command the relative position of all axes");
2354 addUsage((std::string(
"[set] [vmos] (") + args +
")").c_str(),
2355 "command the velocity of all axes");
2357 addUsage(
"[set] [aen] $iAxisNumber",
"enable (amplifier for) the given axis");
2358 addUsage(
"[set] [adi] $iAxisNumber",
"disable (amplifier for) the given axis");
2359 addUsage(
"[get] [acu] $iAxisNumber",
"get current for the given axis");
2360 addUsage(
"[get] [acus]",
"get current for all axes");
2387 controlledJoints = 0;