Skip to content
Snippets Groups Projects
Commit ac16076f authored by Patrick Dormanns's avatar Patrick Dormanns
Browse files

get endeffector from HumanMapping

parent 759f5bcc
No related branches found
No related tags found
1 merge request!53Implement 'PointAt'-skill
......@@ -137,13 +137,23 @@ namespace armarx::control::pointing::core
Side side,
const std::string& shapeName)
{
auto eefName = std::string("Hand_") + (side == Side::LEFT ? "L" : "R") + "_EEF"; // TODO
auto eef = robot->getEndEffector(eefName);
auto humanMapping = robot->getHumanMapping();
ARMARX_CHECK(humanMapping) << "Robot '" << robot->getName() << "' has no human mapping";
auto armDescription = (side == LEFT) ? humanMapping->leftArm : humanMapping->rightArm;
auto tcp = armDescription.segments.tcp.nodeName;
// get endeffector whichs tcp-name matches the tcp-name of the according hand
auto eefs = robot->getEndEffectors();
auto eef = std::find_if(eefs.begin(),
eefs.end(),
[&tcp](VirtualRobot::EndEffectorPtr eef)
{ return eef->getTcpName() == tcp; });
ARMARX_CHECK(eef != eefs.end());
auto shape = eef->getPreshape(shapeName);
auto shape = (*eef)->getPreshape(shapeName);
if (not shape)
{
ARMARX_ERROR << "Hand '" << eefName << "' has no shape '" << shape << "'";
ARMARX_ERROR << "Hand '" << (*eef)->getName() << "' has no shape '" << shapeName << "'";
throw armarx::exceptions::local::PointingFailedException();
}
return shape->getRobotNodeJointValueMap();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment