TrajectoryPlayer.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 RobotComponents::ArmarXObjects::TrajectoryPlayer
17  * @author zhou ( derekyou dot zhou at gmail dot com )
18  * @date 2016
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #include "TrajectoryPlayer.h"
24 
25 #include <SimoxUtility/math/convert.h>
26 
29 
30 
31 using namespace armarx;
32 
33 #define STATE_POSITION 0
34 #define STATE_VELOCITY 1
35 #define STATE_ACCELERATION 2
36 
37 bool
39 {
40  direction = 1;
41  timeOffset = 0;
42 
43 
44  if (isPreview)
45  {
46  ARMARX_INFO << "robot file name : " << kinematicUnit->getRobotFilename();
47  debugDrawer->setRobotVisu("Preview",
48  "previewRobot",
49  kinematicUnit->getRobotFilename(),
51  armarx::CollisionModel);
52  debugDrawer->updateRobotColor("Preview", "previewRobot", DrawColor{0, 1, 0, 0.5});
53  }
54 
55 
56  try
57  {
59  this, &TrajectoryPlayer::run, 10, false, "TrajectoryPlayerTask", false);
60  paused = false;
61  firstRound = true;
62  currentTime = 0;
63  runningTime = 0;
65 
66  task->start();
67  return task->isRunning();
68  }
69  catch (...)
70  {
71  ARMARX_WARNING << "Failed to start MMMPLayer task";
72  return false;
73  }
74 }
75 
76 bool
78 {
79  std::unique_lock lock(motionMutex);
80 
81  if (!paused)
82  {
83  paused = true;
85  firstRound = true;
86  kinematicUnit->setJointVelocities(nullVelocities);
87  }
88  else
89  {
90  paused = false;
91  }
92 
93  return paused;
94 }
95 
96 bool
98 {
99  std::unique_lock lock(motionMutex);
100  paused = true;
101 
102 
103  if (isPreview)
104  {
105  debugDrawer->clearLayer("Preview");
106  }
107 
108  try
109  {
110  if (task)
111  {
112  task->stop();
113  }
114  if (task->isRunning())
115  {
116  ARMARX_WARNING << "Failed to stop MMMPlayer";
117  }
118  else
119  {
120  ARMARX_INFO << "stopped MMMPlayer task from GUI";
121  }
122  kinematicUnit->setJointVelocities(nullVelocities);
123  return !(task->isRunning());
124  }
125  catch (...)
126  {
127  ARMARX_WARNING << "Failed to stop MMMPlayer";
128  }
129 
130  return false;
131 }
132 
133 void
135 {
136  StringVariantBaseMap debugTargetValues;
137  StringVariantBaseMap debugVelocityValues;
138 
139  {
140  std::unique_lock lock(motionMutex);
141  targetPositionValues.clear();
142  targetVelocityValues.clear();
143 
144  int maxDerivative = 1;
145  // ARMARX_INFO << deactivateSpam(1) << VAROUT(currentTime);
146  std::vector<Ice::DoubleSeq> states = jointTraj->getAllStates(currentTime, maxDerivative);
147 
148  for (size_t i = 0; i < jointNames.size(); ++i)
149  {
150  const auto& jointName = jointNames.at(i);
151 
152  if (jointNamesUsed[jointName])
153  {
154  // update targetPositionValues
155  auto& targetPosValue = targetPositionValues[jointName] = states[i][STATE_POSITION];
156  auto it = jointOffets.find(jointName);
157  if (it != jointOffets.end())
158  {
159  targetPosValue += it->second;
160  }
161  assert(targetPosValue == targetPositionValues[jointName]);
162  debugTargetValues[jointName] = new Variant(targetPosValue);
163 
164  // update targetVelocityValues
165 
166  // float& targetVel = targetVelocityValues[jointName] = 0;
167  // if (frozenTime != currentTime)
168  // {
169  // targetVel = (states[i][STATE_POSITION] - lastStates[i][STATE_POSITION]) / (currentTime - frozenTime);
170  // }
171 
172  // ARMARX_INFO << "jointName: " << jointName << " targetVel: " << targetVel;
173  float& targetVel = targetVelocityValues[jointName] = states[i][STATE_VELOCITY];
174  if (isVelocityControl)
175  {
176 
177  auto pid = PIDs.find(jointName);
178 
179  if (pid != PIDs.end())
180  {
181 
182  auto cv = pid->second->getControlValue();
183  //ARMARX_INFO << "*" << (jointName) << ": targetPosValue: " << targetPosValue << ", targetVel:" << (targetVel) << ", pid-cv:" << cv << ", result vel:" << (cv + targetVel);
184  targetVel += cv;
185  }
186  }
187  targetVel = std::min<double>(maxVel / 180.0 * M_PI, targetVel);
188  targetVel = std::max<double>(-1 * maxVel / 180.0 * M_PI, targetVel);
189  debugVelocityValues[jointName] = new Variant(targetVel);
190  }
191  else
192  {
193  targetVelocityValues[jointName] = 0;
194  }
195  }
196 
197 
199  {
200  std::vector<Ice::DoubleSeq> pose = basePoseTraj->getAllStates(currentTime, 0);
201 
202  Eigen::Vector3f position(pose[0][0], pose[1][0], pose[2][0]);
203  Eigen::Quaternionf orientation(pose[3][0], pose[4][0], pose[5][0], pose[6][0]);
204  Eigen::Matrix4f p = offset * simox::math::pos_quat_to_mat4f(position, orientation);
205  if (customRootNode)
206  {
207  localModel->setJointValues(targetPositionValues);
208  localModel->setGlobalPoseForRobotNode(customRootNode, p);
209  targetRobotPose = new Pose(localModel->getGlobalPose());
210  }
211  else
212  {
213  targetRobotPose = new Pose(p);
214  }
215  }
216  }
217 
218  debugObserver->setDebugChannel("targetJointAngles", debugTargetValues);
219  debugObserver->setDebugChannel("targetVelocity", debugVelocityValues);
220 }
221 
222 bool
223 TrajectoryPlayer::resetTrajectoryPlayer(bool moveToFrameZeroPose, const Ice::Current&)
224 {
225  std::unique_lock lock(motionMutex);
226  currentTime = 0;
227  runningTime = 0;
228  if (moveToFrameZeroPose)
229  {
230  this->setIsVelocityControl(false);
232  kinematicUnit->setJointAngles(targetPositionValues);
233  }
234  return true;
235 }
236 
237 bool
238 TrajectoryPlayer::setJointsInUse(const std::string& jointName, bool inUse, const Ice::Current&)
239 {
240  jointNamesUsed[jointName] = inUse;
241  return jointNamesUsed[jointName];
242 }
243 
244 void
245 TrajectoryPlayer::loadJointTraj(const TrajectoryBasePtr& trajs, const Ice::Current&)
246 {
247  std::unique_lock lock(motionMutex);
248  // get model filename
249  if (!armarxProject.empty())
250  {
251  std::vector<std::string> proj = armarx::Split(armarxProject, ",;", true, true);
252 
253  for (std::string& p : proj)
254  {
255  ARMARX_INFO << "Adding to datapaths of " << p;
256  armarx::CMakePackageFinder finder(p);
257 
258  if (!finder.packageFound())
259  {
260  ARMARX_WARNING << "ArmarX Package " << p << " has not been found!";
261  }
262  else
263  {
264  ARMARX_INFO << "Adding to datapaths: " << finder.getDataDir();
266  }
267  }
268  }
269 
271  localModel = VirtualRobot::RobotIO::loadRobot(
272  modelFileName, VirtualRobot::RobotIO::RobotDescription::eStructure);
273  if (getProperty<std::string>("CustomRootNode").isSet() &&
274  !getProperty<std::string>("CustomRootNode").getValue().empty())
275  {
276  customRootNode =
277  localModel->getRobotNode(getProperty<std::string>("CustomRootNode").getValue());
278  }
279  else
280  {
281  customRootNode.reset();
282  }
283 
284 
285  // load trajectory
286  jointTraj = TrajectoryPtr::dynamicCast(trajs);
287 
288 
289  if (!jointTraj)
290  {
291  ARMARX_ERROR << "Error when loading TrajectoryPlayer: cannot load jointTraj !!!";
292  return;
293  }
294 
295  endTime = *jointTraj->getTimestamps().rbegin() - *jointTraj->getTimestamps().begin();
296 
297  jointTraj = jointTraj->normalize(0, endTime);
298  trajEndTime = endTime;
299  jointNames = jointTraj->getDimensionNames();
301 
302  if (jointNames.size() != jointTraj->dim())
303  {
304  ARMARX_ERROR << "Not all trajectory dimensions are named !!! (would cause problems when "
305  "using kinematicUnit)";
306  return;
307  }
308 
309  NameControlModeMap modes;
310  LimitlessStateSeq limitlessStates;
311 
312  for (size_t i = 0; i < jointNames.size(); ++i)
313  {
314  const auto& jointName = jointNames.at(i);
315 
316  if (isVelocityControl)
317  {
318  modes[jointName] = eVelocityControl;
319  }
320  else
321  {
322  modes[jointName] = ePositionControl;
323  }
324 
325  nullVelocities[jointName] = 0.0;
326  jointNamesUsed[jointName] = true;
327 
328  if (localModel)
329  {
330  LimitlessState ls;
331  ls.enabled = false;
332  VirtualRobot::RobotNodePtr rn = localModel->getRobotNode(jointName);
333  if (rn)
334  {
335  ls.enabled = rn->isLimitless();
336  ls.limitLo = rn->getJointLimitLo();
337  ls.limitHi = rn->getJointLimitHi();
338  limitlessMap[jointName] = rn->isLimitless();
339  }
340  ARMARX_INFO << "limitless status - " << jointName << ": " << rn->isLimitless();
341  limitlessStates.push_back(ls);
342  }
343  }
344 
345  // setup limitless status of joints
346  if (limitlessStates.size() == jointNames.size())
347  {
348  ARMARX_INFO << "SETTING UP LIMITLESS JOINTS";
349  jointTraj->setLimitless(limitlessStates);
350  }
351  /*else
352  {
353  ARMARX_IMPORTANT << "NOT SETTING LIMITLESS JOINTS!";
354  }*/
355 
356  ARMARX_INFO << "Setting null velocities: " << nullVelocities;
357  kinematicUnit->switchControlMode(modes);
358  kinematicUnit->setJointVelocities(nullVelocities);
359 }
360 
361 void
362 TrajectoryPlayer::loadBasePoseTraj(const TrajectoryBasePtr& trajs, const Ice::Current&)
363 {
364  basePoseTraj = TrajectoryPtr::dynamicCast(trajs);
365 }
366 
367 void
368 TrajectoryPlayer::setLoopPlayback(bool loop, const Ice::Current&)
369 {
370  loopPlayback = loop;
371 }
372 
373 void
374 TrajectoryPlayer::setIsVelocityControl(bool isVelocity, const Ice::Current&)
375 {
376  // std::unique_lock lock(motionMutex);
377 
378  isVelocityControl = isVelocity;
379  NameControlModeMap modes;
380 
381  for (size_t i = 0; i < jointNames.size(); ++i)
382  {
383  const auto& jointName = jointNames.at(i);
384 
385  if (isVelocity)
386  {
387  modes[jointName] = eVelocityControl;
388  }
389  else
390  {
391  modes[jointName] = ePositionControl;
392  }
393  }
394 
395  try
396  {
397  kinematicUnit->switchControlMode(modes);
398  }
399  catch (...)
400  {
401  }
402 }
403 
404 void
406  Ice::Long timestamp,
407  bool,
408  const Ice::Current&)
409 {
410  std::unique_lock lock(jointAnglesMutex);
411  latestJointAngles = angles;
412 }
413 
414 void
416 {
417  offeringTopic("DebugObserver");
418  usingProxy(getProperty<std::string>("KinematicUnitName").getValue());
419 
420  paused = true;
421 
422  isVelocityControl = getProperty<bool>("isVelocityControl").getValue();
423  loopPlayback = getProperty<bool>("LoopPlayback").getValue();
424  maxVel = getProperty<float>("absMaximumVelocity").getValue();
425 
426  usingTopic(getProperty<std::string>("KinematicTopicName").getValue());
427 
428  offeringTopic("DebugDrawerUpdates");
429 }
430 
431 void
433 {
434  kinematicUnit = getProxy<KinematicUnitInterfacePrx>(
435  getProperty<std::string>("KinematicUnitName").getValue());
436  debugObserver = getTopic<DebugObserverInterfacePrx>("DebugObserver");
437  debugDrawer = getTopic<armarx::DebugDrawerInterfacePrx>("DebugDrawerUpdates");
438  armarxProject = getProperty<std::string>("ArmarXProjects").getValue();
439  robotPoseUnitEnabled = getProperty<bool>("EnableRobotPoseUnit").getValue();
440 
441  Eigen::Vector3f position(getProperty<float>("Offset.x").getValue(),
442  getProperty<float>("Offset.y").getValue(),
443  getProperty<float>("Offset.z").getValue());
444  Eigen::Vector3f orientation(getProperty<float>("Offset.roll").getValue(),
445  getProperty<float>("Offset.pitch").getValue(),
446  getProperty<float>("Offset.yaw").getValue());
447  offset = simox::math::pos_rpy_to_mat4f(position, orientation);
448  ARMARX_INFO << "Trajectory Player Offset " << offset;
449 
450  targetRobotPose = new Pose();
451 }
452 
453 void
455 {
456 }
457 
458 void
460 {
461 }
462 
465 {
468 }
469 
470 void
472 {
473  if (!jointTraj)
474  {
475  ARMARX_WARNING << "joint trajectory not found ...";
476  return;
477  }
478 
479  if (paused)
480  {
481  sleep(1);
483  }
484  else
485  {
486  runningTime = (armarx::TimeUtil::GetTime() - startTime).toSecondsDouble() + timeOffset;
487 
488  if (direction > 0)
489  {
491  }
492  else
493  {
495  }
496 
497  // if (!firstRound)
498  // {
499  // startCal = armarx::TimeUtil::GetTime();
500  // }
501 
502  ARMARX_INFO << deactivateSpam(1) << "currentTime: " << currentTime;
503  ARMARX_INFO << deactivateSpam(1) << "endTime: " << endTime;
504 
505  if (runningTime >= endTime) // reset timer.
506  {
507  runningTime = 0;
509  timeOffset = 0;
510  }
511 
512 
513  if (currentTime >= endTime)
514  {
515  kinematicUnit->setJointVelocities(nullVelocities);
516 
517  if (loopPlayback)
518  {
519  direction = -1;
520  }
521  else if (task)
522  {
523  task->stop();
524  sleep(1);
525  return;
526  }
527  }
528 
529  if (currentTime <= 0)
530  {
531  if (loopPlayback)
532  {
533  direction = 1;
534  }
535  else if (task)
536  {
537  task->stop();
538  sleep(1);
539  return;
540  }
541  }
542 
543  StringVariantBaseMap debugTargetValues;
544  StringVariantBaseMap debugVelocityValues;
545 
546  {
547  std::unique_lock lock(motionMutex);
548  ARMARX_CHECK_EXPRESSION((size_t)jointNames.size() == jointTraj->dim());
549  // updateTargetValues();
550  targetPositionValues.clear();
551  targetVelocityValues.clear();
552 
553  int maxDerivative = 1;
554  // ARMARX_INFO << deactivateSpam(1) << VAROUT(currentTime);
555  std::vector<Ice::DoubleSeq> states =
556  jointTraj->getAllStates(currentTime, maxDerivative);
557 
558 
559  for (size_t i = 0; i < jointNames.size(); ++i)
560  {
561  const auto& jointName = jointNames.at(i);
562 
563  if (jointNamesUsed[jointName])
564  {
565  // update targetPositionValues
566  auto& targetPosValue = targetPositionValues[jointName] =
567  states[i][STATE_POSITION];
568  auto it = jointOffets.find(jointName);
569  if (it != jointOffets.end())
570  {
571  targetPosValue += it->second;
572  }
573  assert(targetPosValue == targetPositionValues[jointName]);
574  debugTargetValues[jointName] = new Variant(targetPosValue);
575 
576 
577  // update targetVelocityValues
578 
579  // float& targetVel = targetVelocityValues[jointName] = 0;
580  // if (frozenTime != currentTime)
581  // {
582  // targetVel = (states[i][STATE_POSITION] - lastStates[i][STATE_POSITION]) / (currentTime - frozenTime);
583  // }
584 
585  // ARMARX_INFO << "jointName: " << jointName << " targetVel: " << targetVel;
586  float& targetVel = targetVelocityValues[jointName] = states[i][STATE_VELOCITY];
587 
588  if (isVelocityControl)
589  {
590 
591  auto pid = PIDs.find(jointName);
592 
593  if (pid != PIDs.end())
594  {
595  auto cv = pid->second->getControlValue();
596  /*if (cv > 20)
597  {
598  ARMARX_INFO << "" << (jointName) << ": targetPosValue: " << targetPosValue << ", targetVel:" << (targetVel) << ", pid-cv:" << cv << ", result vel:" << (cv + targetVel);
599  }
600  if (fabs(cv) > 0.2)
601  {
602  ARMARX_IMPORTANT << "|cv| > 1: " << (jointName) << ": targetPosValue: " << targetPosValue << ", actualPosValue: " << latestJointAngles[jointName] << ", targetVel:" << (targetVel) << ", pid-cv:" << cv << ", result vel:" << (cv + targetVel);
603  }
604  if (fabs(targetVel) > 0.2)
605  {
606  ARMARX_IMPORTANT << "|targetVel| > 1: " << (jointName) << ": targetPosValue: " << targetPosValue << ", actualPosValue: " << latestJointAngles[jointName] << ", targetVel:" << (targetVel) << ", pid-cv:" << cv << ", result vel:" << (cv + targetVel);
607  }*/
608  targetVel += cv;
609  }
610  }
611  targetVel = std::min<double>(maxVel / 180.0 * M_PI, targetVel);
612  targetVel = std::max<double>(-1 * maxVel / 180.0 * M_PI, targetVel);
613  targetVel *= direction;
614  debugVelocityValues[jointName] = new Variant(targetVel);
615  }
616  else
617  {
618  targetVelocityValues[jointName] = 0;
619  }
620  }
621 
622 
624  {
625  std::vector<Ice::DoubleSeq> pose = basePoseTraj->getAllStates(currentTime, 0);
626 
627  Eigen::Vector3f position(pose[0][0], pose[1][0], pose[2][0]);
628  Eigen::Quaternionf orientation(pose[3][0], pose[4][0], pose[5][0], pose[6][0]);
629  Eigen::Matrix4f p = offset * simox::math::pos_quat_to_mat4f(position, orientation);
630  if (customRootNode)
631  {
632  localModel->setJointValues(targetPositionValues);
633  localModel->setGlobalPoseForRobotNode(customRootNode, p);
634  targetRobotPose = new Pose(localModel->getGlobalPose());
635  }
636  else
637  {
638  targetRobotPose = new Pose(p);
639  }
640  }
641  }
642 
643  /*{
644  ARMARX_INFO << "ELBOW - target pos:" << targetPositionValues["ArmL6_Elb2"] << ", actual pos:" << latestJointAngles["ArmL6_Elb2"] << ",\t targetVel:" << targetVelocityValues["ArmL6_Elb2"] << std::endl;
645  }*/
646 
647 
648  if (!isPreview)
649  {
650  if (!isVelocityControl)
651  {
652  kinematicUnit->setJointAngles(targetPositionValues);
653  }
654  else
655  {
656  kinematicUnit->setJointVelocities(targetVelocityValues);
657  }
658 
660  {
661  RobotPoseUnitInterfacePrx robotPoseUnitPrx = getProxy<RobotPoseUnitInterfacePrx>(
662  getProperty<std::string>("RobotPoseUnitName").getValue());
663 
664  robotPoseUnitPrx->moveTo(PoseBasePtr::dynamicCast(targetRobotPose), 0.001f, 0.001f);
665  }
666  }
667  else
668  {
669  ARMARX_INFO << "Preview ... ";
670 
671  if (checkJointsLimit())
672  {
673  debugDrawer->updateRobotConfig("Preview", "previewRobot", targetPositionValues);
674 
676  {
677  debugDrawer->updateRobotPose(
678  "Preview", "previewRobot", PoseBasePtr::dynamicCast(targetRobotPose));
679  }
680  }
681 
682  else
683  {
684  task->stop();
685  sleep(1);
686  return;
687  }
688  }
689 
690  {
691  std::unique_lock lock(jointAnglesMutex);
692  updatePIDController(latestJointAngles);
693  }
694 
695  debugObserver->setDebugChannel("targetJointAngles", debugTargetValues);
696  debugObserver->setDebugChannel("targetVelocity", debugVelocityValues);
697  }
698 }
699 
700 void
701 TrajectoryPlayer::updatePIDController(const NameValueMap& angles)
702 {
703  if (!isVelocityControl)
704  {
705  ARMARX_INFO << deactivateSpam() << "jointangles reporting DISABLED";
706  return;
707  }
708 
709  for (const auto& joint : angles)
710  {
711  const std::string& name = joint.first;
712 
713  if (targetPositionValues.find(name) == targetPositionValues.end())
714  {
715  continue;
716  }
717 
718  auto it = PIDs.find(name);
719 
720  if (it == PIDs.end())
721  {
722  PIDs[name] = PIDControllerPtr(new PIDController(getProperty<float>("Kp").getValue(),
723  getProperty<float>("Ki").getValue(),
724  getProperty<float>("Kd").getValue(),
727  limitlessMap[name]));
728  ARMARX_INFO << "Creating PID for " << name << " is limitless:" << limitlessMap[name];
729  it = PIDs.find(name);
730  }
731 
732  PIDControllerPtr pid = it->second;
733  pid->update(joint.second, targetPositionValues[name]);
734  //ARMARX_INFO << "PID update:" << name << ", measured:" << joint.second << ", target:" << targetPositionValues[name];
735  }
736 }
737 
738 bool
740 {
741 
742  if (!localModel)
743  {
744  ARMARX_WARNING << "No local model found !!! (No joints limit checked)";
745  return false;
746  }
747 
748  std::unique_lock lock(jointAnglesMutex);
749 
750 
751  for (NameValueMap::iterator it = latestJointAngles.begin(); it != latestJointAngles.end(); it++)
752  {
753  std::string jointName = it->first;
754  float jointValue = it->second;
755 
756  float lowLimit = localModel->getRobotNode(jointName)->getJointLimitLow();
757  float highLimit = localModel->getRobotNode(jointName)->getJointLimitHigh();
758  DrawColor errColor = {1, 0, 0, 1};
759  DrawColor warnColor = {1, 1, 0, 1};
760  DrawColor normColor = {0, 1, 0, 1};
761  if (jointValue < lowLimit || jointValue > highLimit)
762  {
763  debugDrawer->updateRobotNodeColor("Preview", "previewRobot", jointName, errColor);
764  return false;
765  }
766 
767  float dist = highLimit - lowLimit;
768 
769  bool isWarning = ((jointValue < (lowLimit + 0.1 * dist)) && (jointValue >= lowLimit)) ||
770  ((jointValue > (highLimit - 0.1 * dist)) && (jointValue <= highLimit));
771 
772  if (isWarning)
773  {
774  debugDrawer->updateRobotNodeColor("Preview", "previewRobot", jointName, warnColor);
775  }
776  else
777  {
778  debugDrawer->updateRobotNodeColor("Preview", "previewRobot", jointName, normColor);
779  }
780  }
781 
782  return true;
783 }
784 
785 bool
787 {
788  if (!localModel)
789  {
790  ARMARX_WARNING << "No local model found !!! (No joints limit checked)";
791  return false;
792  }
793 
794  std::unique_lock lock(jointAnglesMutex);
795 
796  localModel->setJointValues(latestJointAngles);
797 
798  return true;
799 }
armarx::TrajectoryPlayer::offset
Eigen::Matrix4f offset
Definition: TrajectoryPlayer.h:311
armarx::TrajectoryPlayer::localModel
VirtualRobot::RobotPtr localModel
Definition: TrajectoryPlayer.h:346
armarx::Variant
The Variant class is described here: Variants.
Definition: Variant.h:223
armarx::TrajectoryPlayer::armarxProject
std::string armarxProject
Definition: TrajectoryPlayer.h:308
armarx::TrajectoryPlayer::debugObserver
DebugObserverInterfacePrx debugObserver
Definition: TrajectoryPlayer.h:305
armarx::TrajectoryPlayer::targetVelocityValues
NameValueMap targetVelocityValues
Definition: TrajectoryPlayer.h:330
armarx::TrajectoryPlayer::onDisconnectComponent
void onDisconnectComponent() override
Definition: TrajectoryPlayer.cpp:454
armarx::StringVariantBaseMap
std::map< std::string, VariantBasePtr > StringVariantBaseMap
Definition: ManagedIceObject.h:110
armarx::CMakePackageFinder::packageFound
bool packageFound() const
Returns whether or not this package was found with cmake.
Definition: CMakePackageFinder.cpp:511
armarx::navigation::core::Pose
Eigen::Isometry3f Pose
Definition: basic_types.h:31
armarx::TrajectoryPlayer::loadJointTraj
void loadJointTraj(const TrajectoryBasePtr &trajs, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: TrajectoryPlayer.cpp:245
armarx::TrajectoryPlayer::targetPositionValues
NameValueMap targetPositionValues
Definition: TrajectoryPlayer.h:329
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:650
armarx::TrajectoryPlayer::run
void run()
Definition: TrajectoryPlayer.cpp:471
armarx::Split
std::vector< std::string > Split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)
Definition: StringHelperTemplates.h:36
armarx::TrajectoryPlayer::kinematicUnit
KinematicUnitInterfacePrx kinematicUnit
Definition: TrajectoryPlayer.h:304
armarx::PIDControllerPtr
std::shared_ptr< PIDController > PIDControllerPtr
Definition: PIDController.h:94
armarx::CMakePackageFinder
The CMakePackageFinder class provides an interface to the CMake Package finder capabilities.
Definition: CMakePackageFinder.h:52
armarx::TrajectoryPlayer::endTime
double endTime
Definition: TrajectoryPlayer.h:324
armarx::TrajectoryPlayer::jointNames
Ice::StringSeq jointNames
Definition: TrajectoryPlayer.h:314
armarx::TrajectoryPlayer::loopPlayback
bool loopPlayback
Definition: TrajectoryPlayer.h:326
armarx::TrajectoryPlayer::stopTrajectoryPlayer
bool stopTrajectoryPlayer(const Ice::Current &) override
Definition: TrajectoryPlayer.cpp:97
armarx::TrajectoryPlayer::limitlessMap
std::map< std::string, bool > limitlessMap
Definition: TrajectoryPlayer.h:316
armarx::TrajectoryPlayer::onConnectComponent
void onConnectComponent() override
Definition: TrajectoryPlayer.cpp:432
armarx::TrajectoryPlayer::nullVelocities
NameValueMap nullVelocities
Definition: TrajectoryPlayer.h:332
armarx::TrajectoryPlayer::jointTraj
::armarx::TrajectoryPtr jointTraj
Definition: TrajectoryPlayer.h:300
TrajectoryPlayer.h
armarx::TrajectoryPlayer::setIsVelocityControl
void setIsVelocityControl(bool isVelocity, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: TrajectoryPlayer.cpp:374
armarx::TrajectoryPlayer::startTime
IceUtil::Time startTime
Definition: TrajectoryPlayer.h:322
cxxopts::empty
bool empty(const std::string &s)
Definition: cxxopts.hpp:234
armarx::TrajectoryPlayer::modelFileName
std::string modelFileName
Definition: TrajectoryPlayer.h:339
armarx::TrajectoryPlayerPropertyDefinitions
Definition: TrajectoryPlayer.h:47
armarx::TrajectoryPlayer::isVelocityControl
bool isVelocityControl
Definition: TrajectoryPlayer.h:318
armarx::TrajectoryPlayer::onInitComponent
void onInitComponent() override
Definition: TrajectoryPlayer.cpp:415
armarx::TrajectoryPlayer::maxVel
float maxVel
Definition: TrajectoryPlayer.h:337
M_PI
#define M_PI
Definition: MathTools.h:17
armarx::PIDController
Definition: PIDController.h:43
armarx::TrajectoryPlayer::direction
int direction
Definition: TrajectoryPlayer.h:335
armarx::TrajectoryPlayer::currentTime
double currentTime
Definition: TrajectoryPlayer.h:320
STATE_VELOCITY
#define STATE_VELOCITY
Definition: TrajectoryPlayer.cpp:34
armarx::TrajectoryPlayer::resetTrajectoryPlayer
bool resetTrajectoryPlayer(bool moveToFrameZeroPose, const Ice::Current &) override
Definition: TrajectoryPlayer.cpp:223
armarx::TrajectoryPlayer::runningTime
double runningTime
Definition: TrajectoryPlayer.h:321
armarx::CMakePackageFinder::getDataDir
std::string getDataDir() const
Definition: CMakePackageFinder.h:194
armarx::TrajectoryPlayer::setLoopPlayback
void setLoopPlayback(bool loop, const Ice::Current &) override
Definition: TrajectoryPlayer.cpp:368
armarx::VariantType::Long
const VariantTypeId Long
Definition: Variant.h:918
armarx::TrajectoryPlayer::updateTargetValues
void updateTargetValues()
Definition: TrajectoryPlayer.cpp:134
armarx::TrajectoryPlayer::pauseTrajectoryPlayer
bool pauseTrajectoryPlayer(const Ice::Current &) override
Definition: TrajectoryPlayer.cpp:77
max
T max(T t1, T t2)
Definition: gdiam.h:51
ARMARX_ERROR
#define ARMARX_ERROR
Definition: Logging.h:196
armarx::TrajectoryPlayer::checkJointsLimit
bool checkJointsLimit()
Definition: TrajectoryPlayer.cpp:739
armarx::TrajectoryPlayer::checkSelfCollision
bool checkSelfCollision()
Definition: TrajectoryPlayer.cpp:786
armarx::TrajectoryPlayer::jointNamesUsed
std::map< std::string, bool > jointNamesUsed
Definition: TrajectoryPlayer.h:315
armarx::TimeUtil::GetTime
static IceUtil::Time GetTime(TimeMode timeMode=TimeMode::VirtualTime)
Get the current time.
Definition: TimeUtil.cpp:42
armarx::TrajectoryPlayer::isPreview
bool isPreview
Definition: TrajectoryPlayer.h:327
armarx::control::common::getValue
T getValue(nlohmann::json &userConfig, nlohmann::json &defaultConfig, const std::string &entryName)
Definition: utils.h:71
armarx::control::njoint_controller::platform::platform_follower_controller::NameValueMap
std::map< std::string, float > NameValueMap
Definition: PlatformFollowerController.h:88
armarx::ManagedIceObject::usingTopic
void usingTopic(const std::string &name, bool orderedPublishing=false)
Registers a proxy for subscription after initialization.
Definition: ManagedIceObject.cpp:254
armarx::TrajectoryPlayer::reportJointAngles
void reportJointAngles(const NameValueMap &angles, Ice::Long, bool, const Ice::Current &) override
Definition: TrajectoryPlayer.cpp:405
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:79
CMakePackageFinder.h
armarx::TrajectoryPlayer::robotPoseUnitEnabled
bool robotPoseUnitEnabled
Definition: TrajectoryPlayer.h:309
ARMARX_CHECK_EXPRESSION
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
Definition: ExpressionException.h:73
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:181
armarx::ArmarXDataPath::addDataPaths
static void addDataPaths(const std::string &dataPathList)
Definition: ArmarXDataPath.cpp:554
armarx::TrajectoryPlayer::jointOffets
NameValueMap jointOffets
Definition: TrajectoryPlayer.h:336
STATE_POSITION
#define STATE_POSITION
Definition: TrajectoryPlayer.cpp:33
VAROUT
#define VAROUT(x)
Definition: StringHelpers.h:198
armarx::TrajectoryPlayer::debugDrawer
DebugDrawerInterfacePrx debugDrawer
Definition: TrajectoryPlayer.h:306
armarx::Quaternion< float, 0 >
armarx::ManagedIceObject::offeringTopic
void offeringTopic(const std::string &name)
Registers a topic for retrival after initialization.
Definition: ManagedIceObject.cpp:300
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::TrajectoryPlayer::targetRobotPose
PosePtr targetRobotPose
Definition: TrajectoryPlayer.h:331
armarx::Logging::deactivateSpam
SpamFilterDataPtr deactivateSpam(float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const
disables the logging for the current line for the given amount of seconds.
Definition: Logging.cpp:99
cv
Definition: helper.h:34
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:109
armarx::PeriodicTask
Definition: ArmarXManager.h:70
armarx::TrajectoryPlayer::task
PeriodicTask< TrajectoryPlayer >::pointer_type task
Definition: TrajectoryPlayer.h:313
armarx::TrajectoryPlayer::timeOffset
double timeOffset
Definition: TrajectoryPlayer.h:323
armarx::TrajectoryPlayer::startTrajectoryPlayer
bool startTrajectoryPlayer(const Ice::Current &) override
Definition: TrajectoryPlayer.cpp:38
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:193
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:35
ArmarXDataPath.h
armarx::TrajectoryPlayer::setJointsInUse
bool setJointsInUse(const std::string &jointName, bool inUse, const Ice::Current &) override
Definition: TrajectoryPlayer.cpp:238
armarx::ManagedIceObject::usingProxy
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
Definition: ManagedIceObject.cpp:154
armarx::TrajectoryPlayer::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: TrajectoryPlayer.cpp:464
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::TrajectoryPlayer::PIDs
std::map< std::string, PIDControllerPtr > PIDs
Definition: TrajectoryPlayer.h:328
armarx::TrajectoryPlayer::loadBasePoseTraj
void loadBasePoseTraj(const TrajectoryBasePtr &trajs, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: TrajectoryPlayer.cpp:362
armarx::TrajectoryPlayer::basePoseTraj
::armarx::TrajectoryPtr basePoseTraj
Definition: TrajectoryPlayer.h:301
armarx::TrajectoryPlayer::onExitComponent
void onExitComponent() override
Definition: TrajectoryPlayer.cpp:459