DeprecatedNJointPeriodicTSDMPCompliantController.cpp
Go to the documentation of this file.
2 
4 
5 
7 {
9 
11  const RobotUnitPtr& robUnit,
12  const armarx::NJointControllerConfigPtr& config,
14  {
15  ARMARX_INFO << "creating periodic task-space impedance dmp controller";
16 
18  cfg = DeprecatedNJointPeriodicTSDMPCompliantControllerConfigPtr::dynamicCast(config);
19  ARMARX_CHECK_EXPRESSION(!cfg->nodeSetName.empty());
20 
21  VirtualRobot::RobotNodeSetPtr rns = rtGetRobot()->getRobotNodeSet(cfg->nodeSetName);
22  ARMARX_CHECK_EXPRESSION(rns) << cfg->nodeSetName;
23  for (size_t i = 0; i < rns->getSize(); ++i)
24  {
25  std::string jointName = rns->getNode(i)->getName();
26 
27  ControlTargetBase* ct = useControlTarget(jointName, ControlModes::Torque1DoF);
28  const SensorValueBase* sv = useSensorValue(jointName);
29  targets.push_back(ct->asA<ControlTarget1DoFActuatorTorque>());
30 
31  const SensorValue1DoFActuatorVelocity* velocitySensor = sv->asA<SensorValue1DoFActuatorVelocity>();
32  const SensorValue1DoFActuatorPosition* positionSensor = sv->asA<SensorValue1DoFActuatorPosition>();
33 
34  if (!velocitySensor)
35  {
36  ARMARX_WARNING << "No velocitySensor available for " << jointName;
37  }
38  if (!positionSensor)
39  {
40  ARMARX_WARNING << "No positionSensor available for " << jointName;
41  }
42 
43  velocitySensors.push_back(velocitySensor);
44  positionSensors.push_back(positionSensor);
45  };
46 
47  tcp = rns->getTCP();
48  ik.reset(new VirtualRobot::DifferentialIK(rns, rns->getRobot()->getRootNode(), VirtualRobot::JacobiProvider::eSVDDamped));
49  ik->setDampedSvdLambda(0.0001);
50  numOfJoints = targets.size();
51  qvel_filtered.setZero(targets.size());
52  torqueLimit = cfg->jointTorqueLimit;
53 
54  /// setup force sensor and filters
55  const SensorValueBase* svlf = robUnit->getSensorDevice(cfg->forceSensorName)->getSensorValue();
56  forceSensor = svlf->asA<SensorValueForceTorque>();
57 
58  float tcpMass = 0.0f;
59  Eigen::Vector3f tcpCoMInForceSensorFrame;
60  tcpCoMInForceSensorFrame.setZero();
61 
62  enableTCPGravityCompensation.store(cfg->enableTCPGravityCompensation);
63  ARMARX_INFO << VAROUT(enableTCPGravityCompensation);
64  if (enableTCPGravityCompensation.load())
65  {
66  tcpMass = cfg->tcpMass;
67  tcpCoMInForceSensorFrame = cfg->tcpCoMInForceSensorFrame;
68  }
69 
70  forceOffset.setZero();
71  torqueOffset.setZero();
72  filteredForce.setZero();
73  filteredTorque.setZero();
74  filteredForceInRoot.setZero();
75  filteredTorqueInRoot.setZero();
76 
77  /// Setup tool
78  toolFrameInRoot = cfg->toolFrameInRoot;
79  forcePID.reset(new PIDController(cfg->pidForce[0], cfg->pidForce[1], cfg->pidForce[2], cfg->pidForce[3]));
80 
81  /// setup DMP
82  tsvmp::TaskSpaceDMPControllerConfig taskSpaceDMPConfig;
83  taskSpaceDMPConfig.motionTimeDuration = cfg->timeDuration;
84  taskSpaceDMPConfig.DMPKernelSize = cfg->kernelSize;
85  taskSpaceDMPConfig.DMPAmplitude = cfg->dmpAmplitude;
86  taskSpaceDMPConfig.DMPMode = "Linear";
87  taskSpaceDMPConfig.DMPStyle = "Periodic";
88  taskSpaceDMPConfig.phaseStopParas.goDist = cfg->phaseDist0;
89  taskSpaceDMPConfig.phaseStopParas.backDist = cfg->phaseDist1;
90  taskSpaceDMPConfig.phaseStopParas.Kpos = cfg->phaseKpPos;
91  taskSpaceDMPConfig.phaseStopParas.Dpos = 0;
92  taskSpaceDMPConfig.phaseStopParas.Kori = cfg->phaseKpOri;
93  taskSpaceDMPConfig.phaseStopParas.Dori = 0;
94  taskSpaceDMPConfig.phaseStopParas.mm2radi = cfg->posToOriRatio;
95  taskSpaceDMPConfig.phaseStopParas.maxValue = cfg->phaseL;
96  taskSpaceDMPConfig.phaseStopParas.slop = cfg->phaseK;
97 
98  dmpCtrl.reset(new tsvmp::TaskSpaceDMPController("periodicDMP", taskSpaceDMPConfig, false));
99  kinematic_chain = cfg->nodeSetName;
100 
101  // /// - null space
102  // useNullSpaceJointDMP = cfg->useNullSpaceJointDMP;
103  // nullSpaceJointDMPPtr.reset(new DMP::UMIDMP(100));
104  // isNullSpaceJointDMPLearned = false;
105  // ARMARX_CHECK_EQUAL(cfg->targetNullSpaceJointValues.size(), targets.size());
106 
107  /// initialize control parameters and buffers
108  /// - control parameter
109  ARMARX_CHECK_EQUAL(cfg->Knull.size(), targets.size());
110  ARMARX_CHECK_EQUAL(cfg->Dnull.size(), targets.size());
111  CtrlParams initParams =
112  {
113  cfg->kpImpedance, cfg->kdImpedance,
114  cfg->Knull, cfg->Dnull,
115  cfg->pidForce,
116  tcpMass, tcpCoMInForceSensorFrame
117  };
118  ctrlParams.reinitAllBuffers(initParams);
119 
120 
121  ARMARX_CHECK_EQUAL(cfg->ws_x.size(), 2);
122  ARMARX_CHECK_EQUAL(cfg->ws_y.size(), 2);
123  ARMARX_CHECK_EQUAL(cfg->ws_z.size(), 2);
124 
125  // only for ARMAR-6 (safe-guard)
126  if (!cfg->ignoreWSLimitChecks)
127  {
128  ARMARX_CHECK_LESS(cfg->ws_x[0], cfg->ws_x[1]);
129  ARMARX_CHECK_LESS(cfg->ws_x[0], 1000);
130  ARMARX_CHECK_LESS(-200, cfg->ws_x[1]);
131 
132  ARMARX_CHECK_LESS(cfg->ws_y[0], cfg->ws_y[1]);
133  ARMARX_CHECK_LESS(cfg->ws_y[0], 1200);
134  ARMARX_CHECK_LESS(0, cfg->ws_y[1]);
135 
136  ARMARX_CHECK_LESS(cfg->ws_z[0], cfg->ws_z[1]);
137  ARMARX_CHECK_LESS(cfg->ws_z[0], 1800);
138  ARMARX_CHECK_LESS(300, cfg->ws_z[1]);
139  }
140 
141  changeTimer = 0;
142  }
143 
145  {
146  ARMARX_INFO << "init ...";
147  /// initialize control parameters and buffers
148  /// - control target
150  initData.targetTSVel = Eigen::Vector6f::Zero();
151  initData.targetForce = 0.0f;
152  initData.targetNullSpaceJointValues = cfg->targetNullSpaceJointValues;
153  reinitTripleBuffer(initData);
154 
155  /// - rt to interface
156  RT2InterfaceData rt2InterfaceData;
157  rt2InterfaceData.currentTcpPose = tcp->getPoseInRootFrame();
158  rt2InterfaceData.waitTimeForCalibration = 0;
159  rt2InterfaceBuffer.reinitAllBuffers(rt2InterfaceData);
160 
161  /// - rt to mp
162  RT2MPData rt2MPData;
163  rt2MPData.deltaT = 0;
164  rt2MPData.currentTime = 0;
165  rt2MPData.currentPose = tcp->getPoseInRootFrame();
166  rt2MPData.currentTwist.setZero();
167  rt2MPData.isPhaseStop = false;
168  rt2MPBuffer.reinitAllBuffers(rt2MPData);
169 
170 
171  // ARMARX_IMPORTANT << "read force sensor ...";
172  // forceOffset = forceSensor->force;
173  // ARMARX_IMPORTANT << "force offset: " << forceOffset;
174  // started = false;
175 
176  /// start mp thread
177  runTask("DeprecatedNJointPeriodicTSDMPCompliantController", [&]
178  {
179  CycleUtil c(1);
180  getObjectScheduler()->waitForObjectStateMinimum(eManagedIceObjectStarted);
181  while (getState() == eManagedIceObjectStarted)
182  {
183  if (isControllerActive())
184  {
185  controllerRun();
186  }
187  c.waitForCycleDuration();
188  }
189  });
190 
191  ARMARX_IMPORTANT << "started controller ";
192  }
193 
195  {
196  return "DeprecatedNJointPeriodicTSDMPCompliantController";
197  }
198 
200  {
201  if (!dmpCtrl || !rt2MPBuffer.updateReadBuffer())
202  {
203  return;
204  }
205 
206  Eigen::Vector6f targetVels = Eigen::Vector6f::Zero();
207  bool isPhaseStop = rt2MPBuffer.getUpToDateReadBuffer().isPhaseStop;
208  if (!isPhaseStop && mpRunning.load())
209  {
210  double deltaT = rt2MPBuffer.getUpToDateReadBuffer().deltaT;
211  Eigen::Matrix4f currentPose = rt2MPBuffer.getUpToDateReadBuffer().currentPose;
212  Eigen::VectorXf currentTwist = rt2MPBuffer.getUpToDateReadBuffer().currentTwist;
213 
214 
215  LockGuardType guardMP {mpMutex};
216  dmpCtrl->flow(deltaT, currentPose, currentTwist);
217 
218  targetVels = dmpCtrl->getTargetVelocity();
219  {
220  debugMPBuffer.getWriteBuffer().currentPose["currentPose_x"] = currentPose(0, 3);
221  debugMPBuffer.getWriteBuffer().currentPose["currentPose_y"] = currentPose(1, 3);
222  debugMPBuffer.getWriteBuffer().currentPose["currentPose_z"] = currentPose(2, 3);
223  VirtualRobot::MathTools::Quaternion currentQ = VirtualRobot::MathTools::eigen4f2quat(currentPose);
224  debugMPBuffer.getWriteBuffer().currentPose["currentPose_qw"] = currentQ.w;
225  debugMPBuffer.getWriteBuffer().currentPose["currentPose_qx"] = currentQ.x;
226  debugMPBuffer.getWriteBuffer().currentPose["currentPose_qy"] = currentQ.y;
227  debugMPBuffer.getWriteBuffer().currentPose["currentPose_qz"] = currentQ.z;
228  debugMPBuffer.getWriteBuffer().currentCanVal = dmpCtrl->debugData.canVal;
229  debugMPBuffer.getWriteBuffer().mpcFactor = dmpCtrl->debugData.mpcFactor;
230  debugMPBuffer.getWriteBuffer().error = dmpCtrl->debugData.poseError;
231  debugMPBuffer.getWriteBuffer().posError = dmpCtrl->debugData.posiError;
232  debugMPBuffer.getWriteBuffer().oriError = dmpCtrl->debugData.oriError;
233  debugMPBuffer.getWriteBuffer().deltaT = deltaT;
234  }
235 
237  getWriterControlStruct().targetTSVel = targetVels;
238  getWriterControlStruct().targetTSPose = dmpCtrl->getTargetPoseMat();
240  }
241  else
242  {
244  if (isPhaseStop)
245  {
246  getWriterControlStruct().targetTSPose = rt2MPBuffer.getUpToDateReadBuffer().currentPose;
247  }
248  getWriterControlStruct().targetTSVel = targetVels;
250  }
251 
252  {
253  debugMPBuffer.getWriteBuffer().latestTargetVelocities["x_vel"] = targetVels(0);
254  debugMPBuffer.getWriteBuffer().latestTargetVelocities["y_vel"] = targetVels(1);
255  debugMPBuffer.getWriteBuffer().latestTargetVelocities["z_vel"] = targetVels(2);
256  debugMPBuffer.getWriteBuffer().latestTargetVelocities["roll_vel"] = targetVels(3);
257  debugMPBuffer.getWriteBuffer().latestTargetVelocities["pitch_vel"] = targetVels(4);
258  debugMPBuffer.getWriteBuffer().latestTargetVelocities["yaw_vel"] = targetVels(5);
259  debugMPBuffer.commitWrite();
260  }
261  }
262 
263 
264  void DeprecatedNJointPeriodicTSDMPCompliantController::rtRun(const IceUtil::Time& sensorValuesTimestamp, const IceUtil::Time& timeSinceLastIteration)
265  {
266  /// ---------------------------- get current kinematics ---------------------------------------------
267  Eigen::Matrix4f currentPose = tcp->getPoseInRootFrame();
268  Eigen::MatrixXf jacobi = ik->getJacobianMatrix(tcp, VirtualRobot::IKSolver::CartesianSelection::All);
269 
270  Eigen::VectorXf qpos(positionSensors.size());
271  Eigen::VectorXf qvel(velocitySensors.size());
272  for (size_t i = 0; i < positionSensors.size(); ++i)
273  {
274  qpos(i) = positionSensors[i]->position;
275  qvel(i) = velocitySensors[i]->velocity;
276  }
277  qvel_filtered = (1 - cfg->qvelFilter) * qvel_filtered + cfg->qvelFilter * qvel;
278  Eigen::VectorXf currentTwist = jacobi * qvel_filtered;
279  jacobi.block(0, 0, 3, numOfJoints) = 0.001 * jacobi.block(0, 0, 3, numOfJoints); // convert mm to m
280 
281  double deltaT = timeSinceLastIteration.toSecondsDouble();
282 
283  /// ---------------------------- update control parameters ---------------------------------------------
284  Eigen::Vector6f kpImpedance = ctrlParams.getUpToDateReadBuffer().kpImpedance;
285  Eigen::Vector6f kdImpedance = ctrlParams.getUpToDateReadBuffer().kdImpedance;
286  Eigen::VectorXf knull = ctrlParams.getUpToDateReadBuffer().knull;
287  Eigen::VectorXf dnull = ctrlParams.getUpToDateReadBuffer().dnull;
288  Eigen::Vector4f pidForce = ctrlParams.getUpToDateReadBuffer().pidForce;
289  forcePID->Kp = pidForce(0);
290  forcePID->Ki = pidForce(1);
291  forcePID->Kd = pidForce(2);
292  forcePID->maxControlValue = pidForce(3);
293 
294  float tcpMass = ctrlParams.getUpToDateReadBuffer().tcpMass;
295  Eigen::Vector3f tcpCoMInFTFrame = ctrlParams.getUpToDateReadBuffer().tcpCoMInForceSensorFrame;
296 
297 
298  /// ---------------------------- get current force torque value ---------------------------------------------
299  Eigen::Vector3f forceBaseline = Eigen::Vector3f::Zero();
300  Eigen::Vector3f torqueBaseline = Eigen::Vector3f::Zero();
301  Eigen::Vector6f forceTorque;
302  Eigen::Vector6f tcpGravityCompensation;
303  forceTorque.setZero();
304  tcpGravityCompensation.setZero();
305 
306  /// ---------------------------- get control targets ---------------------------------------------
307  Eigen::Matrix4f targetPose;
308  Eigen::Vector6f targetVel = Eigen::Vector6f::Zero();
309  Eigen::VectorXf targetNullSpaceJointValues = rtGetControlStruct().targetNullSpaceJointValues;
310  Eigen::Vector3f targetVelInTool = Eigen::Vector3f::Zero();
311  Eigen::Matrix3f currentToolOriInRoot = Eigen::Matrix3f::Identity();
312 
313  float targetForce = 0.0f;
314  if (rtFirstRun.load())
315  {
316  rtReady.store(false);
317  rtFirstRun.store(false);
318  timeForCalibration = 0;
319  forceOffset.setZero();
320  torqueOffset.setZero();
321  forcePID->reset();
322 
323  Eigen::Matrix4f forceFrameInRoot = rtGetRobot()->getRobotNode(cfg->forceFrameName)->getPoseInRootFrame();
324  forceFrameInTCP.block<3, 3>(0, 0) = currentPose.block<3, 3>(0, 0).transpose() * forceFrameInRoot.block<3, 3>(0, 0);
325  tcpCoMInTCPFrame = forceFrameInTCP.block<3, 3>(0, 0) * tcpCoMInFTFrame;
326 
327  targetPose = currentPose;
328  previousTargetPose = currentPose;
329  toolOriInHand = currentPose.block<3, 3>(0, 0).transpose() * toolFrameInRoot.block<3, 3>(0, 0);
330 
331  ARMARX_IMPORTANT << "impedance control first run with " << VAROUT(targetPose);
332 
334  getWriterControlStruct().targetTSPose = currentPose;
336  }
337  else
338  {
339  if (enableTCPGravityCompensation.load())
340  {
341  tcpGravityCompensation = getTCPGravityCompensation(currentPose, tcpMass);
342  }
343  if (!rtReady.load())
344  {
345  targetPose = previousTargetPose;
346  forceOffset = (1 - cfg->forceFilter) * forceOffset + cfg->forceFilter * (forceSensor->force - tcpGravityCompensation.head(3));
347  torqueOffset = (1 - cfg->forceFilter) * torqueOffset + cfg->forceFilter * (forceSensor->torque - tcpGravityCompensation.tail(3));
348  timeForCalibration = timeForCalibration + deltaT;
349  if (timeForCalibration > cfg->waitTimeForCalibration)
350  {
351  /// rt is ready only if the FT sensor is calibrated, and the rt2interface buffer is updated (see above)
352  ARMARX_IMPORTANT << "FT calibration done, RT is ready! \n" << VAROUT(forceOffset) << "\n" << VAROUT(torqueOffset) << "\n" << VAROUT(targetPose);
353  rtReady.store(true);
354  }
355  }
356  else
357  {
358  /// update tool information
359  currentToolOriInRoot = currentPose.block<3, 3>(0, 0) * toolOriInHand;
360  forceTorque = getFilteredForceTorque(forceBaseline, torqueBaseline, tcpGravityCompensation);
361  Eigen::VectorXf ftInTool = forceTorque;
362  ftInTool.head(3) = currentToolOriInRoot.transpose() * ftInTool.head(3);
363 
364  targetForce = rtGetControlStruct().targetForce;
365  targetVel = rtGetControlStruct().targetTSVel;
366  targetPose = rtGetControlStruct().targetTSPose;
367 
368  forcePID->update(deltaT, ftInTool(2), targetForce);
369  float forcePIDVel = -1000.0f * (float)forcePID->getControlValue(); /// convert to mm/s as in ArmarX
370 
371  targetVelInTool(2) = forcePIDVel;
372  targetVel.head(3) += currentToolOriInRoot * targetVelInTool;
373 
374 
375  targetPose.block<3, 1>(0, 3) = targetPose.block<3, 1>(0, 3) + (float)deltaT * targetVel.block<3, 1>(0, 0);
376  if ((previousTargetPose.block<3, 1>(0, 3) - targetPose.block<3, 1>(0, 3)).norm() > 100.0f)
377  {
378  ARMARX_WARNING << "new target \n" << VAROUT(targetPose) << "\nis too far away from\n" << VAROUT(previousTargetPose);
379  targetPose = previousTargetPose;
380  }
381  previousTargetPose = targetPose;
382  }
383  }
384 
385  bool isPhaseStop = false;
386  float diff = (targetPose.block<2, 1>(0, 3) - currentPose.block<2, 1>(0, 3)).norm();
387  if (diff > cfg->phaseDist0)
388  {
389  isPhaseStop = true;
390  }
391 
392  if (isPhaseStop)
393  {
394  Eigen::Vector2f currentXY = currentPose.block<2, 1>(0, 3);
395  if ((lastPosition - currentXY).norm() < cfg->changePositionTolerance)
396  {
397  changeTimer += deltaT;
398  }
399  else
400  {
401  lastPosition = currentPose.block<2, 1>(0, 3);
402  changeTimer = 0;
403  }
404 
405  if (changeTimer > cfg->changeTimerThreshold)
406  {
407  targetPose(0, 3) = currentPose(0, 3);
408  targetPose(1, 3) = currentPose(1, 3);
409  isPhaseStop = false;
410  changeTimer = 0;
411  }
412  }
413  else
414  {
415  changeTimer = 0;
416  }
417 
418  targetPose(0, 3) = std::clamp(targetPose(0, 3), cfg->ws_x[0], cfg->ws_x[1]);
419  targetPose(1, 3) = std::clamp(targetPose(1, 3), cfg->ws_y[0], cfg->ws_y[1]);
420  targetPose(2, 3) = std::clamp(targetPose(2, 3), cfg->ws_z[0], cfg->ws_z[1]);
421 
422  // write rt buffers
423  {
424  rt2InterfaceBuffer.getWriteBuffer().currentTcpPose = currentPose;
425  rt2InterfaceBuffer.getWriteBuffer().waitTimeForCalibration += deltaT;
426  rt2InterfaceBuffer.commitWrite();
427 
428  debugRTBuffer.getWriteBuffer().targetPose = targetPose;
429  debugRTBuffer.getWriteBuffer().currentPose = currentPose;
430  debugRTBuffer.getWriteBuffer().filteredForce = filteredForceInRoot;
431  debugRTBuffer.getWriteBuffer().targetVel = targetVel;
432  debugRTBuffer.getWriteBuffer().isPhaseStop = isPhaseStop;
433  debugRTBuffer.getWriteBuffer().targetVelInTool = targetVelInTool;
434 
435  rt2MPBuffer.getWriteBuffer().currentPose = currentPose;
436  rt2MPBuffer.getWriteBuffer().currentTwist = currentTwist;
437  rt2MPBuffer.getWriteBuffer().deltaT = deltaT;
438  rt2MPBuffer.getWriteBuffer().currentTime += deltaT;
439  rt2MPBuffer.getWriteBuffer().isPhaseStop = isPhaseStop;
440  rt2MPBuffer.commitWrite();
441  }
442 
443  /// ----------------------------- Impedance control ---------------------------------------------
444  /// calculate pose error between virtual pose and current pose
445  /// !!! This is very important: you have to keep postion and orientation both
446  /// with UI unit (meter, radian) to calculate impedance force.
447  Eigen::Vector6f poseErrorImp;
448  Eigen::Matrix3f diffMat = targetPose.block<3, 3>(0, 0) * currentPose.block<3, 3>(0, 0).transpose();
449  poseErrorImp.head(3) = 0.001 * (targetPose.block<3, 1>(0, 3) - currentPose.block<3, 1>(0, 3));
450  currentTwist.head(3) *= 0.001;
451  poseErrorImp.tail(3) = VirtualRobot::MathTools::eigen3f2rpy(diffMat);
452  Eigen::Vector6f forceImpedance = kpImpedance.cwiseProduct(poseErrorImp) - kdImpedance.cwiseProduct(currentTwist);
453 
454  /// ----------------------------- Nullspace PD Control --------------------------------------------------
455  Eigen::VectorXf nullspaceTorque = knull.cwiseProduct(targetNullSpaceJointValues - qpos) - dnull.cwiseProduct(qvel);
456 
457  /// ----------------------------- Map TS target force to JS --------------------------------------------------
458  Eigen::MatrixXf I = Eigen::MatrixXf::Identity(targets.size(), targets.size());
459  Eigen::MatrixXf jtpinv = ik->computePseudoInverseJacobianMatrix(jacobi.transpose(), 2.0);
460  Eigen::VectorXf jointDesiredTorques = jacobi.transpose() * forceImpedance + (I - jacobi.transpose() * jtpinv) * nullspaceTorque;
461 
462  /// ----------------------------- Send torque command to joint device --------------------------------------------------
463  ARMARX_CHECK_EXPRESSION(!targets.empty());
464  for (size_t i = 0; i < targets.size(); ++i)
465  {
466  targets.at(i)->torque = jointDesiredTorques(i);
467  if (!targets.at(i)->isValid() || isnan(targets.at(i)->torque))
468  {
469  targets.at(i)->torque = 0.0f;
470  }
471  else
472  {
473  if (fabs(targets.at(i)->torque) > fabs(torqueLimit))
474  {
475  targets.at(i)->torque = fabs(torqueLimit) * (targets.at(i)->torque / fabs(targets.at(i)->torque));
476  }
477  }
478  }
479 
480  debugRTBuffer.commitWrite();
481  }
482 
484  {
485  // static compensation
486  Eigen::Vector3f gravity;
487  gravity << 0.0, 0.0, -9.8;
488  Eigen::Vector3f localGravity = currentPose.block<3, 3>(0, 0).transpose() * gravity;
489  Eigen::Vector3f localForceVec = tcpMass * localGravity;
490  Eigen::Vector3f localTorqueVec = tcpCoMInTCPFrame.cross(localForceVec);
491 
492  Eigen::Vector6f tcpGravityCompensation;
493  tcpGravityCompensation << localForceVec, localTorqueVec;
494  return tcpGravityCompensation;
495  }
496 
497  Eigen::Vector6f DeprecatedNJointPeriodicTSDMPCompliantController::getFilteredForceTorque(Eigen::Vector3f& forceBaseline, Eigen::Vector3f& torqueBaseline, Eigen::Vector6f& handCompensatedFT)
498  {
499  filteredForce = (1 - cfg->forceFilter) * filteredForce + cfg->forceFilter * forceSensor->force;
500  filteredTorque = (1 - cfg->forceFilter) * filteredTorque + cfg->forceFilter * forceSensor->torque;
501 
502  Eigen::Matrix4f forceFrameInRoot = rtGetRobot()->getRobotNode(cfg->forceFrameName)->getPoseInRootFrame();
503  filteredForceInRoot = forceFrameInRoot.block<3, 3>(0, 0) * (filteredForce - forceOffset - handCompensatedFT.head(3)) - forceBaseline;
504  filteredTorqueInRoot = forceFrameInRoot.block<3, 3>(0, 0) * (filteredTorque - torqueOffset - handCompensatedFT.tail(3)) - torqueBaseline;
505 
506  for (size_t i = 0; i < 3; ++i)
507  {
508  if (fabs(filteredForceInRoot(i)) > cfg->forceDeadZone)
509  {
510  filteredForceInRoot(i) -= (filteredForceInRoot(i) / fabs(filteredForceInRoot(i))) * cfg->forceDeadZone;
511  }
512  else
513  {
514  filteredForceInRoot(i) = 0;
515  }
516 
517  if (fabs(filteredTorqueInRoot(i)) > cfg->torqueDeadZone)
518  {
519  filteredTorqueInRoot(i) -= (filteredTorqueInRoot(i) / fabs(filteredTorqueInRoot(i))) * cfg->torqueDeadZone;
520  }
521  else
522  {
523  filteredTorqueInRoot(i) = 0;
524  }
525  }
526 
527  Eigen::Vector6f forceTorque;
528  forceTorque << filteredForceInRoot, filteredTorqueInRoot;
529  return forceTorque;
530  }
531 
533  {
534  LockGuardType guard(mpMutex);
535  ctrlParams.getWriteBuffer().kpImpedance = kpImpedance;
536  ctrlParams.commitWrite();
537  }
538 
540  {
541  LockGuardType guard(mpMutex);
542  ctrlParams.getWriteBuffer().kdImpedance = kdImpedance;
543  ctrlParams.commitWrite();
544  }
545 
547  {
548  return kinematic_chain;
549  }
550 
551  void DeprecatedNJointPeriodicTSDMPCompliantController::learnDMPFromFiles(const Ice::StringSeq& fileNames, const Ice::Current&)
552  {
553  ARMARX_INFO << "Learning DMP ... ";
554 
555  LockGuardType guard {mpMutex};
556  dmpCtrl->learnDMPFromFiles(fileNames);
557 
558  }
559 
560  void DeprecatedNJointPeriodicTSDMPCompliantController::learnDMPFromTrajectory(const TrajectoryBasePtr& trajectory, const Ice::Current&)
561  {
562  ARMARX_INFO << "Learning DMP ... ";
563  ARMARX_CHECK_EXPRESSION(trajectory);
564  TrajectoryPtr dmpTraj = TrajectoryPtr::dynamicCast(trajectory);
565  ARMARX_CHECK_EXPRESSION(dmpTraj);
566 
567  LockGuardType guard {mpMutex};
568  dmpCtrl->learnDMPFromTrajectory(dmpTraj);
569 
570  }
571 
573  {
574  return false;
575  }
576 
578  {
579  LockGuardType guard {mpMutex};
580  dmpCtrl->setSpeed(times);
581  }
582 
583 
584  void DeprecatedNJointPeriodicTSDMPCompliantController::setGoals(const Ice::DoubleSeq& goals, const Ice::Current& ice)
585  {
586  LockGuardType guard {mpMutex};
587  dmpCtrl->setGoalPoseVec(goals);
588  }
589 
591  {
592  LockGuardType guard {mpMutex};
593  dmpCtrl->setAmplitude(amp);
594  }
595 
597  {
599  getWriterControlStruct().targetForce = targetForce;
601  }
602 
603  void DeprecatedNJointPeriodicTSDMPCompliantController::runDMP(const Ice::DoubleSeq& goals, Ice::Double tau, const Ice::Current&)
604  {
605  rtFirstRun.store(true);
606  while (rtFirstRun.load() || !rtReady.load() || !rt2InterfaceBuffer.updateReadBuffer())
607  {
608  usleep(100);
609  }
610 
611  Eigen::Matrix4f pose = rt2InterfaceBuffer.getUpToDateReadBuffer().currentTcpPose;
612 
613  LockGuardType guard {mpMutex};
614  dmpCtrl->prepareExecution(dmpCtrl->eigen4f2vec(pose), goals);
615  dmpCtrl->setSpeed(tau);
616 
617  mpRunning.store(true);
618  dmpCtrl->resumeController();
619  ARMARX_INFO << "start mp ...";
620  }
621 
623  {
624  return dmpCtrl->canVal;
625  }
626 
627 
629  {
630  // if (started)
631  if (mpRunning.load())
632  {
633  ARMARX_INFO << "Cannot reset running DMP";
634  }
635  rtFirstRun = true;
636  }
637 
639  {
640  mpRunning.store(false);
641  // oldPose = interfaceData.getUpToDateReadBuffer().currentTcpPose;
642  // started = false;
643  // stopped = true;
644  }
645 
647  {
648  dmpCtrl->pauseController();
649  }
650 
652  {
653  dmpCtrl->resumeController();
654  // stopped = false;
655  }
656 
657 
659  {
660  std::string datafieldName;
661  std::string debugName = "Periodic";
662  StringVariantBaseMap datafields;
663 
664  Eigen::Matrix4f targetPoseDebug = debugRTBuffer.getUpToDateReadBuffer().targetPose;
665  datafields["target_x"] = new Variant(targetPoseDebug(0, 3));
666  datafields["target_y"] = new Variant(targetPoseDebug(1, 3));
667  datafields["target_z"] = new Variant(targetPoseDebug(2, 3));
668 
669  Eigen::Vector3f targetVelInTool = debugRTBuffer.getUpToDateReadBuffer().targetVelInTool;
670  datafields["targetVelInTool_x"] = new Variant(targetVelInTool(0));
671  datafields["targetVelInTool_y"] = new Variant(targetVelInTool(1));
672  datafields["targetVelInTool_z"] = new Variant(targetVelInTool(2));
673 
674  Eigen::Matrix4f currentPoseDebug = debugRTBuffer.getUpToDateReadBuffer().currentPose;
675  datafields["current_x"] = new Variant(currentPoseDebug(0, 3));
676  datafields["current_y"] = new Variant(currentPoseDebug(1, 3));
677  datafields["current_z"] = new Variant(currentPoseDebug(2, 3));
678 
679  Eigen::Vector3f filteredForce = debugRTBuffer.getUpToDateReadBuffer().filteredForce;
680  datafields["filteredforce_x"] = new Variant(filteredForce(0));
681  datafields["filteredforce_y"] = new Variant(filteredForce(1));
682  datafields["filteredforce_z"] = new Variant(filteredForce(2));
683 
684 
685  Eigen::Vector3f reactForce = debugRTBuffer.getUpToDateReadBuffer().reactForce;
686  datafields["reactForce_x"] = new Variant(reactForce(0));
687  datafields["reactForce_y"] = new Variant(reactForce(1));
688  datafields["reactForce_z"] = new Variant(reactForce(2));
689 
690  Eigen::VectorXf targetVel = debugRTBuffer.getUpToDateReadBuffer().targetVel;
691  datafields["targetVel_x"] = new Variant(targetVel(0));
692  datafields["targetVel_y"] = new Variant(targetVel(1));
693  datafields["targetVel_z"] = new Variant(targetVel(2));
694 
695  datafields["canVal"] = new Variant(debugMPBuffer.getUpToDateReadBuffer().currentCanVal);
696  datafields["deltaT"] = new Variant(debugMPBuffer.getUpToDateReadBuffer().deltaT);
697 
698  datafields["PhaseStop"] = new Variant(debugRTBuffer.getUpToDateReadBuffer().isPhaseStop);
699 
700 
701  // datafields["targetVel_rx"] = new Variant(targetVel(3));
702  // datafields["targetVel_ry"] = new Variant(targetVel(4));
703  // datafields["targetVel_rz"] = new Variant(targetVel(5));
704 
705  // auto values = debugOutputData.getUpToDateReadBuffer().latestTargetVelocities;
706  // for (auto& pair : values)
707  // {
708  // datafieldName = pair.first + "_" + debugName;
709  // datafields[datafieldName] = new Variant(pair.second);
710  // }
711 
712  // auto currentPose = debugOutputData.getUpToDateReadBuffer().currentPose;
713  // for (auto& pair : currentPose)
714  // {
715  // datafieldName = pair.first + "_" + debugName;
716  // datafields[datafieldName] = new Variant(pair.second);
717  // }
718 
719  // datafieldName = "canVal_" + debugName;
720  // datafields[datafieldName] = new Variant(debugOutputData.getUpToDateReadBuffer().currentCanVal);
721  // datafieldName = "mpcFactor_" + debugName;
722  // datafields[datafieldName] = new Variant(debugOutputData.getUpToDateReadBuffer().mpcFactor);
723  // datafieldName = "error_" + debugName;
724  // datafields[datafieldName] = new Variant(debugOutputData.getUpToDateReadBuffer().error);
725  // datafieldName = "posError_" + debugName;
726  // datafields[datafieldName] = new Variant(debugOutputData.getUpToDateReadBuffer().posError);
727  // datafieldName = "oriError_" + debugName;
728  // datafields[datafieldName] = new Variant(debugOutputData.getUpToDateReadBuffer().oriError);
729  // datafieldName = "deltaT_" + debugName;
730  // datafields[datafieldName] = new Variant(debugOutputData.getUpToDateReadBuffer().deltaT);
731 
732  datafieldName = "PeriodicDMP";
733  debugObs->setDebugChannel(datafieldName, datafields);
734  }
735 
736 
737 
739  {
740  ARMARX_INFO << "stopped ...";
741  }
742 
743 
744 
745 }
armarx::NJointControllerWithTripleBuffer< DeprecatedNJointPeriodicTSDMPCompliantControllerControlData >::reinitTripleBuffer
void reinitTripleBuffer(const DeprecatedNJointPeriodicTSDMPCompliantControllerControlData &initial)
Definition: NJointControllerWithTripleBuffer.h:68
armarx::ControlTargetBase::asA
const T * asA() const
Definition: ControlTargetBase.h:76
armarx::Variant
The Variant class is described here: Variants.
Definition: Variant.h:224
armarx::control::deprecated_njoint_mp_controller::task_space::DeprecatedNJointPeriodicTSDMPCompliantController::setTargetForceInRootFrame
void setTargetForceInRootFrame(Ice::Float force, const Ice::Current &) override
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.cpp:596
armarx::control::deprecated_njoint_mp_controller::tsvmp::PhaseStopParams::Kori
float Kori
Definition: TaskSpaceVMP.h:47
armarx::control::deprecated_njoint_mp_controller::task_space::DeprecatedNJointPeriodicTSDMPCompliantController::setKdImpedance
void setKdImpedance(const Eigen::Vector6f &kdImpedance, const Ice::Current &) override
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.cpp:539
armarx::DeprecatedNJointPeriodicTSDMPCompliantControllerInterface::getCanVal
double getCanVal()
armarx::control::deprecated_njoint_mp_controller::task_space::DeprecatedNJointPeriodicTSDMPCompliantController::learnDMPFromFiles
void learnDMPFromFiles(const Ice::StringSeq &fileNames, const Ice::Current &) override
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.cpp:551
armarx::DeprecatedNJointPeriodicTSDMPCompliantControllerInterface::resetDMP
void resetDMP()
armarx::control::deprecated_njoint_mp_controller::task_space::registrationControllerDeprecatedNJointPeriodicTSDMPCompliantController
NJointControllerRegistration< DeprecatedNJointPeriodicTSDMPCompliantController > registrationControllerDeprecatedNJointPeriodicTSDMPCompliantController("DeprecatedNJointPeriodicTSDMPCompliantController")
armarx::control::deprecated_njoint_mp_controller::task_space::DeprecatedNJointPeriodicTSDMPCompliantControllerControlData
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.h:28
armarx::control::deprecated_njoint_mp_controller::tsvmp::PhaseStopParams::Dpos
float Dpos
Definition: TaskSpaceVMP.h:46
armarx::control::deprecated_njoint_mp_controller::task_space::DeprecatedNJointPeriodicTSDMPCompliantController::setAmplitude
void setAmplitude(Ice::Double amp, const Ice::Current &) override
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.cpp:590
armarx::TripleBuffer::getWriteBuffer
T & getWriteBuffer()
Definition: TripleBuffer.h:90
armarx::NJointControllerRegistration
Definition: NJointControllerRegistry.h:74
armarx::NJointControllerBase::useSynchronizedRtRobot
const VirtualRobot::RobotPtr & useSynchronizedRtRobot(bool updateCollisionModel=false)
Requests a VirtualRobot for use in rtRun *.
Definition: NJointController.cpp:293
armarx::NJointControllerWithTripleBuffer< DeprecatedNJointPeriodicTSDMPCompliantControllerControlData >::rtGetControlStruct
const DeprecatedNJointPeriodicTSDMPCompliantControllerControlData & rtGetControlStruct() const
Definition: NJointControllerWithTripleBuffer.h:32
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPControllerConfig::DMPKernelSize
int DMPKernelSize
Definition: TaskSpaceVMP.h:54
armarx::StringVariantBaseMap
std::map< std::string, VariantBasePtr > StringVariantBaseMap
Definition: ManagedIceObject.h:111
ARMARX_IMPORTANT
#define ARMARX_IMPORTANT
Definition: Logging.h:183
armarx::SensorValueBase::asA
const T * asA() const
Definition: SensorValueBase.h:82
armarx::SensorValueBase
The SensorValueBase class.
Definition: SensorValueBase.h:40
armarx::ControlTargetBase
Brief description of class JointControlTargetBase.
Definition: ControlTargetBase.h:47
armarx::TripleBuffer::commitWrite
void commitWrite()
Definition: TripleBuffer.h:146
armarx::WriteBufferedTripleBuffer::commitWrite
void commitWrite()
Definition: TripleBuffer.h:326
armarx::NJointControllerBase::useControlTarget
ControlTargetBase * useControlTarget(const std::string &deviceName, const std::string &controlMode)
Declares to calculate the ControlTarget for the given ControlDevice in the given ControlMode when rtR...
Definition: NJointController.cpp:410
armarx::control::deprecated_njoint_mp_controller::task_space::DeprecatedNJointPeriodicTSDMPCompliantController::getFilteredForceTorque
Eigen::Vector6f getFilteredForceTorque(Eigen::Vector3f &forceBaseline, Eigen::Vector3f &torqueBaseline, Eigen::Vector6f &handCompensatedFT)
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.cpp:497
armarx::control::deprecated_njoint_mp_controller::task_space
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.cpp:6
armarx::CycleUtil
This util class helps with keeping a cycle time during a control cycle.
Definition: CycleUtil.h:40
armarx::ManagedIceObject::getState
int getState() const
Retrieve current state of the ManagedIceObject.
Definition: ManagedIceObject.cpp:725
armarx::control::deprecated_njoint_mp_controller::task_space::DeprecatedNJointPeriodicTSDMPCompliantController::rtRun
void rtRun(const IceUtil::Time &sensorValuesTimestamp, const IceUtil::Time &timeSinceLastIteration)
TODO make protected and use attorneys.
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.cpp:264
ARMARX_CHECK_LESS
#define ARMARX_CHECK_LESS(lhs, rhs)
This macro evaluates whether lhs is less (<) than rhs and if it turns out to be false it will throw a...
Definition: ExpressionException.h:102
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPControllerConfig
Definition: TaskSpaceVMP.h:52
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPControllerConfig::phaseStopParas
PhaseStopParams phaseStopParas
Definition: TaskSpaceVMP.h:60
armarx::NJointControllerWithTripleBuffer< DeprecatedNJointPeriodicTSDMPCompliantControllerControlData >::getWriterControlStruct
DeprecatedNJointPeriodicTSDMPCompliantControllerControlData & getWriterControlStruct()
Definition: NJointControllerWithTripleBuffer.h:54
armarx::control::deprecated_njoint_mp_controller::tsvmp::PhaseStopParams::goDist
float goDist
Definition: TaskSpaceVMP.h:41
armarx::NJointControllerWithTripleBuffer< DeprecatedNJointPeriodicTSDMPCompliantControllerControlData >::LockGuardType
std::lock_guard< std::recursive_mutex > LockGuardType
Definition: NJointControllerWithTripleBuffer.h:14
armarx::control::deprecated_njoint_mp_controller::task_space::DeprecatedNJointPeriodicTSDMPCompliantController::setGoals
void setGoals(const Ice::DoubleSeq &goals, const Ice::Current &) override
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.cpp:584
armarx::control::deprecated_njoint_mp_controller::task_space::DeprecatedNJointPeriodicTSDMPCompliantController::setKpImpedance
void setKpImpedance(const Eigen::Vector6f &kpImpedance, const Ice::Current &) override
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.cpp:532
armarx::control::deprecated_njoint_mp_controller::task_space::DeprecatedNJointPeriodicTSDMPCompliantController::onPublish
virtual void onPublish(const SensorAndControl &, const DebugDrawerInterfacePrx &, const DebugObserverInterfacePrx &)
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.cpp:658
armarx::SensorValueForceTorque::force
Eigen::Vector3f force
Definition: SensorValueForceTorque.h:35
armarx::VariantType::Quaternion
const VariantTypeId Quaternion
Definition: Pose.h:39
clamp
double clamp(double x, double a, double b)
Definition: point.hpp:125
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPControllerConfig::motionTimeDuration
float motionTimeDuration
Definition: TaskSpaceVMP.h:59
IceInternal::Handle< Trajectory >
armarx::NJointControllerBase::rtGetRobot
const VirtualRobot::RobotPtr & rtGetRobot()
TODO make protected and use attorneys.
Definition: NJointControllerBase.h:845
armarx::control::deprecated_njoint_mp_controller::tsvmp::PhaseStopParams::backDist
float backDist
Definition: TaskSpaceVMP.h:42
armarx::control::deprecated_njoint_mp_controller::tsvmp::PhaseStopParams::maxValue
float maxValue
Definition: TaskSpaceVMP.h:43
armarx::detail::ControlThreadOutputBufferEntry
Definition: ControlThreadOutputBuffer.h:177
armarx::VariantType::Double
const VariantTypeId Double
Definition: Variant.h:919
armarx::control::deprecated_njoint_mp_controller::task_space::DeprecatedNJointPeriodicTSDMPCompliantController::setSpeed
void setSpeed(Ice::Double times, const Ice::Current &) override
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.cpp:577
armarx::control::deprecated_njoint_mp_controller::tsvmp::PhaseStopParams::Dori
float Dori
Definition: TaskSpaceVMP.h:48
GfxTL::Identity
void Identity(MatrixXX< N, N, T > *a)
Definition: MatrixXX.h:523
armarx::control::deprecated_njoint_mp_controller::task_space::DeprecatedNJointPeriodicTSDMPCompliantControllerControlData::targetNullSpaceJointValues
Eigen::VectorXf targetNullSpaceJointValues
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.h:34
armarx::control::deprecated_njoint_mp_controller::task_space::DeprecatedNJointPeriodicTSDMPCompliantController::getClassName
std::string getClassName(const Ice::Current &) const
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.cpp:194
armarx::NJointControllerBase::isControllerActive
bool isControllerActive(const Ice::Current &=Ice::emptyCurrent) const final override
Definition: NJointControllerBase.h:777
armarx::PIDController
Definition: PIDController.h:43
armarx::NJointControllerBase::runTask
void runTask(const std::string &taskName, Task &&task)
Executes a given task in a separate thread from the Application ThreadPool.
Definition: NJointControllerBase.h:753
armarx::control::deprecated_njoint_mp_controller::task_space::DeprecatedNJointPeriodicTSDMPCompliantController::DeprecatedNJointPeriodicTSDMPCompliantController
DeprecatedNJointPeriodicTSDMPCompliantController(const RobotUnitPtr &, const NJointControllerConfigPtr &config, const VirtualRobot::RobotPtr &)
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.cpp:10
armarx::DeprecatedNJointPeriodicTSDMPCompliantControllerInterface::pauseDMP
void pauseDMP()
DeprecatedNJointPeriodicTSDMPCompliantController.h
armarx::NJointControllerWithTripleBuffer< DeprecatedNJointPeriodicTSDMPCompliantControllerControlData >::writeControlStruct
void writeControlStruct()
Definition: NJointControllerWithTripleBuffer.h:44
armarx::control::deprecated_njoint_mp_controller::task_space::DeprecatedNJointPeriodicTSDMPCompliantController::runDMP
void runDMP(const Ice::DoubleSeq &goals, Ice::Double tau, const Ice::Current &) override
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.cpp:603
armarx::SensorValueForceTorque::torque
DETAIL_SensorValueBase_DEFAULT_METHOD_IMPLEMENTATION Eigen::Vector3f torque
Definition: SensorValueForceTorque.h:34
ArmarXObjectScheduler.h
armarx::WriteBufferedTripleBuffer::getWriteBuffer
T & getWriteBuffer()
Definition: TripleBuffer.h:280
armarx::NJointControllerWithTripleBuffer< DeprecatedNJointPeriodicTSDMPCompliantControllerControlData >::controlDataMutex
MutexType controlDataMutex
Definition: NJointControllerWithTripleBuffer.h:73
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPControllerConfig::DMPAmplitude
float DMPAmplitude
Definition: TaskSpaceVMP.h:57
armarx::armem::Time
armarx::core::time::DateTime Time
Definition: forward_declarations.h:13
armarx::control::deprecated_njoint_mp_controller::tsvmp::PhaseStopParams::slop
float slop
Definition: TaskSpaceVMP.h:44
armarx::control::deprecated_njoint_mp_controller::tsvmp::PhaseStopParams::Kpos
float Kpos
Definition: TaskSpaceVMP.h:45
armarx::control::deprecated_njoint_mp_controller::task_space::DeprecatedNJointPeriodicTSDMPCompliantController::learnDMPFromTrajectory
void learnDMPFromTrajectory(const TrajectoryBasePtr &trajectory, const Ice::Current &) override
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.cpp:560
armarx::control::deprecated_njoint_mp_controller::task_space::DeprecatedNJointPeriodicTSDMPCompliantController::getTCPGravityCompensation
Eigen::Vector6f getTCPGravityCompensation(Eigen::Matrix4f &currentPose, float tcpMass)
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.cpp:483
armarx::DeprecatedNJointPeriodicTSDMPCompliantControllerInterface::getKinematicChainName
string getKinematicChainName()
armarx::control::deprecated_njoint_mp_controller::task_space::DeprecatedNJointPeriodicTSDMPCompliantController::controllerRun
void controllerRun()
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.cpp:199
armarx::WriteBufferedTripleBuffer::reinitAllBuffers
void reinitAllBuffers(const T &init)
Definition: TripleBuffer.h:332
GfxTL::Matrix3f
MatrixXX< 3, 3, float > Matrix3f
Definition: MatrixXX.h:600
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:601
armarx::control::deprecated_njoint_mp_controller::task_space::DeprecatedNJointPeriodicTSDMPCompliantController::onDisconnectNJointController
void onDisconnectNJointController()
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.cpp:738
ARMARX_CHECK_EXPRESSION
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
Definition: ExpressionException.h:73
armarx::control::deprecated_njoint_mp_controller::task_space::DeprecatedNJointPeriodicTSDMPCompliantControllerControlData::targetTSVel
Eigen::Vector6f targetTSVel
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.h:32
armarx::control::deprecated_njoint_mp_controller::task_space::DeprecatedNJointPeriodicTSDMPCompliantControllerControlData::targetForce
float targetForce
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.h:31
float
#define float
Definition: 16_Level.h:22
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
VAROUT
#define VAROUT(x)
Definition: StringHelpers.h:182
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPControllerConfig::DMPStyle
std::string DMPStyle
Definition: TaskSpaceVMP.h:56
IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface >
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPControllerConfig::DMPMode
std::string DMPMode
Definition: TaskSpaceVMP.h:55
armarx::DeprecatedNJointPeriodicTSDMPCompliantControllerInterface::resumeDMP
void resumeDMP()
Eigen::Matrix< float, 6, 1 >
armarx::control::deprecated_njoint_mp_controller::tsvmp::PhaseStopParams::mm2radi
float mm2radi
Definition: TaskSpaceVMP.h:49
armarx::control::deprecated_njoint_mp_controller::task_space::DeprecatedNJointPeriodicTSDMPCompliantController::onInitNJointController
void onInitNJointController()
Definition: DeprecatedNJointPeriodicTSDMPCompliantController.cpp:144
armarx::DeprecatedNJointPeriodicTSDMPCompliantControllerInterface::stopDMP
void stopDMP()
armarx::TripleBuffer::getUpToDateReadBuffer
const T & getUpToDateReadBuffer() const
Definition: TripleBuffer.h:108
ARMARX_CHECK_EQUAL
#define ARMARX_CHECK_EQUAL(lhs, rhs)
This macro evaluates whether lhs is equal (==) rhs and if it turns out to be false it will throw an E...
Definition: ExpressionException.h:130
armarx::SensorValueForceTorque
Definition: SensorValueForceTorque.h:31
armarx::WriteBufferedTripleBuffer::getUpToDateReadBuffer
const T & getUpToDateReadBuffer() const
Definition: TripleBuffer.h:296
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:186
armarx::transpose
std::vector< std::vector< T > > transpose(const std::vector< std::vector< T >> &src, Thrower thrower)
Definition: SimoxCSpace.cpp:706
armarx::TripleBuffer::reinitAllBuffers
std::enable_if< std::is_copy_constructible< U >::value >::type reinitAllBuffers(const T &init)
Definition: TripleBuffer.h:153
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPController
Brief description of class TaskSpaceDMPController.
Definition: TaskSpaceVMP.h:83
armarx::ManagedIceObject::getObjectScheduler
ArmarXObjectSchedulerPtr getObjectScheduler() const
Definition: ManagedIceObject.cpp:731
armarx::DeprecatedNJointPeriodicTSDMPCompliantControllerInterface::isFinished
bool isFinished()
armarx::NJointControllerBase::useSensorValue
const SensorValueBase * useSensorValue(const std::string &sensorDeviceName) const
Get a const ptr to the given SensorDevice's SensorValue.
Definition: NJointController.cpp:383
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18
armarx::TripleBuffer::updateReadBuffer
bool updateReadBuffer() const
Swaps in the hidden buffer if it contains new data.
Definition: TripleBuffer.h:131
norm
double norm(const Point &a)
Definition: point.hpp:94