26 using namespace GraspObjectGroup;
33 #include <VirtualRobot/Grasping/Grasp.h>
34 #include <VirtualRobot/Grasping/GraspSet.h>
35 #include <VirtualRobot/ManipulationObject.h>
36 #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 =
60 getPriorKnowledge()->getObjectClassesSegment();
61 memoryx::CommonStorageInterfacePrx databasePrx = getPriorKnowledge()->getCommonStorage();
63 memoryx::EntityBasePtr entity = classesSegmentPrx->getEntityByName(objectName);
68 VirtualRobot::ManipulationObjectPtr mo = simoxWrapper->getManipulationObject();
73 std::string graspSetName = in.getGraspSetName();
75 if (mo->getGraspSet(graspSetName))
77 std::string graspName = in.getGraspName();
78 VirtualRobot::GraspPtr grasp = mo->getGraspSet(graspSetName)->getGrasp(graspName);
82 ARMARX_ERROR <<
"No grasp with name " << graspName <<
" found! ";
87 transformationFromObjectToTCPPose = grasp->getTransformation().inverse();
92 ARMARX_ERROR <<
"No grasp set with name " << graspSetName <<
" found! ";
96 Eigen::Matrix4f desiredTcpOffsetToObjectEigen = transformationFromObjectToTCPPose;
97 PosePtr desiredTcpOffsetToObject =
new Pose(desiredTcpOffsetToObjectEigen);
98 local.setDesiredTcpOffsetToObject(desiredTcpOffsetToObject);