MoveJointPlatformTrajectory.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 RobotSkillTemplates::MotionAndPlatformControlGroup
17  * @author Raphael Grimm ( raphael dot grimm at kit dot edu )
18  * @date 2016
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 #include <chrono>
23 #include <thread>
24 
26 
28 
29 #include <RobotAPI/interface/units/KinematicUnitInterface.h>
30 
32 #include <VirtualRobot/RobotConfig.h>
33 
34 #include <algorithm>
35 
36 using namespace armarx;
37 using namespace MotionAndPlatformControlGroup;
38 
39 // DO NOT EDIT NEXT LINE
40 MoveJointPlatformTrajectory::SubClassRegistry MoveJointPlatformTrajectory::Registry(MoveJointPlatformTrajectory::GetName(), &MoveJointPlatformTrajectory::CreateInstance);
41 
43 {
44  // put your user code for the enter-point here
45  // execution time should be short (<100ms)
46  timeoutEvent = setTimeoutEvent(in.getTimeoutInMs(), createEventFailure());
47 
48  t = in.getTrajectory();
49  jointNames = t->getDimensionNames();
50  if (!validJointNames())
51  {
52  ARMARX_ERROR_S << "MoveJointPlatformTrajectory expects a trajectory with x, y, alpha as its first coordinates!";
53  ARMARX_ERROR_S << "given trajectory dimensions: " << jointNames;
54  emitFailure();
55  return;
56  }
57  maxAccs.clear();
58  if (in.isJointMaxAccelsSet())
59  {
60  maxAccs = in.getJointMaxAccels();
61  }
62  jointMaxSpeeds.clear();
63  if (in.isJointMaxSpeedsSet())
64  {
65  jointMaxSpeeds = in.getJointMaxSpeeds();
66  }
67 
68 
69 
70  jointTargetTolerance = std::fabs(in.getJointTargetTolerance());
71  translationTargetTolerance = std::fabs(in.getTranslationTargetTolerance());
72  context = getContext<MotionAndPlatformControlGroupStatechartContext>();
73  lastCfgIt = --(t->end());
74  currentCfgIt = t->begin();
75  ARMARX_DEBUG << "timeout installed" << std::endl;
76 }
77 
79 {
80  ARMARX_INFO_S << "trajectory:\n" << in.getTrajectory()->output();
81  if (in.getSkipFirstTimepoint() >= in.getTrajectory()->size())
82  {
83  //nothing to do
84  ARMARX_WARNING_S << "The Trajectory did not result in movement!\n"
85  << "skip first = " << in.getSkipFirstTimepoint();
86  emitSuccess();
87  }
88 
89  //the platform has no control mode
90  //exec
92  if (in.getUseNativePositionControl())
93  {
94  setControlMode(ePositionControl);
95  ctrlNative();
96  }
97  else
98  {
99  datafieldsVelocities = getDataFieldIdentifiers("jointvelocities");
100  setControlMode(eVelocityControl);
101  ctrlInterpol();
102  }
103 }
104 
106 {
107  waitForDone(false);
108  ARMARX_INFO_S << "exit MoveJointPlatformTrajectory";
109 }
111 {
112  waitForDone(true);
113  ARMARX_INFO_S << "break MoveJointPlatformTrajectory";
114 }
115 
116 void MoveJointPlatformTrajectory::waitForDone(bool stopAtCurrentPos)
117 {
118  while (!isRunningTaskFinished())
119  {
120  std::this_thread::sleep_for(std::chrono::milliseconds {5});
121  }
122  if (in.getSkipFirstTimepoint() >= in.getTrajectory()->size())
123  {
124  return;
125  }
126  cacheValues();
127 
128  if (in.getHoldPositionAfterwards())
129  {
130  NameValueMap targetJointAngles;
131  NameControlModeMap controlModes;
132  NameValueMap targetJointVelocities;
133 
134  for (size_t i = 0; i < jointNames.size(); ++i)
135  {
136  targetJointAngles[jointNames.at(i)] = stopAtCurrentPos ? getValue(i) : lastCfgIt->getPosition(i);
137  targetJointVelocities[jointNames.at(i)] = 0.0f;
138  controlModes[jointNames.at(i)] = ePositionControl;
139  }
140  ARMARX_INFO_S << "hold position aftawards is set! (using position contol to hold position)";
141  setControlMode(ePositionControl);
142  setValues(targetJointAngles);
143  setVelocity(targetJointVelocities);
144  }
145 
146  ARMARX_INFO << "Joint target tolerance: " << in.getJointTargetTolerance();
147  NameValueMap differences;
148  for (size_t i = 0; i < jointNames.size(); ++i)
149  {
150  differences[jointNames.at(i)] = lastCfgIt->getPosition(i) - getValue(i);
151  }
152  ARMARX_INFO << VAROUT(differences);
153  out.setJointAndPlatformDistancesToTargets(differences);
154 }
155 
156 // DO NOT EDIT NEXT FUNCTION
158 {
160 }
161 
162 
163 
165 {
166  //running data per joint used for ctrl
167  struct JointData
168  {
169  //data per joint
170  float maxAcc;
171  float maxVel;
172  float maxDeltaVel;
173  //data changed per config
174  float targetAng;
175  float prevAng;
176  float configDeltaAng;
177  float allowedPercInaccuracy;
178 
179  //data changed per iteration
180  float ang;
181  float vel;
182 
183  float deltaAng;
184  float deltaAngSig;
185  float percAng; //percentage of the current angle done
186 
187  float nextVel;
188  float nextPercAng;
189  bool nextVelForced;
190  };
191  std::vector<JointData> jointData(jointNames.size());
192 
193  //init per joint data
194  {
195  cacheValues();
196  for (std::size_t i = 0; i < jointNames.size(); ++i)
197  {
198  JointData& data = jointData.at(i);
199  data.maxAcc = std::fabs(getMaxAcc(i));
200  data.maxVel = std::fabs(getMaxVel(i));
201  data.maxDeltaVel = data.maxAcc * secondsPerPeriod;
202  data.targetAng = getValue(i);
203  }
204  }
205 
206  auto updateJoitnDataForNewConfig = [&]
207  {
208  for (std::size_t i = 0; i < jointNames.size(); ++i)
209  {
210  JointData& data = jointData.at(i);
211  data.prevAng = data.targetAng;
212  data.targetAng = currentCfgIt->getPosition(i);
213  data.configDeltaAng = data.targetAng - data.prevAng;
214  data.allowedPercInaccuracy = getTargetTolerance(i) / std::fabs(data.configDeltaAng);
215  ARMARX_INFO_S << jointNames.at(i)
216  << " move " << data.prevAng
217  << " -> " << data.targetAng
218  << " (delta = " << data.configDeltaAng << ")";
219  }
220  };
221 
222  ARMARX_INFO_S << "MoveJointPlatformTrajectory start axis sync (acceleration limited) PTP";
223  NameValueMap targetJointVel;
224  //skip the first target?
225  if (in.getSkipFirstTimepoint())
226  {
227  ARMARX_INFO_S << "skipping first config";
228  ++currentCfgIt;
229  updateJoitnDataForNewConfig();
230  }
231  while (!isRunningTaskStopped() && !doneAllConfigs())
232  {
233  //update per config data
234  updateJoitnDataForNewConfig();
235 
236  //ctrl for current target
237  while (!isRunningTaskStopped())
238  {
239  auto startIter = std::chrono::high_resolution_clock::now();
240  //per it
241  cacheValues();
242  cacheVelocities();
243 
244  // data to decide whether we go to the next config
245  // float maxAbsDeltaAng = -std::numeric_limits<float>::infinity();
246  // float maxAbsDeltaTrans = -std::numeric_limits<float>::infinity();
247  bool dontAdvanceToNextConfig = false;
248  //used to determine the major axis
249  float minNextPerc = std::numeric_limits<float>::infinity();
250 
251  //calculate per joint the optimal velocity (getting it as close as possible to the goal without overshooting it)
252  //also calculate the axis lagging behind (aka the axis with the lowest % of distance to its current target
253  //this will be the major axis and all other axis will try to reach the same % of their current target
254  //if an axis has to deaccellerate maximally to stop from overshooting the target, it will do so (and may not try to reach the %)
255  //if an axis reached its goal already it will not move
256  //no axis will move backwards (they only stop to wait for others)
257  for (std::size_t i = 0; i < jointNames.size(); ++i)
258  {
259  JointData& data = jointData.at(i);
260  //init sentinels
261  data.nextPercAng = -1;
262  data.percAng = -1;
263  data.nextVelForced = false;
264  //angles
265  data.ang = getValue(i);
266  data.vel = getVelocity(i);
267  const float velSig = sign(data.vel);
268 
269  data.deltaAng = data.targetAng - data.ang;
270  data.deltaAngSig = sign(data.deltaAng);
271 
272  // float& maxAbsDelta = (i < 3 ? maxAbsDeltaTrans : maxAbsDeltaAng);
273  // maxAbsDelta = std::max(std::fabs(data.deltaAng), maxAbsDelta);
274 
275  dontAdvanceToNextConfig |= std::fabs(data.deltaAng) > getConfigChangeTolerance(i);
276 
277  const float absBrakingDistance = data.vel * data.vel / (2.f * data.maxAcc);
278 
279  //if we are near the goal (in tolerance) -> deaccelerate/ move to goal (forced)
280  //if this joint should not move (reached target) -> deaccelerate/ move to goal (forced)
281  if (
282  (
283  (data.deltaAngSig == velSig) //if we brake we move in the direction of the target
284  && (std::fabs(data.deltaAng) <= absBrakingDistance + getTargetTolerance(i)) //we are near the target and have to brake now
285  )
286  || (std::fabs(data.deltaAng) <= getTargetTolerance(i)) //we are at the goal
287  )
288  {
289  if (std::fabs(data.vel) < data.maxDeltaVel)
290  {
291  //we are slow enough to set the vel to 0
292  data.nextVel = 0;
293  }
294  else
295  {
296  //we are to fast to set the vel to 0 -> brake with max a
297  data.nextVel = (std::fabs(data.vel) - data.maxDeltaVel) * sign(data.vel);
298  }
299  data.nextVelForced = true;
300 
301 
302 
303  assert(data.nextVel <= data.maxVel);
304  assert(data.nextVel >= -data.maxVel);
305  continue;
306  }
307 
308  //calc opt next vel (vel required to reach target if we will deaccelerate starting at next step)
309  //it ignores max a for acceleration (it is only used for deacceleration) and v
310  const float p = data.maxDeltaVel;
311  const float q = data.deltaAngSig * (data.vel * data.maxDeltaVel - 2 * data.maxAcc * data.deltaAng);
312  const float nextVelOpt = data.deltaAngSig * (-p / 2.f + std::sqrt((p / 2.f) * (p / 2.f) - q));
313  const float nextVelAccCapped = std::clamp(nextVelOpt, data.vel - data.maxDeltaVel, data.vel + data.maxDeltaVel);
314  const float nextVelVelCapped = std::clamp(nextVelAccCapped, -data.maxVel, data.maxVel);
315  data.nextVel = nextVelVelCapped;
316 
317  assert(data.nextVel <= data.maxVel);
318  assert(data.nextVel >= -data.maxVel);
319  const float nextAngPredict = data.ang + secondsPerPeriod * (data.vel + data.nextVel) / 2.f;
320 
321  //joint is past target
322  data.percAng = 1 - data.deltaAng / data.configDeltaAng; // should not be nan, may be +- inf
323  assert(std::isfinite(data.percAng));
324  if (
325  data.percAng > 1.f ||//past target ->move to target
326  std::fabs(data.configDeltaAng) < jointTargetTolerance
327  // this joint should not move (but it is not near enough) try to move it to the target
328  )
329  {
330  //we want the current joint to move to the target
331  data.nextVelForced = true;
332  continue;
333  }
334 
335  const float nextAngPredictDelta = data.targetAng - nextAngPredict;
336  data.nextPercAng = 1 - nextAngPredictDelta / data.configDeltaAng; // should not be nan / +- inf
337  assert(std::isfinite(data.nextPercAng));
338  minNextPerc = std::min(data.nextPercAng, minNextPerc);
339  }
340 
341  ARMARX_INFO << VAROUT(minNextPerc);
342  //calculate final vel (in consideration of the major axis)
343  //there are 4 options:
344  // 1: this joints velocity is forced -> don't adapt its vel
345  // 2: this joint is one of the major axis -> don't adapt its vel
346  // 3: this joint is further than the major axis will be -> try to stop
347  // 4: this joint is neither of the above -> try to reach the major axis %
348  for (std::size_t i = 0; i < jointNames.size(); ++i)
349  {
350  const auto& name = jointNames.at(i);
351  JointData& data = jointData.at(i);
352  //case 1+2
353  if (data.nextVelForced || data.nextPercAng <= minNextPerc + data.allowedPercInaccuracy)
354  {
355 
356  //either this joint has to brake, or it is a major axis
357  targetJointVel[name] = data.nextVel;
358  assert(std::fabs(targetJointVel[name]) <= std::fabs(data.maxVel) + std::numeric_limits<float>::epsilon());
359  assert(std::fabs(targetJointVel[name]) <= std::fabs(data.vel) + std::fabs(data.maxDeltaVel) + std::numeric_limits<float>::epsilon());
360 
361  if (data.nextVelForced)
362  {
363  ARMARX_INFO << "for name " << name << "\t" << targetJointVel[name] << " (" << data.maxVel << ") delta " << data.deltaAng;
364  }
365  else
366  {
367  ARMARX_INFO << "maj name " << name << "\t" << targetJointVel[name] << " (" << data.maxVel << ") delta " << data.deltaAng << "\t p/np" << data.percAng << "\t/\t" << data.nextPercAng;
368  }
369  continue;
370  }
371  //case 3
372  if (data.percAng >= minNextPerc)
373  {
374  // we don't want to move our joint backwards.
375  // => slow down
376  targetJointVel[name] = std::max(0.f, std::fabs(data.vel) - data.maxDeltaVel) * sign(data.vel);
377  assert(std::fabs(targetJointVel[name]) <= std::fabs(data.maxVel) + std::numeric_limits<float>::epsilon());
378  assert(std::fabs(targetJointVel[name]) <= std::fabs(data.vel) + std::fabs(data.maxDeltaVel) + std::numeric_limits<float>::epsilon());
379 
380  ARMARX_INFO << "slo name " << name << "\t" << targetJointVel[name] << " (" << data.maxVel << ") delta " << data.deltaAng << "\t p/np" << data.percAng << "\t/\t" << data.nextPercAng;
381  continue;
382  }
383  //case 4
384  //the delta this joint should moved (is capped by maxAcc/maxVel, since the new vel will be less than the calculated nextVel
385  const float deltaAngMoved = data.configDeltaAng - data.deltaAng;
386  const float deltaAngMovedNext = minNextPerc * data.configDeltaAng;
387  const float delatAngToMoveInIteratiron = deltaAngMovedNext - deltaAngMoved;
388  const float newVel = 2.f * delatAngToMoveInIteratiron / secondsPerPeriod - data.vel;
389  assert(std::fabs(newVel) <= std::fabs(data.nextVel) + std::numeric_limits<float>::epsilon());
390  targetJointVel[name] = newVel;
391  assert(std::fabs(targetJointVel[name]) <= std::fabs(data.maxVel) + std::numeric_limits<float>::epsilon());
392  assert(std::fabs(targetJointVel[name]) <= std::fabs(data.vel) + std::fabs(data.maxDeltaVel) + std::numeric_limits<float>::epsilon());
393  ARMARX_INFO << "var name " << name << "\t" << targetJointVel[name] << " (" << data.maxVel << ") delta " << data.deltaAng << "\t p/np" << data.percAng << "\t/\t" << data.nextPercAng;
394  }
395  //set vels
396  ARMARX_INFO << "###############################";
397  setVelocity(targetJointVel);
398  if (!dontAdvanceToNextConfig)
399  {
400  break;
401  }
402  //check for speed
403  const auto tIter = std::chrono::high_resolution_clock::now() - startIter;
404  ARMARX_INFO_S << deactivateSpam() << "Controler iteration took " << std::chrono::duration_cast<std::chrono::milliseconds>(tIter).count() << " ms";
405  if (tIter > period)
406  {
407  ARMARX_WARNING_S << "iteration took long! (" << std::chrono::duration_cast<std::chrono::milliseconds>(tIter).count() << " ms. Period = " << period.count() << " ms)";
408  }
409  else
410  {
411  std::this_thread::sleep_until(period + startIter);
412  }
413  }//ctrl for current target
414  ++currentCfgIt;
415  }//ctrl for all targets
416  if (doneAllConfigs())
417  {
418  ARMARX_INFO_S << "MoveJointPlatformTrajectory end success axis sync (acceleration limited) PTP";
419  emitSuccess();
420  }
421  ARMARX_INFO_S << "MoveJointPlatformTrajectory exit failure axis sync (acceleration limited) PTP";
422 }
423 
425 {
426  ARMARX_INFO_S << "MoveJointPlatformTrajectory native PTP";
427  {
428  NameValueMap maxVelsMap;
429  for (std::size_t i = 0; i < jointNames.size(); ++i)
430  {
431  maxVelsMap[jointNames.at(i)] = getMaxVel(i);
432  }
433  setMaxVelocity(maxVelsMap);
434  }
435  NameValueMap jointTargetMap;
436  while (!doneAllConfigs())
437  {
438  if (isRunningTaskStopped())
439  {
440  return;
441  }
442  currentCfgIt->writePositionsToNameValueMap(jointTargetMap);
443  setValues(jointTargetMap);
444  //wait for joint reached
445  while (true)
446  {
447  setValues(jointTargetMap);
448  if (isRunningTaskStopped())
449  {
450  return;
451  }
452  //calc max delta
453  cacheValues();
454  float maxDelta = 0;
455  float maxTranslationDelta =
456  std::max(
457  std::fabs(getValue(0) - jointTargetMap.at("x")),
458  std::fabs(getValue(1) - jointTargetMap.at("y"))
459  );
460  //alpha is considered a rotation joint
461  for (std::size_t i = 2; i < jointNames.size(); ++i)
462  {
463  maxDelta = std::max(
464  maxDelta,
465  std::fabs(
466  getValue(i) - jointTargetMap.at(jointNames.at(i))
467  )
468  );
469  }
470  //break if delta is small
471 
472  if (maxDelta < jointTargetTolerance && maxTranslationDelta < translationTargetTolerance)
473  {
474  break;
475  }
476  std::this_thread::sleep_for(period);
477  }
478  ++currentCfgIt;
479  }
480  ARMARX_INFO_S << "MoveJointPlatformTrajectory exit native PTP";
481  emitSuccess();
482 }
483 
484 
485 
486 
487 
488 
489 
490 float MoveJointPlatformTrajectory::getValue(std::size_t i) const
491 {
492  return getFromList(cachedValues, i);
493 }
494 
496 {
497  return getFromList(cachedVelocities, i);
498 }
499 
501 {
502  return (val < 0) ? -1 : 1;
503 }
GfxTL::sqrt
VectorXD< D, T > sqrt(const VectorXD< D, T > &a)
Definition: VectorXD.h:662
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::getConfigChangeTolerance
float getConfigChangeTolerance(std::size_t i) const
Definition: MoveJointPlatformTrajectory.h:205
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::onEnter
void onEnter() override
Definition: MoveJointPlatformTrajectory.cpp:42
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::onBreak
void onBreak() override
Definition: MoveJointPlatformTrajectory.cpp:110
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::getMaxAcc
float getMaxAcc(std::size_t joint) const
Definition: MoveJointPlatformTrajectory.h:195
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::getMaxVel
float getMaxVel(std::size_t joint) const
Definition: MoveJointPlatformTrajectory.h:191
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::jointNames
std::vector< std::string > jointNames
Definition: MoveJointPlatformTrajectory.h:222
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::ctrlNative
void ctrlNative()
Definition: MoveJointPlatformTrajectory.cpp:424
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::MoveJointPlatformTrajectory
MoveJointPlatformTrajectory(const XMLStateConstructorParams &stateData)
Definition: MoveJointPlatformTrajectory.h:44
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::maxAccs
std::vector< float > maxAccs
Definition: MoveJointPlatformTrajectory.h:223
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::setValues
void setValues(NameValueMap &values)
Definition: MoveJointPlatformTrajectory.h:140
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::run
void run() override
Definition: MoveJointPlatformTrajectory.cpp:78
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::lastCfgIt
Trajectory::ordered_view::const_iterator lastCfgIt
Definition: MoveJointPlatformTrajectory.h:240
armarx::XMLStateConstructorParams
Definition: XMLState.h:50
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::currentCfgIt
Trajectory::ordered_view::const_iterator currentCfgIt
Definition: MoveJointPlatformTrajectory.h:241
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::validJointNames
bool validJointNames() const
Definition: MoveJointPlatformTrajectory.h:183
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::timeoutEvent
ActionEventIdentifier timeoutEvent
Definition: MoveJointPlatformTrajectory.h:244
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::cacheValues
void cacheValues()
Definition: MoveJointPlatformTrajectory.h:100
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::getValue
float getValue(std::size_t i) const
Definition: MoveJointPlatformTrajectory.cpp:490
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::Registry
static SubClassRegistry Registry
Definition: MoveJointPlatformTrajectory.h:58
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::getFromList
static float getFromList(const TimedVariantBaseLists &lists, std::size_t i)
Definition: MoveJointPlatformTrajectory.h:111
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::setMaxVelocity
void setMaxVelocity(NameValueMap &vels)
Definition: MoveJointPlatformTrajectory.h:157
clamp
double clamp(double x, double a, double b)
Definition: point.hpp:125
IceInternal::Handle
Definition: forward_declarations.h:8
std::isfinite
bool isfinite(const std::vector< T, Ts... > &v)
Definition: algorithm.h:327
deactivateSpam
SpamFilterDataPtr deactivateSpam(SpamFilterDataPtr const &spamFilter, float deactivationDurationSec, const std::string &identifier, bool deactivate)
Definition: Logging.cpp:72
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::sign
static int sign(double val)
Definition: MoveJointPlatformTrajectory.cpp:500
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::setControlMode
void setControlMode(ControlMode mode)
Definition: MoveJointPlatformTrajectory.h:174
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::getDataFieldIdentifiers
DataFieldIdentifierBaseLists getDataFieldIdentifiers(const std::string &channelName)
Definition: MoveJointPlatformTrajectory.h:60
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::getTargetTolerance
float getTargetTolerance(std::size_t i) const
Definition: MoveJointPlatformTrajectory.h:200
ARMARX_ERROR_S
#define ARMARX_ERROR_S
Definition: Logging.h:209
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
ARMARX_DEBUG
#define ARMARX_DEBUG
Definition: Logging.h:177
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::onExit
void onExit() override
Definition: MoveJointPlatformTrajectory.cpp:105
max
T max(T t1, T t2)
Definition: gdiam.h:48
MoveJointPlatformTrajectory.h
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::jointMaxSpeeds
std::vector< float > jointMaxSpeeds
Definition: MoveJointPlatformTrajectory.h:224
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::context
MotionAndPlatformControlGroupStatechartContext * context
Definition: MoveJointPlatformTrajectory.h:225
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::ctrlInterpol
void ctrlInterpol()
Definition: MoveJointPlatformTrajectory.cpp:164
q
#define q
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::cacheVelocities
void cacheVelocities()
Definition: MoveJointPlatformTrajectory.h:105
ARMARX_WARNING_S
#define ARMARX_WARNING_S
Definition: Logging.h:206
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::getVelocity
float getVelocity(std::size_t i) const
Definition: MoveJointPlatformTrajectory.cpp:495
armarx::XMLStateFactoryBasePtr
IceInternal::Handle< XMLStateFactoryBase > XMLStateFactoryBasePtr
Definition: XMLState.h:65
armarx::control::njoint_controller::platform::platform_follower_controller::NameValueMap
std::map< std::string, float > NameValueMap
Definition: PlatformFollowerController.h:91
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::datafieldsVelocities
DataFieldIdentifierBaseLists datafieldsVelocities
Definition: MoveJointPlatformTrajectory.h:230
TimeUtil.h
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
VAROUT
#define VAROUT(x)
Definition: StringHelpers.h:182
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::period
const std::chrono::milliseconds period
Definition: MoveJointPlatformTrajectory.h:234
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::doneAllConfigs
bool doneAllConfigs() const
Definition: MoveJointPlatformTrajectory.h:95
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::waitForDone
void waitForDone(bool stopAtCurrentPos)
Definition: MoveJointPlatformTrajectory.cpp:116
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::jointTargetTolerance
float jointTargetTolerance
Definition: MoveJointPlatformTrajectory.h:238
ARMARX_INFO_S
#define ARMARX_INFO_S
Definition: Logging.h:195
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::t
TrajectoryPtr t
Definition: MoveJointPlatformTrajectory.h:221
min
T min(T t1, T t2)
Definition: gdiam.h:42
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::secondsPerPeriod
const float secondsPerPeriod
Definition: MoveJointPlatformTrajectory.h:237
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::datafieldsValues
DataFieldIdentifierBaseLists datafieldsValues
Definition: MoveJointPlatformTrajectory.h:227
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::cachedValues
TimedVariantBaseLists cachedValues
Definition: MoveJointPlatformTrajectory.h:228
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::translationTargetTolerance
float translationTargetTolerance
Definition: MoveJointPlatformTrajectory.h:239
RobotStatechartContext.h
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::setVelocity
void setVelocity(NameValueMap &vels)
Definition: MoveJointPlatformTrajectory.h:122
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::cachedVelocities
TimedVariantBaseLists cachedVelocities
Definition: MoveJointPlatformTrajectory.h:231
armarx::MotionAndPlatformControlGroup::MoveJointPlatformTrajectory::CreateInstance
static XMLStateFactoryBasePtr CreateInstance(XMLStateConstructorParams stateData)
Definition: MoveJointPlatformTrajectory.cpp:157