WorkingMemoryExample.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::WorkingMemoryExample
17 * @author (kozlov 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 
26 #include <RobotAPI/interface/core/RobotState.h>
28 
29 #include <MemoryX/interface/components/WorkingMemoryInterface.h>
30 #include <MemoryX/interface/components/LongtermMemoryInterface.h>
31 
32 namespace memoryx
33 {
34 
37  {
38  public:
41  {
42  defineOptionalProperty<std::string>("TestToRun", "UpdateNotifications", "Name of test that should be executed");
43  defineOptionalProperty<std::string>("SnapshotName", "", "Name of WM snapshot to load (if TestToRun=SnapshotLoad)");
44  defineOptionalProperty<std::string>("CommonPlacesSnapshot", "dataset1_1205", "Name of secondary WM snapshot to load (if TestToRun=CommonPlaces)");
45  }
46  };
47 
49  virtual public armarx::Component,
50  virtual public WorkingMemoryListenerInterface
51  {
52  public:
53  /**
54  * @see PropertyUser::createPropertyDefinitions()
55  */
57  {
60  getConfigIdentifier()));
61  }
62 
63  // inherited from Component
64  std::string getDefaultName() const override
65  {
66  return "WorkingMemoryExample";
67  }
68  void onInitComponent() override;
69  void onConnectComponent() override;
70 
71  void reportEntityCreated(const std::string& segmentName, const ::memoryx::EntityBasePtr& entity, const ::Ice::Current& = Ice::emptyCurrent) override;
72  void reportEntityUpdated(const std::string& segmentName, const ::memoryx::EntityBasePtr& entityOld, const ::memoryx::EntityBasePtr& entityNew, const ::Ice::Current& = Ice::emptyCurrent) override;
73  void reportEntityRemoved(const std::string& segmentName, const ::memoryx::EntityBasePtr& entity, const ::Ice::Current& = Ice::emptyCurrent) override;
74  void reportSnapshotLoaded(const std::string& segmentName, const ::Ice::Current& = Ice::emptyCurrent) override;
75  void reportSnapshotCompletelyLoaded(const Ice::Current& c = Ice::emptyCurrent) override;
76  void reportMemoryCleared(const std::string& segmentName, const ::Ice::Current& = Ice::emptyCurrent) override;
77 
78  private:
79  WorkingMemoryInterfacePrx memoryPrx;
80  LongtermMemoryInterfacePrx longtermMemoryPrx;
81  armarx::RobotStateComponentInterfacePrx robotStateComponentPrx;
82  std::string testToRun;
83 
84  void testFileTransfer();
85  void testUpdateObserver();
86  void testObjectMovement();
87  void testSnapshots();
88  void testCommonPlaces();
89  void testAgent();
90  };
91 
92 
93 }
94 
memoryx::WorkingMemoryExample::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: WorkingMemoryExample.h:64
memoryx::WorkingMemoryExamplePropertyDefinitions
Definition: WorkingMemoryExample.h:35
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::WorkingMemoryExample::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: WorkingMemoryExample.h:56
memoryx::WorkingMemoryExample
Definition: WorkingMemoryExample.h:48
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
memoryx::WorkingMemoryExamplePropertyDefinitions::WorkingMemoryExamplePropertyDefinitions
WorkingMemoryExamplePropertyDefinitions(std::string prefix)
Definition: WorkingMemoryExample.h:39
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:70
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface >
armarx::ComponentPropertyDefinitions::ComponentPropertyDefinitions
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
Definition: Component.cpp:37
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:34
ImportExportComponent.h