Component.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 control::ArmarXObjects::retrieve_hand
17  * @author Jianfeng Gao ( jianfeng dot gao at kit dot edu )
18  * @date 2023
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 
24 #pragma once
25 
26 
27 // #include <mutex>
28 
30 
31 // #include <ArmarXCore/libraries/ArmarXCoreComponentPlugins/DebugObserverComponentPlugin.h>
32 
33 // #include <ArmarXGui/libraries/ArmarXGuiComponentPlugins/LightweightRemoteGuiComponentPlugin.h>
34 
35 // #include <RobotAPI/libraries/RobotAPIComponentPlugins/ArVizComponentPlugin.h>
37 #include <RobotAPI/interface/units/RobotUnit/RobotUnitInterface.h>
39 
40 #include <armarx/control/components/retrieve_hand_skill_provider/ComponentInterface.h>
41 
42 
44 {
45 
46  class Component :
47  virtual public ::armarx::Component
51 
52  // , virtual public armarx::DebugObserverComponentPluginUser
53  // , virtual public armarx::LightweightRemoteGuiComponentPluginUser
54  // , virtual public armarx::ArVizComponentPluginUser
55  {
56  public:
57 
58  /// @see armarx::ManagedIceObject::getDefaultName()
59  std::string getDefaultName() const override;
60 
61  /// Get the component's default name.
62  static std::string GetDefaultName();
63 
64 
65  protected:
66 
67  /// @see PropertyUser::createPropertyDefinitions()
69 
70  /// @see armarx::ManagedIceObject::onInitComponent()
71  void onInitComponent() override;
72 
73  /// @see armarx::ManagedIceObject::onConnectComponent()
74  void onConnectComponent() override;
75 
76  /// @see armarx::ManagedIceObject::onDisconnectComponent()
77  void onDisconnectComponent() override;
78 
79  /// @see armarx::ManagedIceObject::onExitComponent()
80  void onExitComponent() override;
81 
82 
83  /* (Requires armarx::LightweightRemoteGuiComponentPluginUser.)
84  /// This function should be called once in onConnect() or when you
85  /// need to re-create the Remote GUI tab.
86  void createRemoteGuiTab();
87 
88  /// After calling `RemoteGui_startRunningTask`, this function is
89  /// called periodically in a separate thread. If you update variables,
90  /// make sure to synchronize access to them.
91  void RemoteGui_update() override;
92  */
93 
94 
95  private:
96 
97  // Private methods go here.
98 
99  // Forward declare `Properties` if you used it before its defined.
100  // struct Properties;
101 
102  /* (Requires the armarx::ArVizComponentPluginUser.)
103  /// Draw some boxes in ArViz.
104  void drawBoxes(const Properties& p, viz::Client& arviz);
105  */
106 
107 
108  private:
109 
110  static const std::string defaultName;
111 
112 
113  // Private member variables go here.
114 
115 
116  /// Properties shown in the Scenario GUI.
117  struct Properties
118  {
119  std::string retrieveHandSkillProviderName = "retrieveHandSkillProvider";
120  };
121 
122  Properties properties;
123 
124  struct Remote
125  {
127  };
128 
129  Remote remote;
130  /* Use a mutex if you access variables from different threads
131  * (e.g. ice functions and RemoteGui_update()).
132  std::mutex propertiesMutex;
133  */
134 
135 
136  /* (Requires the armarx::LightweightRemoteGuiComponentPluginUser.)
137  /// Tab shown in the Remote GUI.
138  struct RemoteGuiTab : armarx::RemoteGui::Client::Tab
139  {
140  armarx::RemoteGui::Client::LineEdit boxLayerName;
141  armarx::RemoteGui::Client::IntSpinBox numBoxes;
142 
143  armarx::RemoteGui::Client::Button drawBoxes;
144  };
145  RemoteGuiTab tab;
146  */
147 
148  };
149 
150 } // namespace armarx::control::components::retrieve_hand_skill_provider
armarx::control::components::retrieve_hand_skill_provider::ComponentInterface
Definition: ComponentInterface.ice:32
armarx::control::components::retrieve_hand_skill_provider::Component::onExitComponent
void onExitComponent() override
Definition: Component.cpp:147
SkillProviderComponentPlugin.h
armarx::control::components::retrieve_hand_skill_provider::Component::onDisconnectComponent
void onDisconnectComponent() override
Definition: Component.cpp:141
armarx::control::components::retrieve_hand_skill_provider::Component::GetDefaultName
static std::string GetDefaultName()
Get the component's default name.
Definition: Component.cpp:160
armarx::armem::client::plugins::PluginUser
Adds the Memory Name System client component plugin.
Definition: PluginUser.h:29
armarx::SkillProviderComponentPluginUser
Definition: SkillProviderComponentPlugin.h:120
armarx::control::components::retrieve_hand_skill_provider
Definition: Component.cpp:37
armarx::control::components::retrieve_hand_skill_provider::Component::getDefaultName
std::string getDefaultName() const override
Definition: Component.cpp:153
armarx::control::components::retrieve_hand_skill_provider::Component
Definition: Component.h:46
Component.h
armarx::control::components::retrieve_hand_skill_provider::Component::createPropertyDefinitions
::armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: Component.cpp:45
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
ScenarioManager::Data_Structure::Remote
@ Remote
Definition: Scenario.h:54
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::control::components::retrieve_hand_skill_provider::Component::onConnectComponent
void onConnectComponent() override
Definition: Component.cpp:84
IceInternal::ProxyHandle<::IceProxy::armarx::RobotUnitInterface >
PluginUser.h
armarx::control::components::retrieve_hand_skill_provider::Component::onInitComponent
void onInitComponent() override
Definition: Component.cpp:73