TaskSpaceVMP.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @package RobotAPI::ArmarXObjects::DMPController
17  * @author zhou ( you dot zhou at kit dot edu )
18  * @date 2018
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #include "TaskSpaceVMP.h"
24 
25 #include <boost/archive/text_iarchive.hpp>
26 #include <boost/archive/text_oarchive.hpp>
27 #include <boost/archive/xml_iarchive.hpp>
28 #include <boost/archive/xml_oarchive.hpp>
29 
31 
32 
34 {
35 
36  void
38  const Eigen::Matrix4f& currentPose,
39  const Eigen::VectorXf& twist)
40  {
41  canVal = flow(canVal, deltaT, currentPose, twist);
42  }
43 
44  double
46  double deltaT,
47  const Eigen::Matrix4f& currentPose,
48  const Eigen::VectorXf& twist)
49  {
50  if (paused)
51  {
52  targetVel.setZero();
53  return canVal;
54  }
55  if (canVal < 0.1 && config.DMPStyle == "Periodic")
56  {
58  }
59  if (canVal < 1e-8 && config.DMPStyle == "Discrete")
60  {
61  targetVel.setZero();
62  return canVal;
63  }
64 
65  Eigen::Vector3f currentPosition;
66  Eigen::Quaterniond currentOrientation;
67  double posiError = 0;
68  double oriError = 0;
69 
70  getError(currentPose, currentPosition, currentOrientation, posiError, oriError);
71 
72  double poseError = posiError + config.phaseStopParas.mm2radi * oriError;
73 
74  double phaseDist;
75  if (isDisturbance)
76  {
77  phaseDist = config.phaseStopParas.backDist;
78  }
79  else
80  {
81  phaseDist = config.phaseStopParas.goDist;
82  }
83  double phaseL = config.phaseStopParas.maxValue;
84  double phaseK = config.phaseStopParas.slop;
85 
86  double phaseStop = phaseL / (1 + exp(-phaseK * (poseError - phaseDist)));
87  double mpcFactor = 1 - (phaseStop / phaseL);
88 
89  if (mpcFactor < 0.1)
90  {
91  isDisturbance = true;
92  }
93 
94  if (mpcFactor > 0.9)
95  {
96  isDisturbance = false;
97  }
98 
99  double timeDuration = config.motionTimeDuration;
100  canVal -= tau * deltaT * 1; // / (1 + phaseStop) ;
101 
102 
103  DMP::Vec<DMP::DMPState> temporalState = dmpPtr->calculateDirectlyVelocity(
104  currentState, canVal / timeDuration, deltaT / timeDuration, targetPoseVec);
105 
106  // scale translation velocity
107  for (size_t i = 0; i < 3; ++i)
108  {
109  currentState[i].vel = tau * temporalState[i].vel * config.DMPAmplitude / timeDuration;
110  currentState[i].pos += deltaT * currentState[i].vel;
111  }
112 
113  // define the translation velocity
114  if (isPhaseStopControl)
115  {
116  float vel0, vel1;
117 
118  Eigen::Vector3f linearVel;
119  linearVel << twist(0), twist(1), twist(2);
120  for (size_t i = 0; i < 3; i++)
121  {
122  vel0 = currentState[i].vel;
123  vel1 = config.phaseStopParas.Kpos * (targetPoseVec[i] - currentPosition(i)) -
124  config.phaseStopParas.Dpos * linearVel(i);
125  targetVel(i) = mpcFactor * vel0 + (1 - mpcFactor) * vel1;
126  }
127  }
128  else
129  {
130  for (size_t i = 0; i < 3; i++)
131  {
132  targetVel(i) = currentState[i].vel;
133  }
134  }
135 
136 
137  // define the rotation velocity
138  Eigen::Quaterniond dmpQuaternionVel;
139  dmpQuaternionVel.w() = temporalState[3].vel;
140  dmpQuaternionVel.x() = temporalState[4].vel;
141  dmpQuaternionVel.y() = temporalState[5].vel;
142  dmpQuaternionVel.z() = temporalState[6].vel;
143 
144  Eigen::Quaterniond dmpQuaternionPosi;
145  dmpQuaternionPosi.w() = currentState[3].pos;
146  dmpQuaternionPosi.x() = currentState[4].pos;
147  dmpQuaternionPosi.y() = currentState[5].pos;
148  dmpQuaternionPosi.z() = currentState[6].pos;
149 
150 
151  Eigen::Quaterniond angularVel0 = dmpQuaternionVel * dmpQuaternionPosi.inverse();
152  angularVel0.w() *= 2;
153  angularVel0.x() *= 2;
154  angularVel0.y() *= 2;
155  angularVel0.z() *= 2;
156 
157 
158  double angularChange = angularVel0.angularDistance(oldDMPAngularVelocity);
159  if (angularVel0.w() * oldDMPAngularVelocity.w() < 0 &&
160  angularVel0.x() * oldDMPAngularVelocity.x() < 0 &&
161  angularVel0.y() * oldDMPAngularVelocity.y() < 0 &&
162  angularVel0.z() * oldDMPAngularVelocity.z() < 0 && angularChange < 1e-2)
163  {
164  angularVel0.w() = -angularVel0.w();
165  angularVel0.x() = -angularVel0.x();
166  angularVel0.y() = -angularVel0.y();
167  angularVel0.z() = -angularVel0.z();
168  }
169  oldDMPAngularVelocity = angularVel0;
170 
171  // scale orientation velocity
172  angularVel0.w() = 0;
173  angularVel0.x() = tau * angularVel0.x() * config.oriAmplitude / timeDuration;
174  angularVel0.y() = tau * angularVel0.y() * config.oriAmplitude / timeDuration;
175  angularVel0.z() = tau * angularVel0.z() * config.oriAmplitude / timeDuration;
176 
177  // Eigen::Quaterniond scaledQuat = (angularVel0 * dmpQuaternionPosi);
178  // currentState[3].vel = 0.5 * scaledQuat.w();
179  // currentState[4].vel = 0.5 * scaledQuat.x();
180  // currentState[6].vel = 0.5 * scaledQuat.z();
181  // currentState[5].vel = 0.5 * scaledQuat.y();
182 
183  for (size_t i = 3; i < 7; ++i)
184  {
185  currentState[i].vel = tau * temporalState[i].vel * config.oriAmplitude / timeDuration;
186  currentState[i].pos += currentState[i].vel * deltaT;
187  }
188 
189  if (isPhaseStopControl)
190  {
191  Eigen::Vector3f currentAngularVel;
192  currentAngularVel << twist(3), twist(4), twist(5);
193 
194  Eigen::Quaternionf targetQuaternionf;
195  targetQuaternionf.w() = targetPoseVec[3];
196  targetQuaternionf.x() = targetPoseVec[4];
197  targetQuaternionf.y() = targetPoseVec[5];
198  targetQuaternionf.z() = targetPoseVec[6];
199 
200  Eigen::Matrix3f desiredMat(targetQuaternionf);
201  Eigen::Matrix3f currentMat = currentPose.block<3, 3>(0, 0);
202  Eigen::Matrix3f diffMat = desiredMat * currentMat.inverse();
203  Eigen::Vector3f diffRPY = VirtualRobot::MathTools::eigen3f2rpy(diffMat);
204  Eigen::Vector3f angularVel1 = config.phaseStopParas.Kori * diffRPY -
205  config.phaseStopParas.Dori * currentAngularVel;
206 
207  targetVel(3) =
208  mpcFactor * angularVel0.x() / timeDuration + (1 - mpcFactor) * angularVel1(0);
209  targetVel(4) =
210  mpcFactor * angularVel0.y() / timeDuration + (1 - mpcFactor) * angularVel1(1);
211  targetVel(5) =
212  mpcFactor * angularVel0.z() / timeDuration + (1 - mpcFactor) * angularVel1(2);
213  }
214  else
215  {
216  targetVel(3) = angularVel0.x();
217  targetVel(4) = angularVel0.y();
218  targetVel(5) = angularVel0.z();
219  }
220 
222  debugData.oriError = oriError;
223  debugData.posiError = posiError;
224  debugData.mpcFactor = mpcFactor;
225  debugData.poseError = poseError;
226 
227  return canVal;
228  }
229 
230  void
231  TaskSpaceDMPController::learnDMPFromFiles(const std::vector<std::string>& fileNames,
232  const std::vector<double>& ratios)
233  {
234  if (ratios.size() != fileNames.size())
235  {
236  ARMARX_ERROR << "ratios should have the same size with files";
237  return;
238  }
239 
240 
241  DMP::Vec<DMP::SampledTrajectoryV2> trajs;
242 
243  double ratioSum = 0;
244  for (size_t i = 0; i < fileNames.size(); ++i)
245  {
246  DMP::SampledTrajectoryV2 traj;
247  std::string absPath;
248  ArmarXDataPath::getAbsolutePath(fileNames.at(i), absPath);
249  traj.readFromCSVFile(absPath);
251  trajs.push_back(traj);
252 
253  ratioSum += ratios.at(i);
254  }
255 
256  if (ratioSum == 0)
257  {
258  ARMARX_ERROR << "ratios are invalid. The sum is equal to 0";
259  return;
260  }
261 
262  DMP::DVec ratiosVec;
263  ratiosVec.resize(ratios.size());
264  for (size_t i = 0; i < ratios.size(); ++i)
265  {
266  ratiosVec.at(i) = ratios.at(i) / ratioSum;
267  }
268 
269  dmpPtr->learnFromTrajectories(trajs);
270  dmpPtr->styleParas = dmpPtr->getStyleParasWithRatio(ratiosVec);
271  }
272 
273  void
274  TaskSpaceDMPController::learnDMPFromFiles(const std::vector<std::string>& fileNames)
275  {
276  std::vector<double> ratios;
277  for (size_t i = 0; i < fileNames.size(); ++i)
278  {
279  if (i == 0)
280  {
281  ratios.push_back(1.0);
282  }
283  else
284  {
285  ratios.push_back(0.0);
286  }
287  }
288 
289  learnDMPFromFiles(fileNames, ratios);
290  }
291 
292  void
294  const DMP::Vec<DMP::SampledTrajectoryV2>& trajs,
295  const std::vector<double>& ratios)
296  {
297  dmpPtr->learnFromTrajectories(trajs);
298  dmpPtr->styleParas = dmpPtr->getStyleParasWithRatio(ratios);
299  }
300 
301  void
302  TaskSpaceDMPController::setRatios(const std::vector<double>& ratios)
303  {
304  dmpPtr->styleParas = dmpPtr->getStyleParasWithRatio(ratios);
305  }
306 
307  void
309  {
310  ARMARX_CHECK_EQUAL(traj->dim(), 7);
311  DMP::SampledTrajectoryV2 dmpTraj;
312 
313  DMP::DVec timestamps(traj->getTimestamps());
314  for (size_t i = 0; i < traj->dim(); ++i)
315  {
316  DMP::DVec dimData(traj->getDimensionData(i, 0));
317  dmpTraj.addDimension(timestamps, dimData);
318  }
319 
320  DMP::Vec<DMP::SampledTrajectoryV2> trajs;
321 
322  dmpTraj = DMP::SampledTrajectoryV2::normalizeTimestamps(dmpTraj, 0, 1);
323  trajs.push_back(dmpTraj);
324  DMP::DVec ratiosVec;
325  ratiosVec.push_back(1.0);
326  dmpPtr->learnFromTrajectories(trajs);
327  dmpPtr->styleParas = dmpPtr->getStyleParasWithRatio(ratiosVec);
328  }
329 
330  void
331  TaskSpaceDMPController::loadDMPFromString(const std::string& dmpStr)
332  {
333  std::stringstream ss;
334  ss.str(dmpStr);
335  boost::archive::text_iarchive ia{ss};
336  DMP::UMITSMP* dmpPointer;
337  ia >> dmpPointer;
338  dmpPtr.reset(dmpPointer);
339  }
340 
341 
342  std::string
344  {
345  std::stringstream ss;
346  boost::archive::text_oarchive oa{ss};
347  oa << dmpPtr.get();
348  return ss.str();
349  }
350 
351  void
352  TaskSpaceDMPController::loadDMPFromXML(const std::string& dmpXML)
353  {
354  std::string absPath;
355  ArmarXDataPath::getAbsolutePath(dmpXML, absPath);
356  DMP::UMITSMP* dmpPointer;
357  std::ifstream ifs(absPath);
358  boost::archive::xml_iarchive ai(ifs);
359  ai >> boost::serialization::make_nvp("dmp", dmpPointer);
360  dmpPtr.reset(dmpPointer);
361  }
362 
363 
364  void
365  TaskSpaceDMPController::saveDMPToXML(const std::string& dmpXML)
366  {
367  std::string absPath;
368  ArmarXDataPath::getAbsolutePath(dmpXML, absPath);
369  std::ofstream ofs(absPath);
370  boost::archive::xml_oarchive ar(ofs);
371  DMP::UMITSMP* dmpPointer = dmpPtr.get();
372  ar << boost::serialization::make_nvp("dmp", dmpPointer);
373  dmpPtr.reset(dmpPointer);
374  }
375 
376  void
378  {
379 
380  setViaPose(canVal, eigen4f2vec(viaPose));
381  }
382 
383  void
385  const std::vector<double>& viaPoseWithQuaternion)
386  {
387  if (canVal <= dmpPtr->getUMin())
388  {
389  goalPoseVec = viaPoseWithQuaternion;
390  }
391  dmpPtr->setViaPoint(canVal, viaPoseWithQuaternion);
392  }
393 
394  void
396  {
397  dmpPtr->removeViaPoints();
398  }
399 
400  void
402  const Eigen::Matrix4f& goalPose)
403  {
404  std::vector<double> currentPoseVec = eigen4f2vec(currentPose);
405  std::vector<double> goalPoseVec = eigen4f2vec(goalPose);
406 
407  prepareExecution(currentPoseVec, goalPoseVec);
408  }
409 
410  void
411  TaskSpaceDMPController::prepareExecution(const std::vector<double>& currentPoseVec,
412  const std::vector<double>& goalPoseVec)
413  {
414  ARMARX_CHECK_EQUAL(currentPoseVec.size(), 7);
415  ARMARX_CHECK_EQUAL(goalPoseVec.size(), 7);
416 
417  ARMARX_IMPORTANT << "prepareExecution: currentPoseVec: " << currentPoseVec;
418  for (size_t i = 0; i < currentPoseVec.size(); ++i)
419  {
420  currentState[i].pos = currentPoseVec.at(i);
421  currentState[i].vel = 0;
422  targetPoseVec.at(i) = currentPoseVec.at(i);
423  }
424 
425  dmpPtr->prepareExecution(goalPoseVec, currentState, 1, 1);
426  this->goalPoseVec = goalPoseVec;
427  isDisturbance = false;
429  oldDMPAngularVelocity.setIdentity();
430  }
431 
432  void
434  {
435  if (times <= 0)
436  {
437  ARMARX_WARNING << "TaskSpaceDMPController: cannot set non-positive speed times";
438  }
439 
440  tau = times;
441  }
442 
443  void
445  {
446  if (amp <= 0)
447  {
448  ARMARX_WARNING << "TaskSpaceDMPController: cannot set non-positive amplitude";
449  }
450  config.DMPAmplitude = amp;
451  }
452 
453  std::vector<double>
455  {
456  std::vector<double> viaPoseVec;
457  viaPoseVec.resize(7);
458 
459  for (size_t i = 0; i < 3; ++i)
460  {
461  viaPoseVec.at(i) = pose(i, 3);
462  }
463 
464  VirtualRobot::MathTools::Quaternion quat = VirtualRobot::MathTools::eigen4f2quat(pose);
465 
466  viaPoseVec.at(3) = quat.w;
467  viaPoseVec.at(4) = quat.x;
468  viaPoseVec.at(5) = quat.y;
469  viaPoseVec.at(6) = quat.z;
470 
471  return viaPoseVec;
472  }
473 
474  void
475  TaskSpaceDMPController::getError(const Eigen::Matrix4f& currentPose,
476  Eigen::Vector3f& currentPosition,
477  Eigen::Quaterniond& currentOrientation,
478  double& posiError,
479  double& oriError)
480  {
481  currentPosition.setZero();
482  currentPosition << currentPose(0, 3), currentPose(1, 3), currentPose(2, 3);
483 
485  VirtualRobot::MathTools::eigen4f2quat(currentPose);
486  currentOrientation.w() = quat.w;
487  currentOrientation.x() = quat.x;
488  currentOrientation.y() = quat.y;
489  currentOrientation.z() = quat.z;
490 
491  posiError = 0;
492  for (size_t i = 0; i < 3; ++i)
493  {
494  posiError += pow(currentPosition(i) - targetPoseVec[i], 2);
495  }
496  posiError = sqrt(posiError);
497 
498  Eigen::Quaterniond targetQuaternion;
499  targetQuaternion.w() = targetPoseVec[3];
500  targetQuaternion.x() = targetPoseVec[4];
501  targetQuaternion.y() = targetPoseVec[5];
502  targetQuaternion.z() = targetPoseVec[6];
503 
504  oriError = targetQuaternion.angularDistance(currentOrientation);
505  if (oriError > M_PI)
506  {
507  oriError = 2 * M_PI - oriError;
508  }
509  }
510 
511 } // namespace armarx::control::dmp_controller
GfxTL::sqrt
VectorXD< D, T > sqrt(const VectorXD< D, T > &a)
Definition: VectorXD.h:662
armarx::control::deprecated_njoint_mp_controller::tsvmp::DebugInfo::canVal
double canVal
Definition: TaskSpaceVMP.h:65
armarx::control::deprecated_njoint_mp_controller::tsvmp::PhaseStopParams::Kori
float Kori
Definition: TaskSpaceVMP.h:47
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPController::debugData
DebugInfo debugData
Definition: TaskSpaceVMP.h:192
armarx::control::deprecated_njoint_mp_controller::tsvmp::PhaseStopParams::Dpos
float Dpos
Definition: TaskSpaceVMP.h:46
ARMARX_IMPORTANT
#define ARMARX_IMPORTANT
Definition: Logging.h:183
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPControllerConfig::oriAmplitude
float oriAmplitude
Definition: TaskSpaceVMP.h:58
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPController::setViaPose
void setViaPose(double canVal, const Eigen::Matrix4f &viaPose)
Definition: TaskSpaceVMP.cpp:377
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPControllerConfig::phaseStopParas
PhaseStopParams phaseStopParas
Definition: TaskSpaceVMP.h:60
armarx::control::deprecated_njoint_mp_controller::tsvmp::PhaseStopParams::goDist
float goDist
Definition: TaskSpaceVMP.h:41
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
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPController::removeAllViaPoints
void removeAllViaPoints()
Definition: TaskSpaceVMP.cpp:395
IceInternal::Handle< Trajectory >
armarx::control::deprecated_njoint_mp_controller::tsvmp::PhaseStopParams::backDist
float backDist
Definition: TaskSpaceVMP.h:42
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPController::setAmplitude
void setAmplitude(double amp)
Definition: TaskSpaceVMP.cpp:444
armarx::control::deprecated_njoint_mp_controller::tsvmp::PhaseStopParams::maxValue
float maxValue
Definition: TaskSpaceVMP.h:43
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPController::config
TaskSpaceDMPControllerConfig config
Definition: TaskSpaceVMP.h:265
armarx::control::deprecated_njoint_mp_controller::tsvmp::PhaseStopParams::Dori
float Dori
Definition: TaskSpaceVMP.h:48
armarx::control::deprecated_njoint_mp_controller::tsvmp::DebugInfo::poseError
double poseError
Definition: TaskSpaceVMP.h:67
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPController::isPhaseStopControl
bool isPhaseStopControl
Definition: TaskSpaceVMP.h:262
normalizeTimestamps
TrajectoryPtr normalizeTimestamps(TrajectoryPtr t, float maxTransVel, float maxRotVel)
Definition: PlayPlatformTrajectory.cpp:76
M_PI
#define M_PI
Definition: MathTools.h:17
armarx::control::common::mp::DVec
Ice::DoubleSeq DVec
Definition: MP.h:46
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPController::saveDMPToString
std::string saveDMPToString()
Definition: TaskSpaceVMP.cpp:343
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPController::learnDMPFromSampledTrajectory
void learnDMPFromSampledTrajectory(const DMP::Vec< DMP::SampledTrajectoryV2 > &trajs)
armarx::control::deprecated_njoint_mp_controller::tsvmp::DebugInfo::posiError
double posiError
Definition: TaskSpaceVMP.h:68
armarx::control::deprecated_njoint_mp_controller::tsvmp
Definition: NJointTaskSpaceImpedanceDMPController.h:20
ARMARX_ERROR
#define ARMARX_ERROR
Definition: Logging.h:189
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPControllerConfig::DMPAmplitude
float DMPAmplitude
Definition: TaskSpaceVMP.h:57
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPController::prepareExecution
void prepareExecution(const Eigen::Matrix4f &currentPose, const Eigen::Matrix4f &goalPose)
Definition: TaskSpaceVMP.cpp:401
armarx::control::deprecated_njoint_mp_controller::tsvmp::PhaseStopParams::slop
float slop
Definition: TaskSpaceVMP.h:44
TaskSpaceVMP.h
armarx::control::deprecated_njoint_mp_controller::tsvmp::PhaseStopParams::Kpos
float Kpos
Definition: TaskSpaceVMP.h:45
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPController::loadDMPFromXML
void loadDMPFromXML(const std::string &dmpXML)
Definition: TaskSpaceVMP.cpp:352
armarx::control::deprecated_njoint_mp_controller::tsvmp::DebugInfo::oriError
double oriError
Definition: TaskSpaceVMP.h:69
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPController::saveDMPToXML
void saveDMPToXML(const std::string &dmpXML)
Definition: TaskSpaceVMP.cpp:365
GfxTL::Matrix3f
MatrixXX< 3, 3, float > Matrix3f
Definition: MatrixXX.h:600
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:601
armarx::Quaternion< float, 0 >
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPControllerConfig::DMPStyle
std::string DMPStyle
Definition: TaskSpaceVMP.h:56
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPController::learnDMPFromFiles
void learnDMPFromFiles(const std::vector< std::string > &fileNames, const std::vector< double > &ratios)
Definition: TaskSpaceVMP.cpp:231
Eigen::Quaterniond
Quaternion< double, 0 > Quaterniond
Definition: EigenForwardDeclarations.h:62
armarx::control::deprecated_njoint_mp_controller::tsvmp::PhaseStopParams::mm2radi
float mm2radi
Definition: TaskSpaceVMP.h:49
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPController::flow
void flow(double deltaT, const Eigen::Matrix4f &currentPose, const Eigen::VectorXf &twist)
Definition: TaskSpaceVMP.cpp:37
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPController::setSpeed
void setSpeed(double times)
Definition: TaskSpaceVMP.cpp:433
armarx::ArmarXDataPath::getAbsolutePath
static bool getAbsolutePath(const std::string &relativeFilename, std::string &storeAbsoluteFilename, const std::vector< std::string > &additionalSearchPaths={}, bool verbose=true)
Definition: ArmarXDataPath.cpp:111
armarx::control::deprecated_njoint_mp_controller::tsvmp::DebugInfo::mpcFactor
double mpcFactor
Definition: TaskSpaceVMP.h:66
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPController::loadDMPFromString
void loadDMPFromString(const std::string &dmpStr)
Definition: TaskSpaceVMP.cpp:331
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_WARNING
#define ARMARX_WARNING
Definition: Logging.h:186
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPController::canVal
double canVal
Definition: TaskSpaceVMP.h:261
ArmarXDataPath.h
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPController::eigen4f2vec
std::vector< double > eigen4f2vec(const Eigen::Matrix4f &pose)
Definition: TaskSpaceVMP.cpp:454
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPController::learnDMPFromTrajectory
void learnDMPFromTrajectory(const TrajectoryPtr &traj)
Definition: TaskSpaceVMP.cpp:308
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPController::setRatios
void setRatios(const std::vector< double > &ratios)
Definition: TaskSpaceVMP.cpp:302
armarx::control::deprecated_njoint_mp_controller::tsvmp::TaskSpaceDMPController::dmpPtr
DMP::UMITSMPPtr dmpPtr
Definition: TaskSpaceVMP.h:264