3 #include <SimoxUtility/math/compare/is_equal.h>
4 #include <SimoxUtility/math/convert/mat4f_to_pos.h>
5 #include <SimoxUtility/math/convert/mat4f_to_quat.h>
6 #include <VirtualRobot/MathTools.h>
42 vmp->prepareExecution();
53 TSMPOutputPtr out = std::dynamic_pointer_cast<TSMPOutput>(output);
64 double phaseStop = 0.0;
74 ARMARX_INFO <<
" -- Discrete mode: MP " <<
cfg.name <<
" finished.";
88 double deltaT = in->deltaT;
128 double timeDuration =
cfg.durationSec;
129 canonicalValue -= tau * deltaT / ((1 + phaseStop) * timeDuration);
131 std::vector<mplib::representation::MPState> targetState =
132 std::dynamic_pointer_cast<mplib::representation::vmp::TaskSpacePrincipalComponentVMP>(
137 for (
size_t i = 0; i < 3; ++i)
139 currentState[i].vel = tau * targetState[i].vel *
cfg.amplitude / timeDuration;
157 for (
size_t i = 0; i < 3; i++)
165 targetState[3].vel, targetState[4].vel, targetState[5].vel, targetState[6].vel};
169 angularVel0.w() *= 2;
170 angularVel0.x() *= 2;
171 angularVel0.y() *= 2;
172 angularVel0.z() *= 2;
181 angularVel0.w() = -angularVel0.w();
182 angularVel0.x() = -angularVel0.x();
183 angularVel0.y() = -angularVel0.y();
184 angularVel0.z() = -angularVel0.z();
191 tau * angularVel0.x() *
cfg.amplitude / timeDuration;
193 tau * angularVel0.y() *
cfg.amplitude / timeDuration;
195 tau * angularVel0.z() *
cfg.amplitude / timeDuration;
203 for (
size_t i = 3; i < 7; ++i)
206 tau * targetState[i].vel *
cfg.amplitude / timeDuration;
226 out->vel(3) = angularVel0.x();
227 out->vel(4) = angularVel0.y();
228 out->vel(5) = angularVel0.z();
242 std::vector<double> targetVec;
243 for (
const auto& t : targetState)
245 targetVec.push_back(t.pos);