ObjectMemory.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 RobotAPI::ArmarXObjects::ObjectMemory
17  * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
18  * @date 2021
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
30 
32 
35 
36 #include <RobotAPI/interface/armem/server/ObjectMemoryInterface.h>
37 
39 
40 #include <memory>
41 
42 
43 #define ICE_CURRENT_ARG const Ice::Current& = Ice::emptyCurrent
44 
45 
47 {
48 
49  /**
50  * @defgroup Component-ObjectMemory ObjectMemory
51  * @ingroup RobotAPI-Components
52  * A description of the component ObjectMemory.
53  *
54  * @class ObjectMemory
55  * @ingroup Component-ObjectMemory
56  * @brief Brief description of class ObjectMemory.
57  *
58  * Detailed description of class ObjectMemory.
59  */
60  class ObjectMemory :
61  virtual public Component
62 
63  , virtual public armarx::armem::server::ObjectMemoryInterface
67  , virtual public armarx::ArVizComponentPluginUser
68  {
69  public:
70 
71  ObjectMemory();
72  virtual ~ObjectMemory() override;
73 
74 
75  /// @see armarx::ManagedIceObject::getDefaultName()
76  std::string getDefaultName() const override;
77 
78 
79  public:
80 
82 
83  void onInitComponent() override;
84  void onConnectComponent() override;
85 
86  void onDisconnectComponent() override;
87  void onExitComponent() override;
88 
89  // Without this, ObjectMemory draws the original
90  // methods from ObjectMemoryInterface and complains
91  // that an overload is being hidden.
96 
97  // Actions
98  armem::actions::GetActionsOutputSeq
99  getActions(const armem::actions::GetActionsInputSeq& inputs) override;
100  armem::actions::ExecuteActionOutputSeq
101  executeActions(const armem::actions::ExecuteActionInputSeq& inputs) override;
102 
103  // Predictions
104  armem::prediction::data::PredictionResultSeq
105  predict(const armem::prediction::data::PredictionRequestSeq& requests) override;
106 
107  // Remote GUI
108  void createRemoteGuiTab();
109  void RemoteGui_update() override;
110 
111 
112  private:
113 
114  DebugObserverInterfacePrx debugObserver;
115  KinematicUnitObserverInterfacePrx kinematicUnitObserver;
116 
117  double predictionTimeWindow = 2;
118 
119  clazz::Segment classSegment;
120 
121  attachments::Segment attachmentSegment;
122 
123  // associations::Segment associationsSegment;
124 
125  struct RemoteGuiTab : armarx::RemoteGui::Client::Tab
126  {
129  };
130  std::unique_ptr<RemoteGuiTab> tab;
131 
132  struct Properties {
133  int64_t maxMarkerHistorySize = -1;
134  std::string markerMemoryName = "Marker";
135  };
136  Properties p;
137 
139  };
140 
141 }
142 
143 #undef ICE_CURRENT_ARG
armarx::armem::server::obj::ObjectMemory::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition: ObjectMemory.cpp:173
ArVizComponentPlugin.h
armarx::armem::server::obj::ObjectMemory::executeActions
armem::actions::ExecuteActionOutputSeq executeActions(const armem::actions::ExecuteActionInputSeq &inputs) override
Definition: ObjectMemory.cpp:199
armarx::armem::server::plugins::ReadWritePluginUser::predict
virtual armem::prediction::data::PredictionResultSeq predict(const armem::prediction::data::PredictionRequestSeq &requests)
Definition: ReadWritePluginUser.cpp:153
armarx::armem::server::obj::ObjectMemory::getDefaultName
std::string getDefaultName() const override
Definition: ObjectMemory.cpp:90
armarx::armem::server::obj::ObjectMemory::getActions
armem::actions::GetActionsOutputSeq getActions(const armem::actions::GetActionsInputSeq &inputs) override
Definition: ObjectMemory.cpp:177
RobotStateComponentPlugin.h
armarx::armem::server::obj::ObjectMemory::ObjectMemory
ObjectMemory()
Definition: ObjectMemory.cpp:76
armarx::armem::client::plugins::ReaderWriterPlugin
A component plugin offering client-side access to a reader or writer and manages the lifecycle,...
Definition: ReaderWriterPlugin.h:44
ReadWritePluginUser.h
armarx::RemoteGui::Client::Tab
Definition: Tab.h:15
armarx::armem::server::obj::ObjectMemory::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: ObjectMemory.cpp:141
SegmentAdapter.h
ReaderWriterPlugin.h
Segment.h
armarx::armem::server::plugins::ReadWritePluginUser::getActions
virtual armem::actions::GetActionsOutputSeq getActions(const armem::actions::GetActionsInputSeq &inputs)
Definition: ReadWritePluginUser.cpp:132
armarx::armem::server::obj
Definition: ObjectMemory.cpp:39
armarx::armem::server::obj::ObjectMemory::onDisconnectComponent
void onDisconnectComponent() override
Hook for subclass.
Definition: ObjectMemory.cpp:168
armarx::armem::server::plugins::ReadWritePluginUser::getAvailableEngines
virtual armem::prediction::data::EngineSupportMap getAvailableEngines()
Definition: ReadWritePluginUser.cpp:159
LightweightRemoteGuiComponentPlugin.h
armarx::ArVizComponentPluginUser
Provides a ready-to-use ArViz client arviz as member variable.
Definition: ArVizComponentPlugin.h:36
armarx::armem::server::obj::clazz::Segment
Definition: Segment.h:24
armarx::armem::server::plugins::ReadWritePluginUser
Base class of memory server components.
Definition: ReadWritePluginUser.h:20
VirtualRobotReader.h
armarx::LightweightRemoteGuiComponentPluginUser
Definition: LightweightRemoteGuiComponentPlugin.h:73
armarx::armem::server::obj::ObjectMemory::predict
armem::prediction::data::PredictionResultSeq predict(const armem::prediction::data::PredictionRequestSeq &requests) override
Definition: ObjectMemory.cpp:235
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
Segment.h
armarx::armem::server::plugins::ReadWritePluginUser::executeActions
virtual armem::actions::ExecuteActionOutputSeq executeActions(const armem::actions::ExecuteActionInputSeq &inputs)
Definition: ReadWritePluginUser.cpp:146
armarx::armem::server::obj::clazz::Segment::RemoteGui
Definition: Segment.h:65
armarx::armem::server::obj::attachments::Segment
Definition: Segment.h:39
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface >
armarx::armem::server::obj::instance::SegmentAdapter
Helps implementing the armarx::armem::server::ObjectInstanceSegmentInterface.
Definition: SegmentAdapter.h:53
armarx::armem::server::obj::ObjectMemory::createRemoteGuiTab
void createRemoteGuiTab()
Definition: ObjectMemory.cpp:308
armarx::armem::server::obj::ObjectMemory
Brief description of class ObjectMemory.
Definition: ObjectMemory.h:60
armarx::armem::server::obj::ObjectMemory::~ObjectMemory
virtual ~ObjectMemory() override
Definition: ObjectMemory.cpp:85
armarx::armem::server::obj::ObjectMemory::RemoteGui_update
void RemoteGui_update() override
Definition: ObjectMemory.cpp:331
armarx::armem::server::obj::ObjectMemory::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: ObjectMemory.cpp:96
armarx::armem::server::obj::instance::SegmentAdapter::RemoteGui
Definition: SegmentAdapter.h:157
armarx::armem::server::obj::ObjectMemory::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: ObjectMemory.cpp:42