RemoteRobot.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package
19  * @author
20  * @date
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 #include "RemoteRobot.h"
25 
26 #include <Eigen/Geometry>
27 
28 #include <SimoxUtility/algorithm/string/string_tools.h>
29 #include <VirtualRobot/CollisionDetection/CollisionChecker.h>
30 #include <VirtualRobot/Nodes/RobotNode.h>
31 #include <VirtualRobot/Nodes/RobotNodeFixed.h>
32 #include <VirtualRobot/Nodes/RobotNodeFixedFactory.h>
33 #include <VirtualRobot/Nodes/RobotNodePrismatic.h>
34 #include <VirtualRobot/Nodes/RobotNodePrismaticFactory.h>
35 #include <VirtualRobot/Nodes/RobotNodeRevolute.h>
36 #include <VirtualRobot/Nodes/RobotNodeRevoluteFactory.h>
37 #include <VirtualRobot/Robot.h>
38 #include <VirtualRobot/RobotConfig.h>
39 #include <VirtualRobot/RobotFactory.h>
40 #include <VirtualRobot/RobotNodeSet.h>
41 #include <VirtualRobot/VirtualRobot.h>
42 #include <VirtualRobot/XML/RobotIO.h>
43 
48 
49 #include <RobotAPI/interface/core/RobotState.h>
51 
52 //#define DMES(Obj) cout << format("[%1%|%2%|%3%] %4%") % __FILE__ % __LINE__ % __func__ % Obj;
53 #define DMES(Obj) ;
54 
55 using namespace VirtualRobot;
56 using namespace Eigen;
57 
58 namespace armarx
59 {
60 
61  std::recursive_mutex RemoteRobot::m;
62 
63  RemoteRobot::RemoteRobot(SharedRobotInterfacePrx robot) : Robot(), _robot(robot)
64  {
65  _robot->ref();
66  }
67 
69  {
70  try
71  {
72  _robot->unref();
73  }
74  catch (std::exception& e)
75  {
76  ARMARX_DEBUG_S << "Unref of SharedRobot failed: " << e.what();
77  }
78  catch (...)
79  {
80  ARMARX_DEBUG_S << "Unref of SharedRobot failed: reason unknown";
81  }
82  }
83 
84  RobotNodePtr
86  {
87  // lazy initialization needed since shared_from_this() must not be called in constructor
88  if (!_root)
89  {
90  _root = RemoteRobot::createRemoteRobotNode(_robot->getRootNode(), shared_from_this());
91  }
92  return _root;
93  }
94 
95  bool
96  RemoteRobot::hasRobotNode(const std::string& robotNodeName) const
97  {
98  if (_cachedNodes.find(name) == _cachedNodes.end())
99  {
100  return _robot->hasRobotNode(robotNodeName);
101  }
102  else
103  {
104  return true;
105  }
106  }
107 
108  bool
109  RemoteRobot::hasRobotNode(RobotNodePtr robotNode) const
110  {
111  return this->hasRobotNode(robotNode->getName());
112 
113  /*
114  * This just does not work. because you cannot tell wheter RemoteRobotNode<RobotNodeRevolute> or another type is used
115  * perhaps you can infer the actual RobotNodeType somehow. Until now we just check for names which is
116  * much faster!
117  *
118  if ( (_cachedNodes.find(name)==_cachedNodes.end()) || _robot->hasRobotNode(robotNode->getName())) {
119  shared_ptr<RemoteRobotNode> remoteNode(dynamic_pointer_cast<RemoteRobotNode>(robotNode));
120  if (! remoteNode) return false;
121 
122  SharedRobotNodeInterfacePrx sharedNode = remoteNode->getSharedNode();
123  SharedRobotNodeInterfacePrx otherSharedNode = dynamic_pointer_cast<RemoteRobotNode>(this->getRobotNode(robotNodeName))->getSharedNode();
124  if (sharedNode == otherSharedNode)
125  return true;
126  }
127 
128  return false;
129  */
130  }
131 
132  RobotNodePtr
133  RemoteRobot::getRobotNode(const std::string& robotNodeName) const
134  {
135  DMES((format("Node: %1%") % robotNodeName));
136  auto it = _cachedNodes.find(robotNodeName);
137  if (it == _cachedNodes.end() || it->second == NULL)
138  {
139  DMES("No cache hit");
141  _robot->getRobotNode(robotNodeName), shared_from_this());
142  return _cachedNodes[robotNodeName];
143  }
144  else
145  {
146  DMES("Cache hit");
147  return it->second;
148  }
149  }
150 
151  void
152  RemoteRobot::getRobotNodes(std::vector<RobotNodePtr>& storeNodes, bool clearVector) const
153  {
154  if (clearVector)
155  {
156  storeNodes.clear();
157  }
158 
159  NameList nodes = _robot->getRobotNodes();
160  for (std::string const& name : nodes)
161  {
162  storeNodes.push_back(this->getRobotNode(name));
163  }
164  }
165 
166  bool
167  RemoteRobot::hasRobotNodeSet(const std::string& name) const
168  {
169  return _robot->hasRobotNodeSet(name);
170  }
171 
172  RobotNodeSetPtr
173  RemoteRobot::getRobotNodeSet(const std::string& nodeSetName) const
174  {
175  std::vector<RobotNodePtr> storeNodes;
176  RobotNodeSetInfoPtr info = _robot->getRobotNodeSet(nodeSetName);
177  return RobotNodeSet::createRobotNodeSet(
178  shared_from_this(), nodeSetName, info->names, info->rootName, info->tcpName);
179  }
180 
181  void
182  RemoteRobot::getRobotNodeSets(std::vector<RobotNodeSetPtr>& storeNodeSet) const
183  {
184  NameList sets = _robot->getRobotNodeSets();
185 
186  for (std::string const& name : sets)
187  {
188  storeNodeSet.push_back(this->getRobotNodeSet(name));
189  }
190  }
191 
192  Matrix4f
194  {
195  PosePtr p = PosePtr::dynamicCast(_robot->getGlobalPose());
196  return p->toEigen(); // convert to eigen first
197  }
198 
199  float
201  {
202  return _robot->getScaling();
203  }
204 
207  {
208  return this->_robot;
209  }
210 
211  std::string
213  {
214  return _robot->getName();
215  }
216 
217  VirtualRobot::RobotNodePtr
219  SharedRobotNodeInterfacePrx remoteNode,
220  std::vector<VirtualRobot::RobotNodePtr>& allNodes,
221  std::map<VirtualRobot::RobotNodePtr, std::vector<std::string>>& childrenMap,
222  RobotPtr robo)
223  {
224  std::scoped_lock cloneLock(m);
225  static int nonameCounter = 0;
226 
227  if (!remoteNode || !robo)
228  {
229  ARMARX_ERROR_S << " NULL data ";
230  return VirtualRobot::RobotNodePtr();
231  }
232 
233  VirtualRobot::RobotNodeFactoryPtr revoluteNodeFactory =
234  VirtualRobot::RobotNodeFactory::fromName(
235  VirtualRobot::RobotNodeRevoluteFactory::getName(), NULL);
236  VirtualRobot::RobotNodeFactoryPtr fixedNodeFactory =
237  VirtualRobot::RobotNodeFactory::fromName(VirtualRobot::RobotNodeFixedFactory::getName(),
238  NULL);
239  VirtualRobot::RobotNodeFactoryPtr prismaticNodeFactory =
240  VirtualRobot::RobotNodeFactory::fromName(
241  VirtualRobot::RobotNodePrismaticFactory::getName(), NULL);
242 
243  Eigen::Vector3f idVec3 = Eigen::Vector3f::Zero();
244  std::string name = remoteNode->getName();
245 
246  if (name.empty())
247  {
248  ARMARX_LOG_S << "Node without name!!!";
249  std::stringstream ss;
250  ss << "robot_node_" << nonameCounter;
251  nonameCounter++;
252  name = ss.str();
253  }
254 
255  VirtualRobot::RobotNodePtr result;
256  PosePtr lTbase = PosePtr::dynamicCast(remoteNode->getLocalTransformation());
257  Eigen::Matrix4f localTransform = lTbase->toEigen();
258 
259  //float jv = remoteNode->getJointValue();
260  float jvLo = remoteNode->getJointLimitLow();
261  float jvHi = remoteNode->getJointLimitHigh();
262  float jointOffset = 0; //remoteNode->getJointOffset();
263 
264  JointType jt = remoteNode->getType();
265 
266  SceneObject::Physics physics;
267  physics.localCoM = Vector3Ptr::dynamicCast(remoteNode->getCoM())->toEigen();
268  std::vector<float> inertia = remoteNode->getInertia();
269  for (int i = 0; i < 3; i++)
270  for (int j = 0; j < 3; j++)
271  {
272  physics.inertiaMatrix(i, j) = inertia.at(i * 3 + j);
273  }
274  physics.massKg = remoteNode->getMass();
275 
276  switch (jt)
277  {
278  case ePrismatic:
279  {
280  Vector3Ptr axisBase =
281  Vector3Ptr::dynamicCast(remoteNode->getJointTranslationDirection());
282  Eigen::Vector3f axis = axisBase->toEigen();
283  // convert axis to local coord system
284  Eigen::Vector4f result4f = Eigen::Vector4f::Zero();
285  result4f.segment(0, 3) = axis;
286  PosePtr gp = PosePtr::dynamicCast(remoteNode->getGlobalPose());
287  result4f = gp->toEigen().inverse() * result4f;
288  axis = result4f.block(0, 0, 3, 1);
289 
290  result = prismaticNodeFactory->createRobotNode(robo,
291  name,
292  VirtualRobot::VisualizationNodePtr(),
293  VirtualRobot::CollisionModelPtr(),
294  jvLo,
295  jvHi,
296  jointOffset,
297  localTransform,
298  idVec3,
299  axis,
300  physics);
301  }
302  break;
303 
304  case eFixed:
305  result = fixedNodeFactory->createRobotNode(robo,
306  name,
307  VirtualRobot::VisualizationNodePtr(),
308  VirtualRobot::CollisionModelPtr(),
309  0,
310  0,
311  0,
312  localTransform,
313  idVec3,
314  idVec3,
315  physics);
316  break;
317 
318  case eRevolute:
319  {
320  Vector3Ptr axisBase = Vector3Ptr::dynamicCast(remoteNode->getJointRotationAxis());
321  Eigen::Vector3f axis = axisBase->toEigen();
322  // convert axis to local coord system
323  Eigen::Vector4f result4f = Eigen::Vector4f::Zero();
324  result4f.segment(0, 3) = axis;
325  PosePtr gp = PosePtr::dynamicCast(remoteNode->getGlobalPose());
326  result4f = gp->toEigen().inverse() * result4f;
327  axis = result4f.block(0, 0, 3, 1);
328 
329  result = revoluteNodeFactory->createRobotNode(robo,
330  name,
331  VirtualRobot::VisualizationNodePtr(),
332  VirtualRobot::CollisionModelPtr(),
333  jvLo,
334  jvHi,
335  jointOffset,
336  localTransform,
337  axis,
338  idVec3,
339  physics);
340  }
341  break;
342 
343  default:
344  ARMARX_ERROR_S << "JointType nyi...";
345  return VirtualRobot::RobotNodePtr();
346  break;
347  }
348 
349  robo->registerRobotNode(result);
350  allNodes.push_back(result);
351 
352 
353  // setup joint->nextNodes children
354  std::vector<std::string> childrenBase = remoteNode->getChildren();
355  std::vector<std::string> children;
356 
357  // check for RobotNodes (sensors do also register as children!)
358  for (size_t i = 0; i < childrenBase.size(); i++)
359  {
360  if (_robot->hasRobotNode(childrenBase[i]))
361  {
362  SharedRobotNodeInterfacePrx rnRemote = _robot->getRobotNode(childrenBase[i]);
363  VirtualRobot::RobotNodePtr localNode =
364  createLocalNode(rnRemote, allNodes, childrenMap, robo);
365 
366  if (!localNode)
367  {
368  ARMARX_ERROR_S << "Could not create local node: " << children[i];
369  continue;
370  }
371 
372  children.push_back(childrenBase[i]);
373  }
374  }
375 
376  childrenMap[result] = children;
377  return result;
378  }
379 
382  {
383  std::scoped_lock cloneLock(m);
384  std::string robotType = getName();
385  std::string robotName = getName();
386  VirtualRobot::RobotPtr robo(new VirtualRobot::LocalRobot(robotName, robotType));
387 
388  //RobotNodePtr
389  SharedRobotNodeInterfacePrx root = _robot->getRootNode();
390 
391  std::vector<VirtualRobot::RobotNodePtr> allNodes;
392  std::map<VirtualRobot::RobotNodePtr, std::vector<std::string>> childrenMap;
393 
394  VirtualRobot::RobotNodePtr rootLocal = createLocalNode(root, allNodes, childrenMap, robo);
395 
396  bool res =
397  VirtualRobot::RobotFactory::initializeRobot(robo, allNodes, childrenMap, rootLocal);
398 
399  if (!res)
400  {
401  ARMARX_ERROR_S << "Failed to initialize local robot...";
402  return VirtualRobot::RobotPtr();
403  }
404 
405  // clone rns
406  std::vector<std::string> rns = _robot->getRobotNodeSets();
407 
408  for (size_t i = 0; i < rns.size(); i++)
409  {
410  RobotNodeSetInfoPtr rnsInfo = _robot->getRobotNodeSet(rns[i]);
411  RobotNodeSet::createRobotNodeSet(
412  robo, rnsInfo->name, rnsInfo->names, rnsInfo->rootName, rnsInfo->tcpName, true);
413  }
414 
415  //ARMARX_IMPORTANT_S << "RemoteRobot local clone end" << flush;
416  auto pose = PosePtr::dynamicCast(_robot->getGlobalPose());
417  robo->setGlobalPose(pose->toEigen());
418  return robo;
419  }
420 
423  const std::string& filename,
424  const Ice::StringSeq packages,
425  VirtualRobot::RobotIO::RobotDescription loadMode)
426  {
427  return createLocalClone(robotStatePrx->getSynchronizedRobot(),
428  filename,
429  robotStatePrx->getScaling(),
430  packages,
431  loadMode);
432  }
433 
434  RobotPtr
436  std::string filename,
437  float scaling,
438  const Ice::StringSeq packages,
439  VirtualRobot::RobotIO::RobotDescription loadMode)
440  {
441  RobotPtr result;
442 
443  std::scoped_lock cloneLock(m);
444  ARMARX_VERBOSE_S << "Creating local clone of remote robot (filename:" << filename << ")";
445 
446 
447  if (!sharedRobotPrx)
448  {
449  ARMARX_ERROR_S << "NULL sharedRobotPrx. Aborting...";
450  return result;
451  }
452 
453  if (filename.empty())
454  {
455  std::shared_ptr<RemoteRobot> rob(new RemoteRobot(sharedRobotPrx));
456  result = rob->createLocalClone();
457 
458  if (!result)
459  {
460  ARMARX_ERROR_S << "Could not create local clone. Aborting...";
461  return result;
462  }
463  }
464  else
465  {
466  Ice::StringSeq includePaths;
467  for (const std::string& projectName : packages)
468  {
469  if (projectName.empty())
470  {
471  continue;
472  }
473 
474  CMakePackageFinder project(projectName);
475 
476  auto pathsString = project.getDataDir();
477  ARMARX_DEBUG_S << "Data paths of ArmarX package " << projectName << ": "
478  << pathsString;
479  Ice::StringSeq projectIncludePaths = simox::alg::split(pathsString, ";,");
480  ARMARX_DEBUG_S << "Result: Data paths of ArmarX package " << projectName << ": "
481  << projectIncludePaths;
482  includePaths.insert(
483  includePaths.end(), projectIncludePaths.begin(), projectIncludePaths.end());
484  }
485 
486 
488  {
489  ARMARX_ERROR_S << "Could find robot file " << filename;
490  return result;
491  }
492  result = RobotIO::loadRobot(filename, loadMode);
493 
494  if (!result)
495  {
496  ARMARX_ERROR_S << "Could not load robot file " << filename << ". Aborting...";
497  return result;
498  }
499  }
500 
501  if (result && scaling != 1.0f)
502  {
503  ARMARX_INFO_S << "Scaling robot to " << scaling;
504  result = result->clone(result->getName(), result->getCollisionChecker(), scaling);
505  }
506 
507  synchronizeLocalClone(result, sharedRobotPrx);
508  return result;
509  }
510 
511  RobotPtr
513  RobotIO::RobotDescription loadMode)
514  {
515  return createLocalClone(robotStatePrx,
516  robotStatePrx->getRobotFilename(),
517  robotStatePrx->getArmarXPackages(),
518  loadMode);
519  }
520 
521  bool
523  RobotStateComponentInterfacePrx robotStatePrx)
524  {
525  return synchronizeLocalClone(robot, robotStatePrx->getSynchronizedRobot());
526  }
527 
528  bool
530  SharedRobotInterfacePrx sharedRobotPrx)
531  {
532  if (!robot)
533  {
534  ARMARX_ERROR << "Robot is NULL! Aborting...";
535  return false;
536  }
537  if (!sharedRobotPrx)
538  {
539  ARMARX_ERROR_S << "shared robot prx is NULL! Aborting...";
540  return false;
541  }
542  PoseBasePtr globalPose;
543  RobotConfigPtr c(new RobotConfig(robot, "synchronizeLocalClone"));
544  NameValueMap jv = sharedRobotPrx->getConfigAndPose(globalPose);
545 
546  for (NameValueMap::const_iterator it = jv.begin(); it != jv.end(); it++)
547  {
548  // joint values
549  const std::string& jointName = it->first;
550  float jointAngle = it->second;
551 
552  if (!c->setConfig(jointName, jointAngle))
553  {
554  ARMARX_WARNING << deactivateSpam(10, jointName)
555  << "Joint not known in local copy:" << jointName << ". Skipping...";
556  }
557  }
558 
559  robot->setConfig(c);
560  auto pose = PosePtr::dynamicCast(globalPose);
561  robot->setGlobalPose(pose->toEigen());
562  return true;
563  }
564 
565  bool
567  RobotStateComponentInterfacePrx robotStatePrx,
569  {
570  ARMARX_CHECK_EXPRESSION(robotStatePrx);
571 
572  RobotConfigPtr c(new RobotConfig(robot, "synchronizeLocalClone"));
573  RobotStateConfig state = robotStatePrx->getRobotStateAtTimestamp(timestamp);
574 
575  return synchronizeLocalCloneToState(robot, state);
576  }
577 
578  bool
579  RemoteRobot::synchronizeLocalCloneToState(RobotPtr robot, const RobotStateConfig& state)
580  {
582 
583  RobotConfigPtr c(new RobotConfig(robot, "synchronizeLocalClone"));
584  if (state.jointMap.empty())
585  {
586  return false;
587  }
588 
589  for (NameValueMap::const_iterator it = state.jointMap.begin(); it != state.jointMap.end();
590  it++)
591  {
592  // joint values
593  const std::string& jointName = it->first;
594  float jointAngle = it->second;
595 
596  if (!c->setConfig(jointName, jointAngle))
597  {
598  ARMARX_WARNING << deactivateSpam(10, jointName)
599  << "Joint not known in local copy:" << jointName << ". Skipping...";
600  }
601  }
602 
603  robot->setConfig(c);
604  auto pose = PosePtr::dynamicCast(state.globalPose);
605  robot->setGlobalPose(pose->toEigen());
606 
607  return true;
608  }
609 
610  // Private (unused methods)
611 
612  bool
613  RemoteRobot::hasEndEffector(const std::string& endEffectorName) const
614  {
615  return false;
616  }
617 
618  EndEffectorPtr
619  RemoteRobot::getEndEffector(const std::string& endEffectorName) const
620  {
621  return EndEffectorPtr();
622  }
623 
624  void
625  RemoteRobot::getEndEffectors(std::vector<EndEffectorPtr>& storeEEF) const
626  {
627  }
628 
629  void
630  RemoteRobot::setRootNode(RobotNodePtr node)
631  {
632  }
633 
634  void
636  {
637  }
638 
639  void
641  {
642  }
643 
644  void
645  RemoteRobot::registerRobotNodeSet(RobotNodeSetPtr nodeSet)
646  {
647  }
648 
649  void
650  RemoteRobot::deregisterRobotNodeSet(RobotNodeSetPtr nodeSet)
651  {
652  }
653 
654  void
655  RemoteRobot::registerEndEffector(EndEffectorPtr endEffector)
656  {
657  }
658 
659  void
660  RemoteRobot::setGlobalPose(const Eigen::Matrix4f& globalPose, bool applyValues)
661  {
662  if (_robot)
663  {
664  _robot->setGlobalPose(new Pose(globalPose));
665  }
666  }
667 
668  CollisionCheckerPtr
670  {
671  return VirtualRobot::CollisionChecker::getGlobalCollisionChecker();
672  }
673 
674 
675 } // namespace armarx
armarx::RemoteRobot::m
static std::recursive_mutex m
Definition: RemoteRobot.h:285
armarx::RemoteRobot::getGlobalPose
Eigen::Matrix4f getGlobalPose() const override
Definition: RemoteRobot.cpp:193
RemoteRobot.h
armarx::RemoteRobot::createRemoteRobotNode
static VirtualRobot::RobotNodePtr createRemoteRobotNode(SharedRobotNodeInterfacePrx, VirtualRobot::RobotPtr)
Definition: RemoteRobotNode.cpp:43
Eigen
Definition: Elements.h:32
armarx::RemoteRobot::hasRobotNode
bool hasRobotNode(const std::string &robotNodeName) const override
Definition: RemoteRobot.cpp:96
armarx::RemoteRobot::_robot
SharedRobotInterfacePrx _robot
Definition: RemoteRobot.h:281
armarx::RemoteRobot::deregisterRobotNode
void deregisterRobotNode(VirtualRobot::RobotNodePtr node) override
Not implemented yet.
Definition: RemoteRobot.cpp:640
armarx::navigation::core::Pose
Eigen::Isometry3f Pose
Definition: basic_types.h:31
armarx::RemoteRobot::synchronizeLocalClone
static bool synchronizeLocalClone(VirtualRobot::RobotPtr robot, RobotStateComponentInterfacePrx robotStatePrx)
Definition: RemoteRobot.cpp:522
VirtualRobot
Definition: FramedPose.h:42
armarx::RemoteRobot::createLocalCloneFromFile
static VirtualRobot::RobotPtr createLocalCloneFromFile(RobotStateComponentInterfacePrx robotStatePrx, VirtualRobot::RobotIO::RobotDescription loadMode=VirtualRobot::RobotIO::eFull)
This is a convenience function for createLocalClone, which automatically gets the filename from the R...
Definition: RemoteRobot.cpp:512
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:650
armarx::RemoteRobot::getRootNode
VirtualRobot::RobotNodePtr getRootNode() const override
Definition: RemoteRobot.cpp:85
armarx::RemoteRobot::getRobotNodes
void getRobotNodes(std::vector< VirtualRobot::RobotNodePtr > &storeNodes, bool clearVector=true) const override
Definition: RemoteRobot.cpp:152
armarx::RemoteRobot::_root
VirtualRobot::RobotNodePtr _root
Definition: RemoteRobot.h:283
armarx::RemoteRobot::getEndEffectors
void getEndEffectors(std::vector< VirtualRobot::EndEffectorPtr > &storeEEF) const override
Not implemented yet.
Definition: RemoteRobot.cpp:625
armarx::CMakePackageFinder
The CMakePackageFinder class provides an interface to the CMake Package finder capabilities.
Definition: CMakePackageFinder.h:52
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:46
project
std::string project
Definition: VisualizationRobot.cpp:85
armarx::RemoteRobot::getScaling
float getScaling()
Definition: RemoteRobot.cpp:200
armarx::RemoteRobot::getRobotNodeSet
VirtualRobot::RobotNodeSetPtr getRobotNodeSet(const std::string &nodeSetName) const override
Definition: RemoteRobot.cpp:173
armarx::RemoteRobot::getRobotNode
VirtualRobot::RobotNodePtr getRobotNode(const std::string &robotNodeName) const override
Definition: RemoteRobot.cpp:133
IceInternal::Handle< Pose >
armarx::RemoteRobot::getName
std::string getName() const override
Definition: RemoteRobot.cpp:212
deactivateSpam
SpamFilterDataPtr deactivateSpam(SpamFilterDataPtr const &spamFilter, float deactivationDurationSec, const std::string &identifier, bool deactivate)
Definition: Logging.cpp:75
armarx::RemoteRobot::hasRobotNodeSet
bool hasRobotNodeSet(const std::string &name) const override
Definition: RemoteRobot.cpp:167
ARMARX_DEBUG_S
#define ARMARX_DEBUG_S
Definition: Logging.h:205
FramedPose.h
armarx::RemoteRobot::getRobotNodeSets
void getRobotNodeSets(std::vector< VirtualRobot::RobotNodeSetPtr > &storeNodeSet) const override
Definition: RemoteRobot.cpp:182
armarx::armem::human::Robot
@ Robot
Definition: util.h:17
ARMARX_ERROR_S
#define ARMARX_ERROR_S
Definition: Logging.h:216
armarx::RemoteRobot::registerEndEffector
void registerEndEffector(VirtualRobot::EndEffectorPtr endEffector) override
Not implemented yet.
Definition: RemoteRobot.cpp:655
armarx::VariantType::Long
const VariantTypeId Long
Definition: Variant.h:918
filename
std::string filename
Definition: VisualizationRobot.cpp:86
timestamp
std::string timestamp()
Definition: CartographerAdapter.cpp:85
armarx::RemoteRobot::getSharedRobot
SharedRobotInterfacePrx getSharedRobot() const
Use this method to share the robot instance over Ice.
Definition: RemoteRobot.cpp:206
ARMARX_ERROR
#define ARMARX_ERROR
Definition: Logging.h:196
armarx::RemoteRobot::deregisterRobotNodeSet
void deregisterRobotNodeSet(VirtualRobot::RobotNodeSetPtr nodeSet) override
Not implemented yet.
Definition: RemoteRobot.cpp:650
ARMARX_LOG_S
#define ARMARX_LOG_S
Definition: Logging.h:145
armarx::RemoteRobotNode_getGlobalCollisionChecker
CollisionCheckerPtr RemoteRobotNode_getGlobalCollisionChecker()
Definition: RemoteRobot.cpp:669
ExpressionException.h
armarx::control::njoint_controller::platform::platform_follower_controller::NameValueMap
std::map< std::string, float > NameValueMap
Definition: PlatformFollowerController.h:88
DMES
#define DMES(Obj)
Definition: RemoteRobot.cpp:53
CMakePackageFinder.h
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::RemoteRobot::_cachedNodes
std::map< std::string, VirtualRobot::RobotNodePtr > _cachedNodes
Definition: RemoteRobot.h:282
armarx::RemoteRobot::~RemoteRobot
~RemoteRobot() override
Definition: RemoteRobot.cpp:68
armarx::RemoteRobot::registerRobotNodeSet
void registerRobotNodeSet(VirtualRobot::RobotNodeSetPtr nodeSet) override
Not implemented yet.
Definition: RemoteRobot.cpp:645
armarx::RemoteRobot::createLocalClone
VirtualRobot::RobotPtr createLocalClone()
Clones the structure of this remote robot to a local instance.
Definition: RemoteRobot.cpp:381
armarx::RemoteRobot::synchronizeLocalCloneToTimestamp
static bool synchronizeLocalCloneToTimestamp(VirtualRobot::RobotPtr robot, RobotStateComponentInterfacePrx robotStatePrx, Ice::Long timestamp)
Synchronizes a local robot to a robot state at timestamp.
Definition: RemoteRobot.cpp:566
IceInternal::ProxyHandle<::IceProxy::armarx::SharedRobotInterface >
armarx::RemoteRobot::synchronizeLocalCloneToState
static bool synchronizeLocalCloneToState(VirtualRobot::RobotPtr robot, RobotStateConfig const &state)
Definition: RemoteRobot.cpp:579
ARMARX_VERBOSE_S
#define ARMARX_VERBOSE_S
Definition: Logging.h:207
armarx::RemoteRobot::getEndEffector
VirtualRobot::EndEffectorPtr getEndEffector(const std::string &endEffectorName) const override
Not implemented yet.
Definition: RemoteRobot.cpp:619
armarx::RemoteRobot::RemoteRobot
RemoteRobot(SharedRobotInterfacePrx robot)
Definition: RemoteRobot.cpp:63
ARMARX_INFO_S
#define ARMARX_INFO_S
Definition: Logging.h:202
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
Logging.h
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:193
ArmarXDataPath.h
armarx::RemoteRobot::createLocalNode
VirtualRobot::RobotNodePtr createLocalNode(SharedRobotNodeInterfacePrx remoteNode, std::vector< VirtualRobot::RobotNodePtr > &allNodes, std::map< VirtualRobot::RobotNodePtr, std::vector< std::string >> &childrenMap, VirtualRobot::RobotPtr robo)
Definition: RemoteRobot.cpp:218
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::RemoteRobot::setRootNode
void setRootNode(VirtualRobot::RobotNodePtr node) override
Not implemented yet.
Definition: RemoteRobot.cpp:630
armarx::RemoteRobot::setGlobalPose
void setGlobalPose(const Eigen::Matrix4f &globalPose, bool applyValues=true) override
Sets the global pose of the robot.
Definition: RemoteRobot.cpp:660
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:19
armarx::RemoteRobot::registerRobotNode
void registerRobotNode(VirtualRobot::RobotNodePtr node) override
Not implemented yet.
Definition: RemoteRobot.cpp:635
armarx::split
std::vector< std::string > split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)
Definition: StringHelpers.cpp:38
armarx::RemoteRobot::hasEndEffector
bool hasEndEffector(const std::string &endEffectorName) const override
Not implemented yet.
Definition: RemoteRobot.cpp:613