26 using namespace ObjectLocalization;
41 ChannelRefBasePtr objectInstanceChannel;
43 if (in.isObjectInstanceChannelSet() && in.getObjectInstanceChannel())
46 objectInstanceChannel = in.getObjectInstanceChannel();
48 else if (in.isObjectNameSet())
50 std::string objectName = in.getObjectName();
51 if (objectName.find(
"/") != std::string::npos)
64 ARMARX_INFO <<
"Object pose from ObjectPoseStorage is " << pose->output();
66 out.setObjectPose(pose);
67 out.setObjectPosition(
new FramedPosition(pose->toEigen(), pose->frame, pose->agent));
68 out.setObjectOrientation(
new FramedOrientation(pose->toEigen(), pose->frame, pose->agent));
78 ARMARX_WARNING <<
"Object instance ID '" << objectName <<
"' looks like an armarx::ObjectID, "
79 <<
"but no such object was found in ObjectPoseStorage (offering " << objectPoses.size() <<
" objects).";
80 emitNoPoseAvailable();
85 memoryx::ObjectMemoryObserverInterfacePrx objectMemoryObserver = getObjectMemoryObserver();
86 std::vector<ChannelRefBasePtr> objectInstanceList = objectMemoryObserver->getObjectInstancesByClass(objectName);
88 ARMARX_INFO <<
"found " << objectInstanceList.size() <<
" instances for object " << in.getObjectName();
89 if (objectInstanceList.size())
91 objectInstanceChannel = objectInstanceList.front();
96 if (!objectInstanceChannel)
98 emitNoPoseAvailable();
102 ChannelRefPtr channelRef = ChannelRefPtr::dynamicCast(objectInstanceChannel);
103 if (!channelRef || !channelRef->hasDatafield(
"pose"))
105 ARMARX_WARNING <<
"unable to cast channel reference or datafield pose does not exists.";
106 emitNoPoseAvailable();
111 ARMARX_INFO <<
"object pose is " << pose->output();
113 out.setObjectPose(pose);
114 out.setObjectPosition(
new FramedPosition(pose->toEigen(), pose->frame, pose->agent));
115 out.setObjectOrientation(
new FramedOrientation(pose->toEigen(), pose->frame, pose->agent));
116 out.setObjectInstanceChannel(channelRef);