NJointAdaptiveWipingController.cpp
Go to the documentation of this file.
2 
4 
6 {
8 
9  NJointAdaptiveWipingController::NJointAdaptiveWipingController(const RobotUnitPtr& robUnit, const armarx::NJointControllerConfigPtr& config, const VirtualRobot::RobotPtr&)
10  {
12  cfg = NJointAdaptiveWipingControllerConfigPtr::dynamicCast(config);
13  ARMARX_CHECK_EXPRESSION(!cfg->nodeSetName.empty());
14  VirtualRobot::RobotNodeSetPtr rns = rtGetRobot()->getRobotNodeSet(cfg->nodeSetName);
15 
16  ARMARX_CHECK_EXPRESSION(rns) << cfg->nodeSetName;
17  for (size_t i = 0; i < rns->getSize(); ++i)
18  {
19  std::string jointName = rns->getNode(i)->getName();
20  ControlTargetBase* ct = useControlTarget(jointName, ControlModes::Torque1DoF);
21  const SensorValueBase* sv = useSensorValue(jointName);
22  targets.push_back(ct->asA<ControlTarget1DoFActuatorTorque>());
23 
24  const SensorValue1DoFActuatorVelocity* velocitySensor = sv->asA<SensorValue1DoFActuatorVelocity>();
25  const SensorValue1DoFActuatorPosition* positionSensor = sv->asA<SensorValue1DoFActuatorPosition>();
26 
27  velocitySensors.push_back(velocitySensor);
28  positionSensors.push_back(positionSensor);
29  };
30 
31  tcp = rns->getTCP();
32  // set tcp controller
33  nodeSetName = cfg->nodeSetName;
34  ik.reset(new VirtualRobot::DifferentialIK(rns, rns->getRobot()->getRootNode(), VirtualRobot::JacobiProvider::eSVDDamped));
35 
36  tsvmp::TaskSpaceDMPControllerConfig taskSpaceDMPConfig;
37  taskSpaceDMPConfig.motionTimeDuration = cfg->timeDuration;
38  taskSpaceDMPConfig.DMPKernelSize = cfg->kernelSize;
39  taskSpaceDMPConfig.DMPAmplitude = cfg->dmpAmplitude;
40  taskSpaceDMPConfig.DMPMode = "Linear";
41  taskSpaceDMPConfig.DMPStyle = "Periodic";
42  taskSpaceDMPConfig.phaseStopParas.goDist = cfg->phaseDist0;
43  taskSpaceDMPConfig.phaseStopParas.backDist = cfg->phaseDist1;
44  taskSpaceDMPConfig.phaseStopParas.Kpos = cfg->phaseKpPos;
45  taskSpaceDMPConfig.phaseStopParas.Kori = cfg->phaseKpOri;
46  taskSpaceDMPConfig.phaseStopParas.mm2radi = cfg->posToOriRatio;
47  taskSpaceDMPConfig.phaseStopParas.maxValue = cfg->phaseL;
48  taskSpaceDMPConfig.phaseStopParas.slop = cfg->phaseK;
49  taskSpaceDMPConfig.phaseStopParas.Dpos = 0;
50  taskSpaceDMPConfig.phaseStopParas.Dori = 0;
51 
52 
53 
54  dmpCtrl.reset(new tsvmp::TaskSpaceDMPController("periodicDMP", taskSpaceDMPConfig, false));
55 
57  initData.targetTSVel.resize(6);
58  for (size_t i = 0; i < 6; ++i)
59  {
60  initData.targetTSVel(i) = 0;
61  }
62  reinitTripleBuffer(initData);
63 
64  firstRun = true;
65  dmpRunning = false;
66 
67 
68  ARMARX_CHECK_EQUAL(cfg->Kpos.size(), 3);
69  ARMARX_CHECK_EQUAL(cfg->Dpos.size(), 3);
70  ARMARX_CHECK_EQUAL(cfg->Kori.size(), 3);
71  ARMARX_CHECK_EQUAL(cfg->Dori.size(), 3);
72 
73  kpos << cfg->Kpos[0], cfg->Kpos[1], cfg->Kpos[2];
74  dpos << cfg->Dpos[0], cfg->Dpos[1], cfg->Dpos[2];
75  kori << cfg->Kori[0], cfg->Kori[1], cfg->Kori[2];
76  dori << cfg->Dori[0], cfg->Dori[1], cfg->Dori[2];
77 
78  kpf = cfg->Kpf;
79  // forcePID.reset(new PIDController(cfg->kpf, ));
80  knull.setZero(targets.size());
81  dnull.setZero(targets.size());
82 
83  for (size_t i = 0; i < targets.size(); ++i)
84  {
85  knull(i) = cfg->Knull.at(i);
86  dnull(i) = cfg->Dnull.at(i);
87 
88  }
89 
90  nullSpaceJointsVec.resize(cfg->desiredNullSpaceJointValues.size());
91  for (size_t i = 0; i < cfg->desiredNullSpaceJointValues.size(); ++i)
92  {
93  nullSpaceJointsVec(i) = cfg->desiredNullSpaceJointValues.at(i);
94  }
95 
96 
97  const SensorValueBase* svlf = robUnit->getSensorDevice(cfg->forceSensorName)->getSensorValue();
98  forceSensor = svlf->asA<SensorValueForceTorque>();
99 
100 
101  ARMARX_CHECK_EQUAL(cfg->ftOffset.size(), 6);
102 
103  currentForceOffset.setZero();
104  forceOffset << cfg->ftOffset[0], cfg->ftOffset[1], cfg->ftOffset[2];
105  torqueOffset << cfg->ftOffset[3], cfg->ftOffset[4], cfg->ftOffset[5];
106 
107  handMass = cfg->handMass;
108  handCOM << cfg->handCOM[0], cfg->handCOM[1], cfg->handCOM[2];
109 
110 
111  filteredForce.setZero();
112  filteredTorque.setZero();
113 
114  filteredForceInRoot.setZero();
115  filteredTorqueInRoot.setZero();
116 
117  UserToRTData initUserData;
118  initUserData.targetForce = 0;
119  user2rtData.reinitAllBuffers(initUserData);
120 
121  oriToolDir << 0, 0, 1;
122  gravityInRoot << 0, 0, -9.8;
123 
124  qvel_filtered.setZero(targets.size());
125 
126  ARMARX_CHECK_EQUAL(cfg->ws_x.size(), 2);
127  ARMARX_CHECK_EQUAL(cfg->ws_y.size(), 2);
128  ARMARX_CHECK_EQUAL(cfg->ws_z.size(), 2);
129  // only for ARMAR-6 (safe-guard)
130  ARMARX_CHECK_LESS(cfg->ws_x[0], cfg->ws_x[1]);
131  ARMARX_CHECK_LESS(cfg->ws_x[0], 1000);
132  ARMARX_CHECK_LESS(-200, cfg->ws_x[1]);
133 
134  ARMARX_CHECK_LESS(cfg->ws_y[0], cfg->ws_y[1]);
135  ARMARX_CHECK_LESS(cfg->ws_y[0], 1200);
136  ARMARX_CHECK_LESS(0, cfg->ws_y[1]);
137 
138  ARMARX_CHECK_LESS(cfg->ws_z[0], cfg->ws_z[1]);
139  ARMARX_CHECK_LESS(cfg->ws_z[0], 1800);
140  ARMARX_CHECK_LESS(300, cfg->ws_z[1]);
141 
142  adaptK = kpos;
143  lastDiff = 0;
144  changeTimer = 0;
145  }
146 
148  {
149  ARMARX_INFO << "init ...";
150 
151 
152  RTToControllerData initSensorData;
153  initSensorData.deltaT = 0;
154  initSensorData.currentTime = 0;
155  initSensorData.currentPose = tcp->getPoseInRootFrame();
156  initSensorData.currentTwist.setZero();
157  initSensorData.isPhaseStop = false;
158  rt2CtrlData.reinitAllBuffers(initSensorData);
159 
160  RTToUserData initInterfaceData;
161  initInterfaceData.currentTcpPose = tcp->getPoseInRootFrame();
162  initInterfaceData.waitTimeForCalibration = 0;
163  rt2UserData.reinitAllBuffers(initInterfaceData);
164 
165  started = false;
166 
167  runTask("NJointAdaptiveWipingController", [&]
168  {
169  CycleUtil c(1);
170  getObjectScheduler()->waitForObjectStateMinimum(eManagedIceObjectStarted);
171  while (getState() == eManagedIceObjectStarted)
172  {
173  if (isControllerActive())
174  {
175  controllerRun();
176  }
177  c.waitForCycleDuration();
178  }
179  });
180 
181  }
182 
183  std::string NJointAdaptiveWipingController::getClassName(const Ice::Current&) const
184  {
185  return "NJointAdaptiveWipingController";
186  }
187 
189  {
190  if (!started)
191  {
192  return;
193  }
194 
195  if (!dmpCtrl)
196  {
197  return;
198  }
199 
200  Eigen::VectorXf targetVels(6);
201  bool isPhaseStop = rt2CtrlData.getUpToDateReadBuffer().isPhaseStop;
202  if (isPhaseStop)
203  {
204  targetVels.setZero();
205  }
206  else
207  {
208 
209  double deltaT = rt2CtrlData.getUpToDateReadBuffer().deltaT;
210  Eigen::Matrix4f currentPose = rt2CtrlData.getUpToDateReadBuffer().currentPose;
211  Eigen::VectorXf currentTwist = rt2CtrlData.getUpToDateReadBuffer().currentTwist;
212 
213  LockGuardType guard {controllerMutex};
214  dmpCtrl->flow(deltaT, currentPose, currentTwist);
215 
216  targetVels = dmpCtrl->getTargetVelocity();
217 
218  debugOutputData.getWriteBuffer().latestTargetVelocities["x_vel"] = targetVels(0);
219  debugOutputData.getWriteBuffer().latestTargetVelocities["y_vel"] = targetVels(1);
220  debugOutputData.getWriteBuffer().latestTargetVelocities["z_vel"] = targetVels(2);
221  debugOutputData.getWriteBuffer().latestTargetVelocities["roll_vel"] = targetVels(3);
222  debugOutputData.getWriteBuffer().latestTargetVelocities["pitch_vel"] = targetVels(4);
223  debugOutputData.getWriteBuffer().latestTargetVelocities["yaw_vel"] = targetVels(5);
224  debugOutputData.getWriteBuffer().currentPose["currentPose_x"] = currentPose(0, 3);
225  debugOutputData.getWriteBuffer().currentPose["currentPose_y"] = currentPose(1, 3);
226  debugOutputData.getWriteBuffer().currentPose["currentPose_z"] = currentPose(2, 3);
227  VirtualRobot::MathTools::Quaternion currentQ = VirtualRobot::MathTools::eigen4f2quat(currentPose);
228  debugOutputData.getWriteBuffer().currentPose["currentPose_qw"] = currentQ.w;
229  debugOutputData.getWriteBuffer().currentPose["currentPose_qx"] = currentQ.x;
230  debugOutputData.getWriteBuffer().currentPose["currentPose_qy"] = currentQ.y;
231  debugOutputData.getWriteBuffer().currentPose["currentPose_qz"] = currentQ.z;
232  debugOutputData.getWriteBuffer().currentCanVal = dmpCtrl->debugData.canVal;
233  debugOutputData.getWriteBuffer().mpcFactor = dmpCtrl->debugData.mpcFactor;
234  debugOutputData.getWriteBuffer().error = dmpCtrl->debugData.poseError;
235  debugOutputData.getWriteBuffer().posError = dmpCtrl->debugData.posiError;
236  debugOutputData.getWriteBuffer().oriError = dmpCtrl->debugData.oriError;
237  debugOutputData.getWriteBuffer().deltaT = deltaT;
238  debugOutputData.commitWrite();
239  }
240 
241  getWriterControlStruct().targetTSVel = targetVels;
243 
244  dmpRunning = true;
245  }
246 
247 
248  void NJointAdaptiveWipingController::rtRun(const IceUtil::Time& sensorValuesTimestamp, const IceUtil::Time& timeSinceLastIteration)
249  {
250  double deltaT = timeSinceLastIteration.toSecondsDouble();
251 
252  Eigen::Matrix4f currentPose = tcp->getPoseInRootFrame();
253  rt2UserData.getWriteBuffer().currentTcpPose = currentPose;
254  rt2UserData.getWriteBuffer().waitTimeForCalibration += deltaT;
255  rt2UserData.commitWrite();
256 
257  Eigen::Vector3f currentToolDir;
258  currentToolDir.setZero();
259  Eigen::MatrixXf jacobi = ik->getJacobianMatrix(tcp, VirtualRobot::IKSolver::CartesianSelection::All);
260 
261  Eigen::VectorXf qpos(positionSensors.size());
262  Eigen::VectorXf qvel(velocitySensors.size());
263  for (size_t i = 0; i < positionSensors.size(); ++i)
264  {
265  qpos(i) = positionSensors[i]->position;
266  qvel(i) = velocitySensors[i]->velocity;
267  }
268 
269  qvel_filtered = (1 - cfg->velFilter) * qvel_filtered + cfg->velFilter * qvel;
270  Eigen::VectorXf currentTwist = jacobi * qvel_filtered;
271 
272  Eigen::VectorXf targetVel(6);
273  Eigen::Vector3f axis;
274  axis.setZero();
275  targetVel.setZero();
276  Eigen::Vector3f forceInToolFrame;
277  forceInToolFrame << 0, 0, 0;
278 
279  Eigen::Vector3f torqueInToolFrame;
280  torqueInToolFrame << 0, 0, 0;
281 
282  float angle = 0;
283  if (firstRun || !dmpRunning)
284  {
285  lastPosition = currentPose.block<2, 1>(0, 3);
286  targetPose = currentPose;
287  firstRun = false;
288  filteredForce.setZero();
289  Eigen::Vector3f currentForce = forceSensor->force - forceOffset;
290 
291  Eigen::Matrix3f forceFrameOri = rtGetRobot()->getSensor(cfg->forceSensorName)->getRobotNode()->getPoseInRootFrame().block<3, 3>(0, 0);
292  Eigen::Vector3f gravityInForceFrame = forceFrameOri.transpose() * gravityInRoot;
293  Eigen::Vector3f handGravity = handMass * gravityInForceFrame;
294  currentForce = currentForce - handGravity;
295 
296  currentForceOffset = 0.1 * currentForceOffset + 0.9 * currentForce;
297  origHandOri = currentPose.block<3, 3>(0, 0);
298  toolTransform = origHandOri.transpose();
299  targetVel.setZero();
300  }
301  else
302  {
303  // communicate with DMP controller
305  targetVel = rtGetControlStruct().targetTSVel;
306  targetVel(2) = 0;
307 
308  // calculate force
309  Eigen::Vector3f currentForce = forceSensor->force - forceOffset - currentForceOffset;
310 
311  Eigen::Matrix3f forceFrameOri = rtGetRobot()->getSensor(cfg->forceSensorName)->getRobotNode()->getPoseInRootFrame().block<3, 3>(0, 0);
312  Eigen::Vector3f gravityInForceFrame = forceFrameOri.transpose() * gravityInRoot;
313  Eigen::Vector3f handGravity = handMass * gravityInForceFrame;
314 
315  currentForce = currentForce - handGravity;
316  filteredForce = (1 - cfg->forceFilter) * filteredForce + cfg->forceFilter * currentForce;
317 
318  Eigen::Vector3f currentTorque = forceSensor->torque - torqueOffset;
319  Eigen::Vector3f handTorque = handCOM.cross(gravityInForceFrame);
320  currentTorque = currentTorque - handTorque;
321  filteredTorque = (1 - cfg->forceFilter) * filteredTorque + cfg->forceFilter * currentTorque;
322 
323  for (size_t i = 0; i < 3; ++i)
324  {
325  if (fabs(filteredForce(i)) > cfg->forceDeadZone)
326  {
327  filteredForce(i) -= (filteredForce(i) / fabs(filteredForce(i))) * cfg->forceDeadZone;
328  }
329  else
330  {
331  filteredForce(i) = 0;
332  }
333  }
334 
335  filteredForceInRoot = forceFrameOri * filteredForce;
336  filteredTorqueInRoot = forceFrameOri * filteredTorque;
337  float targetForce = user2rtData.getUpToDateReadBuffer().targetForce;
338 
339  Eigen::Matrix3f currentHandOri = currentPose.block<3, 3>(0, 0);
340  Eigen::Matrix3f currentToolOri = currentHandOri * toolTransform;
341 
342  forceInToolFrame = currentToolOri.transpose() * filteredForceInRoot;
343  torqueInToolFrame = currentToolOri.transpose() * filteredTorqueInRoot;
344 
345  float desiredZVel = kpf * (targetForce - forceInToolFrame(2));
346  targetVel(2) -= desiredZVel;
347  targetVel.block<3, 1>(0, 0) = currentToolOri * targetVel.block<3, 1>(0, 0);
348 
349  currentToolDir = currentToolOri * oriToolDir;
350 
351  for (int i = 3; i < 6; ++i)
352  {
353  targetVel(i) = 0;
354  }
355 
356  // rotation changes
357 
358  if (filteredForceInRoot.norm() > fabs(cfg->minimumReactForce))
359  {
360  Eigen::Vector3f toolYDir;
361  toolYDir << 0, 1.0, 0;
362  Eigen::Vector3f toolYDirInRoot = currentToolOri * toolYDir;
363  Eigen::Vector3f projectedFilteredForceInRoot = filteredForceInRoot - filteredForceInRoot.dot(toolYDirInRoot) * toolYDirInRoot;
364  Eigen::Vector3f desiredToolDir = projectedFilteredForceInRoot.normalized();// / projectedFilteredForceInRoot.norm();
365  currentToolDir.normalize();
366 
367  axis = currentToolDir.cross(desiredToolDir);
368  axis = axis.normalized();
369  angle = acosf(currentToolDir.dot(desiredToolDir));
370 
371 
372  if (fabs(angle) < M_PI / 2 && fabs(angle) > cfg->frictionCone)
373  {
374  // sigmoid function
375  float adaptedAngularKp = cfg->angularKp / (1 + exp(10 * (angle - M_PI / 4)));
376  float angularKp = fmin(adaptedAngularKp, cfg->angularKp);
377 
378  // test axis
379  Eigen::Vector3f fixedAxis;
380  if (axis(1) > 0)
381  {
382  fixedAxis << 0.0, 1.0, 0.0;
383  }
384  else
385  {
386  fixedAxis << 0.0, -1.0, 0.0;
387  }
388  Eigen::AngleAxisf desiredToolRot(angle - cfg->frictionCone, fixedAxis);
389  Eigen::Matrix3f desiredRotMat = desiredToolRot * Eigen::Matrix3f::Identity();
390 
391  Eigen::Vector3f angularDiff = VirtualRobot::MathTools::eigen3f2rpy(desiredRotMat);
392 
393  targetVel.tail(3) = angularKp * angularDiff;
394 
395  //Eigen::Vector3f desiredRPY = VirtualRobot::MathTools::eigen3f2rpy(desiredRotMat);
396  Eigen::Vector3f checkedToolDir = desiredRotMat * currentToolDir;
397  checkedToolDir.normalize();
398  }
399  }
400  // integrate for targetPose
401  }
402 
403  bool isPhaseStop = false;
404 
405  float diff = (targetPose.block<2, 1>(0, 3) - currentPose.block<2, 1>(0, 3)).norm();
406  if (diff > cfg->phaseDist0)
407  {
408  isPhaseStop = true;
409  }
410 
411  float dTf = (float)deltaT;
412 
413 
414  if (filteredForceInRoot.block<2, 1>(0, 0).norm() > cfg->dragForceDeadZone)
415  {
416  Eigen::Vector2f dragForce = filteredForceInRoot.block<2, 1>(0, 0) - cfg->dragForceDeadZone * filteredForceInRoot.block<2, 1>(0, 0) / filteredForceInRoot.block<2, 1>(0, 0).norm();
417  adaptK(0) = fmax(adaptK(0) - dTf * cfg->adaptForceCoeff * dragForce.norm(), 0);
418  adaptK(1) = fmax(adaptK(1) - dTf * cfg->adaptForceCoeff * dragForce.norm(), 0);
419  lastDiff = diff;
420  }
421  else
422  {
423  adaptK(0) = fmin(adaptK(0) + fabs(dTf * cfg->adaptCoeff), kpos(0));
424  adaptK(1) = fmin(adaptK(1) + fabs(dTf * cfg->adaptCoeff), kpos(1));
425  }
426  adaptK(2) = kpos(2);
427 
428  // adaptive control with distance
429 
430 
431 
432 
433  targetPose.block<3, 1>(0, 3) = targetPose.block<3, 1>(0, 3) + dTf * targetVel.block<3, 1>(0, 0);
434  Eigen::Matrix3f rotMat = VirtualRobot::MathTools::rpy2eigen3f(dTf * targetVel(3), dTf * targetVel(4), dTf * targetVel(5));
435  targetPose.block<3, 3>(0, 0) = rotMat * targetPose.block<3, 3>(0, 0);
436 
437  if (isPhaseStop)
438  {
439  Eigen::Vector2f currentXY = currentPose.block<2, 1>(0, 3);
440  if ((lastPosition - currentXY).norm() < cfg->changePositionTolerance)
441  {
442  changeTimer += deltaT;
443  }
444  else
445  {
446  lastPosition = currentPose.block<2, 1>(0, 3);
447  changeTimer = 0;
448  }
449 
450  if (changeTimer > cfg->changeTimerThreshold)
451  {
452  targetPose(0, 3) = currentPose(0, 3);
453  targetPose(1, 3) = currentPose(1, 3);
454  isPhaseStop = false;
455  changeTimer = 0;
456  }
457  }
458  else
459  {
460  changeTimer = 0;
461  }
462 
463 
464  targetPose(0, 3) = targetPose(0, 3) > cfg->ws_x[0] ? targetPose(0, 3) : cfg->ws_x[0];
465  targetPose(0, 3) = targetPose(0, 3) < cfg->ws_x[1] ? targetPose(0, 3) : cfg->ws_x[1];
466 
467  targetPose(1, 3) = targetPose(1, 3) > cfg->ws_y[0] ? targetPose(1, 3) : cfg->ws_y[0];
468  targetPose(1, 3) = targetPose(1, 3) < cfg->ws_y[1] ? targetPose(1, 3) : cfg->ws_y[1];
469 
470  targetPose(2, 3) = targetPose(2, 3) > cfg->ws_z[0] ? targetPose(2, 3) : cfg->ws_z[0];
471  targetPose(2, 3) = targetPose(2, 3) < cfg->ws_z[1] ? targetPose(2, 3) : cfg->ws_z[1];
472 
473 
474 
475  debugRT.getWriteBuffer().currentToolDir = tcp->getRobot()->getRootNode()->toGlobalCoordinateSystemVec(currentToolDir);
476  debugRT.getWriteBuffer().targetPose = targetPose;
477  debugRT.getWriteBuffer().globalPose = tcp->getRobot()->getRootNode()->toGlobalCoordinateSystem(targetPose);
478  debugRT.getWriteBuffer().currentPose = currentPose;
479  debugRT.getWriteBuffer().filteredForceInRoot = filteredForceInRoot;
480  debugRT.getWriteBuffer().rotationAxis = axis;
481  debugRT.getWriteBuffer().filteredForce = forceInToolFrame;
482  debugRT.getWriteBuffer().globalFilteredForce = tcp->getRobot()->getRootNode()->toGlobalCoordinateSystemVec(filteredForceInRoot);
483  debugRT.getWriteBuffer().targetVel = targetVel;
484  debugRT.getWriteBuffer().adaptK = adaptK;
485  debugRT.getWriteBuffer().isPhaseStop = isPhaseStop;
486  debugRT.getWriteBuffer().rotAngle = angle;
487  debugRT.getWriteBuffer().currentTwist = currentTwist;
488  debugRT.getWriteBuffer().filteredTorque = torqueInToolFrame;
489 
490 
491  debugRT.commitWrite();
492 
493  rt2CtrlData.getWriteBuffer().currentPose = currentPose;
494  rt2CtrlData.getWriteBuffer().currentTwist = currentTwist;
495  rt2CtrlData.getWriteBuffer().deltaT = deltaT;
496  rt2CtrlData.getWriteBuffer().currentTime += deltaT;
497  rt2CtrlData.getWriteBuffer().isPhaseStop = isPhaseStop;
498  rt2CtrlData.commitWrite();
499 
500  // Eigen::Matrix3f rotVel = VirtualRobot::MathTools::rpy2eigen3f(targetVel(3) * dTf, targetVel(4) * dTf, targetVel(5) * dTf);
501  // targetPose.block<3, 3>(0, 0) = rotVel * targetPose.block<3, 3>(0, 0);
502 
503  // inverse dynamic controller
504  jacobi.block<3, 8>(0, 0) = 0.001 * jacobi.block<3, 8>(0, 0); // convert mm to m
505 
506 
507 
508 
509  Eigen::Vector6f jointControlWrench;
510  {
511  Eigen::Vector3f targetTCPLinearVelocity;
512  targetTCPLinearVelocity << 0.001 * targetVel(0), 0.001 * targetVel(1), 0.001 * targetVel(2);
513  Eigen::Vector3f currentTCPLinearVelocity;
514  currentTCPLinearVelocity << 0.001 * currentTwist(0), 0.001 * currentTwist(1), 0.001 * currentTwist(2);
515  Eigen::Vector3f currentTCPPosition = currentPose.block<3, 1>(0, 3);
516  Eigen::Vector3f desiredPosition = targetPose.block<3, 1>(0, 3);
517 
518  Eigen::Vector3f linearVel = adaptK.cwiseProduct(desiredPosition - currentTCPPosition);
519 
520  // if (isPhaseStop)
521  // {
522  // linearVel = ((float)cfg->phaseKpPos) * (desiredPosition - currentTCPPosition);
523  // for (size_t i = 0; i < 3; ++i)
524  // {
525  // linearVel(i) = fmin(cfg->maxLinearVel, linearVel(i));
526  // }
527  // }
528  // else
529  // {
530  // linearVel = kpos.cwiseProduct(desiredPosition - currentTCPPosition);
531  // }
532  Eigen::Vector3f tcpDesiredForce = 0.001 * linearVel + dpos.cwiseProduct(- currentTCPLinearVelocity);
533 
534  Eigen::Vector3f currentTCPAngularVelocity;
535  currentTCPAngularVelocity << currentTwist(3), currentTwist(4), currentTwist(5);
536  Eigen::Matrix3f currentRotMat = currentPose.block<3, 3>(0, 0);
537  Eigen::Matrix3f diffMat = targetPose.block<3, 3>(0, 0) * currentRotMat.inverse();
538  Eigen::Vector3f rpy = VirtualRobot::MathTools::eigen3f2rpy(diffMat);
539  Eigen::Vector3f tcpDesiredTorque = kori.cwiseProduct(rpy) + dori.cwiseProduct(- currentTCPAngularVelocity);
540  jointControlWrench << tcpDesiredForce, tcpDesiredTorque;
541  }
542 
543 
544 
545  Eigen::MatrixXf I = Eigen::MatrixXf::Identity(targets.size(), targets.size());
546  Eigen::VectorXf nullspaceTorque = knull.cwiseProduct(nullSpaceJointsVec - qpos) - dnull.cwiseProduct(qvel);
547  Eigen::MatrixXf jtpinv = ik->computePseudoInverseJacobianMatrix(jacobi.transpose(), 2.0);
548  Eigen::VectorXf jointDesiredTorques = jacobi.transpose() * jointControlWrench + (I - jacobi.transpose() * jtpinv) * nullspaceTorque;
549 
550  // torque filter (maybe)
551  for (size_t i = 0; i < targets.size(); ++i)
552  {
553  targets.at(i)->torque = jointDesiredTorques(i);
554 
555  if (!targets.at(i)->isValid())
556  {
557  targets.at(i)->torque = 0.0f;
558  }
559  else
560  {
561  if (fabs(targets.at(i)->torque) > fabs(cfg->maxJointTorque))
562  {
563  targets.at(i)->torque = fabs(cfg->maxJointTorque) * (targets.at(i)->torque / fabs(targets.at(i)->torque));
564  }
565  }
566  }
567 
568 
569  }
570 
571 
572  void NJointAdaptiveWipingController::learnDMPFromFiles(const Ice::StringSeq& fileNames, const Ice::Current&)
573  {
574  ARMARX_INFO << "Learning DMP ... ";
575 
576  LockGuardType guard {controllerMutex};
577  dmpCtrl->learnDMPFromFiles(fileNames);
578 
579  }
580 
581  void NJointAdaptiveWipingController::learnDMPFromTrajectory(const TrajectoryBasePtr& trajectory, const Ice::Current&)
582  {
583  ARMARX_INFO << "Learning DMP ... ";
584  ARMARX_CHECK_EXPRESSION(trajectory);
585  TrajectoryPtr dmpTraj = TrajectoryPtr::dynamicCast(trajectory);
586  ARMARX_CHECK_EXPRESSION(dmpTraj);
587 
588  LockGuardType guard {controllerMutex};
589  dmpCtrl->learnDMPFromTrajectory(dmpTraj);
590 
591  }
592 
593  void NJointAdaptiveWipingController::setSpeed(Ice::Double times, const Ice::Current&)
594  {
595  LockGuardType guard {controllerMutex};
596  dmpCtrl->setSpeed(times);
597  }
598 
599 
600  void NJointAdaptiveWipingController::setGoals(const Ice::DoubleSeq& goals, const Ice::Current& ice)
601  {
602  LockGuardType guard {controllerMutex};
603  dmpCtrl->setGoalPoseVec(goals);
604  }
605 
607  {
608  LockGuardType guard {controllerMutex};
609  dmpCtrl->setAmplitude(amp);
610  }
611 
612  void NJointAdaptiveWipingController::setTargetForceInRootFrame(float targetForce, const Ice::Current&)
613  {
615  user2rtData.getWriteBuffer().targetForce = targetForce;
616  user2rtData.commitWrite();
617  }
618 
619  void NJointAdaptiveWipingController::runDMP(const Ice::DoubleSeq& goals, Ice::Double tau, const Ice::Current&)
620  {
621  firstRun = true;
622  while (firstRun || rt2UserData.getUpToDateReadBuffer().waitTimeForCalibration < cfg->waitTimeForCalibration)
623  {
624  usleep(100);
625  }
626 
627 
628  Eigen::Matrix4f pose = rt2UserData.getUpToDateReadBuffer().currentTcpPose;
629 
630  LockGuardType guard {controllerMutex};
631  dmpCtrl->prepareExecution(dmpCtrl->eigen4f2vec(pose), goals);
632  dmpCtrl->setSpeed(tau);
633 
634  ARMARX_IMPORTANT << "run DMP";
635  started = true;
636  dmpRunning = false;
637  }
638 
639 
641  {
642  std::string datafieldName;
643  std::string debugName = "Periodic";
644  StringVariantBaseMap datafields;
645 
646  Eigen::Matrix4f targetPoseDebug = debugRT.getUpToDateReadBuffer().targetPose;
647  datafields["target_x"] = new Variant(targetPoseDebug(0, 3));
648  datafields["target_y"] = new Variant(targetPoseDebug(1, 3));
649  datafields["target_z"] = new Variant(targetPoseDebug(2, 3));
650 
651  Eigen::Matrix4f currentPoseDebug = debugRT.getUpToDateReadBuffer().currentPose;
652  datafields["current_x"] = new Variant(currentPoseDebug(0, 3));
653  datafields["current_y"] = new Variant(currentPoseDebug(1, 3));
654  datafields["current_z"] = new Variant(currentPoseDebug(2, 3));
655 
656  Eigen::Vector3f filteredForce = debugRT.getUpToDateReadBuffer().filteredForce;
657  datafields["filteredforceInTool_x"] = new Variant(filteredForce(0));
658  datafields["filteredforceInTool_y"] = new Variant(filteredForce(1));
659  datafields["filteredforceInTool_z"] = new Variant(filteredForce(2));
660 
661  Eigen::Vector3f filteredTorque = debugRT.getUpToDateReadBuffer().filteredTorque;
662  datafields["filteredtorqueInTool_x"] = new Variant(filteredTorque(0));
663  datafields["filteredtorqueInTool_y"] = new Variant(filteredTorque(1));
664  datafields["filteredtorqueInTool_z"] = new Variant(filteredTorque(2));
665 
666 
667  Eigen::Vector3f filteredForceInRoot = debugRT.getUpToDateReadBuffer().filteredForceInRoot;
668  datafields["filteredForceInRoot_x"] = new Variant(filteredForceInRoot(0));
669  datafields["filteredForceInRoot_y"] = new Variant(filteredForceInRoot(1));
670  datafields["filteredForceInRoot_z"] = new Variant(filteredForceInRoot(2));
671 
672  Eigen::Vector3f rotationAxis = debugRT.getUpToDateReadBuffer().rotationAxis;
673  datafields["rotationAxis_x"] = new Variant(rotationAxis(0));
674  datafields["rotationAxis_y"] = new Variant(rotationAxis(1));
675  datafields["rotationAxis_z"] = new Variant(rotationAxis(2));
676 
677  Eigen::Vector3f reactForce = debugRT.getUpToDateReadBuffer().reactForce;
678  datafields["reactForce_x"] = new Variant(reactForce(0));
679  datafields["reactForce_y"] = new Variant(reactForce(1));
680  datafields["reactForce_z"] = new Variant(reactForce(2));
681 
682  Eigen::VectorXf targetVel = debugRT.getUpToDateReadBuffer().targetVel;
683  datafields["targetVel_x"] = new Variant(targetVel(0));
684  datafields["targetVel_y"] = new Variant(targetVel(1));
685  datafields["targetVel_z"] = new Variant(targetVel(2));
686  datafields["targetVel_ro"] = new Variant(targetVel(3));
687  datafields["targetVel_pi"] = new Variant(targetVel(4));
688  datafields["targetVel_ya"] = new Variant(targetVel(5));
689 
690  Eigen::VectorXf currentTwist = debugRT.getUpToDateReadBuffer().currentTwist;
691  datafields["currentTwist_x"] = new Variant(currentTwist(0));
692  datafields["currentTwist_y"] = new Variant(currentTwist(1));
693  datafields["currentTwist_z"] = new Variant(currentTwist(2));
694  datafields["currentTwist_ro"] = new Variant(currentTwist(3));
695  datafields["currentTwist_pi"] = new Variant(currentTwist(4));
696  datafields["currentTwist_ya"] = new Variant(currentTwist(5));
697 
698 
699  Eigen::Vector3f adaptK = debugRT.getUpToDateReadBuffer().adaptK;
700  datafields["adaptK_x"] = new Variant(adaptK(0));
701  datafields["adaptK_y"] = new Variant(adaptK(1));
702 
703  datafields["canVal"] = new Variant(debugOutputData.getUpToDateReadBuffer().currentCanVal);
704  datafields["deltaT"] = new Variant(debugOutputData.getUpToDateReadBuffer().deltaT);
705 
706  datafields["PhaseStop"] = new Variant(debugRT.getUpToDateReadBuffer().isPhaseStop);
707  datafields["rotAngle"] = new Variant(debugRT.getUpToDateReadBuffer().rotAngle);
708 
709 
710  // datafields["targetVel_rx"] = new Variant(targetVel(3));
711  // datafields["targetVel_ry"] = new Variant(targetVel(4));
712  // datafields["targetVel_rz"] = new Variant(targetVel(5));
713 
714  // auto values = debugOutputData.getUpToDateReadBuffer().latestTargetVelocities;
715  // for (auto& pair : values)
716  // {
717  // datafieldName = pair.first + "_" + debugName;
718  // datafields[datafieldName] = new Variant(pair.second);
719  // }
720 
721  // auto currentPose = debugOutputData.getUpToDateReadBuffer().currentPose;
722  // for (auto& pair : currentPose)
723  // {
724  // datafieldName = pair.first + "_" + debugName;
725  // datafields[datafieldName] = new Variant(pair.second);
726  // }
727 
728  // datafieldName = "canVal_" + debugName;
729  // datafields[datafieldName] = new Variant(debugOutputData.getUpToDateReadBuffer().currentCanVal);
730  // datafieldName = "mpcFactor_" + debugName;
731  // datafields[datafieldName] = new Variant(debugOutputData.getUpToDateReadBuffer().mpcFactor);
732  // datafieldName = "error_" + debugName;
733  // datafields[datafieldName] = new Variant(debugOutputData.getUpToDateReadBuffer().error);
734  // datafieldName = "posError_" + debugName;
735  // datafields[datafieldName] = new Variant(debugOutputData.getUpToDateReadBuffer().posError);
736  // datafieldName = "oriError_" + debugName;
737  // datafields[datafieldName] = new Variant(debugOutputData.getUpToDateReadBuffer().oriError);
738  // datafieldName = "deltaT_" + debugName;
739  // datafields[datafieldName] = new Variant(debugOutputData.getUpToDateReadBuffer().deltaT);
740 
741  datafieldName = "PeriodicDMP";
742  debugObs->setDebugChannel(datafieldName, datafields);
743 
744 
745  // draw force;
746  Eigen::Matrix4f globalPose = debugRT.getUpToDateReadBuffer().globalPose;
747  Eigen::Vector3f handPosition = globalPose.block<3, 1>(0, 3);
748  Eigen::Vector3f forceDir = debugRT.getUpToDateReadBuffer().globalFilteredForce;
749 
750  debugDrawer->setArrowVisu("Force", "currentForce", new Vector3(handPosition), new Vector3(forceDir), DrawColor {0, 0, 1, 1}, 10 * forceDir.norm(), 3);
751 
752  // draw direction of the tool
753  Eigen::Vector3f currentToolDir = debugRT.getUpToDateReadBuffer().currentToolDir;
754  debugDrawer->setArrowVisu("Tool", "Tool", new Vector3(handPosition), new Vector3(currentToolDir), DrawColor {1, 0, 0, 1}, 100, 3);
755  debugDrawer->setPoseVisu("target", "targetPose", new Pose(globalPose));
756 
757  }
758 
759 
760 
762  {
763  ARMARX_INFO << "stopped ...";
764  }
765 
766 
767 
768 }
armarx::NJointControllerWithTripleBuffer< NJointAdaptiveWipingControllerControlData >::reinitTripleBuffer
void reinitTripleBuffer(const NJointAdaptiveWipingControllerControlData &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::tsvmp::PhaseStopParams::Kori
float Kori
Definition: TaskSpaceVMP.h:47
armarx::control::deprecated_njoint_mp_controller::adaptive::NJointAdaptiveWipingControllerControlData
Definition: NJointAdaptiveWipingController.h:30
armarx::control::deprecated_njoint_mp_controller::adaptive::NJointAdaptiveWipingController::onDisconnectNJointController
void onDisconnectNJointController()
Definition: NJointAdaptiveWipingController.cpp:761
armarx::control::deprecated_njoint_mp_controller::tsvmp::PhaseStopParams::Dpos
float Dpos
Definition: TaskSpaceVMP.h:46
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< NJointAdaptiveWipingControllerControlData >::rtGetControlStruct
const NJointAdaptiveWipingControllerControlData & 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::navigation::core::Pose
Eigen::Isometry3f Pose
Definition: basic_types.h:31
armarx::ControlTargetBase
Brief description of class JointControlTargetBase.
Definition: ControlTargetBase.h:47
armarx::TripleBuffer::commitWrite
void commitWrite()
Definition: TripleBuffer.h:146
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::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_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::control::deprecated_njoint_mp_controller::adaptive::NJointAdaptiveWipingController::setTargetForceInRootFrame
void setTargetForceInRootFrame(Ice::Float force, const Ice::Current &)
Definition: NJointAdaptiveWipingController.cpp:612
armarx::NJointControllerWithTripleBuffer< NJointAdaptiveWipingControllerControlData >::getWriterControlStruct
NJointAdaptiveWipingControllerControlData & getWriterControlStruct()
Definition: NJointControllerWithTripleBuffer.h:54
armarx::control::deprecated_njoint_mp_controller::tsvmp::PhaseStopParams::goDist
float goDist
Definition: TaskSpaceVMP.h:41
armarx::NJointControllerWithTripleBuffer< NJointAdaptiveWipingControllerControlData >::LockGuardType
std::lock_guard< std::recursive_mutex > LockGuardType
Definition: NJointControllerWithTripleBuffer.h:14
armarx::SensorValueForceTorque::force
Eigen::Vector3f force
Definition: SensorValueForceTorque.h:35
armarx::VariantType::Quaternion
const VariantTypeId Quaternion
Definition: Pose.h:39
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::control::deprecated_njoint_mp_controller::adaptive::NJointAdaptiveWipingControllerControlData::targetTSVel
Eigen::VectorXf targetTSVel
Definition: NJointAdaptiveWipingController.h:33
armarx::detail::ControlThreadOutputBufferEntry
Definition: ControlThreadOutputBuffer.h:177
armarx::VariantType::Double
const VariantTypeId Double
Definition: Variant.h:919
armarx::control::deprecated_njoint_mp_controller::adaptive
Definition: NJointAdaptiveWipingController.cpp:5
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
M_PI
#define M_PI
Definition: MathTools.h:17
armarx::NJointControllerBase::isControllerActive
bool isControllerActive(const Ice::Current &=Ice::emptyCurrent) const final override
Definition: NJointControllerBase.h:777
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::NJointControllerWithTripleBuffer< NJointAdaptiveWipingControllerControlData >::rtUpdateControlStruct
bool rtUpdateControlStruct()
Definition: NJointControllerWithTripleBuffer.h:38
armarx::control::deprecated_njoint_mp_controller::adaptive::NJointAdaptiveWipingController::setAmplitude
void setAmplitude(Ice::Double amp, const Ice::Current &)
Definition: NJointAdaptiveWipingController.cpp:606
armarx::NJointControllerWithTripleBuffer< NJointAdaptiveWipingControllerControlData >::writeControlStruct
void writeControlStruct()
Definition: NJointControllerWithTripleBuffer.h:44
armarx::control::deprecated_njoint_mp_controller::adaptive::NJointAdaptiveWipingController::rtRun
void rtRun(const IceUtil::Time &sensorValuesTimestamp, const IceUtil::Time &timeSinceLastIteration)
TODO make protected and use attorneys.
Definition: NJointAdaptiveWipingController.cpp:248
armarx::control::deprecated_njoint_mp_controller::adaptive::NJointAdaptiveWipingController::learnDMPFromTrajectory
void learnDMPFromTrajectory(const TrajectoryBasePtr &trajectory, const Ice::Current &)
Definition: NJointAdaptiveWipingController.cpp:581
armarx::SensorValueForceTorque::torque
DETAIL_SensorValueBase_DEFAULT_METHOD_IMPLEMENTATION Eigen::Vector3f torque
Definition: SensorValueForceTorque.h:34
ArmarXObjectScheduler.h
armarx::NJointControllerWithTripleBuffer< NJointAdaptiveWipingControllerControlData >::controlDataMutex
MutexType controlDataMutex
Definition: NJointControllerWithTripleBuffer.h:73
armarx::control::deprecated_njoint_mp_controller::adaptive::NJointAdaptiveWipingController::onPublish
virtual void onPublish(const SensorAndControl &, const DebugDrawerInterfacePrx &, const DebugObserverInterfacePrx &)
Definition: NJointAdaptiveWipingController.cpp:640
armarx::control::deprecated_njoint_mp_controller::adaptive::registrationControllerNJointAdaptiveWipingController
NJointControllerRegistration< NJointAdaptiveWipingController > registrationControllerNJointAdaptiveWipingController("NJointAdaptiveWipingController")
armarx::control::deprecated_njoint_mp_controller::adaptive::NJointAdaptiveWipingController::setSpeed
void setSpeed(Ice::Double times, const Ice::Current &)
Definition: NJointAdaptiveWipingController.cpp:593
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
for
for(;yybottom<=yytop;yybottom++)
Definition: Grammar.cpp:790
armarx::control::deprecated_njoint_mp_controller::adaptive::NJointAdaptiveWipingController::onInitNJointController
void onInitNJointController()
Definition: NJointAdaptiveWipingController.cpp:147
armarx::control::deprecated_njoint_mp_controller::adaptive::NJointAdaptiveWipingController::NJointAdaptiveWipingController
NJointAdaptiveWipingController(const RobotUnitPtr &, const NJointControllerConfigPtr &config, const VirtualRobot::RobotPtr &)
Definition: NJointAdaptiveWipingController.cpp:9
GfxTL::Matrix3f
MatrixXX< 3, 3, float > Matrix3f
Definition: MatrixXX.h:600
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:601
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::adaptive::NJointAdaptiveWipingController::setGoals
void setGoals(const Ice::DoubleSeq &goals, const Ice::Current &)
Definition: NJointAdaptiveWipingController.cpp:600
float
#define float
Definition: 16_Level.h:22
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::control::deprecated_njoint_mp_controller::adaptive::NJointAdaptiveWipingController::learnDMPFromFiles
void learnDMPFromFiles(const Ice::StringSeq &fileNames, const Ice::Current &)
Definition: NJointAdaptiveWipingController.cpp:572
memoryx::KBM::Vector3
Eigen::Vector3d Vector3
Definition: kbm.h:41
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
angle
double angle(const Point &a, const Point &b, const Point &c)
Definition: point.hpp:100
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::adaptive::NJointAdaptiveWipingController::runDMP
void runDMP(const Ice::DoubleSeq &goals, Ice::Double tau, const Ice::Current &)
Definition: NJointAdaptiveWipingController.cpp:619
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::control::deprecated_njoint_mp_controller::adaptive::NJointAdaptiveWipingController::getClassName
std::string getClassName(const Ice::Current &) const
Definition: NJointAdaptiveWipingController.cpp:183
NJointAdaptiveWipingController.h
armarx::control::deprecated_njoint_mp_controller::adaptive::NJointAdaptiveWipingController::controllerRun
void controllerRun()
Definition: NJointAdaptiveWipingController.cpp:188
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::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
norm
double norm(const Point &a)
Definition: point.hpp:94