23 #ifndef _ARMARX_LIB_RobotAPI_TaskSpaceDMPController_H
24 #define _ARMARX_LIB_RobotAPI_TaskSpaceDMPController_H
27 #include <dmp/representation/dmp/umitsmp.h>
30 #include <VirtualRobot/RobotNodeSet.h>
31 #include <VirtualRobot/MathTools.h>
104 targetPoseVec.resize(7);
107 currentState.resize(7);
111 this->paused =
false;
121 void flow(
double deltaT,
const Eigen::Matrix4f& currentPose,
const Eigen::VectorXf& twist);
131 return targetPoseVec;
136 Eigen::Matrix4f res = VirtualRobot::MathTools::quat2eigen4f(targetPoseVec.at(4), targetPoseVec.at(5), targetPoseVec.at(6), targetPoseVec.at(3));
137 res(0, 3) = targetPoseVec.at(0);
138 res(1, 3) = targetPoseVec.at(1);
139 res(2, 3) = targetPoseVec.at(2);
146 Eigen::Matrix4f res = VirtualRobot::MathTools::quat2eigen4f(currentState.at(4).pos,
147 currentState.at(5).pos,
148 currentState.at(6).pos,
149 currentState.at(3).pos);
150 res(0, 3) = currentState.at(0).pos;
151 res(1, 3) = currentState.at(1).pos;
152 res(2, 3) = currentState.at(2).pos;
157 void learnDMPFromFiles(
const std::vector<std::string>& fileNames,
const std::vector<double>& ratios);
170 void setViaPose(
double canVal,
const std::vector<double>& viaPoseWithQuaternion);
174 void prepareExecution(
const std::vector<double>& currentPoseVec,
const std::vector<double>& goalPoseVec);
190 void setRatios(
const std::vector<double>& ratios);
206 this->paused =
false;
209 void setWeights(
const std::vector<std::vector<double> >& weights)
211 dmpPtr->setWeights(weights);
218 for (
size_t i = 0; i < 3; ++i)
220 dmpPtr->setWeights(i, weights[i]);
228 for (
size_t i = 0; i < 4; ++i)
230 dmpPtr->setWeights(3 + i, weights[i]);
236 return dmpPtr->getWeights();
243 for (
size_t i = 0; i < 3; ++i)
245 res.push_back(weights[i]);
254 for (
size_t i = 3; i < 7; ++i)
256 res.push_back(weights[i]);
271 Eigen::VectorXf targetVel;
274 DMP::Vec<DMP::DMPState > currentState;