32 using namespace ScanLocationGroup;
48 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)
78 ChannelRefPtr::dynamicCast(memoryObserver->requestObjectClassRepeated(
79 className, in.getCycleTimeMs(), armarx::DEFAULT_VIEWTARGET_PRIORITY));
85 localizationQueries.push_back(channel);
95 local.setLocalizationQueries(localizationQueries);
103 memoryx::ObjectMemoryObserverInterfacePrx memoryObserver = getObjectMemoryObserver();
104 std::vector<armarx::ChannelRefPtr> resultInstances;
105 std::vector<std::string> objectClassNames = in.getObjectclassesToLocalize();
107 for (std::string
const& className : objectClassNames)
109 if (className.find(
"/") != std::string::npos)
111 ARMARX_INFO <<
"Not adding ObjectInstanceChannel for ObjectPoseStorage instance: "
117 ARMARX_INFO <<
"Checking for instances of type " << className;
118 auto instances = memoryObserver->getObjectInstancesByClass(className);
120 for (
auto& channel : instances)
122 auto objectInstanceChannelRef = ChannelRefPtr::dynamicCast(channel);
124 if (objectInstanceChannelRef)
126 resultInstances.push_back(objectInstanceChannelRef);
130 ARMARX_WARNING <<
"Channelref of instance " << className <<
" is null";
136 ARMARX_IMPORTANT <<
"Found the following objectInstances object instances: " << resultInstances;
137 out.setObjectInstanceChannels(resultInstances);
141 ARMARX_INFO <<
"Releasing " << channel->channelName;
142 memoryObserver->releaseObjectClass(channel);