WorkingMemory.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 MemoryX::ShortTermMemory
17* @author Kai Welke (welke at kit dot edu)
18* @date 2012
19* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20* GNU General Public License
21*/
22
23#pragma once
24
27
28#include <MemoryX/interface/components/WorkingMemoryInterface.h>
29#include <MemoryX/interface/memorytypes/MemorySegments.h>
30#include <MemoryX/interface/workingmemory/AbstractWorkingMemoryInterface.h>
32
33namespace memoryx
34{
37
39 {
40 public:
43 {
45 "UseKalmanFilter", true, "Switch fusion with Kalman Filter on/off.");
46
48 "MatchThreshold",
49 0.,
50 "Threshold value of spatial proximity between observations \nto consider them "
51 "belonging to the same instance (0..1)")
52 .setMin(0)
53 .setMax(1);
54
56 "MatchByClassName",
57 true,
58 "Check for class equality when searching for corresponding instance");
59 }
60 };
61
62 /*!
63 * \brief The WorkingMemory class provides methods for storing runtime information. The data is stored in segments.
64 *
65 * On startup the working memory gets proxies of LongtermMemory, PriorKnowledge, CommonStorage
66 * and creates a topic to publish updates
67 * (established connections depend on the configuration, \see AbstractWorkingMemory).
68 *
69 * By default the WorkingMemory holds a segment to store object instances (e.g. recognized objects).
70 * This segment is initialized with a fusion method which appends attributes from prior knowledge.
71 * This means every time an entity is added, attribute enrichment (e.g. 3d model loading etc) is performed.
72 * \see PriorAttributeEnrichmentFusion
73 *
74 * See \ref workingmemory "memoryx::WorkingMemory" - abstract working memory, that gets updated "in the loop"
75 */
77 virtual public AbstractWorkingMemory,
78 virtual public WorkingMemoryInterface
79 {
80 public:
81 // inherited from Component
82 std::string
83 getDefaultName() const override
84 {
85 return "WorkingMemory";
86 }
87
88 void onInitWorkingMemory() override;
89 void onConnectWorkingMemory() override;
90
91 void setUpdater(ObjectLocalizationMemoryUpdaterPtr locUpdater);
92
93 /**
94 * @see PropertyUser::createPropertyDefinitions()
95 */
102
103 /*!
104 * \brief getObjectInstancesSegment Get the segment where all object instances are stored.
105 *\see ObjectInstanceMemorySegment
106 * \return The segment.
107 */
108 ObjectInstanceMemorySegmentBasePrx
109 getObjectInstancesSegment(const ::Ice::Current& = Ice::emptyCurrent) override;
110
111 /*!
112 * \brief getObjectClassesSegment Get the segment where all used object classes are stored.
113 *\see ObjectClassMemorySegment
114 * \return The segment.
115 */
116 ObjectClassMemorySegmentBasePrx
117 getObjectClassesSegment(const ::Ice::Current& = Ice::emptyCurrent) override;
118 RelationMemorySegmentBasePrx
119 getRelationsSegment(const ::Ice::Current& = Ice::emptyCurrent) override;
120
121 ObjectLocalizationMemoryUpdaterBasePrx
122 getObjectLocalizationUpdater(const ::Ice::Current& = Ice::emptyCurrent) override;
123
124 CommonStorageInterfacePrx
125 getCommonStorage(const ::Ice::Current& = Ice::emptyCurrent) const override;
126 PriorKnowledgeInterfacePrx
127 getPriorKnowledge(const ::Ice::Current& = Ice::emptyCurrent) const override;
128 ActiveOacMemorySegmentBasePrx
129 getActiveOacSegment(const ::Ice::Current& = Ice::emptyCurrent) override;
130 AgentInstancesSegmentBasePrx
131 getAgentInstancesSegment(const ::Ice::Current& = Ice::emptyCurrent) override;
132 WorldStateSegmentBasePrx
133 getWorldStateSegment(const ::Ice::Current& = Ice::emptyCurrent) override;
134 virtual OacMemorySegmentBasePrx getOacSegment(const ::Ice::Current& = Ice::emptyCurrent);
135 AffordanceSegmentBasePrx
136 getAffordanceSegment(const ::Ice::Current& = Ice::emptyCurrent) override;
137 EnvironmentalPrimitiveSegmentBasePrx
138 getEnvironmentalPrimitiveSegment(const ::Ice::Current& = Ice::emptyCurrent) override;
139 std::string getMemoryName(const Ice::Current&) const override;
140
141 private:
143 };
144
146
147} // namespace memoryx
#define ARMARXCOMPONENT_IMPORT_EXPORT
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)
The ObjectLocalizationMemoryUpdater triggers the localization of object classes based on the content ...
WorkingMemoryPropertyDefinitions(std::string prefix)
The WorkingMemory class provides methods for storing runtime information. The data is stored in segme...
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.
IceInternal::Handle< WorkingMemory > WorkingMemoryPtr
IceInternal::Handle< ObjectLocalizationMemoryUpdater > ObjectLocalizationMemoryUpdaterPtr