27 #include "GraspObjectGroupStatechartContext.generated.h"
30 using namespace GraspObjectGroup;
46 GraspObjectGroupStatechartContext* context = getContext<GraspObjectGroupStatechartContext>();
48 ChannelRefPtr handMemoryChannel = getInput<ChannelRef>(
"HandMemoryChannel");
49 memoryx::ChannelRefBaseSequence instances =
50 context->getObjectMemoryObserver()->getObjectInstances(handMemoryChannel);
52 if (instances.size() == 0)
54 ARMARX_ERROR <<
"No instances of the hand in the memory";
62 ChannelRefPtr::dynamicCast(instances.front())->get<
FramedPosition>(
"position");
64 ChannelRefPtr::dynamicCast(instances.front())->get<
FramedOrientation>(
"orientation");
66 orientation->toEigen(), position->toEigen(), position->getFrame(), position->agent);
68 if (position->getFrame().empty())
76 Eigen::Vector3f liftTranslation = in.getLiftTranslation()->
toEigen();
77 Eigen::Matrix4f targetEigen1 = handPoseFromMemoryX.toRootEigen(getRobot());
78 targetEigen1(2, 3) += 0.7f * liftTranslation(2);
80 targetEigen1, getRobot()->getRootNode()->getName(), handPoseFromMemoryX.agent);
81 out.setTcpTargetPose1(target1);
82 Eigen::Matrix4f targetEigen2 = handPoseFromMemoryX.toRootEigen(getRobot());
83 targetEigen2.block<3, 1>(0, 3) += liftTranslation;
85 targetEigen1, getRobot()->getRootNode()->getName(), handPoseFromMemoryX.agent);
86 out.setTcpTargetPose2(target2);
88 emitTargetCalculated();