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 navigation::ArmarXObjects::navigation_skill_provider
17  * @author Fabian Reister ( fabian dot reister 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 
27 
33 
35 #include <armarx/navigation/client/ice/NavigatorInterface.h>
37 #include <armarx/navigation/components/navigation_skill_provider/ComponentInterface.h>
44 
46 {
47 
48  class Component :
49  virtual public armarx::Component,
50  virtual public ComponentInterface,
52  // virtual public armarx::navigation::client::ComponentPluginUser,
53  virtual public armem::ListeningClientPluginUser,
54  // , virtual public armarx::DebugObserverComponentPluginUser
55  // , virtual public armarx::LightweightRemoteGuiComponentPluginUser
57  {
58  public:
59  Component();
60  /// @see armarx::ManagedIceObject::getDefaultName()
61  std::string getDefaultName() const override;
62 
63  /// Get the component's default name.
64  static std::string GetDefaultName();
65 
66 
67  protected:
68  /// @see PropertyUser::createPropertyDefinitions()
70 
71  /// @see armarx::ManagedIceObject::onInitComponent()
72  void onInitComponent() override;
73 
74  /// @see armarx::ManagedIceObject::onConnectComponent()
75  void onConnectComponent() override;
76 
77  /// @see armarx::ManagedIceObject::onDisconnectComponent()
78  void onDisconnectComponent() override;
79 
80  /// @see armarx::ManagedIceObject::onExitComponent()
81  void onExitComponent() override;
82 
83 
84  /* (Requires armarx::LightweightRemoteGuiComponentPluginUser.)
85  /// This function should be called once in onConnect() or when you
86  /// need to re-create the Remote GUI tab.
87  void createRemoteGuiTab();
88 
89  /// After calling `RemoteGui_startRunningTask`, this function is
90  /// called periodically in a separate thread. If you update variables,
91  /// make sure to synchronize access to them.
92  void RemoteGui_update() override;
93  */
94 
95 
96  private:
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  static const std::string defaultName;
110 
111  /// Properties shown in the Scenario GUI.
112  struct Properties
113  {
114  std::string robotName;
115 
116  skills::NavigateToNamedLocation::Properties navigateToNamedLocation;
117 
118  skills::NavigateToChargingStation::Properties navigateToChargingStation;
119  };
120 
121  Properties properties;
122 
123  /* (Requires the armarx::LightweightRemoteGuiComponentPluginUser.)
124  /// Tab shown in the Remote GUI.
125  struct RemoteGuiTab : armarx::RemoteGui::Client::Tab
126  {
127  armarx::RemoteGui::Client::LineEdit boxLayerName;
128  armarx::RemoteGui::Client::IntSpinBox numBoxes;
129 
130  armarx::RemoteGui::Client::Button drawBoxes;
131  };
132  RemoteGuiTab tab;
133  */
134 
135  client::IceNavigator iceNavigator;
136 
137  client::NavigatorInterfacePrx navigatorPrx;
138 
139  template <typename T>
141 
142 
144  nullptr;
145  ReaderWriterPlugin<memory::client::costmap::Reader>* costmapReaderPlugin = nullptr;
146  ReaderWriterPlugin<memory::client::graph::Reader>* graphReaderPlugin = nullptr;
147  ReaderWriterPlugin<memory::client::rooms::Reader>* roomsReaderPlugin = nullptr;
148  };
149 
150 } // namespace armarx::navigation::components::navigation_skill_provider
ArVizComponentPlugin.h
forward_declarations.h
armarx::navigation::components::navigation_skill_provider::ComponentInterface
Definition: ComponentInterface.ice:32
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::navigation::skills::NavigateToChargingStation::Properties
Definition: NavigateToChargingStation.h:32
NavigateToNamedLocation.h
Reader.h
armarx::navigation::components::navigation_skill_provider::Component::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: Component.cpp:50
ReaderWriterPlugin.h
armarx::navigation::client::IceNavigator
Definition: IceNavigator.h:17
armarx::navigation::components::navigation_skill_provider::Component::Component
Component()
Definition: Component.cpp:39
armarx::navigation::components::navigation_skill_provider::Component::onExitComponent
void onExitComponent() override
Definition: Component.cpp:199
armarx::navigation::components::navigation_skill_provider
Definition: Component.cpp:37
armarx::SkillProviderComponentPluginUser
Definition: SkillProviderComponentPlugin.h:120
armarx::navigation::components::navigation_skill_provider::Component::getDefaultName
std::string getDefaultName() const override
Definition: Component.cpp:204
armarx::ArVizComponentPluginUser
Provides a ready-to-use ArViz client arviz as member variable.
Definition: ArVizComponentPlugin.h:36
armarx::navigation::components::navigation_skill_provider::Component::onDisconnectComponent
void onDisconnectComponent() override
Definition: Component.cpp:194
IceNavigator.h
Reader.h
armarx::navigation::components::navigation_skill_provider::Component
Definition: Component.h:48
VirtualRobotReader.h
client.h
plugins.h
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
armarx::navigation::components::navigation_skill_provider::Component::GetDefaultName
static std::string GetDefaultName()
Get the component's default name.
Definition: Component.cpp:210
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::navigation::skills::NavigateToNamedLocation::Properties
Definition: NavigateToNamedLocation.h:56
armarx::navigation::components::navigation_skill_provider::Component::onConnectComponent
void onConnectComponent() override
Definition: Component.cpp:86
NavigateToChargingStation.h
armarx::armem::client::plugins::ListeningPluginUser
A memory name system client which listens to the memory updates topic (MemoryListenerInterface).
Definition: ListeningPluginUser.h:23
Reader.h
armarx::navigation::components::navigation_skill_provider::Component::onInitComponent
void onInitComponent() override
Definition: Component.cpp:76