32 using namespace ScanLocationGroup;
48 ChannelRefPtr counterId = ChannelRefPtr::dynamicCast(getSystemObserver()->startCounter(0,
"ScanLocationCounter"));
49 local.setLocationCounterId(counterId);
52 auto display = in.getDisplay_Text();
62 std::vector<std::string> objectClasses = in.getObjectclassesToLocalize();
64 if (objectClasses.empty())
70 memoryx::ObjectMemoryObserverInterfacePrx memoryObserver = getObjectMemoryObserver();
72 Term classesLocalized;
73 std::vector<ChannelRefPtr> localizationQueries;
75 for (std::string className : objectClasses)
77 ChannelRefPtr channel = ChannelRefPtr::dynamicCast(memoryObserver->requestObjectClassRepeated(className, in.getCycleTimeMs(), armarx::DEFAULT_VIEWTARGET_PRIORITY));
83 localizationQueries.push_back(channel);
93 local.setLocalizationQueries(localizationQueries);
102 memoryx::ObjectMemoryObserverInterfacePrx memoryObserver = getObjectMemoryObserver();
103 std::vector<armarx::ChannelRefPtr> resultInstances;
104 std::vector<std::string> objectClassNames = in.getObjectclassesToLocalize();
106 for (std::string
const& className : objectClassNames)
108 if (className.find(
"/") != std::string::npos)
110 ARMARX_INFO <<
"Not adding ObjectInstanceChannel for ObjectPoseStorage instance: "
116 ARMARX_INFO <<
"Checking for instances of type " << className;
117 auto instances = memoryObserver->getObjectInstancesByClass(className);
119 for (
auto& channel : instances)
121 auto objectInstanceChannelRef = ChannelRefPtr::dynamicCast(channel);
123 if (objectInstanceChannelRef)
125 resultInstances.push_back(objectInstanceChannelRef);
129 ARMARX_WARNING <<
"Channelref of instance " << className <<
" is null";
135 ARMARX_IMPORTANT <<
"Found the following objectInstances object instances: " << resultInstances;
136 out.setObjectInstanceChannels(resultInstances);
140 ARMARX_INFO <<
"Releasing " << channel->channelName;
141 memoryObserver->releaseObjectClass(channel);