PutAwayLocationPredicateProvider.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
30#include <MemoryX/interface/components/GraphNodePoseResolverInterface.h>
31#include <MemoryX/interface/components/WorkingMemoryInterface.h>
32#include <MemoryX/interface/memorytypes/MemorySegments.h>
33
34namespace memoryx
35{
38 {
39 public:
42 {
43 defineOptionalProperty<std::string>("CommonPlacesLearnerName",
44 "CommonPlacesLearnerPutAwayLocations",
45 "The CommonPlacesLearner to use");
47 "CPL_PutAwayLocations",
48 "The LTM segment to use for common places");
49 defineOptionalProperty<std::string>("PlatformGraphSceneName",
50 "XperienceDemoKitchenRM",
51 "Name of the scene in the graph segment");
52 }
53 };
54
56 {
57 public:
59
60 // ManagedIceObject interface
61 protected:
62 void onInitWorldStateUpdater() override;
63 void onConnectWorldStateUpdater() override;
64 std::string getDefaultName() const override;
65
72
73 // WorldStateUpdaterInterface interface
74 public:
75 PredicateInfoList getPredicateInfos(const Ice::Current& c = Ice::emptyCurrent) override;
76 PredicateInstanceList calcPredicates(const Ice::Current&) override;
77
78 private:
79 struct CachedCommonPlace
80 {
81 std::string className;
82 EntityRefBasePtr putAwayNodeRef;
83 };
84
85 CachedCommonPlace getCacheEntry(const std::string& className);
86
87 std::map<std::string, CachedCommonPlace> cpCache;
88
89 std::string cplSegmentName;
90 std::string sceneName;
91
92 WorkingMemoryInterfacePrx wm;
93 PriorKnowledgeInterfacePrx prior;
94 LongtermMemoryInterfacePrx ltm;
95 GraphNodePoseResolverInterfacePrx psr;
96 CommonPlacesLearnerInterfacePrx cpl;
97
98 ObjectInstanceMemorySegmentBasePrx objectInstances;
99 GraphMemorySegmentBasePrx graphSegment;
100 PersistentObjectInstanceSegmentBasePrx cplObjectsSegment;
101
102 std::vector<ObjectInstancePtr> cplObjects;
103
104 PredicateInfo putAwayLocation;
105 };
106
107} // namespace memoryx
constexpr T c
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)
PredicateInstanceList calcPredicates(const Ice::Current &) override
PredicateInfoList getPredicateInfos(const Ice::Current &c=Ice::emptyCurrent) override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
std::string getDefaultName() const override
Retrieve default name of component.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
VirtualRobot headers.