ObjectMemoryObserver.cpp
Go to the documentation of this file.
1 /*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package VisionX::Observers
17 * @author Kai Welke (welke at kit dot edu), David Schiebener (david dot schiebener at kit dot edu)
18 * @copyright 2012 Humanoids Group, HIS, KIT
19 * @license http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
23 #include "ObjectMemoryObserver.h"
24 
26 
32 
33 #include <RobotAPI/interface/components/ViewSelectionInterface.h>
34 
36 
37 // checks
43 
44 namespace memoryx
45 {
46  // ********************************************************************
47  // observer framework hooks
48  // ********************************************************************
50  {
51  usingProxy(getProperty<std::string>("WorkingMemoryProxy").getValue());
52  usingProxy(getProperty<std::string>("PriorKnowledgeProxy").getValue());
53 
54  uniqueId = 0;
55 
56  // register all checks
62 
63  // use working memory update topic
64  usingTopic(getProperty<std::string>("WorkingMemoryListenerTopic").getValue());
65  }
66 
68  {
69  // retrieve object memory proxy
70  proxyWorkingMemory = getProxy<AbstractWorkingMemoryInterfacePrx>(getProperty<std::string>("WorkingMemoryProxy").getValue());
71  getProxy(priorKnowledge, getProperty<std::string>("PriorKnowledgeProxy").getValue());
72  priorObjectClassesSegment = priorKnowledge->getObjectClassesSegment();
73  // retrieve required segments of memory
74  objectInstancesSegment = ObjectInstanceMemorySegmentBasePrx::checkedCast(proxyWorkingMemory->getSegment("objectInstances"));
75  objectClassesSegment = ObjectClassMemorySegmentBasePrx::checkedCast(proxyWorkingMemory->getSegment("objectClasses"));
76  }
77 
78  // ********************************************************************
79  // ObjectMemoryObserverInterface implementation
80  // ********************************************************************
81 
82  armarx::ChannelRefBasePtr ObjectMemoryObserver::requestObjectClassOnce(const std::string& objectClassName, const IceUtil::Optional<Ice::Int>& priority, const ::Ice::Current& c)
83  {
84  return requestObjectClassRepeated(objectClassName, -1, priority, c);
85  }
86 
87  armarx::ChannelRefBasePtr ObjectMemoryObserver::requestObjectClassRepeated(const std::string& objectClassName, int cycleTimeMS, const IceUtil::Optional<Ice::Int>& priority, const ::Ice::Current& c)
88  {
89  ARMARX_IMPORTANT << "attending to objects of class: " << objectClassName << " with cycle time " << cycleTimeMS;
90 
91  // assure complete ontology tree is in object classes segment
92  ObjectClassList classes = objectClassesSegment->addPriorClassWithSubclasses(objectClassName);
93 
94  if (classes.size() == 0)
95  {
96  ARMARX_WARNING_S << "Class " << objectClassName << " not found ";
97  return NULL;
98  }
99 
100  // create name for query
101  std::stringstream ss;
102  ss << objectClassName << "_query_" << getUniqueId();
103  std::string queryName = ss.str();
104 
105  // update requested entity with query
106  ObjectClassPtr objectClass = ObjectClassPtr::dynamicCast(objectClassesSegment->getEntityByName(objectClassName)->ice_clone());
107  EntityWrappers::ObjectRecognitionWrapperPtr recognitionWrapper = objectClass->addWrapper(new EntityWrappers::ObjectRecognitionWrapper());
108 
109  int localizationPriority = armarx::DEFAULT_VIEWTARGET_PRIORITY;
110  if (priority)
111  {
112  localizationPriority = priority.get();
113  }
114  LocalizationQueryPtr query = new LocalizationQuery(queryName, objectClassName, cycleTimeMS, localizationPriority);
115  recognitionWrapper->addLocalizationQuery(query);
116 
117  // create channel
118  armarx::ChannelRefBasePtr queryChannel = createObjectLocalizationQueryChannel(query);
119 
120  // update class segment
121  objectClassesSegment->updateEntity(objectClass->getId(), objectClass);
122 
123  return queryChannel;
124  }
125 
126 
127  void ObjectMemoryObserver::releaseObjectClass(const armarx::ChannelRefBasePtr& objectClassChannel, const ::Ice::Current& c)
128  {
129  armarx::ChannelRefPtr channelRef = armarx::ChannelRefPtr::dynamicCast(objectClassChannel);
130  if (!existsChannel(objectClassChannel->channelName))
131  {
132  ARMARX_INFO << "Object class query channel " << objectClassChannel->channelName << "does not exist - skipping removal";
133  return;
134  }
135  std::string objectClassName = channelRef->getDataField("className")->getString();
136 
137  ARMARX_IMPORTANT << "releasing objects of class " << objectClassName;
138 
139  // remove query requested entity with query
140  auto entity = objectClassesSegment->getEntityByName(objectClassName);
141  ObjectClassPtr objectClass = ObjectClassPtr::dynamicCast(entity);
142  if (objectClass)
143  {
144  EntityWrappers::ObjectRecognitionWrapperPtr recognitionWrapper = objectClass->addWrapper(new EntityWrappers::ObjectRecognitionWrapper());
145 
146  recognitionWrapper->removeLocalizationQuery(objectClassChannel->channelName);
147 
148  // update the entity
149  objectClassesSegment->updateEntity(objectClass->getId(), objectClass);
150 
151  // remove reference to the class
152  objectClassesSegment->removePriorClassWithSubclasses(objectClassName);
153  }
154 
155  // remove channel
156  removeChannel(objectClassChannel->channelName);
157  }
158 
159  memoryx::ChannelRefBaseSequence ObjectMemoryObserver::getObjectInstancesByClass(const std::string& objectClassName, const ::Ice::Current& c)
160  {
161  memoryx::ChannelRefBaseSequence channels;
162 
163  // retrieve all subclasses of the object class
164  ObjectClassList relevantClasses = priorObjectClassesSegment->getClassWithSubclasses(objectClassName);
165  for (ObjectClassBasePtr& objClass : relevantClasses)
166  {
167  ARMARX_DEBUG << "relevant class: " << objClass->getName();
168  }
169  // go through channels
170  armarx::ChannelRegistry registry = getAvailableChannels(false);
171 
172  for (armarx::ChannelRegistry::iterator iter = registry.begin() ; iter != registry.end() ; iter++)
173  {
174  // check whether channel is instances channel
175  armarx::ChannelRegistryEntry channelEntry = iter->second;
176  ARMARX_DEBUG << "Checking " << channelEntry.name;
177 
178  if (channelEntry.dataFields.find("instanceName") == channelEntry.dataFields.end())
179  {
180  ARMARX_DEBUG << "No instance name for " << channelEntry.name;
181  continue;
182  }
183 
184  // check whether channel belongs to requested class
185  armarx::DataFieldRegistry dataFields = channelEntry.dataFields;
186  armarx::DataFieldRegistry::const_iterator iterDataFields = dataFields.find("className");
187 
188  if (iterDataFields == dataFields.end())
189  {
190  ARMARX_DEBUG << "No class name for " << channelEntry.name;
191  continue;
192  }
193 
194  armarx::DataFieldRegistryEntry dataField = iterDataFields->second;
195  if (!dataField.value->getInitialized())
196  {
197  ARMARX_DEBUG << "className not init. for " << channelEntry.name;
198 
199  continue;
200  }
201  std::string channelObjectClassName = dataField.value->getString();
202 
203  bool relevant = false;
204 
205  for (ObjectClassList::iterator iterClasses = relevantClasses.begin() ; iterClasses != relevantClasses.end() ; iterClasses++)
206  {
207  ObjectClassBasePtr objectClass = *iterClasses;
208 
209  if (objectClass->getName() == channelObjectClassName)
210  {
211  relevant = true;
212  }
213 
214  }
215 
216  if (relevant)
217  {
218  ARMARX_DEBUG << "Adding instance " << iter->first << " to result";
219  channels.push_back(new armarx::ChannelRef(this, iter->first));
220  }
221  else
222  {
223  ARMARX_DEBUG << "No relevant class found";
224  }
225  }
226 
227  return channels;
228  }
229 
230  armarx::ChannelRefBasePtr ObjectMemoryObserver::getFirstObjectInstance(const armarx::ChannelRefBasePtr& objectClassChannel, const Ice::Current& c)
231  {
232  auto instances = getObjectInstances(objectClassChannel, c);
233 
234  if (instances.size() > 0)
235  {
236  return instances.front();
237  }
238  else
239  {
240  return armarx::ChannelRefBasePtr();
241  }
242  }
243 
244  armarx::ChannelRefBasePtr ObjectMemoryObserver::getFirstObjectInstanceByClass(const std::string& objectClassName, const Ice::Current& c)
245  {
246  auto instances = getObjectInstancesByClass(objectClassName, c);
247 
248  if (instances.size() > 0)
249  {
250  return instances.front();
251  }
252  else
253  {
254  return armarx::ChannelRefBasePtr();
255  }
256  }
257 
258  memoryx::ChannelRefBaseSequence ObjectMemoryObserver::getObjectInstances(const armarx::ChannelRefBasePtr& objectClassChannel, const ::Ice::Current& c)
259  {
260  armarx::ChannelRefPtr channelRef = armarx::ChannelRefPtr::dynamicCast(objectClassChannel);
261  return getObjectInstancesByClass(channelRef->getDataField("className")->getString(), c);
262  }
263 
264  void ObjectMemoryObserver::reportEntityCreated(const std::string& segmentName, const EntityBasePtr& entity, const ::Ice::Current& c)
265  {
266  ARMARX_VERBOSE << "reportEntityCreated(): " << entity->getName() << ", segmentName: " << segmentName;
267 
268  ObjectInstancePtr instance = ObjectInstancePtr::dynamicCast(entity);
269 
270  // check whether this is the correct type of entity
271  if (!instance)
272  {
273  return;
274  }
275 
276  // check whether entity is in channel list -> error
277  if (existsChannel(getInstanceChannelName(instance)))
278  {
279  ARMARX_ERROR << "Object instance " << instance->getName() << " already in channel list";
280  return;
281  }
282 
283  // create and update channel
284  createObjectInstanceChannel(instance);
285  updateObjectInstanceChannel(instance);
286  }
287 
288  void ObjectMemoryObserver::reportEntityUpdated(const std::string& segmentName, const EntityBasePtr& entityOld, const EntityBasePtr& entityNew, const ::Ice::Current& c)
289  {
290  ARMARX_DEBUG << deactivateSpam(5, entityNew->getName()) << "ObjectMemoryObserver::reportEntityUpdated(): " << entityNew->getName() << ", segmentName: " << segmentName;
291  try
292  {
293  if (segmentName == "objectClasses")
294  {
295  ObjectClassPtr objectClass = ObjectClassPtr::dynamicCast(entityNew);
296  EntityWrappers::ObjectRecognitionWrapperPtr recognitionWrapper = objectClass->addWrapper(new EntityWrappers::ObjectRecognitionWrapper());
297 
298  LocalizationQueryList queries = recognitionWrapper->getLocalizationQueries();
299 
300  for (LocalizationQueryList::iterator iter = queries.begin() ; iter != queries.end() ; iter++)
301  {
302  try
303  {
304  updateObjectLocalizationQueryChannel(LocalizationQueryPtr::dynamicCast(*iter));
305  }
307  {
308  createObjectLocalizationQueryChannel(LocalizationQueryPtr::dynamicCast(*iter));
309  }
310  }
311 
312  return;
313  }
314 
315  if (segmentName == "objectInstances")
316  {
317  ObjectInstancePtr instance = ObjectInstancePtr::dynamicCast(entityNew);
318 
319  // check whether this is the correct type of entity
320  if (!instance)
321  {
322  return;
323  }
324 
325  // check if instance has associated channel
326  if (!existsChannel(getInstanceChannelName(instance)))
327  {
328 
329  ARMARX_INFO << "Object instance " << instance->getName() << " not in channel list - creating it";
330 
331 
332  createObjectInstanceChannel(instance);
333  }
334 
335  // update instance channel
336  updateObjectInstanceChannel(instance);
337  }
338  }
339  catch (...)
340  {
342  }
343  }
344 
345  void ObjectMemoryObserver::reportEntityRemoved(const std::string& segmentName, const EntityBasePtr& entity, const ::Ice::Current& c)
346  {
347  ARMARX_VERBOSE << "reportEntityRemoved(): " << entity->getName() << ", segmentName: " << segmentName;
348 
349  ObjectInstancePtr instance = ObjectInstancePtr::dynamicCast(entity);
350  ObjectClassPtr objClass = ObjectClassPtr::dynamicCast(entity);
351 
352  // check whether this is the correct type of entity
353  if (instance)
354  {
355 
356  // check whether entity is in channel list -> error
357  if (!existsChannel(getInstanceChannelName(instance)))
358  {
359  ARMARX_ERROR << "Object instance " << instance->getName() << " not in channel list";
360  return;
361  }
362 
363  // remove channel
364  removeChannel(getInstanceChannelName(instance));
365  }
366  else if (objClass)
367  {
368  auto channels = getObjectClassQueries(objClass->getName());
369  for (auto& channel : channels)
370  {
371  releaseObjectClass(channel);
372  }
373  }
374 
375  }
376 
377  // Should this really be in the observer interface??? At least all other report methods should be called accordingly
378  void ObjectMemoryObserver::reportSnapshotLoaded(const std::string& segmentName, const ::Ice::Current& c)
379  {
380  }
381 
382  void ObjectMemoryObserver::reportMemoryCleared(const std::string& segmentName, const ::Ice::Current& c)
383  {
384  std::scoped_lock lock(channelsMutex);
385 
386  if (segmentName == "objectClasses" || segmentName == "objectInstances")
387  {
388  ARMARX_IMPORTANT << "Working memory was cleared! deleting all channels";
389  auto channels = getAvailableChannels(false);
390 
391  for (auto& channel : channels)
392  {
393  removeChannel(channel.first);
394  }
395  }
396  }
397 
398  // ********************************************************************
399  // utility methods
400  // ********************************************************************
401  armarx::ChannelRefPtr ObjectMemoryObserver::createObjectLocalizationQueryChannel(const LocalizationQueryPtr& query)
402  {
403  ARMARX_INFO << "Creating channel for object class: " << query->className;
404  std::string channelName = query->queryName;
405 
406  // offer the channel
407  offerChannel(channelName, "object class information for " + query->className);
408 
409  // set datafields
410  offerDataFieldWithDefault(channelName, "className", query->className, "name of object class");
411  offerDataFieldWithDefault(channelName, "localizationFinished", bool(false), "has the localization query finished yet?");
412 
413  return new armarx::ChannelRef(this, channelName);
414  }
415 
416  void ObjectMemoryObserver::updateObjectLocalizationQueryChannel(const LocalizationQueryPtr& query)
417  {
418  ARMARX_DEBUG << "updateObjectLocalizationQueryChannel()";
419 
420  // create unique channel name
421  std::string channelName = query->queryName;
422 
423  setDataField(channelName, "localizationFinished", query->getFinished());
424 
425  updateChannel(channelName);
426  }
427 
428  std::vector<armarx::ChannelRefPtr> ObjectMemoryObserver::getObjectClassQueries(const std::string& objectClassName)
429  {
430  std::vector<armarx::ChannelRefPtr> result;
431  armarx::ChannelRegistry registry = getAvailableChannels(false);
432  for (auto& pair : registry)
433  {
434  armarx::ChannelRegistryEntry& entry = pair.second;
435  auto it = entry.dataFields.find("className");
436  if (entry.name.find("_query_") != std::string::npos && it != entry.dataFields.end() && it->second.value->getType() == armarx::VariantType::String && it->second.value->getString() == objectClassName)
437  {
438  result.push_back(new armarx::ChannelRef(this, entry.name));
439  }
440  }
441  return result;
442  }
443 
444  void ObjectMemoryObserver::createObjectInstanceChannel(const ObjectInstancePtr& instance)
445  {
446  // create unique channel name
447  std::string channelName = getInstanceChannelName(instance);
448  std::string objectInstanceName = instance->getName();
449 
450  ARMARX_INFO << "Creating channel " << channelName << " for instance: " << objectInstanceName;
451 
452  // offer the channel
453  offerChannel(channelName, "object instance information for " + objectInstanceName);
454 
455  // set datafields
456  offerDataField(channelName, "id", armarx::VariantType::String, "id of the object instance in the working memory");
457  offerDataField(channelName, "className", armarx::VariantType::String, "name of object class");
458  offerDataField(channelName, "instanceName", armarx::VariantType::String, "name of object instance");
459  offerDataField(channelName, "position", armarx::VariantType::FramedPosition, "object position");
460  offerDataField(channelName, "orientation", armarx::VariantType::FramedOrientation, "quaternion for object orientation");
461  offerDataField(channelName, "pose", armarx::VariantType::FramedPose, "object pose");
462  offerDataField(channelName, "priority", armarx::VariantType::Int, "localization priority");
463  offerDataField(channelName, "existenceCertainty", armarx::VariantType::Float, "Existence certainty of this object");
464  offerDataField(channelName, "uncertaintyOfPosition", armarx::VariantType::Float, "Std deviation of the position uncertainty");
465  offerDataField(channelName, "timestamp", armarx::VariantType::Timestamp, "timestamp of last localization");
466  }
467 
468  void ObjectMemoryObserver::updateObjectInstanceChannel(const ObjectInstancePtr& instance)
469  {
470  ARMARX_DEBUG << deactivateSpam(5) << "updateObjectInstanceChannel()";
471 
472  std::string channelName = getInstanceChannelName(instance);
473 
474  // set datafields
475  setDataField(channelName, "id", armarx::Variant(instance->getId()));
476  setDataField(channelName, "className", armarx::Variant(instance->getMostProbableClass()));
477  setDataField(channelName, "instanceName", armarx::Variant(instance->getName()));
478  setDataField(channelName, "position", armarx::Variant(instance->getPosition()));
479  setDataField(channelName, "priority", armarx::Variant(instance->getLocalizationPriority()));
480  setDataField(channelName, "orientation", armarx::Variant(instance->getOrientation()));
481  setDataField(channelName, "pose", armarx::Variant(instance->getPose()));
482  setDataField(channelName, "existenceCertainty", armarx::Variant(instance->getExistenceCertainty()));
483  float stdDeviation = std::numeric_limits<float>::max();
484 
485  if (instance->getPositionUncertainty())
486  {
487  Gaussian posUncertaintyDistribution = EarlyVisionConverters::convertToGaussian(instance->getPositionUncertainty());
488  stdDeviation = pow(posUncertaintyDistribution.getCovariance().determinant(), 0.5 / posUncertaintyDistribution.getDimensions());
489  }
490 
491  setDataField(channelName, "uncertaintyOfPosition", armarx::Variant(stdDeviation));
492  setDataField(channelName, "timestamp", armarx::Variant(instance->hasLocalizationTimestamp() ? new armarx::TimestampVariant(instance->getLocalizationTimestamp()) : armarx::TimestampVariant::nowPtr()));
493 
494  // update the channel
495  updateChannel(channelName);
496  }
497 
498  std::string ObjectMemoryObserver::getInstanceChannelName(const EntityBasePtr& instance, const ::Ice::Current& c) const
499  {
500  std::string channelName = instance->getName() + instance->getId();
501  return channelName;
502  }
503 
504  armarx::ChannelRefBasePtr memoryx::ObjectMemoryObserver::getObjectInstanceById(const std::string& id, const Ice::Current&)
505  {
506  armarx::ChannelRegistry registry = getAvailableChannels(false);
507 
508  for (armarx::ChannelRegistry::iterator iter = registry.begin() ; iter != registry.end() ; iter++)
509  {
510  armarx::ChannelRegistryEntry channelEntry = iter->second;
511  ARMARX_DEBUG << "Checking " << channelEntry.name;
512 
513  if (channelEntry.dataFields.find("instanceName") == channelEntry.dataFields.end())
514  {
515  // ARMARX_DEBUG << "No instance name for " << channelEntry.name;
516  continue;
517  }
518  auto it = channelEntry.dataFields.find("id");
519  if (it == channelEntry.dataFields.end())
520  {
521  // ARMARX_DEBUG << "No id for " << channelEntry.name;
522  continue;
523  }
524  if (it->second.value->getString() == id)
525  {
526  return new armarx::ChannelRef(this, iter->first);
527  }
528  }
529  return NULL;
530  }
531 }
armarx::Observer::updateChannel
void updateChannel(const std::string &channelName, const std::set< std::string > &updatedDatafields=std::set< std::string >())
Update all conditions for a channel.
Definition: Observer.cpp:715
Gaussian::getCovariance
const covariance_type & getCovariance() const
Definition: Gaussian.h:77
armarx::Variant
The Variant class is described here: Variants.
Definition: Variant.h:224
memoryx::ObjectMemoryObserver::getFirstObjectInstance
armarx::ChannelRefBasePtr getFirstObjectInstance(const armarx::ChannelRefBasePtr &objectClassChannel, const Ice::Current &c=Ice::emptyCurrent) override
Definition: ObjectMemoryObserver.cpp:230
ARMARX_VERBOSE
#define ARMARX_VERBOSE
Definition: Logging.h:180
armarx::VariantType::Float
const VariantTypeId Float
Definition: Variant.h:918
ARMARX_IMPORTANT
#define ARMARX_IMPORTANT
Definition: Logging.h:183
ConditionCheckEquals.h
armarx::VariantType::FramedPose
const VariantTypeId FramedPose
Definition: FramedPose.h:37
memoryx::ObjectMemoryObserver::requestObjectClassOnce
armarx::ChannelRefBasePtr requestObjectClassOnce(const std::string &objectClassName, const IceUtil::Optional< Ice::Int > &priority, const ::Ice::Current &c=Ice::emptyCurrent) override
Definition: ObjectMemoryObserver.cpp:82
memoryx::ObjectMemoryObserver::requestObjectClassRepeated
armarx::ChannelRefBasePtr requestObjectClassRepeated(const std::string &objectClassName, int cycleTimeMS, const IceUtil::Optional< Ice::Int > &priority, const ::Ice::Current &c=Ice::emptyCurrent) override
Definition: ObjectMemoryObserver.cpp:87
armarx::Observer::removeChannel
void removeChannel(std::string channelName)
Remove a channel.
Definition: Observer.cpp:289
ConditionCheckInRange.h
memoryx::ObjectMemoryObserver::getObjectInstanceById
armarx::ChannelRefBasePtr getObjectInstanceById(const std::string &, const ::Ice::Current &c=::Ice::Current()) override
Definition: ObjectMemoryObserver.cpp:504
armarx::ChannelRef
The ChannelRef class is a reference to a channel on an Observer. It is used to access data directly f...
Definition: ChannelRef.h:51
armarx::TimestampVariant
Definition: TimestampVariant.h:54
memoryx::ObjectMemoryObserver::reportEntityUpdated
void reportEntityUpdated(const std::string &segmentName, const EntityBasePtr &entityOld, const EntityBasePtr &entityNew, const ::Ice::Current &c=Ice::emptyCurrent) override
Definition: ObjectMemoryObserver.cpp:288
armarx::ConditionCheckSmaller
Definition: ConditionCheckSmaller.h:40
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
ObjectRecognitionWrapper.h
memoryx::ObjectMemoryObserver::reportSnapshotLoaded
void reportSnapshotLoaded(const std::string &segmentName, const ::Ice::Current &c=Ice::emptyCurrent) override
Definition: ObjectMemoryObserver.cpp:378
memoryx::ObjectMemoryObserver::reportMemoryCleared
void reportMemoryCleared(const std::string &segmentName, const ::Ice::Current &c=Ice::emptyCurrent) override
Definition: ObjectMemoryObserver.cpp:382
memoryx::ObjectMemoryObserver::getFirstObjectInstanceByClass
armarx::ChannelRefBasePtr getFirstObjectInstanceByClass(const std::string &objectClassName, const Ice::Current &c=Ice::emptyCurrent) override
Definition: ObjectMemoryObserver.cpp:244
memoryx::ObjectMemoryObserver::reportEntityCreated
void reportEntityCreated(const std::string &segmentName, const EntityBasePtr &entity, const ::Ice::Current &c=Ice::emptyCurrent) override
Definition: ObjectMemoryObserver.cpp:264
armarx::Observer::existsChannel
bool existsChannel(const std::string &channelName) const
Definition: Observer.cpp:1433
Gaussian::getDimensions
int getDimensions() const
Definition: Gaussian.h:85
armarx::TimestampVariant::nowPtr
static TimestampVariantPtr nowPtr()
Definition: TimestampVariant.h:111
memoryx::ObjectMemoryObserver::onInitObserver
void onInitObserver() override
Framework hook.
Definition: ObjectMemoryObserver.cpp:49
IceInternal::Handle< ObjectClass >
ObjectMemoryObserver.h
memoryx::EarlyVisionConverters::convertToGaussian
Gaussian convertToGaussian(const NormalDistributionBasePtr &normalDistribution)
Definition: EarlyVisionConverters.cpp:29
armarx::ConditionCheckUpdated
Definition: ConditionCheckUpdated.h:41
ARMARX_DEBUG
#define ARMARX_DEBUG
Definition: Logging.h:177
armarx::VariantType::ChannelRef
const VariantTypeId ChannelRef
Definition: ChannelRef.h:162
TimestampVariant.h
memoryx::ObjectInstancePtr
IceInternal::Handle< ObjectInstance > ObjectInstancePtr
Definition: ObjectInstance.h:42
armarx::Observer::setDataField
void setDataField(const std::string &channelName, const std::string &datafieldName, const Variant &value, bool triggerFilterUpdate=true)
set datafield with datafieldName and in channel channelName
Definition: Observer.cpp:465
MemoryXCoreObjectFactories.h
max
T max(T t1, T t2)
Definition: gdiam.h:48
armarx::exceptions::local::InvalidChannelException
Definition: InvalidChannelException.h:33
ARMARX_ERROR
#define ARMARX_ERROR
Definition: Logging.h:189
armarx::VariantType::LocalizationQuery
const armarx::VariantTypeId LocalizationQuery
Definition: LocalizationQuery.h:37
armarx::VariantType::Timestamp
const VariantTypeId Timestamp
Definition: TimestampVariant.h:38
Gaussian.h
memoryx::ObjectMemoryObserver::releaseObjectClass
void releaseObjectClass(const armarx::ChannelRefBasePtr &objectClassChannel, const ::Ice::Current &c=Ice::emptyCurrent) override
Definition: ObjectMemoryObserver.cpp:127
memoryx::ObjectMemoryObserver::onConnectObserver
void onConnectObserver() override
Framework hook.
Definition: ObjectMemoryObserver.cpp:67
ARMARX_WARNING_S
#define ARMARX_WARNING_S
Definition: Logging.h:206
armarx::ConditionCheckInRange
Definition: ConditionCheckInRange.h:41
armarx::ManagedIceObject::usingTopic
void usingTopic(const std::string &name, bool orderedPublishing=false)
Registers a proxy for subscription after initialization.
Definition: ManagedIceObject.cpp:248
armarx::Observer::channelsMutex
std::recursive_mutex channelsMutex
Definition: Observer.h:586
memoryx::LocalizationQueryPtr
IceInternal::Handle< LocalizationQuery > LocalizationQueryPtr
Definition: LocalizationQuery.h:43
armarx::Observer::getAvailableChannels
ChannelRegistry getAvailableChannels(bool includeMetaChannels)
Retrieve information on all sensory data channels available from the observer.
Definition: Observer.cpp:1396
armarx::VariantType::FramedOrientation
const VariantTypeId FramedOrientation
Definition: FramedPose.h:40
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
memoryx::ObjectMemoryObserver::reportEntityRemoved
void reportEntityRemoved(const std::string &segmentName, const EntityBasePtr &entity, const ::Ice::Current &c=Ice::emptyCurrent) override
Definition: ObjectMemoryObserver.cpp:345
ConditionCheckSmaller.h
EarlyVisionConverters.h
memoryx::ObjectMemoryObserver::getObjectInstances
ChannelRefBaseSequence getObjectInstances(const armarx::ChannelRefBasePtr &objectClassChannel, const ::Ice::Current &c=Ice::emptyCurrent) override
Definition: ObjectMemoryObserver.cpp:258
memoryx::EntityWrappers::ObjectRecognitionWrapper
Definition: ObjectRecognitionWrapper.h:40
armarx::VariantType::Int
const VariantTypeId Int
Definition: Variant.h:916
armarx::ConditionCheckEquals
Definition: ConditionCheckEquals.h:46
MemoryXTypesObjectFactories.h
memoryx::ObjectMemoryObserver::getObjectInstancesByClass
ChannelRefBaseSequence getObjectInstancesByClass(const std::string &objectClassName, const ::Ice::Current &c=Ice::emptyCurrent) override
Definition: ObjectMemoryObserver.cpp:159
armarx::Logging::deactivateSpam
SpamFilterDataPtr deactivateSpam(float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const
disables the logging for the current line for the given amount of seconds.
Definition: Logging.cpp:92
armarx::Observer::offerConditionCheck
void offerConditionCheck(std::string checkName, ConditionCheck *conditionCheck)
Offer a condition check.
Definition: Observer.cpp:273
ConditionCheckLarger.h
armarx::ConditionCheckLarger
Definition: ConditionCheckLarger.h:40
armarx::VariantType::FramedPosition
const VariantTypeId FramedPosition
Definition: FramedPose.h:39
armarx::Observer::offerDataFieldWithDefault
void offerDataFieldWithDefault(std::string channelName, std::string datafieldName, const Variant &defaultValue, std::string description)
Offer a datafield with default value.
Definition: Observer.cpp:152
Gaussian
Definition: Gaussian.h:46
armarx::handleExceptions
void handleExceptions()
Definition: Exception.cpp:141
armarx::VariantType::String
const VariantTypeId String
Definition: Variant.h:920
armarx::ManagedIceObject::getProxy
Ice::ObjectPrx getProxy(long timeoutMs=0, bool waitForScheduler=true) const
Returns the proxy of this object (optionally it waits for the proxy)
Definition: ManagedIceObject.cpp:393
armarx::Observer::offerDataField
void offerDataField(std::string channelName, std::string datafieldName, VariantTypeId type, std::string description)
Offer a datafield without default value.
Definition: Observer.cpp:187
MemoryXUpdaterObjectFactories.h
armarx::ManagedIceObject::usingProxy
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
Definition: ManagedIceObject.cpp:151
ConditionCheckUpdated.h
armarx::Observer::offerChannel
void offerChannel(std::string channelName, std::string description)
Offer a channel.
Definition: Observer.cpp:126