48 ChannelRefPtr::dynamicCast(getSystemObserver()->startCounter(0,
"ScanLocationCounter"));
49 local.setLocationCounterId(counterId);
52 auto display = in.getDisplay_Text();
53 if (display.size() == 2)
55 getMessageDisplay()->setMessage(display.at(0), display.at(1));
59 ARMARX_WARNING <<
"Display text not set (wrong size): " << display.size();
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);
ScanLocation(XMLStateConstructorParams stateData)
static SubClassRegistry Registry
static XMLStateFactoryBasePtr CreateInstance(XMLStateConstructorParams stateData)
Terms are part of the user front end of the ArmarX condition mechanism.
static IceUtil::Time GetTime(TimeMode timeMode=TimeMode::VirtualTime)
Get the current time.
Implements a Variant type for timestamps.
Class for legacy to stay compatible with old statecharts.
#define ARMARX_INFO
The normal logging level.
#define ARMARX_IMPORTANT
The logging level for always important information, but expected behaviour (in contrast to ARMARX_WAR...
#define ARMARX_IMPORTANT_S
The logging level for always important information, but expected behaviour (in contrast to ARMARX_WAR...
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceInternal::Handle< ChannelRef > ChannelRefPtr
IceInternal::Handle< XMLStateFactoryBase > XMLStateFactoryBasePtr