ObjectAtPredicateProvider.h
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 ArmarX::
17 * @author Valerij Wittenbeck ( valerij.wittenbeck at student dot kit dot edu)
18 * @date 2014
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
23 #pragma once
24 
26 #include <MemoryX/interface/memorytypes/MemorySegments.h>
27 #include <MemoryX/interface/components/WorkingMemoryInterface.h>
29 
30 namespace memoryx
31 {
32 
35  {
36  public:
39  {
40  defineOptionalProperty<float>("DistanceThreshold", 1500.f, "Threshold below which an object is considered to be close to a node");
41  defineOptionalProperty<float>("HandDistanceThreshold", 150.f, "Threshold below which an object is considered to grasped, and no predicate instance will be generated");
42  defineOptionalProperty<std::string>("PlatformGraphSceneName", "XperienceDemoKitchenRM", "Name of the scene in the graph segment");
43  }
44  };
45 
47  {
48  public:
50 
51  // ManagedIceObject interface
52  protected:
53  void onInitWorldStateUpdater() override;
54  void onConnectWorldStateUpdater() override;
55  std::string getDefaultName() const override;
56 
58  {
62  }
63 
64  // WorldStateUpdaterInterface interface
65  public:
66  PredicateInfoList getPredicateInfos(const Ice::Current& = Ice::emptyCurrent) override;
67  PredicateInstanceList calcPredicates(const Ice::Current& = Ice::emptyCurrent) override;
68 
69  private:
70  struct CachedNodeInfo
71  {
72  GraphNodePtr node;
73  EntityRefBasePtr nodeRef;
74  std::string originalFrame;
75  Ice::StringSeq parents;
76  armarx::FramedPosePtr globalPose;
77  };
78 
79  CachedNodeInfo getCacheEntry(const std::string& nodeId);
80 
81  WorkingMemoryInterfacePrx wm;
82  PriorKnowledgeInterfacePrx prior;
83  GraphNodePoseResolverInterfacePrx psr;
84 
85  AgentInstancesSegmentBasePrx agentInstances;
86  ObjectInstanceMemorySegmentBasePrx objectInstances;
87  PersistentObjectClassSegmentBasePrx objectClasses;
88  GraphMemorySegmentBasePrx graphs;
89 
90  std::string sceneName;
91  float distanceThreshold;
92  float handDistanceThreshold;
93 
94  std::map<std::string, CachedNodeInfo> nodeInfoMap;
95  GraphNodeBaseList graphNodes;
96  std::map<std::string, std::vector<std::string>> classNameParentsMap;
97  };
98 
99 } // namespace memoryx
100 
memoryx::ObjectAtPredicateProviderPropertyDefinitions::ObjectAtPredicateProviderPropertyDefinitions
ObjectAtPredicateProviderPropertyDefinitions(std::string prefix)
Definition: ObjectAtPredicateProvider.h:37
memoryx::ObjectAtPredicateProvider
Definition: ObjectAtPredicateProvider.h:46
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
memoryx::ObjectAtPredicateProvider::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: ObjectAtPredicateProvider.cpp:67
memoryx::ObjectAtPredicateProviderPropertyDefinitions
Definition: ObjectAtPredicateProvider.h:33
IceInternal::Handle< GraphNode >
memoryx::WorldStateUpdaterBase
Definition: WorldStateUpdaterBase.h:44
memoryx::ObjectAtPredicateProvider::calcPredicates
PredicateInstanceList calcPredicates(const Ice::Current &=Ice::emptyCurrent) override
Definition: ObjectAtPredicateProvider.cpp:77
memoryx::ObjectAtPredicateProvider::getPredicateInfos
PredicateInfoList getPredicateInfos(const Ice::Current &=Ice::emptyCurrent) override
Definition: ObjectAtPredicateProvider.cpp:72
memoryx::ObjectAtPredicateProvider::onConnectWorldStateUpdater
void onConnectWorldStateUpdater() override
Definition: ObjectAtPredicateProvider.cpp:48
WorldStateUpdaterBase.h
memoryx::ObjectAtPredicateProvider::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: ObjectAtPredicateProvider.h:57
GraphNodePoseResolver.h
memoryx::WorldStateUpdaterPropertyDefinitions
Definition: WorldStateUpdaterBase.h:33
memoryx::ObjectAtPredicateProvider::ObjectAtPredicateProvider
ObjectAtPredicateProvider()
Definition: ObjectAtPredicateProvider.cpp:32
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:74
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:34
memoryx::ObjectAtPredicateProvider::onInitWorldStateUpdater
void onInitWorldStateUpdater() override
Definition: ObjectAtPredicateProvider.cpp:37