26 #include <VirtualRobot/Grasping/Grasp.h>
29 using namespace FindAndGraspObjectGroup;
44 setOutput(
"objectInstanceChannel", getInput<ChannelRef>(
"objectInstanceChannel"));
45 setOutput(
"markerInstanceChannel", getInput<ChannelRef>(
"markerInstanceChannel"));
51 ChannelRefPtr objectInstanceChannel = getInput<ChannelRef>(
"objectInstanceChannel");
53 float minRecognitionLikelihood = getInput<float>(
"minObjectCertainty");
87 std::string objectFrame = objectPosition->frame;
88 objectGlobalPose.block(0, 3, 3, 1) = objectPosition->toEigen();
91 if (!objectFrame.empty())
96 std::string targetFrame = getInput<std::string>(
"referenceFrame");
97 VirtualRobot::RobotNodePtr targetNode = localRobot->getRobotNode(targetFrame);
101 ARMARX_ERROR <<
"Target frame not part of robot" << std::endl;
104 ARMARX_DEBUG <<
"robot global pose: " << localRobot->getGlobalPose() << std::endl;
105 ARMARX_DEBUG <<
"target frame global pose: " << targetNode->getGlobalPose() << std::endl;
108 Eigen::Matrix4f objectFramedPose = targetNode->getGlobalPose().inverse() * objectGlobalPose;
110 ARMARX_DEBUG <<
"object global pose: " << objectGlobalPose << std::endl;
111 ARMARX_DEBUG <<
"object framed pose: " << objectFramedPose << std::endl;
115 ARMARX_DEBUG <<
"grasp framed pose: " << graspFramedPose << std::endl;
120 setLocal(
"targetPose", targetFramedPose);
125 Eigen::Vector3f viewTarget;
126 viewTarget << targetFramedPose->position->x, targetFramedPose->position->y, targetFramedPose->position->z;
149 return "VisualServoWrapper";