28 #include <RobotAPI/interface/components/ViewSelectionInterface.h>
32 using namespace PlaceObjectGroup;
46 PlaceObjectGroupStatechartContextBase* context = getContext<PlaceObjectGroupStatechartContextBase>();
48 if (context->getObjectMemoryObserver()->getObjectInstancesByClass(in.getObjectName()).size() == 0)
51 ChannelRefBasePtr objectMemoryChannel = context->getObjectMemoryObserver()->requestObjectClassRepeated(in.getObjectName(), 200, armarx::DEFAULT_VIEWTARGET_PRIORITY);
53 if (objectMemoryChannel)
55 local.setObjectMemoryChannel(ChannelRefPtr::dynamicCast(objectMemoryChannel));
59 if (context->getObjectMemoryObserver()->getObjectInstancesByClass(in.getHandNameInMemory()).size() == 0)
62 ChannelRefBasePtr handMemoryChannel = context->getObjectMemoryObserver()->requestObjectClassRepeated(in.getHandNameInMemory(), 300, armarx::DEFAULT_VIEWTARGET_PRIORITY);
64 if (handMemoryChannel)
67 local.setHandMemoryChannel(ChannelRefPtr::dynamicCast(handMemoryChannel));
74 int waitSec = in.getWaitUntilProcessSec();
84 PlaceObjectGroupStatechartContextBase* context = getContext<PlaceObjectGroupStatechartContextBase>();
85 bool bothAvailable =
false;
86 memoryx::ChannelRefBaseSequence objectList;
88 memoryx::ChannelRefBaseSequence handList;
91 while (!isRunningTaskStopped() && !bothAvailable)
93 handList = context->getObjectMemoryObserver()->getObjectInstancesByClass(in.getHandNameInMemory());
95 if (handList.size() > 0)
97 handChannel = ChannelRefPtr::dynamicCast(handList.at(0));
101 ARMARX_VERBOSE <<
"Hand " << in.getHandNameInMemory() <<
" not yet localized";
105 objectList = context->getObjectMemoryObserver()->getObjectInstancesByClass(in.getObjectName());
107 if (objectList.size() > 0)
109 objChannel = ChannelRefPtr::dynamicCast(objectList.at(0));
113 ARMARX_VERBOSE <<
"Object " << in.getObjectName() <<
" not localized";
123 out.setObjectChannelRef(objChannel);
126 out.setHandChannelRef(handChannel);
127 out.setObjectClassName(in.getObjectName());
128 bothAvailable =
true;
129 emitHandAndObjectLocalized();