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
27#include <MemoryX/interface/components/WorkingMemoryInterface.h>
28#include <MemoryX/interface/memorytypes/MemorySegments.h>
29
30namespace memoryx
31{
32
34 {
35 public:
38 {
40 "DistanceThreshold",
41 1500.f,
42 "Threshold below which an object is considered to be close to a node");
43 defineOptionalProperty<float>("HandDistanceThreshold",
44 150.f,
45 "Threshold below which an object is considered to "
46 "grasped, and no predicate instance will be generated");
47 defineOptionalProperty<std::string>("PlatformGraphSceneName",
48 "XperienceDemoKitchenRM",
49 "Name of the scene in the graph segment");
50 }
51 };
52
54 {
55 public:
57
58 // ManagedIceObject interface
59 protected:
60 void onInitWorldStateUpdater() override;
61 void onConnectWorldStateUpdater() override;
62 std::string getDefaultName() const override;
63
70
71 // WorldStateUpdaterInterface interface
72 public:
73 PredicateInfoList getPredicateInfos(const Ice::Current& = Ice::emptyCurrent) override;
74 PredicateInstanceList calcPredicates(const Ice::Current& = Ice::emptyCurrent) override;
75
76 private:
77 struct CachedNodeInfo
78 {
79 GraphNodePtr node;
80 EntityRefBasePtr nodeRef;
81 std::string originalFrame;
82 Ice::StringSeq parents;
83 armarx::FramedPosePtr globalPose;
84 };
85
86 CachedNodeInfo getCacheEntry(const std::string& nodeId);
87
88 WorkingMemoryInterfacePrx wm;
89 PriorKnowledgeInterfacePrx prior;
90 GraphNodePoseResolverInterfacePrx psr;
91
92 AgentInstancesSegmentBasePrx agentInstances;
93 ObjectInstanceMemorySegmentBasePrx objectInstances;
94 PersistentObjectClassSegmentBasePrx objectClasses;
95 GraphMemorySegmentBasePrx graphs;
96
97 std::string sceneName;
98 float distanceThreshold;
99 float handDistanceThreshold;
100
101 std::map<std::string, CachedNodeInfo> nodeInfoMap;
102 GraphNodeBaseList graphNodes;
103 std::map<std::string, std::vector<std::string>> classNameParentsMap;
104 };
105
106} // namespace memoryx
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition Component.cpp:90
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
PredicateInfoList getPredicateInfos(const Ice::Current &=Ice::emptyCurrent) override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
std::string getDefaultName() const override
Retrieve default name of component.
PredicateInstanceList calcPredicates(const Ice::Current &=Ice::emptyCurrent) override
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
IceInternal::Handle< FramedPose > FramedPosePtr
Definition FramedPose.h:272
VirtualRobot headers.
IceInternal::Handle< GraphNode > GraphNodePtr
Definition GraphNode.h:47