37 _verb = (prop.
check(
"verbose",
"if present, give detailed output"));
43 if(!parseOptions(prop))
51 bool ControlBoardRemapper::parseOptions(
Property& prop)
55 usingAxesNamesForAttachAll = prop.
check(
"axesNames",
"list of networks merged by this wrapper");
56 usingNetworksForAttachAll = prop.
check(
"networks",
"list of networks merged by this wrapper");
59 if( usingAxesNamesForAttachAll &&
60 usingNetworksForAttachAll )
66 if( !usingAxesNamesForAttachAll &&
67 !usingNetworksForAttachAll )
73 if( usingAxesNamesForAttachAll )
75 ok = parseAxesNames(prop);
78 if( usingNetworksForAttachAll )
80 ok = parseNetworks(prop);
86 bool ControlBoardRemapper::parseAxesNames(
const Property& prop)
89 if(propAxesNames==
nullptr)
95 axesNames.resize(propAxesNames->
size());
96 for(
size_t ax=0; ax < propAxesNames->
size(); ax++)
101 this->setNrOfControlledAxes(axesNames.size());
106 bool ControlBoardRemapper::parseNetworks(
const Property& prop)
115 if (!prop.
check(
"joints",
"number of joints of the part"))
121 this->setNrOfControlledAxes((
size_t)prop.
find(
"joints").
asInt32());
123 int nsubdevices=nets->
size();
124 remappedControlBoards.lut.resize(controlledJoints);
125 remappedControlBoards.subdevices.resize(nsubdevices);
128 for(
size_t k=0;k<nets->
size();k++)
138 if(parameters.
size()==2)
148 if(tmpBot.
size() != 4)
151 <<
"Check network parameters in part description"
152 <<
"--> I was expecting" << nets->
get(k).
asString() <<
"followed by a list of four integers in parenthesis"
168 else if (parameters.
size()==5)
179 <<
"Check network parameters in part description"
180 <<
"--> I was expecting" << nets->
get(k).
asString() <<
"followed by a list of four integers in parenthesis"
188 if( (wTop-wBase) != (top-base) )
191 <<
"Check network parameters in network " << nets->
get(k).
asString().c_str()
192 <<
"I was expecting a well form quadruple of numbers, got instead: "<< parameters.
toString().c_str();
197 for(
int j=wBase;j<=wTop;j++)
200 remappedControlBoards.lut[j].subControlBoardIndex=k;
201 remappedControlBoards.lut[j].axisIndexInSubControlBoard=base+off;
208 void ControlBoardRemapper::setNrOfControlledAxes(
const size_t nrOfControlledAxes)
210 controlledJoints = nrOfControlledAxes;
211 buffers.controlBoardModes.resize(nrOfControlledAxes,0);
212 buffers.dummyBuffer.resize(nrOfControlledAxes,0.0);
216 bool ControlBoardRemapper::updateAxesName()
219 axesNames.resize(controlledJoints);
221 for(
int l=0; l < controlledJoints; l++)
223 std::string axNameYARP;
224 bool ok = this->getAxisName(l,axNameYARP);
227 axesNames[l] = axNameYARP;
242 if( usingAxesNamesForAttachAll )
244 ok = attachAllUsingAxesNames(polylist);
247 if( usingNetworksForAttachAll )
249 ok = attachAllUsingNetworks(polylist);
254 for(
unsigned int k=0; k<remappedControlBoards.getNrOfSubControlBoards(); k++)
256 if (!remappedControlBoards.subdevices[k].isAttached())
286 bool ControlBoardRemapper::attachAllUsingAxesNames(
const PolyDriverList& polylist)
288 std::map<std::string, axisLocation> axesLocationMap;
290 for(
int p=0;p<polylist.
size();p++)
295 std::string deviceKey=polylist[p]->key;
296 if(deviceKey ==
"Calibrator" || deviceKey ==
"calibrator")
300 polylist[p]->poly->view(calibrator);
302 IRemoteCalibrator::setCalibratorDevice(calibrator);
309 polylist[p]->poly->view(iaxinfos);
310 polylist[p]->poly->view(iencs);
315 yCError(
CONTROLBOARDREMAPPER) <<
"subdevice" << deviceKey <<
"does not implemented the required IAxisInfo or IEncoders interfaces";
319 int nrOfSubdeviceAxes;
320 bool ok = iencs->
getAxes(&nrOfSubdeviceAxes);
328 for(
int axInSubDevice =0; axInSubDevice < nrOfSubdeviceAxes; axInSubDevice++)
330 std::string axNameYARP;
331 ok = iaxinfos->
getAxisName(axInSubDevice,axNameYARP);
333 std::string axName = axNameYARP;
341 auto it = axesLocationMap.find(axName);
342 if( it != axesLocationMap.end() )
345 <<
"multiple axes have the same name" << axName
346 <<
"on on device " << polylist[p]->key <<
"with index" << axInSubDevice
347 <<
"and another on device" << it->second.subDeviceKey <<
"with index" << it->second.indexInSubDevice;
355 axesLocationMap[axName] = newLocation;
360 std::vector<std::string> subControlBoardsKeys;
361 std::map<std::string, size_t> subControlBoardKey2IndexInPolyDriverList;
362 std::map<std::string, size_t> subControlBoardKey2IndexInRemappedControlBoards;
367 for(
const auto& axesName : axesNames)
369 auto it = axesLocationMap.find(axesName);
370 if( it == axesLocationMap.end() )
373 <<
"axis " << axesName
374 <<
"specified in axesNames was not found in the axes of the controlboards passed to attachAll, attachAll failed.";
381 if(std::find(subControlBoardsKeys.begin(), subControlBoardsKeys.end(), key) == subControlBoardsKeys.end())
384 subControlBoardKey2IndexInRemappedControlBoards[key] = subControlBoardsKeys.size();
385 subControlBoardsKeys.push_back(key);
390 assert(controlledJoints == (
int) axesNames.size());
393 size_t nrOfSubControlBoards = subControlBoardsKeys.size();
394 remappedControlBoards.lut.resize(controlledJoints);
395 remappedControlBoards.subdevices.resize(nrOfSubControlBoards);
398 for(
size_t ctrlBrd=0; ctrlBrd < nrOfSubControlBoards; ctrlBrd++)
400 size_t p = subControlBoardKey2IndexInPolyDriverList[subControlBoardsKeys[ctrlBrd]];
403 tmpDevice->
id = subControlBoardsKeys[ctrlBrd];
404 bool ok = tmpDevice->
attach(polylist[p]->poly,subControlBoardsKeys[ctrlBrd]);
413 for(
size_t l=0; l < axesNames.size(); l++)
416 remappedControlBoards.lut[l].subControlBoardIndex = subControlBoardKey2IndexInRemappedControlBoards[loc.
subDeviceKey];
417 remappedControlBoards.lut[l].axisIndexInSubControlBoard = (size_t)loc.
indexInSubDevice;
424 bool ControlBoardRemapper::attachAllUsingNetworks(
const PolyDriverList &polylist)
426 for(
int p=0;p<polylist.
size();p++)
429 std::string subDeviceKey = polylist[p]->key;
430 if(subDeviceKey ==
"Calibrator" || subDeviceKey ==
"calibrator")
434 polylist[p]->poly->view(calibrator);
436 IRemoteCalibrator::setCalibratorDevice(calibrator);
442 for(k=0; k<remappedControlBoards.getNrOfSubControlBoards(); k++)
444 if (remappedControlBoards.subdevices[k].id==subDeviceKey)
446 if (!remappedControlBoards.subdevices[k].attach(polylist[p]->poly, subDeviceKey))
455 bool ok = updateAxesName();
469 int devices=remappedControlBoards.getNrOfSubControlBoards();
470 for(
int k=0;k<devices;k++)
471 remappedControlBoards.getSubControlBoard(k)->detach();
473 IRemoteCalibrator::releaseCalibratorDevice();
477 void ControlBoardRemapper::configureBuffers()
479 allJointsBuffers.configure(remappedControlBoards);
480 selectedJointsBuffers.configure(remappedControlBoards);
484 bool ControlBoardRemapper::setControlModeAllAxes(
const int cm)
486 std::lock_guard<std::mutex> lock(buffers.mutex);
488 for(
int j=0; j < controlledJoints; j++)
490 buffers.controlBoardModes[j] = cm;
493 return this->setControlModes(buffers.controlBoardModes.data());
505 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
506 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
526 for(
int l=0;l<controlledJoints;l++)
528 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
530 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
540 bool ok = p->
pid->
setPid(pidtype, off, ps[l]);
553 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
554 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
575 for(
int l=0;l<controlledJoints;l++)
577 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
579 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
602 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
603 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
623 for(
int l=0;l<controlledJoints;l++)
625 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
627 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
650 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
651 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
672 for(
int l=0;l<controlledJoints;l++)
674 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
675 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
698 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
699 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
719 for(
int l=0;l<controlledJoints;l++)
721 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
723 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
733 ret=
ret&&p->pid->getPidOutput(pidtype, off, outs+l);
745 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
746 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
764 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
765 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
785 for(
int l=0;l<controlledJoints;l++)
787 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
788 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
798 bool ok = p->
pid->
getPid(pidtype, off, pids+l);
812 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
813 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
833 for(
int l=0;l<controlledJoints;l++)
835 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
837 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
860 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
861 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
881 for(
int l=0;l<controlledJoints;l++)
883 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
885 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
909 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
910 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
929 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
930 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
944 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
945 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
964 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
965 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
985 *ax=controlledJoints;
991 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
992 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1012 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
1014 allJointsBuffers.fillSubControlBoardBuffersFromCompleteJointVector(refs,remappedControlBoards);
1016 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1020 bool ok = p->
pos->
positionMove(allJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
1021 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1022 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1032 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
1034 selectedJointsBuffers.fillSubControlBoardBuffersFromArbitraryJointVector(refs,n_joints,joints,remappedControlBoards);
1036 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1040 bool ok = p->
pos->
positionMove(selectedJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
1041 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1042 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1051 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1052 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1063 bool ret = p->pos->getTargetPosition(off, ref);
1073 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
1075 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1084 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1085 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1095 allJointsBuffers.fillCompleteJointVectorFromSubControlBoardBuffers(spds,remappedControlBoards);
1104 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
1107 selectedJointsBuffers.resizeSubControlBoardBuffers(n_joints,joints,remappedControlBoards);
1109 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1118 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1119 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1129 selectedJointsBuffers.fillArbitraryJointVectorFromSubControlBoardBuffers(targets,n_joints,joints,remappedControlBoards);
1136 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1137 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1157 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
1159 allJointsBuffers.fillSubControlBoardBuffersFromCompleteJointVector(deltas,remappedControlBoards);
1161 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1165 bool ok = p->
pos->
relativeMove(allJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
1166 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1167 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1177 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
1179 selectedJointsBuffers.fillSubControlBoardBuffersFromArbitraryJointVector(deltas,n_joints,joints,remappedControlBoards);
1181 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1185 bool ok = p->
pos->
relativeMove(selectedJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
1186 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1187 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1196 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1197 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1219 for(
int l=0;l<controlledJoints;l++)
1221 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
1222 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
1233 bool singleJointMotionDone =
false;
1236 *flag = *flag && singleJointMotionDone;
1251 for(
int j=0;j<n_joints;j++)
1255 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
1256 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
1267 bool singleJointMotionDone =
false;
1270 *flag = *flag && singleJointMotionDone;
1283 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1284 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1304 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
1306 allJointsBuffers.fillSubControlBoardBuffersFromCompleteJointVector(spds,remappedControlBoards);
1308 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1312 bool ok = p->
pos->
setRefSpeeds(allJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
1313 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1314 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1324 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
1326 selectedJointsBuffers.fillSubControlBoardBuffersFromArbitraryJointVector(spds,n_joints,joints,remappedControlBoards);
1328 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1332 bool ok = p->
pos->
setRefSpeeds(selectedJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
1333 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1334 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1343 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1344 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1364 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
1366 allJointsBuffers.fillSubControlBoardBuffersFromCompleteJointVector(accs,remappedControlBoards);
1368 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1373 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1374 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1384 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
1386 selectedJointsBuffers.fillSubControlBoardBuffersFromArbitraryJointVector(accs,n_joints,joints,remappedControlBoards);
1388 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1393 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1394 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1403 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1404 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1424 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
1426 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1434 ok = p->
pos->
getRefSpeeds(allJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
1435 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1436 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1446 allJointsBuffers.fillCompleteJointVectorFromSubControlBoardBuffers(spds,remappedControlBoards);
1455 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
1458 selectedJointsBuffers.resizeSubControlBoardBuffers(n_joints,joints,remappedControlBoards);
1460 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1468 ok = p->
pos->
getRefSpeeds(selectedJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
1469 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1470 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1480 selectedJointsBuffers.fillArbitraryJointVectorFromSubControlBoardBuffers(spds,n_joints,joints,remappedControlBoards);
1487 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1488 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1508 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
1510 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1519 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1520 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1530 allJointsBuffers.fillCompleteJointVectorFromSubControlBoardBuffers(accs,remappedControlBoards);
1538 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
1541 selectedJointsBuffers.resizeSubControlBoardBuffers(n_joints,joints,remappedControlBoards);
1543 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1552 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1553 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1563 selectedJointsBuffers.fillArbitraryJointVectorFromSubControlBoardBuffers(accs,n_joints,joints,remappedControlBoards);
1570 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1571 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1591 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
1593 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1599 ok = p->
pos ? p->
pos->
stop(allJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
1600 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data()) :
false;
1611 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
1612 std::lock_guard<std::mutex> lock2(buffers.mutex);
1615 selectedJointsBuffers.fillSubControlBoardBuffersFromArbitraryJointVector(buffers.dummyBuffer.data(),n_joints,joints,remappedControlBoards);
1617 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1621 bool ok = p->
pos->
stop(selectedJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
1622 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data());
1634 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1635 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1655 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
1657 allJointsBuffers.fillSubControlBoardBuffersFromCompleteJointVector(v,remappedControlBoards);
1659 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
1663 bool ok = p->
vel->
velocityMove(allJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
1664 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
1665 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
1675 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1676 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1696 for(
int l=0;l<controlledJoints;l++)
1698 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
1699 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
1722 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1723 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1744 for(
int l=0;l<controlledJoints;l++)
1746 int off = (int) remappedControlBoards.lut[l].axisIndexInSubControlBoard;
1747 size_t subIndex = remappedControlBoards.lut[l].subControlBoardIndex;
1771 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1772 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1793 for(
int l=0;l<controlledJoints;l++)
1795 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
1796 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
1822 for(
int l=0;l<controlledJoints;l++)
1824 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
1825 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
1849 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1850 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1869 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1870 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1891 for(
int l=0;l<controlledJoints;l++)
1893 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
1894 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
1918 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
1919 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
1940 for(
int l=0;l<controlledJoints;l++)
1942 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
1943 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
1968 *num=controlledJoints;
1974 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
1975 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
1995 for(
int l=0;l<controlledJoints;l++)
1997 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
1998 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
2008 ret=
ret&&p->imotor->getTemperature(off, vals+l);
2020 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2021 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2040 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2041 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2060 int off = (int)remappedControlBoards.lut[m].subControlBoardIndex;
2061 size_t subIndex = remappedControlBoards.lut[m].subControlBoardIndex;
2080 int off = (int)remappedControlBoards.lut[m].subControlBoardIndex;
2081 size_t subIndex = remappedControlBoards.lut[m].subControlBoardIndex;
2105 for (
unsigned int i = 0; i < remappedControlBoards.getNrOfSubControlBoards(); i++)
2137 size_t bottle_size = val.
size();
2138 size_t device_size = remappedControlBoards.getNrOfSubControlBoards();
2139 if (bottle_size != device_size)
2146 for (
unsigned int i = 0; i < device_size; i++)
2170 size_t subIndex = remappedControlBoards.lut[0].subControlBoardIndex;
2190 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2191 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2212 for(
int l=0;l<controlledJoints;l++)
2214 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
2215 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
2239 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2240 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2261 for(
int l=0;l<controlledJoints;l++)
2263 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
2264 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
2289 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2290 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2309 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2310 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2329 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2330 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2351 for(
int l=0;l<controlledJoints;l++)
2353 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
2354 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
2362 ret=
ret&&p->iMotEnc->getMotorEncoder(off, encs+l);
2374 for(
int l=0;l<controlledJoints;l++)
2376 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
2377 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
2401 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2402 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2421 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2422 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2443 for(
int l=0;l<controlledJoints;l++)
2445 int off = (int) remappedControlBoards.lut[l].axisIndexInSubControlBoard;
2446 size_t subIndex = remappedControlBoards.lut[l].subControlBoardIndex;
2470 int off = (int) remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2471 size_t subIndex = remappedControlBoards.lut[m].subControlBoardIndex;
2492 for(
int l=0;l<controlledJoints;l++)
2494 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
2495 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
2521 *num=controlledJoints;
2528 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
2529 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
2555 for(
int l=0;l<controlledJoints;l++)
2557 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
2558 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
2583 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
2584 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
2603 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
2604 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
2623 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
2624 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
2643 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2644 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2663 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2664 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2683 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2684 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2703 int off = (int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2704 size_t subIndex = remappedControlBoards.lut[m].subControlBoardIndex;
2723 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2724 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2742 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2743 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2762 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2763 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2782 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
2783 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
2805 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
2806 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
2825 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
2826 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
2845 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
2846 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
2865 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
2866 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
2896 if(!getCalibratorDevice())
2898 int off = (int) remappedControlBoards.lut[j].axisIndexInSubControlBoard;
2899 size_t subIndex = remappedControlBoards.lut[j].subControlBoardIndex;
2916 return IRemoteCalibrator::getCalibratorDevice()->calibrateSingleJoint(j);
2922 if(!getCalibratorDevice())
2924 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
2942 return IRemoteCalibrator::getCalibratorDevice()->calibrateWholePart();
2948 if(!getCalibratorDevice())
2950 int off = (int) remappedControlBoards.lut[j].axisIndexInSubControlBoard;
2951 size_t subIndex = remappedControlBoards.lut[j].subControlBoardIndex;
2968 return IRemoteCalibrator::getCalibratorDevice()->homingSingleJoint(j);
2974 if(!getCalibratorDevice())
2977 for(
int l=0;l<controlledJoints;l++)
2979 bool ok = this->homingSingleJoint(l);
2987 return IRemoteCalibrator::getCalibratorDevice()->homingWholePart();
2993 if(!getCalibratorDevice())
2995 int off = (int) remappedControlBoards.lut[j].axisIndexInSubControlBoard;
2996 size_t subIndex = remappedControlBoards.lut[j].subControlBoardIndex;
3013 return getCalibratorDevice()->parkSingleJoint(j, _wait);
3019 if(!getCalibratorDevice())
3023 for(
int l=0; l<controlledJoints; l++)
3026 bool ok = this->parkSingleJoint(l,_wait);
3034 return getCalibratorDevice()->parkWholePart();
3040 if(!getCalibratorDevice())
3042 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3060 return IRemoteCalibrator::getCalibratorDevice()->quitCalibrate();
3066 if(!getCalibratorDevice())
3068 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3086 return IRemoteCalibrator::getCalibratorDevice()->quitPark();
3094 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3095 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3108 int off = (int) remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3109 size_t subIndex = remappedControlBoards.lut[j].subControlBoardIndex;
3123 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3124 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3157 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3158 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3177 int off = (int) remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3178 size_t subIndex = remappedControlBoards.lut[j].subControlBoardIndex;
3199 for(
int l=0;l<controlledJoints;l++)
3201 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
3202 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
3226 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3227 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3246 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
3248 allJointsBuffers.fillSubControlBoardBuffersFromCompleteJointVector(
t,remappedControlBoards);
3250 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3259 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3260 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
3275 int off = (int) remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3276 size_t subIndex = remappedControlBoards.lut[j].subControlBoardIndex;
3294 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
3296 selectedJointsBuffers.fillSubControlBoardBuffersFromArbitraryJointVector(
t,n_joints,joints,remappedControlBoards);
3298 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3303 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3304 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
3313 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3314 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3333 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3334 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3353 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3354 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3373 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3374 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3393 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3394 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3415 for(
int l=0;l<controlledJoints;l++)
3417 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
3418 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
3443 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3444 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3465 for(
int l=0;l<controlledJoints;l++)
3467 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
3468 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
3492 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3493 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3512 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3513 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3532 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3533 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3552 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3553 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3566 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
3568 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3577 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3578 allJointsBuffers.m_bufferForSubControlBoardControlModes[ctrlBrd].data());
3588 allJointsBuffers.fillCompleteJointVectorFromSubControlBoardBuffers(modes,remappedControlBoards);
3597 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
3600 selectedJointsBuffers.resizeSubControlBoardBuffers(n_joints,joints,remappedControlBoards);
3602 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3611 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3612 selectedJointsBuffers.m_bufferForSubControlBoardControlModes[ctrlBrd].data());
3622 selectedJointsBuffers.fillArbitraryJointVectorFromSubControlBoardBuffers(modes,n_joints,joints,remappedControlBoards);
3631 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3632 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3641 ret = p->iMode->setControlMode(off, mode);
3649 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
3651 selectedJointsBuffers.fillSubControlBoardBuffersFromArbitraryJointVector(modes,n_joints,joints,remappedControlBoards);
3653 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3658 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3659 selectedJointsBuffers.m_bufferForSubControlBoardControlModes[ctrlBrd].data());
3669 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
3671 allJointsBuffers.fillSubControlBoardBuffersFromCompleteJointVector(modes,remappedControlBoards);
3673 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3678 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3679 allJointsBuffers.m_bufferForSubControlBoardControlModes[ctrlBrd].data());
3688 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3689 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3709 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
3711 selectedJointsBuffers.fillSubControlBoardBuffersFromArbitraryJointVector(dpos,n_joints,joints,remappedControlBoards);
3713 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3717 bool ok = p->
posDir->
setPositions(selectedJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
3718 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3719 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
3729 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
3731 allJointsBuffers.fillSubControlBoardBuffersFromCompleteJointVector(refs,remappedControlBoards);
3733 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3737 bool ok = p->
posDir->
setPositions(allJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
3738 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3739 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
3748 double averageTimestamp = 0.0;
3749 int collectedTimestamps = 0;
3751 for(
int l=0;l<controlledJoints;l++)
3753 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
3765 collectedTimestamps++;
3770 std::lock_guard<std::mutex> lock(buffers.mutex);
3772 if( collectedTimestamps > 0 )
3774 buffers.stamp.update(averageTimestamp/collectedTimestamps);
3778 buffers.stamp.update();
3781 return buffers.stamp;
3786 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3787 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3798 bool ret = p->posDir->getRefPosition(off, ref);
3808 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
3810 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3819 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3820 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
3830 allJointsBuffers.fillCompleteJointVectorFromSubControlBoardBuffers(spds,remappedControlBoards);
3839 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
3842 selectedJointsBuffers.resizeSubControlBoardBuffers(n_joints,joints,remappedControlBoards);
3844 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3853 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3854 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
3864 selectedJointsBuffers.fillArbitraryJointVectorFromSubControlBoardBuffers(targets,n_joints,joints,remappedControlBoards);
3876 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
3878 selectedJointsBuffers.fillSubControlBoardBuffersFromArbitraryJointVector(spds,n_joints,joints,remappedControlBoards);
3880 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3884 bool ok = p->
vel->
velocityMove(selectedJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
3885 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3886 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
3895 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3896 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
3907 bool ret = p->vel->getRefVelocity(off, vel);
3918 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
3920 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3929 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3930 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
3940 allJointsBuffers.fillCompleteJointVectorFromSubControlBoardBuffers(vels,remappedControlBoards);
3948 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
3951 selectedJointsBuffers.resizeSubControlBoardBuffers(n_joints,joints,remappedControlBoards);
3953 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
3962 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
3963 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
3973 selectedJointsBuffers.fillArbitraryJointVectorFromSubControlBoardBuffers(vels,n_joints,joints,remappedControlBoards);
3980 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
3981 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
4001 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
4004 selectedJointsBuffers.resizeSubControlBoardBuffers(n_joints,joints,remappedControlBoards);
4006 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
4015 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
4016 selectedJointsBuffers.m_bufferForSubControlBoardInteractionModes[ctrlBrd].data());
4026 selectedJointsBuffers.fillArbitraryJointVectorFromSubControlBoardBuffers(modes,n_joints,joints,remappedControlBoards);
4034 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
4036 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
4045 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
4046 allJointsBuffers.m_bufferForSubControlBoardInteractionModes[ctrlBrd].data());
4056 allJointsBuffers.fillCompleteJointVectorFromSubControlBoardBuffers(modes,remappedControlBoards);
4063 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
4064 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
4084 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
4086 selectedJointsBuffers.fillSubControlBoardBuffersFromArbitraryJointVector(modes,n_joints,joints,remappedControlBoards);
4088 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
4093 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
4094 selectedJointsBuffers.m_bufferForSubControlBoardInteractionModes[ctrlBrd].data());
4104 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
4106 allJointsBuffers.fillSubControlBoardBuffersFromCompleteJointVector(modes,remappedControlBoards);
4108 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
4113 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
4114 allJointsBuffers.m_bufferForSubControlBoardInteractionModes[ctrlBrd].data());
4125 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
4131 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
4142 for(
int l=0;l<controlledJoints;l++)
4144 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
4145 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
4172 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
4178 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
4189 for(
int l=0;l<controlledJoints;l++)
4191 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
4192 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
4219 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
4225 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
4236 for(
int l=0;l<controlledJoints;l++)
4238 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
4239 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
4266 size_t subIndex=remappedControlBoards.lut[j].subControlBoardIndex;
4272 int off=(int)remappedControlBoards.lut[j].axisIndexInSubControlBoard;
4283 for(
int l=0;l<controlledJoints;l++)
4285 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
4286 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
4313 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
4319 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
4330 for(
int l=0;l<controlledJoints;l++)
4332 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
4333 size_t subIndex=remappedControlBoards.lut[l].subControlBoardIndex;
4360 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
4366 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
4376 std::lock_guard<std::mutex> lock(selectedJointsBuffers.mutex);
4378 selectedJointsBuffers.fillSubControlBoardBuffersFromArbitraryJointVector(currs,n_motor,motors,remappedControlBoards);
4380 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
4384 if (!(p && p->
iCurr))
4390 bool ok = p->
iCurr->
setRefCurrents(selectedJointsBuffers.m_nJointsInSubControlBoard[ctrlBrd],
4391 selectedJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
4392 selectedJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
4402 std::lock_guard<std::mutex> lock(allJointsBuffers.mutex);
4404 allJointsBuffers.fillSubControlBoardBuffersFromCompleteJointVector(currs,remappedControlBoards);
4406 for(
size_t ctrlBrd=0; ctrlBrd < remappedControlBoards.getNrOfSubControlBoards(); ctrlBrd++)
4411 allJointsBuffers.m_jointsInSubControlBoard[ctrlBrd].data(),
4412 allJointsBuffers.m_bufferForSubControlBoard[ctrlBrd].data());
4423 size_t subIndex=remappedControlBoards.lut[m].subControlBoardIndex;
4429 int off=(int)remappedControlBoards.lut[m].axisIndexInSubControlBoard;
4440 for(
int l=0;l<controlledJoints;l++)
4442 int off=(int)remappedControlBoards.lut[l].axisIndexInSubControlBoard;
4443 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