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::NavigationMemory
17  * @author Fabian Reister ( fabian dot reister 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 
25 #include <mutex>
26 
29 #include <ArmarXCore/interface/core/PackagePath.h>
30 
32 
37 
38 #include <armarx/navigation/components/navigation_memory/ComponentInterface.h>
39 
41 {
42 
43  /**
44  * @defgroup Component-NavigationMemory NavigationMemory
45  * @ingroup armarx_navigation-Components
46  * A description of the component NavigationMemory.
47  *
48  * @class NavigationMemory
49  * @ingroup Component-NavigationMemory
50  * @brief Brief description of class NavigationMemory.
51  *
52  * Detailed description of class NavigationMemory.
53  */
54  class Component :
55  virtual public armarx::Component,
56  // , virtual public armarx::DebugObserverComponentPluginUser
58  virtual public armarx::ArVizComponentPluginUser,
60  virtual public memory::NavigationMemoryInterface,
61  virtual public ObjectPoseClientPluginUser
62  {
63  public:
64  Component();
65 
66  /// @see armarx::ManagedIceObject::getDefaultName()
67  std::string getDefaultName() const override;
68 
69  static std::string GetDefaultName();
70  bool storeLocationGraph(const armarx::data::PackagePath& packagePath,
71  const Ice::Current& current) override;
72 
73 
74  protected:
75  /// @see PropertyUser::createPropertyDefinitions()
77 
78  /// @see armarx::ManagedIceObject::onInitComponent()
79  void onInitComponent() override;
80 
81  /// @see armarx::ManagedIceObject::onConnectComponent()
82  void onConnectComponent() override;
83 
84  /// @see armarx::ManagedIceObject::onDisconnectComponent()
85  void onDisconnectComponent() override;
86 
87  /// @see armarx::ManagedIceObject::onExitComponent()
88  void onExitComponent() override;
89 
90 
91  void createRemoteGuiTab();
92  void RemoteGui_update() override;
93 
94 
95  private:
96  void visuRun();
97  void loadSnapshot();
98 
99 
100  private:
101  /// Properties shown in the Scenario GUI.
102  struct Properties
103  {
104  std::string packageToLoad = "PriorKnowledgeData";
105  std::string snapshotToLoad = "";
106 
107  long laserScannerFeaturesMaxHistorySize = 20;
108 
110  {
111  bool visuLocations = true;
112  bool visuGraphEdges = true;
114  };
115 
116  float visuFrequency = 2;
117 
118  bool visuCostmaps = true;
119  float zOffsetCostmap = 5; // [mm]
120 
121  bool visuHumans = true;
122  bool visuTransparent = false;
123  int visuHumanMaxAgeMs = 1000;
124 
125  bool visuRooms = true;
126 
127  LocationGraph locationGraph;
128  };
129 
130  Properties properties;
131  mutable std::mutex propertiesMutex;
132 
133  /// Tab shown in the Remote GUI.
134  struct RemoteGuiTab : armarx::RemoteGui::Client::Tab
135  {
137  {
139 
143 
144  void setup(Component& owner);
145  void update(Component& owner);
146  };
147 
148  LocationGraph locationGraph;
149  };
150 
151  RemoteGuiTab tab;
152 
153  struct Tasks
154  {
156  };
157 
158  Tasks tasks;
159 
160  objpose::ObjectPoseClient objClient;
161  };
162 
163 } // namespace armarx::navigation::components::navigation_memory
ArVizComponentPlugin.h
armarx::navigation::components::navigation_memory::Component::Properties::LocationGraph
Definition: Component.h:109
armarx::navigation::components::navigation_memory::Component::storeLocationGraph
bool storeLocationGraph(const armarx::data::PackagePath &packagePath, const Ice::Current &current) override
Definition: Component.cpp:784
armarx::navigation::components::navigation_memory::Component::RemoteGuiTab::LocationGraph
Definition: Component.h:136
ObjectPoseClientPlugin.h
armarx::navigation::components::navigation_memory::Component::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: Component.cpp:73
armarx::navigation::components::navigation_memory::Component::RemoteGui_update
void RemoteGui_update() override
Definition: Component.cpp:246
ReadWritePluginUser.h
plugins.h
armarx::navigation::components::navigation_memory::Component::onExitComponent
void onExitComponent() override
Definition: Component.cpp:216
armarx::RemoteGui::Client::Tab
Definition: Tab.h:15
armarx::navigation::components::navigation_memory::Component
Definition: Component.h:54
armarx::navigation::components::navigation_memory::Component::onDisconnectComponent
void onDisconnectComponent() override
Definition: Component.cpp:211
armarx::ObjectPoseClientPluginUser
Provides an objpose::ObjectPoseTopicPrx objectPoseTopic as member variable.
Definition: ObjectPoseClientPlugin.h:67
armarx::navigation::components::navigation_memory::Component::RemoteGuiTab::LocationGraph::visuLocations
armarx::RemoteGui::Client::CheckBox visuLocations
Definition: Component.h:141
armarx::objpose::ObjectPoseClient
Provides access to the armarx::objpose::ObjectPoseStorageInterface (aka the object memory).
Definition: ObjectPoseClient.h:18
LightweightRemoteGuiComponentPlugin.h
armarx::navigation::components::navigation_memory::Component::onInitComponent
void onInitComponent() override
Definition: Component.cpp:142
armarx::navigation::components::navigation_memory::Component::RemoteGuiTab::LocationGraph::reloadSnapshot
armarx::RemoteGui::Client::Button reloadSnapshot
Definition: Component.h:140
armarx::ArVizComponentPluginUser
Provides a ready-to-use ArViz client arviz as member variable.
Definition: ArVizComponentPlugin.h:36
armarx::navigation::components::navigation_memory::Component::Component
Component()
Definition: Component.cpp:136
armarx::navigation::components::navigation_memory::Component::Properties::LocationGraph::visuRelativeLocations
bool visuRelativeLocations
Definition: Component.h:113
armarx::armem::server::plugins::ReadWritePluginUser
Base class of memory server components.
Definition: ReadWritePluginUser.h:20
armarx::navigation::components::navigation_memory
Definition: Component.cpp:67
armarx::RemoteGui::Client::GroupBox
Definition: Widgets.h:193
armarx::navigation::components::navigation_memory::Component::getDefaultName
std::string getDefaultName() const override
Definition: Component.cpp:221
TaskUtil.h
armarx::LightweightRemoteGuiComponentPluginUser
Definition: LightweightRemoteGuiComponentPlugin.h:73
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
armarx::navigation::components::navigation_memory::Component::RemoteGuiTab::LocationGraph::update
void update(Component &owner)
Definition: Component.cpp:280
armarx::navigation::components::navigation_memory::Component::onConnectComponent
void onConnectComponent() override
Definition: Component.cpp:192
armarx::navigation::components::navigation_memory::Component::GetDefaultName
static std::string GetDefaultName()
Definition: Component.cpp:227
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::navigation::components::navigation_memory::Component::RemoteGuiTab::LocationGraph::visuGraphEdges
armarx::RemoteGui::Client::CheckBox visuGraphEdges
Definition: Component.h:142
armarx::navigation::memory::NavigationMemoryInterface
Definition: ComponentInterface.ice:39
armarx::RemoteGui::Client::CheckBox
Definition: Widgets.h:129
armarx::RemoteGui::Client::Button
Definition: Widgets.h:120
armarx::navigation::components::navigation_memory::Component::createRemoteGuiTab
void createRemoteGuiTab()
Definition: Component.cpp:233
armarx::navigation::components::navigation_memory::Component::Properties::LocationGraph::visuGraphEdges
bool visuGraphEdges
Definition: Component.h:112
armarx::navigation::components::navigation_memory::Component::RemoteGuiTab::LocationGraph::group
armarx::RemoteGui::Client::GroupBox group
Definition: Component.h:138
armarx::navigation::components::navigation_memory::Component::RemoteGuiTab::LocationGraph::setup
void setup(Component &owner)
Definition: Component.cpp:252
armarx::navigation::components::navigation_memory::Component::Properties::LocationGraph::visuLocations
bool visuLocations
Definition: Component.h:111