26 #include <RobotAPI/interface/observers/ObserverFilters.h>
31 using namespace PlaceObjectGroup;
45 PlaceObjectGroupStatechartContextBase* context = getContext<PlaceObjectGroupStatechartContextBase>();
46 local.setStartTimeRef(ChannelRefPtr::dynamicCast(context->getSystemObserver()->startTimer(
"MoveToPlacePoseStartTime")));
49 local.setForceDatafield(DatafieldRefPtr::dynamicCast(getForceTorqueObserver()->createNulledDatafield(getForceTorqueObserver()->getForceDatafield(in.getForceSensorDatafieldName()))));
52 Literal forceCheck(local.getForceDatafield()->getDataFieldIdentifier(), checks::magnitudelarger, {(float)in.getForceThreshold()});
54 installConditionForHighForceDetected(forceCheck);
55 context->getTCPControlUnit()->request();
60 while (!isRunningTaskStopped())
83 getForceTorqueObserver()->removeFilteredDatafield(local.getForceDatafield());
84 PlaceObjectGroupStatechartContextBase* context = getContext<PlaceObjectGroupStatechartContextBase>();
85 context->getTCPControlUnit()->release();
86 context->getSystemObserver()->removeTimer(local.getStartTimeRef());
88 auto retreatPose = in.getRetreatPose();
89 retreatPose->changeToGlobal(getRobot());
90 retreatPose->position->z += 100;
91 out.setRetreatPose(retreatPose);
93 auto instances = context->getWorkingMemory()->getObjectInstancesSegment()->getObjectInstancesByClass(in.getObjectClassName());
95 if (instances.size() > 0)
97 memoryx::ObjectInstanceBasePtr obj = instances.front();
101 getWorkingMemory()->getObjectInstancesSegment()->setNewMotionModel(obj->getId(), newMotionModel);
102 auto pose = in.getObjectTargetPose();
103 pose->changeFrame(context->getRobot(), context->getRobot()->getRootNode()->getName());
104 getWorkingMemory()->getObjectInstancesSegment()->setObjectPose(obj->getId(),
105 new LinkedPose(pose->toEigen(), pose->getFrame(),
106 context->getRobotStateComponent()->getRobotSnapshot(context->getRobot()->getName())));
107 ARMARX_INFO <<
"Setting object in WM to pose: " << *in.getObjectTargetPose();
111 ARMARX_WARNING <<
"No object instance with name '" << in.getObjectClassName() <<
"' found! Could not change working memory position and motion model of object.";