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 
34 namespace memoryx
35 {
38  {
39  public:
42  {
43  defineOptionalProperty<std::string>("CommonPlacesLearnerName",
44  "CommonPlacesLearnerPutAwayLocations",
45  "The CommonPlacesLearner to use");
46  defineOptionalProperty<std::string>("CPLSegmentName",
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 
68  {
71  }
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
memoryx::PutAwayLocationPredicateProvider::PutAwayLocationPredicateProvider
PutAwayLocationPredicateProvider()
Definition: PutAwayLocationPredicateProvider.cpp:33
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:345
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:46
memoryx::PutAwayLocationPredicateProvider::onConnectWorldStateUpdater
void onConnectWorldStateUpdater() override
Definition: PutAwayLocationPredicateProvider.cpp:52
memoryx::WorldStateUpdaterBase
Definition: WorldStateUpdaterBase.h:45
memoryx::PutAwayLocationPredicateProvider::onInitWorldStateUpdater
void onInitWorldStateUpdater() override
Definition: PutAwayLocationPredicateProvider.cpp:39
memoryx::PutAwayLocationPredicateProviderPropertyDefinitions::PutAwayLocationPredicateProviderPropertyDefinitions
PutAwayLocationPredicateProviderPropertyDefinitions(std::string prefix)
Definition: PutAwayLocationPredicateProvider.h:40
memoryx::PutAwayLocationPredicateProvider::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: PutAwayLocationPredicateProvider.h:67
memoryx::PutAwayLocationPredicateProviderPropertyDefinitions
Definition: PutAwayLocationPredicateProvider.h:36
WorldStateUpdaterBase.h
CommonPlacesLearner.h
Component.h
GraphNodePoseResolver.h
memoryx::WorldStateUpdaterPropertyDefinitions
Definition: WorldStateUpdaterBase.h:33
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:79
memoryx::PutAwayLocationPredicateProvider::calcPredicates
PredicateInstanceList calcPredicates(const Ice::Current &) override
Definition: PutAwayLocationPredicateProvider.cpp:78
IceUtil::Handle< class PropertyDefinitionContainer >
memoryx::PutAwayLocationPredicateProvider
Definition: PutAwayLocationPredicateProvider.h:55
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:35
memoryx::PutAwayLocationPredicateProvider::getPredicateInfos
PredicateInfoList getPredicateInfos(const Ice::Current &c=Ice::emptyCurrent) override
Definition: PutAwayLocationPredicateProvider.cpp:72
memoryx::PutAwayLocationPredicateProvider::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: PutAwayLocationPredicateProvider.cpp:66