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 wp2_skills::ArmarXObjects::bimanual_transport
17  * @author Meixner ( andre dot meixner 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 
33 
34 // #include <ArmarXCore/libraries/ArmarXCoreComponentPlugins/DebugObserverComponentPlugin.h>
35 
36 // #include <ArmarXGui/libraries/ArmarXGuiComponentPlugins/LightweightRemoteGuiComponentPlugin.h>
37 
38 // #include <RobotAPI/libraries/RobotAPIComponentPlugins/ArVizComponentPlugin.h>
41 
43 #include <armarx/control/components/bimanual_transport_skill_provider/ComponentInterface.h>
44 
46 {
47 
48  class Component :
49  virtual public ::armarx::Component,
55  // , virtual public armarx::DebugObserverComponentPluginUser
56  // , virtual public armarx::LightweightRemoteGuiComponentPluginUser
57  // , virtual public armarx::ArVizComponentPluginUser
58  {
59  public:
60  Component();
61 
62  /// @see armarx::ManagedIceObject::getDefaultName()
63  std::string getDefaultName() const override;
64 
65  /// Get the component's default name.
66  static std::string GetDefaultName();
67 
68 
69  protected:
70  /// @see PropertyUser::createPropertyDefinitions()
72 
73  /// @see armarx::ManagedIceObject::onInitComponent()
74  void onInitComponent() override;
75 
76  /// @see armarx::ManagedIceObject::onConnectComponent()
77  void onConnectComponent() override;
78 
79  /// @see armarx::ManagedIceObject::onDisconnectComponent()
80  void onDisconnectComponent() override;
81 
82  /// @see armarx::ManagedIceObject::onExitComponent()
83  void onExitComponent() override;
84 
85 
86  /* (Requires armarx::LightweightRemoteGuiComponentPluginUser.)
87  /// This function should be called once in onConnect() or when you
88  /// need to re-create the Remote GUI tab.
89  void createRemoteGuiTab();
90 
91  /// After calling `RemoteGui_startRunningTask`, this function is
92  /// called periodically in a separate thread. If you update variables,
93  /// make sure to synchronize access to them.
94  void RemoteGui_update() override;
95  */
96 
97 
98  private:
99  // Private methods go here.
100 
101  // Forward declare `Properties` if you used it before its defined.
102  // struct Properties;
103 
104  /* (Requires the armarx::ArVizComponentPluginUser.)
105  /// Draw some boxes in ArViz.
106  void drawBoxes(const Properties& p, viz::Client& arviz);
107  */
108 
109 
110  private:
111  static const std::string defaultName;
112 
113  // Private member variables go here.
114 
115 
116  /// Properties shown in the Scenario GUI.
117  struct Properties
118  {
119  std::string robotName;
120  };
121 
122  Properties properties;
123  /* Use a mutex if you access variables from different threads
124  * (e.g. ice functions and RemoteGui_update()).
125  std::mutex propertiesMutex;
126  */
127 
128 
129  /* (Requires the armarx::LightweightRemoteGuiComponentPluginUser.)
130  /// Tab shown in the Remote GUI.
131  struct RemoteGuiTab : armarx::RemoteGui::Client::Tab
132  {
133  armarx::RemoteGui::Client::LineEdit boxLayerName;
134  armarx::RemoteGui::Client::IntSpinBox numBoxes;
135 
136  armarx::RemoteGui::Client::Button drawBoxes;
137  };
138  RemoteGuiTab tab;
139  */
140 
142  armarx::armem::robot_state::VirtualRobotReader>* virtualRobotReaderPlugin_ = nullptr;
143 
144  ::armarx::control::client::ComponentPlugin* controlClientPlugin_ = nullptr;
145  };
146 
147 } // namespace armarx::control::components::bimanual_transport_skill_provider
armarx::control::components::bimanual_transport_skill_provider::Component::onInitComponent
void onInitComponent() override
Definition: Component.cpp:74
armarx::armem::robot_state::VirtualRobotReader
The VirtualRobotReader class.
Definition: VirtualRobotReader.h:40
SkillProviderComponentPlugin.h
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
armarx::control::components::bimanual_transport_skill_provider::Component::Component
Component()
Definition: Component.cpp:41
armarx::control::components::bimanual_transport_skill_provider::ComponentInterface
Definition: ComponentInterface.ice:32
ReaderWriterPlugin.h
armarx::control::components::bimanual_transport_skill_provider::Component::onDisconnectComponent
void onDisconnectComponent() override
Definition: Component.cpp:101
armarx::control::components::bimanual_transport_skill_provider::Component
Definition: Component.h:48
armarx::armem::client::plugins::PluginUser
Adds the Memory Name System client component plugin.
Definition: PluginUser.h:29
armarx::control::client::ComponentPluginUser
Definition: ComponentPlugin.h:147
armarx::control::client::ComponentPlugin
Definition: ComponentPlugin.h:69
armarx::SkillProviderComponentPluginUser
Definition: SkillProviderComponentPlugin.h:120
armarx::control::components::bimanual_transport_skill_provider::Component::onExitComponent
void onExitComponent() override
Definition: Component.cpp:106
armarx::control::components::bimanual_transport_skill_provider
Definition: Component.cpp:36
VirtualRobotReader.h
armarx::control::components::bimanual_transport_skill_provider::Component::GetDefaultName
static std::string GetDefaultName()
Get the component's default name.
Definition: Component.cpp:117
Component.h
armarx::control::components::bimanual_transport_skill_provider::Component::createPropertyDefinitions
::armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: Component.cpp:48
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
armarx::control::components::bimanual_transport_skill_provider::Component::onConnectComponent
void onConnectComponent() override
Definition: Component.cpp:84
IceUtil::Handle< class PropertyDefinitionContainer >
PluginUser.h
ComponentPlugin.h
armarx::control::components::bimanual_transport_skill_provider::Component::getDefaultName
std::string getDefaultName() const override
Definition: Component.cpp:111