30 #include <VirtualRobot/VirtualRobot.h>
31 #include <VirtualRobot/EndEffector/EndEffector.h>
32 #include <VirtualRobot/XML/RobotIO.h>
42 std::string endeffectorFile = getProperty<std::string>(
"RobotFileName").getValue();
43 std::string endeffectorName = getProperty<std::string>(
"EndeffectorName").getValue();
47 throw UserException(
"Could not find robot file " + endeffectorFile);
53 robot = VirtualRobot::RobotIO::loadRobot(endeffectorFile, VirtualRobot::RobotIO::eStructure);
55 catch (VirtualRobot::VirtualRobotException& e)
57 throw UserException(e.what());
60 if (endeffectorName ==
"")
62 throw UserException(
"EndeffectorName not defined");
65 if (!robot->hasEndEffector(endeffectorName))
67 throw UserException(
"Robot does not contain an endeffector with name: " + endeffectorName);
70 eef = robot->getEndEffector(endeffectorName);
71 robotName = robot->getName();
75 tcpName = robot->getEndEffector(endeffectorName)->getTcp()->getName();
79 throw UserException(
"Endeffector without TCP: " + endeffectorName);
83 std::vector<EndEffectorActorPtr> actors;
84 eef->getActors(actors);
86 for (
size_t i = 0; i < actors.size(); i++)
88 EndEffectorActorPtr
a = actors[i];
89 std::vector<EndEffectorActor::ActorDefinition> ads;
91 for (
size_t j = 0; j < ads.size(); j++)
93 EndEffectorActor::ActorDefinition ad = ads[j];
97 handJoints[ad.robotNode->getName()] = ad.directionAndSpeed;
102 const std::vector<std::string> endeffectorPreshapes = robot->getEndEffector(endeffectorName)->getPreshapes();
105 std::vector<std::string>::const_iterator iter = endeffectorPreshapes.begin();
107 while (iter != endeffectorPreshapes.end())
111 shapeNames->addVariant(currentPreshape);
117 listenerChannelName = endeffectorName +
"State";
118 offeringTopic(listenerChannelName);
120 this->onInitHandUnit();
127 listenerPrx = getTopic<HandUnitListenerPrx>(listenerChannelName);
129 this->onStartHandUnit();
135 this->onExitHandUnit();
146 ARMARX_WARNING <<
"setShapeWithObjectInstance Function not implemented!";
159 getConfigIdentifier()));
165 EndEffectorPtr efp = robot->getEndEffector(getProperty<std::string>(
"EndeffectorName").getValue());
166 RobotConfigPtr rc = efp->getPreshape(shapeName);
167 return rc->getRobotNodeJointValueMap();
174 for (
auto j : handJoints)
176 result[j.first] = 0.0f;
185 graspedObject = objectName;
198 return eef->getName();
219 return "not implemented";