27 #include "GraspObjectGroupStatechartContext.generated.h"
35 using namespace GraspObjectGroup;
52 GraspObjectGroupStatechartContext* context = getContext<GraspObjectGroupStatechartContext>();
56 context->getTCPControlUnit()->request();
60 if (in.isObjectInstanceChannelSet())
62 std::string objName = in.getObjectInstanceChannel()->getDataField(
"className")->getString();
63 auto handInstances = context->getObjectMemoryObserver()->getObjectInstancesByClass(in.getHandMemoryChannel()->getDataField(
"className")->getString());
65 ChannelRefBasePtr handChannel = handInstances.front();
68 memoryx::ObjectInstancePtr object = memoryx::ObjectInstancePtr::dynamicCast(context->getWorkingMemory()->getObjectInstancesSegment()->getEntityByName(objName));
70 context->getWorkingMemory()->getObjectInstancesSegment()->setNewMotionModel(object->getId(), newMotionModel);
71 ARMARX_IMPORTANT <<
"Attached object to " << ChannelRefPtr::dynamicCast(handChannel)->getDataField(
"className")->getString();
75 std::string chainName = in.getKinematicChainName();
76 memoryx::PersistentObjectClassSegmentBasePrx classesSegmentPrx = context->getPriorKnowledge()->getObjectClassesSegment();
77 auto tcpObjectClass = classesSegmentPrx->getObjectClassByName(in.getHandMemoryChannel()->getDataField(
"className")->getString());
80 context->getEntityDrawerTopic()->setObjectVisu(
"VisualServoHandVisu",
"tcpTarget_" + chainName, tcpObjectClass,
new Pose());
81 context->getEntityDrawerTopic()->updateObjectTransparency(
"VisualServoHandVisu",
"tcpTarget_" + chainName, 0.3);
84 local.setStartTimeRef(ChannelRefPtr::dynamicCast(context->systemObserverPrx->startTimer(
"LiftHandTimer")));
97 GraspObjectGroupStatechartContext* context = getContext<GraspObjectGroupStatechartContext>();
99 context->getTCPControlUnit()->release();
102 context->systemObserverPrx->removeTimer(local.getStartTimeRef());
103 context->getEntityDrawerTopic()->removeLayer(
"VisualServoHandVisu");