27 #include "GraspObjectGroupStatechartContext.generated.h"
30 using namespace GraspObjectGroup;
47 GraspObjectGroupStatechartContext* context = getContext<GraspObjectGroupStatechartContext>();
49 ChannelRefPtr handMemoryChannel = getInput<ChannelRef>(
"HandMemoryChannel");
50 memoryx::ChannelRefBaseSequence instances = context->getObjectMemoryObserver()->getObjectInstances(handMemoryChannel);
52 if (instances.size() == 0)
54 ARMARX_ERROR <<
"No instances of the hand in the memory";
63 handPoseFromMemoryX =
FramedPose(orientation->toEigen(), position->toEigen(), position->getFrame(), position->agent);
65 if (position->getFrame().empty())
73 Eigen::Vector3f liftTranslation = in.getLiftTranslation()->
toEigen();
74 Eigen::Matrix4f targetEigen1 = handPoseFromMemoryX.toRootEigen(getRobot());
75 targetEigen1(2, 3) += 0.7f * liftTranslation(2);
76 FramedPose target1(targetEigen1, getRobot()->getRootNode()->getName(), handPoseFromMemoryX.agent);
77 out.setTcpTargetPose1(target1);
78 Eigen::Matrix4f targetEigen2 = handPoseFromMemoryX.toRootEigen(getRobot());
79 targetEigen2.block<3, 1>(0, 3) += liftTranslation;
80 FramedPose target2(targetEigen1, getRobot()->getRootNode()->getName(), handPoseFromMemoryX.agent);
81 out.setTcpTargetPose2(target2);
83 emitTargetCalculated();