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>
43 
45 {
46 
47  class Component :
48  virtual public armarx::Component,
49  virtual public ComponentInterface,
51  // virtual public armarx::navigation::client::ComponentPluginUser,
52  virtual public armem::ListeningClientPluginUser,
53  // , virtual public armarx::DebugObserverComponentPluginUser
54  // , virtual public armarx::LightweightRemoteGuiComponentPluginUser
56  {
57  public:
58  Component();
59  /// @see armarx::ManagedIceObject::getDefaultName()
60  std::string getDefaultName() const override;
61 
62  /// Get the component's default name.
63  static std::string GetDefaultName();
64 
65 
66  protected:
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  // Private methods go here.
97 
98  // Forward declare `Properties` if you used it before its defined.
99  // struct Properties;
100 
101  /* (Requires the armarx::ArVizComponentPluginUser.)
102  /// Draw some boxes in ArViz.
103  void drawBoxes(const Properties& p, viz::Client& arviz);
104  */
105 
106 
107  private:
108  static const std::string defaultName;
109 
110  /// Properties shown in the Scenario GUI.
111  struct Properties
112  {
113  std::string robotName;
114 
115  skills::NavigateToNamedLocation::Properties navigateToNamedLocation;
116  };
117 
118  Properties properties;
119 
120  /* (Requires the armarx::LightweightRemoteGuiComponentPluginUser.)
121  /// Tab shown in the Remote GUI.
122  struct RemoteGuiTab : armarx::RemoteGui::Client::Tab
123  {
124  armarx::RemoteGui::Client::LineEdit boxLayerName;
125  armarx::RemoteGui::Client::IntSpinBox numBoxes;
126 
127  armarx::RemoteGui::Client::Button drawBoxes;
128  };
129  RemoteGuiTab tab;
130  */
131 
132  client::IceNavigator iceNavigator;
133 
134  client::NavigatorInterfacePrx navigatorPrx;
135 
136  template <typename T>
138 
139 
141  nullptr;
142  ReaderWriterPlugin<memory::client::costmap::Reader>* costmapReaderPlugin = nullptr;
143  ReaderWriterPlugin<memory::client::graph::Reader>* graphReaderPlugin = nullptr;
144  ReaderWriterPlugin<memory::client::rooms::Reader>* roomsReaderPlugin = nullptr;
145  };
146 
147 } // 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
NavigateToNamedLocation.h
Reader.h
armarx::navigation::components::navigation_skill_provider::Component::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: Component.cpp:49
ReaderWriterPlugin.h
armarx::navigation::client::IceNavigator
Definition: IceNavigator.h:17
armarx::navigation::components::navigation_skill_provider::Component::Component
Component()
Definition: Component.cpp:38
armarx::navigation::components::navigation_skill_provider::Component::onExitComponent
void onExitComponent() override
Definition: Component.cpp:191
armarx::navigation::components::navigation_skill_provider
Definition: Component.cpp:36
armarx::SkillProviderComponentPluginUser
Definition: SkillProviderComponentPlugin.h:120
armarx::navigation::components::navigation_skill_provider::Component::getDefaultName
std::string getDefaultName() const override
Definition: Component.cpp:196
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:186
IceNavigator.h
Reader.h
armarx::navigation::components::navigation_skill_provider::Component
Definition: Component.h:47
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:202
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:83
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:73