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;