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
31using namespace armarx;
32
33#define STATE_POSITION 0
34#define STATE_VELOCITY 1
35#define STATE_ACCELERATION 2
36
37bool
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
76bool
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
96bool
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
133void
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];
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
222bool
223TrajectoryPlayer::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
237bool
238TrajectoryPlayer::setJointsInUse(const std::string& jointName, bool inUse, const Ice::Current&)
239{
240 jointNamesUsed[jointName] = inUse;
241 return jointNamesUsed[jointName];
242}
243
244void
245TrajectoryPlayer::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;
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
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
361void
362TrajectoryPlayer::loadBasePoseTraj(const TrajectoryBasePtr& trajs, const Ice::Current&)
363{
364 basePoseTraj = TrajectoryPtr::dynamicCast(trajs);
365}
366
367void
368TrajectoryPlayer::setLoopPlayback(bool loop, const Ice::Current&)
369{
370 loopPlayback = loop;
371}
372
373void
374TrajectoryPlayer::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
404void
405TrajectoryPlayer::reportJointAngles(const NameValueMap& angles,
406 Ice::Long timestamp,
407 bool,
408 const Ice::Current&)
409{
410 std::unique_lock lock(jointAnglesMutex);
411 latestJointAngles = angles;
412}
413
414void
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
431void
433{
435 getProperty<std::string>("KinematicUnitName").getValue());
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
453void
457
458void
462
469
470void
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
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 {
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
700void
701TrajectoryPlayer::updatePIDController(const NameValueMap& angles)
702{
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(),
725 std::numeric_limits<double>::max(),
726 std::numeric_limits<double>::max(),
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
738bool
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
785bool
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}
std::string timestamp()
#define M_PI
Definition MathTools.h:17
#define STATE_POSITION
#define STATE_VELOCITY
#define VAROUT(x)
static bool getAbsolutePath(const std::string &relativeFilename, std::string &storeAbsoluteFilename, const std::vector< std::string > &additionalSearchPaths={}, bool verbose=true)
static void addDataPaths(const std::string &dataPathList)
The CMakePackageFinder class provides an interface to the CMake Package finder capabilities.
bool packageFound() const
Returns whether or not this package was found with cmake.
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition Component.cpp:90
Property< PropertyType > getProperty(const std::string &name)
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
void offeringTopic(const std::string &name)
Registers a topic for retrival after initialization.
TopicProxyType getTopic(const std::string &name)
Returns a proxy of the specified topic.
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
void usingTopic(const std::string &name, bool orderedPublishing=false)
Registers a proxy for subscription after initialization.
Ice::ObjectPrx getProxy(long timeoutMs=0, bool waitForScheduler=true) const
Returns the proxy of this object (optionally it waits for the proxy)
The periodic task executes one thread method repeatedly using the time period specified in the constr...
The Pose class.
Definition Pose.h:243
Property< PropertyType > getProperty(const std::string &name)
Property creation and retrieval.
static IceUtil::Time GetTime(TimeMode timeMode=TimeMode::VirtualTime)
Get the current time.
Definition TimeUtil.cpp:42
KinematicUnitInterfacePrx kinematicUnit
void setIsVelocityControl(bool isVelocity, const ::Ice::Current &=Ice::emptyCurrent) override
std::map< std::string, PIDControllerPtr > PIDs
bool pauseTrajectoryPlayer(const Ice::Current &) override
void reportJointAngles(const NameValueMap &angles, Ice::Long, bool, const Ice::Current &) override
void onDisconnectComponent() override
bool setJointsInUse(const std::string &jointName, bool inUse, const Ice::Current &) override
bool resetTrajectoryPlayer(bool moveToFrameZeroPose, const Ice::Current &) override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void loadJointTraj(const TrajectoryBasePtr &trajs, const ::Ice::Current &=Ice::emptyCurrent) override
bool startTrajectoryPlayer(const Ice::Current &) override
DebugObserverInterfacePrx debugObserver
std::map< std::string, bool > jointNamesUsed
std::map< std::string, bool > limitlessMap
void setLoopPlayback(bool loop, const Ice::Current &) override
VirtualRobot::RobotPtr localModel
bool stopTrajectoryPlayer(const Ice::Current &) override
PeriodicTask< TrajectoryPlayer >::pointer_type task
void loadBasePoseTraj(const TrajectoryBasePtr &trajs, const ::Ice::Current &=Ice::emptyCurrent) override
DebugDrawerInterfacePrx debugDrawer
::armarx::TrajectoryPtr basePoseTraj
::armarx::TrajectoryPtr jointTraj
The Variant class is described here: Variants.
Definition Variant.h:224
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
#define ARMARX_INFO
The normal logging level.
Definition Logging.h:181
#define ARMARX_ERROR
The logging level for unexpected behaviour, that must be fixed.
Definition Logging.h:196
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
Definition Logging.h:193
Quaternion< float, 0 > Quaternionf
T getValue(nlohmann::json &userConfig, nlohmann::json &defaultConfig, const std::string &entryName)
Definition utils.h:80
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::map< std::string, VariantBasePtr > StringVariantBaseMap
std::vector< std::string > Split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)
std::shared_ptr< PIDController > PIDControllerPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition helper.h:35