DummyObjectLocalizer.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::ArmarXObjects::DummyObjectLocalizer
17  * @author Fabian Paus ( fabian dot paus at kit dot edu )
18  * @date 2018
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 #include <MemoryX/interface/workingmemory/WorkingMemoryUpdaterBase.h>
26 
29 
30 #include <RobotAPI/interface/core/PoseBase.h>
31 #include <RobotAPI/interface/core/RobotState.h>
32 
33 
34 namespace armarx
35 {
36 
37  struct DummyObject
38  {
39  std::string name;
41  };
42 
43  /**
44  * @class DummyObjectLocalizerPropertyDefinitions
45  * @brief
46  */
49  {
50  public:
53  {
54  //defineRequiredProperty<std::string>("PropertyName", "Description");
55  defineOptionalProperty<std::string>("ObjectPoseFile", "MemoryX/DummyObjectLocations.json", "A file containing framed poses for each object which should be reported by this localizer.");
56 
57  defineOptionalProperty<std::string>("RobotStateComponentName", "RobotStateComponent", "Name of the robot state component that should be used");
58  }
59  };
60 
61  /**
62  * @defgroup Component-DummyObjectLocalizer DummyObjectLocalizer
63  * @ingroup MemoryX-Components
64  * A description of the component DummyObjectLocalizer.
65  *
66  * @class DummyObjectLocalizer
67  * @ingroup Component-DummyObjectLocalizer
68  * @brief Brief description of class DummyObjectLocalizer.
69  *
70  * Detailed description of class DummyObjectLocalizer.
71  */
73  virtual public memoryx::ObjectLocalizerInterface,
74  virtual public armarx::Component
75  {
76  public:
77  /**
78  * @see armarx::ManagedIceObject::getDefaultName()
79  */
80  std::string getDefaultName() const override
81  {
82  return "DummyObjectLocalizer";
83  }
84 
85  protected:
86  /**
87  * @see armarx::ManagedIceObject::onInitComponent()
88  */
89  void onInitComponent() override;
90 
91  /**
92  * @see armarx::ManagedIceObject::onConnectComponent()
93  */
94  void onConnectComponent() override;
95 
96  /**
97  * @see armarx::ManagedIceObject::onDisconnectComponent()
98  */
99  void onDisconnectComponent() override;
100 
101  /**
102  * @see armarx::ManagedIceObject::onExitComponent()
103  */
104  void onExitComponent() override;
105 
106  /**
107  * @see PropertyUser::createPropertyDefinitions()
108  */
110 
111  // ObjectLocalizerInterface interface
112  memoryx::ObjectLocalizationResultList localizeObjectClasses(const memoryx::ObjectClassNameList& classes, const Ice::Current&) override;
113 
114  private:
115  std::vector<DummyObject> dummyObjects;
116 
117 
118  armarx::RobotStateComponentInterfacePrx robotStateComponent;
119 
120  };
121 }
armarx::DummyObjectLocalizer::onExitComponent
void onExitComponent() override
Definition: DummyObjectLocalizer.cpp:123
armarx::DummyObjectLocalizerPropertyDefinitions::DummyObjectLocalizerPropertyDefinitions
DummyObjectLocalizerPropertyDefinitions(std::string prefix)
Definition: DummyObjectLocalizer.h:51
armarx::DummyObjectLocalizer::onConnectComponent
void onConnectComponent() override
Definition: DummyObjectLocalizer.cpp:105
armarx::DummyObjectLocalizer::getDefaultName
std::string getDefaultName() const override
Definition: DummyObjectLocalizer.h:80
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
armarx::DummyObjectLocalizer::localizeObjectClasses
memoryx::ObjectLocalizationResultList localizeObjectClasses(const memoryx::ObjectClassNameList &classes, const Ice::Current &) override
Definition: DummyObjectLocalizer.cpp:136
armarx::DummyObjectLocalizer::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: DummyObjectLocalizer.cpp:128
armarx::DummyObjectLocalizer::onDisconnectComponent
void onDisconnectComponent() override
Definition: DummyObjectLocalizer.cpp:117
armarx::DummyObjectLocalizerPropertyDefinitions
Definition: DummyObjectLocalizer.h:47
IceInternal::Handle< FramedPose >
FramedPose.h
armarx::DummyObject::pose
FramedPosePtr pose
Definition: DummyObjectLocalizer.h:40
armarx::DummyObjectLocalizer::onInitComponent
void onInitComponent() override
Definition: DummyObjectLocalizer.cpp:34
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:70
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface >
armarx::DummyObject
Definition: DummyObjectLocalizer.h:37
armarx::DummyObject::name
std::string name
Definition: DummyObjectLocalizer.h:39
armarx::DummyObjectLocalizer
Brief description of class DummyObjectLocalizer.
Definition: DummyObjectLocalizer.h:72
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28