33 _verb = (prop.
check(
"verbose",
"if present, give detailed output"));
39 if(!parseOptions(prop))
47 bool ControlBoardRemapper::parseOptions(
Property& prop)
51 usingAxesNamesForAttachAll = prop.
check(
"axesNames",
"list of networks merged by this wrapper");
52 usingNetworksForAttachAll = prop.
check(
"networks",
"list of networks merged by this wrapper");
55 if( usingAxesNamesForAttachAll &&
56 usingNetworksForAttachAll )
62 if( !usingAxesNamesForAttachAll &&
63 !usingNetworksForAttachAll )
69 if( usingAxesNamesForAttachAll )
71 ok = parseAxesNames(prop);
74 if( usingNetworksForAttachAll )
76 ok = parseNetworks(prop);
82 bool ControlBoardRemapper::parseAxesNames(
const Property& prop)
85 if(propAxesNames==
nullptr)
91 axesNames.resize(propAxesNames->
size());
92 for(
size_t ax=0; ax < propAxesNames->
size(); ax++)
97 this->setNrOfControlledAxes(axesNames.size());
102 bool ControlBoardRemapper::parseNetworks(
const Property& prop)
111 if (!prop.
check(
"joints",
"number of joints of the part"))
117 this->setNrOfControlledAxes((
size_t)prop.
find(
"joints").
asInt32());
119 int nsubdevices=nets->
size();
120 remappedControlBoards.lut.resize(controlledJoints);
121 remappedControlBoards.subdevices.resize(nsubdevices);
124 for(
size_t k=0;k<nets->
size();k++)
134 if(parameters.
size()==2)
144 if(tmpBot.
size() != 4)
147 <<
"Check network parameters in part description"
148 <<
"--> I was expecting" << nets->
get(k).
asString() <<
"followed by a list of four integers in parenthesis"
164 else if (parameters.
size()==5)
175 <<
"Check network parameters in part description"
176 <<
"--> I was expecting" << nets->
get(k).
asString() <<
"followed by a list of four integers in parenthesis"
184 if( (wTop-wBase) != (top-base) )
187 <<
"Check network parameters in network " << nets->
get(k).
asString().c_str()
188 <<
"I was expecting a well form quadruple of numbers, got instead: "<< parameters.
toString().c_str();
193 for(
int j=wBase;j<=wTop;j++)
196 remappedControlBoards.lut[j].subControlBoardIndex=k;
197 remappedControlBoards.lut[j].axisIndexInSubControlBoard=base+off;
204 void ControlBoardRemapper::setNrOfControlledAxes(
const size_t nrOfControlledAxes)
206 controlledJoints = nrOfControlledAxes;
207 buffers.controlBoardModes.resize(nrOfControlledAxes,0);
208 buffers.dummyBuffer.resize(nrOfControlledAxes,0.0);
212 bool ControlBoardRemapper::updateAxesName()
215 axesNames.resize(controlledJoints);
217 for(
int l=0; l < controlledJoints; l++)
219 std::string axNameYARP;
220 bool ok = this->getAxisName(l,axNameYARP);
223 axesNames[l] = axNameYARP;
238 if( usingAxesNamesForAttachAll )
240 ok = attachAllUsingAxesNames(polylist);
243 if( usingNetworksForAttachAll )
245 ok = attachAllUsingNetworks(polylist);
250 for(
unsigned int k=0; k<remappedControlBoards.getNrOfSubControlBoards(); k++)
252 if (!remappedControlBoards.subdevices[k].isAttached())
282 bool ControlBoardRemapper::attachAllUsingAxesNames(
const PolyDriverList& polylist)
284 std::map<std::string, axisLocation> axesLocationMap;
286 for(
int p=0;p<polylist.
size();p++)
291 std::string deviceKey=polylist[p]->key;
292 if(deviceKey ==
"Calibrator" || deviceKey ==
"calibrator")
296 polylist[p]->poly->view(calibrator);
298 IRemoteCalibrator::setCalibratorDevice(calibrator);
305 polylist[p]->poly->view(iaxinfos);
306 polylist[p]->poly->view(iencs);
311 yCError(
CONTROLBOARDREMAPPER) <<
"subdevice" << deviceKey <<
"does not implemented the required IAxisInfo or IEncoders interfaces";
315 int nrOfSubdeviceAxes;
316 bool ok = iencs->
getAxes(&nrOfSubdeviceAxes);
324 for(
int axInSubDevice =0; axInSubDevice < nrOfSubdeviceAxes; axInSubDevice++)
326 std::string axNameYARP;
327 ok = iaxinfos->
getAxisName(axInSubDevice,axNameYARP);
329 std::string axName = axNameYARP;
337 auto it = axesLocationMap.find(axName);
338 if( it != axesLocationMap.end() )
341 <<
"multiple axes have the same name" << axName
342 <<
"on on device " << polylist[p]->key <<
"with index" << axInSubDevice
343 <<
"and another on device" << it->second.subDeviceKey <<
"with index" << it->second.indexInSubDevice;
351 axesLocationMap[axName] = newLocation;
356 std::vector<std::string> subControlBoardsKeys;
357 std::map<std::string, size_t> subControlBoardKey2IndexInPolyDriverList;
358 std::map<std::string, size_t> subControlBoardKey2IndexInRemappedControlBoards;
363 for(
const auto& axesName : axesNames)
365 auto it = axesLocationMap.find(axesName);
366 if( it == axesLocationMap.end() )
369 <<
"axis " << axesName
370 <<
"specified in axesNames was not found in the axes of the controlboards passed to attachAll, attachAll failed.";
377 if(std::find(subControlBoardsKeys.begin(), subControlBoardsKeys.end(), key) == subControlBoardsKeys.end())
380 subControlBoardKey2IndexInRemappedControlBoards[key] = subControlBoardsKeys.size();
381 subControlBoardsKeys.push_back(key);
386 assert(controlledJoints == (
int) axesNames.size());
389 size_t nrOfSubControlBoards = subControlBoardsKeys.size();
390 remappedControlBoards.lut.resize(controlledJoints);
391 remappedControlBoards.subdevices.resize(nrOfSubControlBoards);
394 for(
size_t ctrlBrd=0; ctrlBrd < nrOfSubControlBoards; ctrlBrd++)
396 size_t p = subControlBoardKey2IndexInPolyDriverList[subControlBoardsKeys[ctrlBrd]];
399 tmpDevice->
id = subControlBoardsKeys[ctrlBrd];
400 bool ok = tmpDevice->
attach(polylist[p]->poly,subControlBoardsKeys[ctrlBrd]);
409 for(
size_t l=0; l < axesNames.size(); l++)
412 remappedControlBoards.lut[l].subControlBoardIndex = subControlBoardKey2IndexInRemappedControlBoards[loc.
subDeviceKey];
420 bool ControlBoardRemapper::attachAllUsingNetworks(
const PolyDriverList &polylist)
422 for(
int p=0;p<polylist.
size();p++)
425 std::string subDeviceKey = polylist[p]->key;
426 if(subDeviceKey ==
"Calibrator" || subDeviceKey ==
"calibrator")
430 polylist[p]->poly->view(calibrator);
432 IRemoteCalibrator::setCalibratorDevice(calibrator);
438 for(k=0; k<remappedControlBoards.getNrOfSubControlBoards(); k++)
440 if (remappedControlBoards.subdevices[k].id==subDeviceKey)
442 if (!remappedControlBoards.subdevices[k].attach(polylist[p]->poly, subDeviceKey))
451 bool ok = updateAxesName();
465 int devices=remappedControlBoards.getNrOfSubControlBoards();
466 for (
int k = 0; k < devices; k++) {
467 remappedControlBoards.getSubControlBoard(k)->detach();
470 IRemoteCalibrator::releaseCalibratorDevice();
474 void ControlBoardRemapper::configureBuffers()
476 allJointsBuffers.configure(remappedControlBoards);
477 selectedJointsBuffers.configure(remappedControlBoards);
481 bool ControlBoardRemapper::setControlModeAllAxes(
const int cm)
483 std::lock_guard<std::mutex> lock(buffers.mutex);
485 for(
int j=0; j < controlledJoints; j++)
487 buffers.controlBoardModes[j] = cm;
490 return this->setControlModes(buffers.controlBoardModes.data());
502 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
503 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
523 for(
int l=0;l<controlledJoints;l++)
525 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
527 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
537 bool ok = p->
pid->
setPid(pidtype, off, ps[l]);
550 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
551 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
572 for(
int l=0;l<controlledJoints;l++)
574 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
576 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
599 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
600 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
620 for(
int l=0;l<controlledJoints;l++)
622 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
624 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
647 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
648 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
669 for(
int l=0;l<controlledJoints;l++)
671 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
672 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
695 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
696 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
716 for(
int l=0;l<controlledJoints;l++)
718 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
720 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
730 ret=
ret&&p->pid->getPidOutput(pidtype, off, outs+l);
742 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
743 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
761 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
762 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
782 for(
int l=0;l<controlledJoints;l++)
784 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
785 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
795 bool ok = p->
pid->
getPid(pidtype, off, pids+l);
809 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
810 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
830 for(
int l=0;l<controlledJoints;l++)
832 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
834 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
857 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
858 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
878 for(
int l=0;l<controlledJoints;l++)
880 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
882 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
906 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
907 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
926 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
927 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
941 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
942 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
961 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
962 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
982 *ax=controlledJoints;
988 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
989 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1009 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
1011 allJointsBuffers.fillSubControlBoardBuffersFromCompleteJointVector(refs,remappedControlBoards);
1013 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1017 bool ok = p->
pos->
positionMove(allJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
1018 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1019 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1029 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
1031 selectedJointsBuffers.fillSubControlBoardBuffersFromArbitraryJointVector(refs,n_joints,joints,remappedControlBoards);
1033 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1037 bool ok = p->
pos->
positionMove(selectedJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
1038 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1039 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1048 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1049 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1060 bool ret = p->pos->getTargetPosition(off, ref);
1070 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
1072 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1081 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1082 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1092 allJointsBuffers.fillCompleteJointVectorFromSubControlBoardBuffers(spds,remappedControlBoards);
1101 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
1104 selectedJointsBuffers.resizeSubControlBoardBuffers(n_joints,joints,remappedControlBoards);
1106 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1115 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1116 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1126 selectedJointsBuffers.fillArbitraryJointVectorFromSubControlBoardBuffers(targets,n_joints,joints,remappedControlBoards);
1133 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1134 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1154 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
1156 allJointsBuffers.fillSubControlBoardBuffersFromCompleteJointVector(deltas,remappedControlBoards);
1158 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1162 bool ok = p->
pos->
relativeMove(allJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
1163 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1164 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1174 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
1176 selectedJointsBuffers.fillSubControlBoardBuffersFromArbitraryJointVector(deltas,n_joints,joints,remappedControlBoards);
1178 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1182 bool ok = p->
pos->
relativeMove(selectedJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
1183 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1184 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1193 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1194 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1216 for(
int l=0;l<controlledJoints;l++)
1218 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
1219 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
1230 bool singleJointMotionDone =
false;
1233 *flag = *flag && singleJointMotionDone;
1248 for(
int j=0;j<n_joints;j++)
1252 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
1253 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
1264 bool singleJointMotionDone =
false;
1267 *flag = *flag && singleJointMotionDone;
1280 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1281 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1301 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
1303 allJointsBuffers.fillSubControlBoardBuffersFromCompleteJointVector(spds,remappedControlBoards);
1305 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1309 bool ok = p->
pos->
setRefSpeeds(allJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
1310 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1311 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1321 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
1323 selectedJointsBuffers.fillSubControlBoardBuffersFromArbitraryJointVector(spds,n_joints,joints,remappedControlBoards);
1325 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1329 bool ok = p->
pos->
setRefSpeeds(selectedJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
1330 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1331 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1340 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1341 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1361 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
1363 allJointsBuffers.fillSubControlBoardBuffersFromCompleteJointVector(accs,remappedControlBoards);
1365 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1370 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1371 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1381 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
1383 selectedJointsBuffers.fillSubControlBoardBuffersFromArbitraryJointVector(accs,n_joints,joints,remappedControlBoards);
1385 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1390 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1391 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1400 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1401 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1421 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
1423 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1431 ok = p->
pos->
getRefSpeeds(allJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
1432 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1433 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1443 allJointsBuffers.fillCompleteJointVectorFromSubControlBoardBuffers(spds,remappedControlBoards);
1452 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
1455 selectedJointsBuffers.resizeSubControlBoardBuffers(n_joints,joints,remappedControlBoards);
1457 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1465 ok = p->
pos->
getRefSpeeds(selectedJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
1466 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1467 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1477 selectedJointsBuffers.fillArbitraryJointVectorFromSubControlBoardBuffers(spds,n_joints,joints,remappedControlBoards);
1484 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1485 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1505 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
1507 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1516 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1517 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1527 allJointsBuffers.fillCompleteJointVectorFromSubControlBoardBuffers(accs,remappedControlBoards);
1535 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
1538 selectedJointsBuffers.resizeSubControlBoardBuffers(n_joints,joints,remappedControlBoards);
1540 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1549 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1550 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1560 selectedJointsBuffers.fillArbitraryJointVectorFromSubControlBoardBuffers(accs,n_joints,joints,remappedControlBoards);
1567 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1568 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1588 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
1590 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1596 ok = p->
pos ? p->
pos->
stop(allJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
1597 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data()) :
false;
1608 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
1609 std::lock_guard<std::mutex> lock2(buffers.mutex);
1612 selectedJointsBuffers.fillSubControlBoardBuffersFromArbitraryJointVector(buffers.dummyBuffer.data(),n_joints,joints,remappedControlBoards);
1614 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1618 bool ok = p->
pos->
stop(selectedJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
1619 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data());
1631 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1632 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1652 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
1654 allJointsBuffers.fillSubControlBoardBuffersFromCompleteJointVector(v,remappedControlBoards);
1656 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1660 bool ok = p->
vel->
velocityMove(allJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
1661 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1662 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1672 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1673 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1693 for(
int l=0;l<controlledJoints;l++)
1695 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
1696 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
1719 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1720 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1741 for(
int l=0;l<controlledJoints;l++)
1743 int off = (int) remappedControlBoards.lut[l].axisIndexInSubControlBoard;
1744 size_t subIndex = remappedControlBoards.lut[l].subControlBoardIndex;
1768 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1769 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1790 for(
int l=0;l<controlledJoints;l++)
1792 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
1793 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
1819 for(
int l=0;l<controlledJoints;l++)
1821 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
1822 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
1846 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1847 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1866 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1867 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1888 for(
int l=0;l<controlledJoints;l++)
1890 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
1891 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
1915 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1916 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1937 for(
int l=0;l<controlledJoints;l++)
1939 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
1940 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
1965 *num=controlledJoints;
1971 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
1972 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
1992 for(
int l=0;l<controlledJoints;l++)
1994 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
1995 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
2005 ret=
ret&&p->imotor->getTemperature(off, vals+l);
2017 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2018 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2037 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2038 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2057 int off = (int)remappedControlBoards.lut[m].subControlBoardIndex;
2058 size_t subIndex = remappedControlBoards.lut[m].subControlBoardIndex;
2077 int off = (int)remappedControlBoards.lut[m].subControlBoardIndex;
2078 size_t subIndex = remappedControlBoards.lut[m].subControlBoardIndex;
2102 for (
unsigned int i = 0; i < remappedControlBoards.getNrOfSubControlBoards(); i++)
2134 size_t bottle_size = val.
size();
2135 size_t device_size = remappedControlBoards.getNrOfSubControlBoards();
2136 if (bottle_size != device_size)
2143 for (
unsigned int i = 0; i < device_size; i++)
2167 size_t subIndex = remappedControlBoards.lut[0].subControlBoardIndex;
2187 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2188 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2209 for(
int l=0;l<controlledJoints;l++)
2211 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
2212 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
2236 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2237 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2258 for(
int l=0;l<controlledJoints;l++)
2260 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
2261 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
2286 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2287 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2306 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2307 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2326 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2327 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2348 for(
int l=0;l<controlledJoints;l++)
2350 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
2351 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
2360 ret=
ret&&p->iMotEnc->getMotorEncoder(off, encs+l);
2372 for(
int l=0;l<controlledJoints;l++)
2374 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
2375 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
2399 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2400 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2419 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2420 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2441 for(
int l=0;l<controlledJoints;l++)
2443 int off = (int) remappedControlBoards.lut[l].axisIndexInSubControlBoard;
2444 size_t subIndex = remappedControlBoards.lut[l].subControlBoardIndex;
2468 int off = (int) remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2469 size_t subIndex = remappedControlBoards.lut[m].subControlBoardIndex;
2490 for(
int l=0;l<controlledJoints;l++)
2492 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
2493 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
2519 *num=controlledJoints;
2526 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
2527 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
2553 for(
int l=0;l<controlledJoints;l++)
2555 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
2556 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
2581 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
2582 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
2601 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
2602 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
2621 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
2622 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
2641 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2642 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2661 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2662 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2681 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2682 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2701 int off = (int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2702 size_t subIndex = remappedControlBoards.lut[m].subControlBoardIndex;
2721 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2722 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2740 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2741 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2760 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2761 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2780 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2781 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2803 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
2804 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
2823 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
2824 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
2843 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
2844 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
2863 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
2864 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
2894 if(!getCalibratorDevice())
2896 int off = (int) remappedControlBoards.lut[j].axisIndexInSubControlBoard;
2897 size_t subIndex = remappedControlBoards.lut[j].subControlBoardIndex;
2914 return IRemoteCalibrator::getCalibratorDevice()->calibrateSingleJoint(j);
2920 if(!getCalibratorDevice())
2922 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
2940 return IRemoteCalibrator::getCalibratorDevice()->calibrateWholePart();
2946 if(!getCalibratorDevice())
2948 int off = (int) remappedControlBoards.lut[j].axisIndexInSubControlBoard;
2949 size_t subIndex = remappedControlBoards.lut[j].subControlBoardIndex;
2966 return IRemoteCalibrator::getCalibratorDevice()->homingSingleJoint(j);
2972 if(!getCalibratorDevice())
2975 for(
int l=0;l<controlledJoints;l++)
2977 bool ok = this->homingSingleJoint(l);
2985 return IRemoteCalibrator::getCalibratorDevice()->homingWholePart();
2991 if(!getCalibratorDevice())
2993 int off = (int) remappedControlBoards.lut[j].axisIndexInSubControlBoard;
2994 size_t subIndex = remappedControlBoards.lut[j].subControlBoardIndex;
3011 return getCalibratorDevice()->parkSingleJoint(j, _wait);
3017 if(!getCalibratorDevice())
3021 for(
int l=0; l<controlledJoints; l++)
3024 bool ok = this->parkSingleJoint(l,_wait);
3032 return getCalibratorDevice()->parkWholePart();
3038 if(!getCalibratorDevice())
3040 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3058 return IRemoteCalibrator::getCalibratorDevice()->quitCalibrate();
3064 if(!getCalibratorDevice())
3066 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3084 return IRemoteCalibrator::getCalibratorDevice()->quitPark();
3092 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3093 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3106 int off = (int) remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3107 size_t subIndex = remappedControlBoards.lut[j].subControlBoardIndex;
3121 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3122 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3155 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3156 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3175 int off = (int) remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3176 size_t subIndex = remappedControlBoards.lut[j].subControlBoardIndex;
3197 for(
int l=0;l<controlledJoints;l++)
3199 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
3200 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
3224 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3225 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3244 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
3246 allJointsBuffers.fillSubControlBoardBuffersFromCompleteJointVector(
t,remappedControlBoards);
3248 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3257 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3258 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
3273 int off = (int) remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3274 size_t subIndex = remappedControlBoards.lut[j].subControlBoardIndex;
3292 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
3294 selectedJointsBuffers.fillSubControlBoardBuffersFromArbitraryJointVector(
t,n_joints,joints,remappedControlBoards);
3296 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3301 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3302 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
3311 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3312 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3331 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3332 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3351 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3352 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3371 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3372 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3391 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3392 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3413 for(
int l=0;l<controlledJoints;l++)
3415 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
3416 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
3441 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3442 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3463 for(
int l=0;l<controlledJoints;l++)
3465 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
3466 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
3490 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3491 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3510 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3511 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3530 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3531 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3550 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3551 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3565 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
3567 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3576 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3577 allJointsBuffers.m_bufferForSubControlBoardControlModes[ctrlBrd].data());
3587 allJointsBuffers.fillCompleteJointVectorFromSubControlBoardBuffers(modes,remappedControlBoards);
3596 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
3599 selectedJointsBuffers.resizeSubControlBoardBuffers(n_joints,joints,remappedControlBoards);
3601 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3610 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3611 selectedJointsBuffers.m_bufferForSubControlBoardControlModes[ctrlBrd].data());
3621 selectedJointsBuffers.fillArbitraryJointVectorFromSubControlBoardBuffers(modes,n_joints,joints,remappedControlBoards);
3630 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3631 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3640 ret = p->iMode->setControlMode(off, mode);
3648 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
3650 selectedJointsBuffers.fillSubControlBoardBuffersFromArbitraryJointVector(modes,n_joints,joints,remappedControlBoards);
3652 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3657 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3658 selectedJointsBuffers.m_bufferForSubControlBoardControlModes[ctrlBrd].data());
3668 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
3670 allJointsBuffers.fillSubControlBoardBuffersFromCompleteJointVector(modes,remappedControlBoards);
3672 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3677 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3678 allJointsBuffers.m_bufferForSubControlBoardControlModes[ctrlBrd].data());
3687 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3688 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3708 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
3710 selectedJointsBuffers.fillSubControlBoardBuffersFromArbitraryJointVector(dpos,n_joints,joints,remappedControlBoards);
3712 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3716 bool ok = p->
posDir->
setPositions(selectedJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
3717 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3718 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
3728 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
3730 allJointsBuffers.fillSubControlBoardBuffersFromCompleteJointVector(refs,remappedControlBoards);
3732 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3736 bool ok = p->
posDir->
setPositions(allJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
3737 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3738 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
3747 double averageTimestamp = 0.0;
3748 int collectedTimestamps = 0;
3750 for(
int l=0;l<controlledJoints;l++)
3752 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
3764 collectedTimestamps++;
3769 std::lock_guard<std::mutex> lock(buffers.mutex);
3771 if( collectedTimestamps > 0 )
3773 buffers.stamp.update(averageTimestamp/collectedTimestamps);
3777 buffers.stamp.update();
3780 return buffers.stamp;
3785 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3786 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3797 bool ret = p->posDir->getRefPosition(off, ref);
3807 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
3809 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3818 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3819 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
3829 allJointsBuffers.fillCompleteJointVectorFromSubControlBoardBuffers(spds,remappedControlBoards);
3838 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
3841 selectedJointsBuffers.resizeSubControlBoardBuffers(n_joints,joints,remappedControlBoards);
3843 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3852 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3853 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
3863 selectedJointsBuffers.fillArbitraryJointVectorFromSubControlBoardBuffers(targets,n_joints,joints,remappedControlBoards);
3874 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
3876 selectedJointsBuffers.fillSubControlBoardBuffersFromArbitraryJointVector(spds,n_joints,joints,remappedControlBoards);
3878 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3882 bool ok = p->
vel->
velocityMove(selectedJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
3883 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3884 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
3893 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3894 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3905 bool ret = p->vel->getRefVelocity(off, vel);
3916 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
3918 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3927 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3928 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
3938 allJointsBuffers.fillCompleteJointVectorFromSubControlBoardBuffers(vels,remappedControlBoards);
3946 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
3949 selectedJointsBuffers.resizeSubControlBoardBuffers(n_joints,joints,remappedControlBoards);
3951 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3960 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3961 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
3971 selectedJointsBuffers.fillArbitraryJointVectorFromSubControlBoardBuffers(vels,n_joints,joints,remappedControlBoards);
3978 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3979 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3999 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
4002 selectedJointsBuffers.resizeSubControlBoardBuffers(n_joints,joints,remappedControlBoards);
4004 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
4013 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
4014 selectedJointsBuffers.m_bufferForSubControlBoardInteractionModes[ctrlBrd].data());
4024 selectedJointsBuffers.fillArbitraryJointVectorFromSubControlBoardBuffers(modes,n_joints,joints,remappedControlBoards);
4032 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
4034 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
4043 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
4044 allJointsBuffers.m_bufferForSubControlBoardInteractionModes[ctrlBrd].data());
4054 allJointsBuffers.fillCompleteJointVectorFromSubControlBoardBuffers(modes,remappedControlBoards);
4061 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
4062 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
4082 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
4084 selectedJointsBuffers.fillSubControlBoardBuffersFromArbitraryJointVector(modes,n_joints,joints,remappedControlBoards);
4086 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
4091 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
4092 selectedJointsBuffers.m_bufferForSubControlBoardInteractionModes[ctrlBrd].data());
4102 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
4104 allJointsBuffers.fillSubControlBoardBuffersFromCompleteJointVector(modes,remappedControlBoards);
4106 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
4111 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
4112 allJointsBuffers.m_bufferForSubControlBoardInteractionModes[ctrlBrd].data());
4123 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
4129 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
4140 for(
int l=0;l<controlledJoints;l++)
4142 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
4143 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
4170 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
4176 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
4187 for(
int l=0;l<controlledJoints;l++)
4189 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
4190 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
4217 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
4223 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
4234 for(
int l=0;l<controlledJoints;l++)
4236 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
4237 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
4264 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
4270 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
4281 for(
int l=0;l<controlledJoints;l++)
4283 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
4284 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
4311 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
4317 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
4328 for(
int l=0;l<controlledJoints;l++)
4330 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
4331 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
4358 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
4364 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
4374 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
4376 selectedJointsBuffers.fillSubControlBoardBuffersFromArbitraryJointVector(currs,n_motor,motors,remappedControlBoards);
4378 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
4382 if (!(p && p->
iCurr))
4388 bool ok = p->
iCurr->
setRefCurrents(selectedJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
4389 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
4390 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
4400 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
4402 allJointsBuffers.fillSubControlBoardBuffersFromCompleteJointVector(currs,remappedControlBoards);
4404 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
4409 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
4410 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
4421 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
4427 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
4438 for(
int l=0;l<controlledJoints;l++)
4440 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
4441 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
const yarp::os::LogComponent & CONTROLBOARDREMAPPER()
constexpr yarp::conf::vocab32_t VOCAB_CM_IDLE
bool parkWholePart() override
parkWholePart: start the parking procedure for the whole part
bool setImpedance(int j, double stiff, double damp) override
Set current impedance gains (stiffness,damping) for a specific joint.
bool getPidErrorLimit(const yarp::dev::PidControlTypeEnum &pidtype, int j, double *limit) override
Get the error limit for the controller on a specific joint.
bool setRefAccelerations(const double *accs) override
Set reference acceleration on all joints.
bool resetMotorEncoder(int m) override
Reset motor encoder, single motor.
bool getTorqueRange(int j, double *min, double *max) override
Get the full scale of the torque sensor of a given joint.
bool getTargetPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
bool getMotorEncoderCountsPerRevolution(int m, double *cpr) override
Gets number of counts per revolution for motor encoder m.
bool getAmpStatus(int *st) override
bool setTemperatureLimit(int m, const double val) override
Set the temperature limit for a specific motor.
bool setPid(const yarp::dev::PidControlTypeEnum &pidtype, int j, const yarp::dev::Pid &p) override
ControlBoard methods.
bool setRefCurrent(int m, double curr) override
Set the reference value of the current for a single motor.
bool getEncoderSpeeds(double *spds) override
Read the instantaneous speed of all axes.
bool getControlMode(int j, int *mode) override
Get the current control mode.
bool getRefPositions(double *refs) override
Get the last position reference for all axes.
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 setNominalCurrent(int m, const double val) override
bool getMotorEncoderTimed(int m, double *v, double *t) override
Read the instantaneous position of a motor encoder.
bool getRefCurrents(double *currs) override
Get the reference value of the currents for all motors.
bool close() override
Close the device driver by deallocating all resources and closing ports.
bool getTorques(double *t) override
Get the value of the torque for all joints (this is the feedback if you have torque sensors).
bool getRemoteVariable(std::string key, yarp::os::Bottle &val) override
bool checkMotionDone(int j, bool *flag) override
Check if the current trajectory is terminated.
bool calibrationDone(int j) override
Check if the calibration is terminated, on a particular joint.
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 setPWMLimit(int m, const double val) override
bool getTemperatureLimit(int m, double *val) override
Retreives the current temperature limit for a specific motor.
bool getAxes(int *ax) override
Get the number of controlled axes.
bool setPidOffset(const yarp::dev::PidControlTypeEnum &pidtype, int j, double v) override
Set offset value for a given controller.
bool setEncoder(int j, double val) override
Set the value of the encoder for a given joint.
bool setRefAcceleration(int j, double acc) override
Set reference acceleration for a joint.
bool getPid(const yarp::dev::PidControlTypeEnum &pidtype, int j, yarp::dev::Pid *p) override
Get current pid value for a specific joint.
bool getImpedanceOffset(int j, double *offset) override
Get current force Offset for a specific joint.
bool getEncoderSpeed(int j, double *sp) override
Read the istantaneous speed of an axis.
bool getRefSpeed(int j, double *ref) override
Get reference speed for a joint.
bool resetEncoder(int j) override
Reset encoder, single joint.
bool getDutyCycles(double *vals) override
Gets the current dutycycle of the output of the amplifier (i.e.
bool getEncoderAcceleration(int j, double *acc) override
Read the instantaneous acceleration of an axis.
bool setControlModes(const int n_joints, const int *joints, int *modes) override
Set the current control mode for a subset of axes.
bool getEncoderTimed(int j, double *v, double *t) override
Read the instantaneous acceleration of all axes.
bool getImpedance(int j, double *stiff, double *damp) override
Get current impedance gains (stiffness,damping,offset) for a specific joint.
bool getEncoders(double *encs) override
Read the position of all axes.
bool getRefPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
bool setVelLimits(int j, double min, double max) override
Set the software speed limits for a particular axis, the behavior of the control card when these limi...
bool getEncoder(int j, double *v) override
Read the value of an encoder.
bool getMotorEncoder(int m, double *v) override
Read the value of a motor encoder.
bool getTorqueRanges(double *min, double *max) override
Get the full scale of the torque sensors of all joints.
bool getMotorEncodersTimed(double *encs, double *t) override
Read the instantaneous position of all motor encoders.
bool setRefTorque(int j, double t) override
Set the reference value of the torque for a given joint.
bool getNumberOfMotors(int *num) override
Retrieves the number of controlled axes from the current physical interface.
bool disableAmp(int j) override
Disable the amplifier on a specific joint.
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 getPeakCurrent(int m, double *val) override
bool setGearboxRatio(int m, const double val) override
Set the gearbox ratio for a specific motor.
bool quitCalibrate() override
quitCalibrate: interrupt the calibration procedure
bool calibrateAxisWithParams(int j, unsigned int ui, double v1, double v2, double v3) override
Start calibration, this method is very often platform specific.
bool getAxisName(int j, std::string &name) override
bool getControlModes(int *modes) override
Get the current control mode (multiple joints).
bool getRefTorques(double *refs) override
Get the reference value of the torque for all joints.
bool getPidReferences(const yarp::dev::PidControlTypeEnum &pidtype, double *refs) override
Get the current reference of all pid controllers.
bool isPidEnabled(const yarp::dev::PidControlTypeEnum &pidtype, int j, bool *enabled) override
Get the current status (enabled/disabled) of the pid.
bool getRefVelocity(const int joint, double *vel) override
Get the last reference speed set by velocityMove for single joint.
bool setPidErrorLimits(const yarp::dev::PidControlTypeEnum &pidtype, const double *limits) override
Get the error limit for the controller on all joints.
bool setRefCurrents(const double *currs) override
Set the reference value of the currents for all motors.
bool setMotorTorqueParams(int j, const yarp::dev::MotorTorqueParameters params) override
Set a subset of motor parameters (bemf, ktau etc) useful for torque control.
bool open(yarp::os::Searchable &prop) override
Open the device driver.
bool setPidErrorLimit(const yarp::dev::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
yarp::dev::IRemoteCalibrator * getCalibratorDevice() override
getCalibratorDevice: return the pointer stored with the setCalibratorDevice
bool abortCalibration() override
bool enablePid(const yarp::dev::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 getLimits(int j, double *min, double *max) override
Get the software limits for a particular axis.
bool getRefDutyCycles(double *refs) override
Gets the last reference sent using the setRefDutyCycles function.
bool getPidReference(const yarp::dev::PidControlTypeEnum &pidtype, int j, double *ref) override
Get the current reference of the pid controller for a specific joint.
bool setRefSpeeds(const double *spds) override
Set reference speed on all joints.
bool getNominalCurrent(int m, double *val) override
bool getRefVelocities(double *vels) override
Get the last reference speed set by velocityMove for all joints.
bool setEncoders(const double *vals) override
Set the value of all encoders.
bool getInteractionMode(int j, yarp::dev::InteractionModeEnum *mode) override
Get the current interaction mode of the robot, values can be stiff or compliant.
bool setMotorEncoder(int m, const double val) override
Set the value of the motor encoder for a given motor.
bool getPidErrors(const yarp::dev::PidControlTypeEnum &pidtype, double *errs) override
Get the error of all joints.
bool getPidError(const yarp::dev::PidControlTypeEnum &pidtype, int j, double *err) override
Get the current error for a joint.
bool getPidErrorLimits(const yarp::dev::PidControlTypeEnum &pidtype, double *limits) override
Get the error limit for all controllers.
bool getCurrent(int m, double *curr) override
bool detachAll() override
Detach the object (you must have first called attach).
bool setPids(const yarp::dev::PidControlTypeEnum &pidtype, const yarp::dev::Pid *ps) override
Set new pid value on multiple axes.
bool parkSingleJoint(int j, bool _wait=true) override
parkSingleJoint(): start the parking procedure for the single joint
bool calibrateSingleJoint(int j) override
calibrateSingleJoint: call the calibration procedure for the single joint
bool getRefTorque(int j, double *t) override
Get the reference value of the torque for a given joint.
bool quitPark() override
quitPark: interrupt the park procedure
bool velocityMove(int j, double v) override
Start motion at a given speed, single joint.
bool getRefDutyCycle(int m, double *ref) override
Gets the last reference sent using the setRefDutyCycle function.
bool getNumberOfMotorEncoders(int *num) override
Get the number of available motor encoders.
bool getPidOutput(const yarp::dev::PidControlTypeEnum &pidtype, int j, double *out) override
Get the output of the controller (e.g.
bool getMotorEncoderAcceleration(int m, double *acc) override
Read the instantaneous acceleration of a motor encoder.
bool setLimits(int j, double min, double max) override
Set the software limits for a particular axis, the behavior of the control card when these limits are...
bool setMotorEncoders(const double *vals) override
Set the value of all motor encoders.
bool getMotorEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all motor encoders.
bool setPidReferences(const yarp::dev::PidControlTypeEnum &pidtype, const double *refs) override
Set the controller reference, multiple axes.
bool getTargetPositions(double *refs) override
Get the last position reference for all axes.
bool getPWM(int m, double *val) override
bool setRemoteVariable(std::string key, const yarp::os::Bottle &val) override
bool setImpedanceOffset(int j, double offset) override
Set current force Offset for a specific joint.
bool getPidOutputs(const yarp::dev::PidControlTypeEnum &pidtype, double *outs) override
Get the output of the controllers (e.g.
bool getJointType(int j, yarp::dev::JointTypeEnum &type) override
bool resetEncoders() override
Reset encoders.
bool setRefDutyCycles(const double *refs) override
Sets the reference dutycycle for all the motors.
yarp::os::Stamp getLastInputStamp() override
Return the time stamp relative to the last acquisition.
bool getDutyCycle(int m, double *val) override
Gets the current dutycycle of the output of the amplifier (i.e.
bool getCurrentRanges(double *min, double *max) override
Get the full scale of the current measurements for all motors motor (e.g.
bool attachAll(const yarp::dev::PolyDriverList &l) override
Attach to a list of objects.
bool getMotorTorqueParams(int j, yarp::dev::MotorTorqueParameters *params) override
Get a subset of motor parameters (bemf, ktau etc) useful for torque control.
bool setRefTorques(const double *t) override
Set the reference value of the torque for all joints.
bool resetMotorEncoders() override
Reset motor encoders.
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 getRefCurrent(int m, double *curr) override
Get the reference value of the current for a single motor.
bool setInteractionMode(int j, yarp::dev::InteractionModeEnum mode) override
Set the interaction mode of the robot, values can be stiff or compliant.
bool getGearboxRatio(int m, double *val) override
Get the gearbox ratio for a specific motor.
bool getVelLimits(int j, double *min, double *max) override
Get the software speed limits for a particular axis.
bool getRefAccelerations(double *accs) override
Get reference acceleration of all joints.
bool enableAmp(int j) override
Enable the amplifier on a specific joint.
bool positionMove(int j, double ref) override
Set new reference point for a single axis.
bool disablePid(const yarp::dev::PidControlTypeEnum &pidtype, int j) override
Disable the pid computation for a joint.
bool getTemperatures(double *vals) override
Get temperature of all the motors.
bool resetPid(const yarp::dev::PidControlTypeEnum &pidtype, int j) override
Reset the controller of a given joint, usually sets the current status of the joint as the reference ...
bool getCurrentRange(int m, double *min, double *max) override
Get the full scale of the current measurement for a given motor (e.g.
bool getTemperature(int m, double *val) override
Get temperature of a motor.
bool setControlMode(const int j, const int mode) override
Set the current control mode.
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 abortPark() override
bool isCalibratorDevicePresent(bool *isCalib) override
isCalibratorDevicePresent: check if a calibrator device has been set
bool setMotorEncoderCountsPerRevolution(int m, const double cpr) override
Sets number of counts per revolution for motor encoder m.
bool getPowerSupplyVoltage(int m, double *val) override
bool getMotorEncoders(double *encs) override
Read the position of all motor encoders.
bool setPositions(const int n_joints, const int *joints, const double *dpos) override
Set new reference point for all axes.
bool setCalibrationParameters(int j, const yarp::dev::CalibrationParameters ¶ms) override
Start calibration, this method is very often platform specific.
bool stop() override
Stop motion, multiple joints.
bool getCurrents(double *currs) override
bool getRemoteVariablesList(yarp::os::Bottle *listOfKeys) override
bool getPWMLimit(int m, double *val) override
bool getEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all axes.
bool setPeakCurrent(int m, const double val) override
bool homingWholePart() override
homingWholePart: call the homing procedure for a the whole part/device
bool getMotorEncoderSpeed(int m, double *sp) override
Read the istantaneous speed of a motor encoder.
bool homingSingleJoint(int j) override
homingSingleJoint: call the homing procedure for a single joint
bool getRefAcceleration(int j, double *acc) override
Get reference acceleration for a joint.
bool getEncodersTimed(double *encs, double *t) override
Read the instantaneous acceleration of all axes.
bool getRefSpeeds(double *spds) override
Get reference speed of all joints.
bool setRefDutyCycle(int m, double ref) override
Sets the reference dutycycle to a single motor.
bool getMaxCurrent(int j, double *v) override
Returns the maximum electric current allowed for a given motor.
bool setPidReference(const yarp::dev::PidControlTypeEnum &pidtype, int j, double ref) override
Set the controller reference for a given axis.
bool getMotorEncoderSpeeds(double *spds) override
Read the instantaneous speed of all motor encoders.
bool getPids(const yarp::dev::PidControlTypeEnum &pidtype, yarp::dev::Pid *pids) override
Get current pid value for a specific joint.
bool setPosition(int j, double ref) override
Set new position for a single axis.
bool relativeMove(int j, double delta) override
Set relative position.
yarp::dev::IPositionControl * pos
yarp::dev::IImpedanceControl * iImpedance
yarp::dev::IAmplifierControl * amp
yarp::dev::IEncodersTimed * iJntEnc
yarp::dev::IInteractionMode * iInteract
yarp::dev::IRemoteVariables * iVar
yarp::dev::ICurrentControl * iCurr
yarp::dev::ITorqueControl * iTorque
yarp::dev::IVelocityControl * vel
yarp::dev::IControlMode * iMode
yarp::dev::IPositionDirect * posDir
yarp::dev::IRemoteCalibrator * remcalib
bool attach(yarp::dev::PolyDriver *d, const std::string &id)
yarp::dev::IPidControl * pid
yarp::dev::IAxisInfo * info
yarp::dev::IControlLimits * lim
yarp::dev::IMotor * imotor
yarp::dev::IPWMControl * iPwm
yarp::dev::IControlCalibration * calib
yarp::dev::IMotorEncoders * iMotEnc
void setVerbose(bool _verbose)
yarp::dev::IPreciselyTimed * iTimed
virtual bool getPWMLimit(int j, double *val)
virtual bool enableAmp(int j)=0
Enable the amplifier on a specific joint.
virtual bool setNominalCurrent(int m, const double val)
virtual bool getPWM(int j, double *val)
virtual bool getAmpStatus(int *st)=0
virtual bool setPWMLimit(int j, const double val)
virtual bool getMaxCurrent(int j, double *v)=0
Returns the maximum electric current allowed for a given motor.
virtual bool getNominalCurrent(int m, double *val)
virtual bool getPowerSupplyVoltage(int j, double *val)
virtual bool setMaxCurrent(int j, double v)=0
virtual bool setPeakCurrent(int m, const double val)
virtual bool getPeakCurrent(int m, double *val)
Interface for getting information about specific axes, if available.
virtual bool getAxisName(int axis, std::string &name)=0
virtual bool getJointType(int axis, yarp::dev::JointTypeEnum &type)
virtual bool setCalibrationParameters(int axis, const CalibrationParameters ¶ms)
Start calibration, this method is very often platform specific.
virtual bool calibrationDone(int j)=0
Check if the calibration is terminated, on a particular joint.
virtual bool calibrateAxisWithParams(int axis, unsigned int type, double p1, double p2, double p3)=0
Start calibration, this method is very often platform specific.
virtual bool getVelLimits(int axis, double *min, double *max)=0
Get the software speed limits for a particular axis.
virtual bool getLimits(int axis, double *min, double *max)=0
Get the software limits for a particular axis.
virtual bool setLimits(int axis, double min, double max)=0
Set the software limits for a particular axis, the behavior of the control card when these limits are...
virtual bool setVelLimits(int axis, double min, double max)=0
Set the software speed limits for a particular axis, the behavior of the control card when these limi...
virtual bool setControlModes(const int n_joint, const int *joints, int *modes)=0
Set the current control mode for a subset of axes.
virtual bool getControlModes(int *modes)=0
Get the current control mode (multiple joints).
virtual bool getControlMode(int j, int *mode)=0
Get the current control mode.
virtual bool setRefCurrent(int m, double curr)=0
Set the reference value of the current for a single motor.
virtual bool setRefCurrents(const double *currs)=0
Set the reference value of the currents for all motors.
virtual bool getCurrent(int m, double *curr)=0
Get the instantaneous current measurement for a single motor.
virtual bool getCurrentRange(int m, double *min, double *max)=0
Get the full scale of the current measurement for a given motor (e.g.
virtual bool getRefCurrent(int m, double *curr)=0
Get the reference value of the current for a single motor.
virtual bool getEncoderTimed(int j, double *encs, double *time)=0
Read the instantaneous acceleration of all axes.
Control board, encoder interface.
virtual bool getEncoderSpeed(int j, double *sp)=0
Read the istantaneous speed of an axis.
virtual bool setEncoder(int j, double val)=0
Set the value of the encoder for a given joint.
virtual bool getEncoder(int j, double *v)=0
Read the value of an encoder.
virtual bool resetEncoder(int j)=0
Reset encoder, single joint.
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
virtual bool getEncoderAcceleration(int j, double *spds)=0
Read the instantaneous acceleration of an axis.
virtual bool setImpedance(int j, double stiffness, double damping)=0
Set current impedance gains (stiffness,damping) for a specific joint.
virtual bool getImpedanceOffset(int j, double *offset)=0
Get current force Offset for a specific joint.
virtual bool setImpedanceOffset(int j, double offset)=0
Set current force Offset for a specific joint.
virtual bool getImpedance(int j, double *stiffness, double *damping)=0
Get current impedance gains (stiffness,damping,offset) for a specific joint.
virtual bool getCurrentImpedanceLimit(int j, double *min_stiff, double *max_stiff, double *min_damp, double *max_damp)=0
Get the current impedandance limits for a specific joint.
virtual bool getInteractionMode(int axis, yarp::dev::InteractionModeEnum *mode)=0
Get the current interaction mode of the robot, values can be stiff or compliant.
virtual bool getInteractionModes(int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes)=0
Get the current interaction mode of the robot for a set of joints, values can be stiff or compliant.
virtual bool setInteractionModes(int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes)=0
Set the interaction mode of the robot for a set of joints, values can be stiff or compliant.
virtual bool setInteractionMode(int axis, yarp::dev::InteractionModeEnum mode)=0
Set the interaction mode of the robot, values can be stiff or compliant.
virtual bool getMotorEncoderCountsPerRevolution(int m, double *cpr)=0
Gets number of counts per revolution for motor encoder m.
virtual bool setMotorEncoderCountsPerRevolution(int m, const double cpr)=0
Sets number of counts per revolution for motor encoder m.
virtual bool resetMotorEncoder(int m)=0
Reset motor encoder, single motor.
virtual bool getMotorEncoderSpeed(int m, double *sp)=0
Read the istantaneous speed of a motor encoder.
virtual bool getMotorEncoderTimed(int m, double *encs, double *time)=0
Read the instantaneous position of a motor encoder.
virtual bool getMotorEncoderAcceleration(int m, double *acc)=0
Read the instantaneous acceleration of a motor encoder.
virtual bool setMotorEncoder(int m, const double val)=0
Set the value of the motor encoder for a given motor.
virtual bool getMotorEncoder(int m, double *v)=0
Read the value of a motor encoder.
virtual bool getTemperature(int m, double *val)=0
Get temperature of a motor.
virtual bool getTemperatureLimit(int m, double *temp)=0
Retreives the current temperature limit for a specific motor.
virtual bool getGearboxRatio(int m, double *val)
Get the gearbox ratio for a specific motor.
virtual bool setTemperatureLimit(int m, const double temp)=0
Set the temperature limit for a specific motor.
virtual bool setGearboxRatio(int m, const double val)
Set the gearbox ratio for a specific motor.
virtual bool getDutyCycle(int m, double *val)=0
Gets the current dutycycle of the output of the amplifier (i.e.
virtual bool setRefDutyCycle(int m, double ref)=0
Sets the reference dutycycle to a single motor.
virtual bool getRefDutyCycle(int m, double *ref)=0
Gets the last reference sent using the setRefDutyCycle function.
virtual bool setPid(const PidControlTypeEnum &pidtype, int j, const Pid &pid)=0
Set new pid value for a joint axis.
virtual bool getPidReference(const PidControlTypeEnum &pidtype, int j, double *ref)=0
Get the current reference of the pid controller for a specific joint.
virtual bool getPidOutput(const PidControlTypeEnum &pidtype, int j, double *out)=0
Get the output of the controller (e.g.
virtual bool resetPid(const PidControlTypeEnum &pidtype, int j)=0
Reset the controller of a given joint, usually sets the current status of the joint as the reference ...
virtual bool setPidOffset(const PidControlTypeEnum &pidtype, int j, double v)=0
Set offset value for a given controller.
virtual bool getPidError(const PidControlTypeEnum &pidtype, int j, double *err)=0
Get the current error for a joint.
virtual bool getPidErrorLimit(const PidControlTypeEnum &pidtype, int j, double *limit)=0
Get the error limit for the controller on a specific joint.
virtual bool setPidErrorLimit(const PidControlTypeEnum &pidtype, int j, double limit)=0
Set the error limit for the controller on a specifi joint.
virtual bool disablePid(const PidControlTypeEnum &pidtype, int j)=0
Disable the pid computation for a joint.
virtual bool setPidReference(const PidControlTypeEnum &pidtype, int j, double ref)=0
Set the controller reference for a given axis.
virtual bool enablePid(const PidControlTypeEnum &pidtype, int j)=0
Enable the pid computation for a joint.
virtual bool isPidEnabled(const PidControlTypeEnum &pidtype, int j, bool *enabled)=0
Get the current status (enabled/disabled) of the pid.
virtual bool getPid(const PidControlTypeEnum &pidtype, int j, Pid *pid)=0
Get current pid value for a specific joint.
virtual bool getRefAcceleration(int j, double *acc)=0
Get reference acceleration for a joint.
virtual bool setRefSpeed(int j, double sp)=0
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
virtual bool setRefAcceleration(int j, double acc)=0
Set reference acceleration for a joint.
virtual bool relativeMove(int j, double delta)=0
Set relative position.
virtual bool setRefSpeeds(const double *spds)=0
Set reference speed on all joints.
virtual bool checkMotionDone(int j, bool *flag)=0
Check if the current trajectory is terminated.
virtual bool getRefSpeeds(double *spds)=0
Get reference speed of all joints.
virtual bool stop(int j)=0
Stop motion, single joint.
virtual bool setRefAccelerations(const double *accs)=0
Set reference acceleration on all joints.
virtual bool getRefAccelerations(double *accs)=0
Get reference acceleration of all joints.
virtual bool getRefSpeed(int j, double *ref)=0
Get reference speed for a joint.
virtual bool positionMove(int j, double ref)=0
Set new reference point for a single axis.
virtual bool getTargetPositions(double *refs)
Get the last position reference for all axes.
virtual bool getRefPositions(double *refs)
Get the last position reference for all axes.
virtual bool setPositions(const int n_joint, const int *joints, const double *refs)=0
Set new reference point for all axes.
virtual bool setPosition(int j, double ref)=0
Set new position for a single axis.
virtual yarp::os::Stamp getLastInputStamp()=0
Return the time stamp relative to the last acquisition.
IRemoteCalibrator interface is meant to remotize the access of the calibration device in order to all...
virtual bool homingSingleJoint(int j)=0
homingSingleJoint: call the homing procedure for a single joint
virtual bool isCalibratorDevicePresent(bool *isCalib)
isCalibratorDevicePresent: check if a calibrator device has been set
virtual bool quitPark()=0
quitPark: interrupt the park procedure
virtual bool parkSingleJoint(int j, bool _wait=true)=0
parkSingleJoint(): start the parking procedure for the single joint
virtual bool calibrateSingleJoint(int j)=0
calibrateSingleJoint: call the calibration procedure for the single joint
virtual bool calibrateWholePart()=0
calibrateWholePart: call the procedure for calibrating the whole device
virtual bool quitCalibrate()=0
quitCalibrate: interrupt the calibration procedure
virtual yarp::dev::IRemoteCalibrator * getCalibratorDevice()
getCalibratorDevice: return the pointer stored with the setCalibratorDevice
virtual bool setRemoteVariable(std::string key, const yarp::os::Bottle &val)=0
virtual bool getRemoteVariable(std::string key, yarp::os::Bottle &val)=0
virtual bool getRemoteVariablesList(yarp::os::Bottle *listOfKeys)=0
virtual bool setRefTorque(int j, double t)=0
Set the reference value of the torque for a given joint.
virtual bool setRefTorques(const double *t)=0
Set the reference value of the torque for all joints.
virtual bool setMotorTorqueParams(int j, const yarp::dev::MotorTorqueParameters params)
Set a subset of motor parameters (bemf, ktau etc) useful for torque control.
virtual bool getMotorTorqueParams(int j, yarp::dev::MotorTorqueParameters *params)
Get a subset of motor parameters (bemf, ktau etc) useful for torque control.
virtual bool getTorqueRange(int j, double *min, double *max)=0
Get the full scale of the torque sensor of a given joint.
virtual bool getRefTorque(int j, double *t)=0
Get the reference value of the torque for a given joint.
virtual bool getTorque(int j, double *t)=0
Get the value of the torque on a given joint (this is the feedback if you have a torque sensor).
virtual bool velocityMove(int j, double sp)=0
Start motion at a given speed, single joint.
virtual bool getRefVelocities(double *vels)
Get the last reference speed set by velocityMove for all joints.
Contains the parameters for a PID.
A simple collection of objects that can be described and transmitted in a portable way.
void fromString(const std::string &text)
Initializes bottle from a string.
void append(const Bottle &alt)
Append the content of the given bottle to the current list.
size_type size() const
Gets the number of elements in the bottle.
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
std::string toString() const override
Gives a human-readable textual representation of the bottle.
A class for storing options and configuration information.
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
void fromString(const std::string &txt, bool wipe=true)
Interprets a string as a list of properties.
bool check(const std::string &key) const override
Check if there exists a property of the given name.
Bottle & findGroup(const std::string &key) const override
Gets a list corresponding to a given keyword.
A base class for nested structures that can be searched.
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
An abstraction for a time stamp and/or sequence number.
double getTime() const
Get the time stamp.
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 yCWarning(component,...)
An interface for the device drivers.
An interface to the operating system, including Port based communication.
size_t indexOfSubDeviceInPolyDriverList