26#include <VirtualRobot/MathTools.h>
30#include <RobotAPI/interface/components/ViewSelectionInterface.h>
52 getContext<CoupledInteractionGroupStatechartContext>();
54 ARMARX_LOG <<
"deactivating automatic view selection";
56 viewSelection->deactivateAutomaticViewSelection();
59 memoryx::ObjectInstanceMemorySegmentBasePrx objectInstancesSegment =
60 workingMemory->getObjectInstancesSegment();
61 memoryx::ObjectInstanceList objectInstanceList =
62 objectInstancesSegment->getObjectInstancesByClass(in.getObjectNameTable());
64 for (
auto& o : objectInstanceList)
73 objectInstancesSegment->removeEntity(objectInstance->getId());
77 memoryx::ObjectMemoryObserverInterfacePrx objectMemoryObserver =
79 objectMemoryObserver->requestObjectClassRepeated(
80 in.getObjectNameTable(), 2000, armarx::DEFAULT_VIEWTARGET_PRIORITY);
87 getContext<CoupledInteractionGroupStatechartContext>();
88 memoryx::ObjectMemoryObserverInterfacePrx objectMemoryObserver =
91 while (!isRunningTaskStopped())
94 memoryx::ChannelRefBaseSequence objectInstanceList =
95 objectMemoryObserver->getObjectInstancesByClass(in.getObjectNameTable());
96 ARMARX_LOG <<
"found " << objectInstanceList.size() <<
" instances for object "
97 << in.getObjectNameTable();
99 for (
auto& o : objectInstanceList)
109 new FramedPose(position, orientation, position->frame, position->agent);
110 Eigen::Vector3f platformPose;
112 platformPose(0) = position->x;
113 platformPose(1) = position->y;
114 platformPose(2) = getYawAngle(tablePose);
119 out.setTablePoseBase(tablePose);
121 emitEvTableLocalized();
132LocalizeTable::getYawAngle(
const armarx::PoseBasePtr& pose)
const
136 VirtualRobot::MathTools::eigen4f2rpy(p->toEigen(), rpy);
152 return "LocalizeTable";
custom implementation of the StatechartContext for a statechart
memoryx::ObjectMemoryObserverInterfacePrx getObjectMemoryObserverProxy()
ViewSelectionInterfacePrx getViewSelection()
memoryx::WorkingMemoryInterfacePrx getWorkingMemoryProxy()
LocalizeTable(XMLStateConstructorParams stateData)
static SubClassRegistry Registry
static std::string GetName()
static XMLStateFactoryBasePtr CreateInstance(XMLStateConstructorParams stateData)
The FramedOrientation class.
The FramedPosition class.
static void MSSleep(int durationMS)
lock the calling thread for a given duration (like usleep(...) but using Timeserver time)
Class for legacy to stay compatible with old statecharts.
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceInternal::Handle< Pose > PosePtr
IceInternal::Handle< ChannelRef > ChannelRefPtr
IceInternal::Handle< FramedPosition > FramedPositionPtr
IceInternal::Handle< FramedOrientation > FramedOrientationPtr
IceInternal::Handle< XMLStateFactoryBase > XMLStateFactoryBasePtr
IceInternal::Handle< FramedPose > FramedPosePtr
IceInternal::Handle< ObjectInstance > ObjectInstancePtr