26 using namespace GraspObjectGroup;
38 #include <VirtualRobot/ManipulationObject.h>
39 #include <VirtualRobot/Grasping/Grasp.h>
40 #include <VirtualRobot/Grasping/GraspSet.h>
41 #include <VirtualRobot/XML/ObjectIO.h>
50 if (in.isDesiredTcpOffsetToObjectInputSet())
52 local.setDesiredTcpOffsetToObject(in.getDesiredTcpOffsetToObjectInput());
56 else if (in.isObjectNameSet() && in.isGraspNameSet() && in.isGraspSetNameSet())
58 std::string objectName = in.getObjectName();
59 memoryx::PersistentObjectClassSegmentBasePrx classesSegmentPrx = getPriorKnowledge()->getObjectClassesSegment();
60 memoryx::CommonStorageInterfacePrx databasePrx = getPriorKnowledge()->getCommonStorage();
62 memoryx::EntityBasePtr entity = classesSegmentPrx->getEntityByName(objectName);
66 VirtualRobot::ManipulationObjectPtr mo = simoxWrapper->getManipulationObject();
71 std::string graspSetName = in.getGraspSetName();
73 if (mo->getGraspSet(graspSetName))
75 std::string graspName = in.getGraspName();
76 VirtualRobot::GraspPtr grasp = mo->getGraspSet(graspSetName)->getGrasp(graspName);
80 ARMARX_ERROR <<
"No grasp with name " << graspName <<
" found! ";
85 transformationFromObjectToTCPPose = grasp->getTransformation().inverse();
90 ARMARX_ERROR <<
"No grasp set with name " << graspSetName <<
" found! ";
94 Eigen::Matrix4f desiredTcpOffsetToObjectEigen = transformationFromObjectToTCPPose;
95 PosePtr desiredTcpOffsetToObject =
new Pose(desiredTcpOffsetToObjectEigen);
96 local.setDesiredTcpOffsetToObject(desiredTcpOffsetToObject);