31 #include <RobotSkillTemplates/statecharts/MotionAndPlatformControlGroup/MoveJointPlatformTrajectory.generated.h>
33 #include "MotionAndPlatformControlGroupStatechartContext.generated.h"
38 public MoveJointPlatformTrajectoryGeneratedBase < MoveJointPlatformTrajectory >
63 datafields.first.reserve(3);
64 datafields.second.reserve(
jointNames.size() - 3);
66 const std::string platformObserverName =
context->getProperty<std::string>(
"PlatformUnitObserverName").
getValue();
67 if (channelName ==
"jointangles")
69 datafields.first.emplace_back(
new DataFieldIdentifier {platformObserverName,
"platformPose",
"positionX"});
70 datafields.first.emplace_back(
new DataFieldIdentifier {platformObserverName,
"platformPose",
"positionY"});
71 datafields.first.emplace_back(
new DataFieldIdentifier {platformObserverName,
"platformPose",
"rotation"});
75 datafields.first.emplace_back(
new DataFieldIdentifier {platformObserverName,
"platformVelocity",
"velocityX"});
76 datafields.first.emplace_back(
new DataFieldIdentifier {platformObserverName,
"platformVelocity",
"velocityY"});
77 datafields.first.emplace_back(
new DataFieldIdentifier {platformObserverName,
"platformVelocity",
"velocityRotation"});
80 const std::string observerName =
context->getProperty<std::string>(
"KinematicUnitObserverName").
getValue();
115 return lists.first.at(i)->getFloat();
117 return lists.second.at(i - 3)->getFloat();
119 float getValue(std::size_t i)
const;
124 const auto x = vels.at(
"x");
125 const auto y = vels.at(
"y");
126 const auto a = vels.at(
"alpha");
127 context->getPlatformUnit()->move(x, y,
a);
128 ARMARX_INFO <<
"VelocitiesPlatform: x= " << x <<
" y=" << y <<
" alpha=" <<
a;
138 context->getKinematicUnit()->setJointVelocities(vels);
142 const auto x =
values.at(
"x");
143 const auto y =
values.at(
"y");
144 const auto a =
values.at(
"alpha");
159 const auto x = vels.at(
"x");
160 const auto y = vels.at(
"y");
161 const auto a = vels.at(
"alpha");
162 context->getPlatformUnit()->setMaxVelocities((x + y) / 2.0,
a);
172 context->getKinematicUnit()->setJointVelocities(vels);
176 NameControlModeMap controlModes;
177 for (
size_t i = 3; i <
jointNames.size(); i++)
181 context->getKinematicUnit()->switchControlMode(controlModes);
197 return (joint <
maxAccs.size() ?
maxAccs.at(joint) : in.getJointMaxAccel());
211 return i < 2 ? in.getNextConfigTranslationTolerance() : in.getNextConfigTolerance();
216 static int sign(
double val);
225 MotionAndPlatformControlGroupStatechartContext*
context;
233 const std::chrono::milliseconds
period
240 typename Trajectory::ordered_view::const_iterator
lastCfgIt;