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