50 _subDevVerbose =
false;
97 if (subdevice->isValid())
100 subdevice->view(pos);
101 subdevice->view(posDir);
102 subdevice->view(vel);
103 subdevice->view(amp);
104 subdevice->view(lim);
105 subdevice->view(calib);
106 subdevice->view(remcalib);
107 subdevice->view(info);
108 subdevice->view(iTimed);
109 subdevice->view(iTorque);
110 subdevice->view(iImpedance);
111 subdevice->view(iMode);
112 subdevice->view(iJntEnc);
113 subdevice->view(iMotEnc);
114 subdevice->view(iInteract);
115 subdevice->view(imotor);
116 subdevice->view(iVar);
117 subdevice->view(iPwm);
118 subdevice->view(iCurr);
126 if ((iTorque==
nullptr) && (_subDevVerbose))
131 if ((iImpedance==
nullptr) && (_subDevVerbose))
136 if ((iInteract==
nullptr) && (_subDevVerbose))
141 if ((iMotEnc==
nullptr) && (_subDevVerbose))
146 if ((imotor==
nullptr) && (_subDevVerbose))
151 if ((iVar ==
nullptr) && (_subDevVerbose))
156 if ((info ==
nullptr) && (_subDevVerbose))
161 if ((iPwm ==
nullptr) && (_subDevVerbose))
166 if ((iCurr ==
nullptr) && (_subDevVerbose))
200 if (!pos->getAxes(&deviceJoints))
205 if(deviceJoints <= 0)
223 m_nJointsInSubControlBoard.resize(nrOfSubControlBoards,0);
224 m_jointsInSubControlBoard.resize(nrOfSubControlBoards);
226 m_bufferForSubControlBoard.resize(nrOfSubControlBoards);
227 m_bufferForSubControlBoardControlModes.resize(nrOfSubControlBoards);
228 m_bufferForSubControlBoardInteractionModes.resize(nrOfSubControlBoards);
230 m_counterForControlBoard.resize(nrOfSubControlBoards);
232 for(
size_t ctrlBrd=0; ctrlBrd < nrOfSubControlBoards; ctrlBrd++)
234 m_nJointsInSubControlBoard[ctrlBrd] = 0;
235 m_jointsInSubControlBoard[ctrlBrd].clear();
236 m_bufferForSubControlBoard[ctrlBrd].clear();
237 m_bufferForSubControlBoardControlModes[ctrlBrd].clear();
238 m_bufferForSubControlBoardInteractionModes[ctrlBrd].clear();
244 int off=(int)remappedControlBoards.
lut[j].axisIndexInSubControlBoard;
245 size_t subIndex=remappedControlBoards.
lut[j].subControlBoardIndex;
247 m_nJointsInSubControlBoard[subIndex]++;
248 m_jointsInSubControlBoard[subIndex].push_back(off);
252 for(
size_t ctrlBrd=0; ctrlBrd < nrOfSubControlBoards; ctrlBrd++)
254 m_bufferForSubControlBoard[ctrlBrd].reserve(m_nJointsInSubControlBoard[ctrlBrd]);
255 m_bufferForSubControlBoardControlModes[ctrlBrd].reserve(m_nJointsInSubControlBoard[ctrlBrd]);
256 m_bufferForSubControlBoardInteractionModes[ctrlBrd].reserve(m_nJointsInSubControlBoard[ctrlBrd]);
258 m_counterForControlBoard[ctrlBrd] = 0;
270 m_bufferForSubControlBoard[ctrlBrd].clear();
273 for(
int j=0; j < m_nrOfControlledAxesInRemappedCtrlBrd; j++)
275 size_t subIndex=remappedControlBoards.
lut[j].subControlBoardIndex;
277 m_bufferForSubControlBoard[subIndex].push_back(full[j]);
285 m_counterForControlBoard[ctrlBrd] = 0;
288 for(
int j=0; j < m_nrOfControlledAxesInRemappedCtrlBrd; j++)
290 size_t subIndex=remappedControlBoards.
lut[j].subControlBoardIndex;
291 full[j] = m_bufferForSubControlBoard[subIndex][m_counterForControlBoard[subIndex]];
292 m_counterForControlBoard[subIndex]++;
300 m_bufferForSubControlBoardControlModes[ctrlBrd].clear();
303 for(
int j=0; j < m_nrOfControlledAxesInRemappedCtrlBrd; j++)
305 size_t subIndex=remappedControlBoards.
lut[j].subControlBoardIndex;
307 m_bufferForSubControlBoardControlModes[subIndex].push_back(full[j]);
315 m_counterForControlBoard[ctrlBrd] = 0;
318 for(
int j=0; j < m_nrOfControlledAxesInRemappedCtrlBrd; j++)
320 size_t subIndex=remappedControlBoards.
lut[j].subControlBoardIndex;
321 full[j] = m_bufferForSubControlBoardControlModes[subIndex][m_counterForControlBoard[subIndex]];
322 m_counterForControlBoard[subIndex]++;
330 m_bufferForSubControlBoardInteractionModes[ctrlBrd].clear();
333 for(
int j=0; j < m_nrOfControlledAxesInRemappedCtrlBrd; j++)
335 size_t subIndex=remappedControlBoards.
lut[j].subControlBoardIndex;
337 m_bufferForSubControlBoardInteractionModes[subIndex].push_back(full[j]);
345 m_counterForControlBoard[ctrlBrd] = 0;
348 for(
int j=0; j < m_nrOfControlledAxesInRemappedCtrlBrd; j++)
350 size_t subIndex=remappedControlBoards.
lut[j].subControlBoardIndex;
351 full[j] = m_bufferForSubControlBoardInteractionModes[subIndex][m_counterForControlBoard[subIndex]];
352 m_counterForControlBoard[subIndex]++;
361 m_nJointsInSubControlBoard.resize(nrOfSubControlBoards,0);
362 m_jointsInSubControlBoard.resize(nrOfSubControlBoards);
363 m_bufferForSubControlBoard.resize(nrOfSubControlBoards);
364 m_bufferForSubControlBoardControlModes.resize(nrOfSubControlBoards);
365 m_bufferForSubControlBoardInteractionModes.resize(nrOfSubControlBoards);
367 m_counterForControlBoard.resize(nrOfSubControlBoards);
369 for(
size_t ctrlBrd=0; ctrlBrd < nrOfSubControlBoards; ctrlBrd++)
371 m_jointsInSubControlBoard[ctrlBrd].clear();
372 m_bufferForSubControlBoard[ctrlBrd].clear();
373 m_bufferForSubControlBoardControlModes[ctrlBrd].clear();
374 m_bufferForSubControlBoardInteractionModes[ctrlBrd].clear();
381 size_t subIndex=remappedControlBoards.
lut[j].subControlBoardIndex;
383 m_nJointsInSubControlBoard[subIndex]++;
387 for(
size_t ctrlBrd=0; ctrlBrd < nrOfSubControlBoards; ctrlBrd++)
389 m_bufferForSubControlBoard[ctrlBrd].reserve(m_nJointsInSubControlBoard[ctrlBrd]);
390 m_bufferForSubControlBoardControlModes[ctrlBrd].reserve(m_nJointsInSubControlBoard[ctrlBrd]);
391 m_bufferForSubControlBoardInteractionModes[ctrlBrd].reserve(m_nJointsInSubControlBoard[ctrlBrd]);
393 m_counterForControlBoard[ctrlBrd] = 0;
394 m_jointsInSubControlBoard[ctrlBrd].reserve(m_nJointsInSubControlBoard[ctrlBrd]);
409 m_counterForControlBoard[ctrlBrd] = 0;
412 for(
int j=0; j < n_joints; j++)
414 size_t subIndex=remappedControlBoards.
lut[joints[j]].subControlBoardIndex;
415 arbitraryVec[j] = m_bufferForSubControlBoard[subIndex][m_counterForControlBoard[subIndex]];
416 m_counterForControlBoard[subIndex]++;
426 this->createListOfJointsDecomposition(n_joints,joints,remappedControlBoards);
430 m_bufferForSubControlBoard[ctrlBrd].clear();
433 for(
int j=0; j < n_joints; j++)
435 size_t subIndex=remappedControlBoards.
lut[joints[j]].subControlBoardIndex;
436 m_bufferForSubControlBoard[subIndex].push_back(arbitraryVec[j]);
448 m_counterForControlBoard[ctrlBrd] = 0;
451 for(
int j=0; j < n_joints; j++)
453 size_t subIndex=remappedControlBoards.
lut[joints[j]].subControlBoardIndex;
454 arbitraryVec[j] = m_bufferForSubControlBoardControlModes[subIndex][m_counterForControlBoard[subIndex]];
455 m_counterForControlBoard[subIndex]++;
465 this->createListOfJointsDecomposition(n_joints,joints,remappedControlBoards);
469 m_bufferForSubControlBoardControlModes[ctrlBrd].clear();
472 for(
int j=0; j < n_joints; j++)
474 size_t subIndex=remappedControlBoards.
lut[joints[j]].subControlBoardIndex;
475 m_bufferForSubControlBoardControlModes[subIndex].push_back(arbitraryVec[j]);
487 m_counterForControlBoard[ctrlBrd] = 0;
490 for(
int j=0; j < n_joints; j++)
492 size_t subIndex=remappedControlBoards.
lut[joints[j]].subControlBoardIndex;
493 arbitraryVec[j] = m_bufferForSubControlBoardInteractionModes[subIndex][m_counterForControlBoard[subIndex]];
494 m_counterForControlBoard[subIndex]++;
504 this->createListOfJointsDecomposition(n_joints,joints,remappedControlBoards);
508 m_bufferForSubControlBoardInteractionModes[ctrlBrd].clear();
511 for(
int j=0; j < n_joints; j++)
513 size_t subIndex=remappedControlBoards.
lut[joints[j]].subControlBoardIndex;
514 m_bufferForSubControlBoardInteractionModes[subIndex].push_back(arbitraryVec[j]);
519 void ControlBoardArbitraryAxesDecomposition::createListOfJointsDecomposition(
const int n_joints,
const int* joints,
const RemappedControlBoards & remappedControlBoards)
523 m_nJointsInSubControlBoard[ctrlBrd] = 0;
524 m_jointsInSubControlBoard[ctrlBrd].clear();
528 for(
int j=0; j < n_joints; j++)
530 int off=(int)remappedControlBoards.
lut[joints[j]].axisIndexInSubControlBoard;
531 size_t subIndex=remappedControlBoards.
lut[joints[j]].subControlBoardIndex;
533 m_nJointsInSubControlBoard[subIndex]++;
534 m_jointsInSubControlBoard[subIndex].push_back(off);
542 createListOfJointsDecomposition(n_joints,joints,remappedControlBoards);
547 m_bufferForSubControlBoard.resize(m_nJointsInSubControlBoard[ctrlBrd]);