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 <cstdint>
26#include <mutex>
27#include <string>
28
29#include <Ice/Current.h>
30
34#include <ArmarXCore/interface/core/PackagePath.h>
35
39
45
46#include <armarx/navigation/components/navigation_memory/ComponentInterface.h>
47
49{
50
51 /**
52 * @defgroup Component-NavigationMemory NavigationMemory
53 * @ingroup armarx_navigation-Components
54 * A description of the component NavigationMemory.
55 *
56 * @class NavigationMemory
57 * @ingroup Component-NavigationMemory
58 * @brief Brief description of class NavigationMemory.
59 *
60 * Detailed description of class NavigationMemory.
61 */
62 class Component :
63 virtual public armarx::Component,
64 // , virtual public armarx::DebugObserverComponentPluginUser
69 virtual public ObjectPoseClientPluginUser
70 {
71 public:
72 Component();
73
74 /// @see armarx::ManagedIceObject::getDefaultName()
75 std::string getDefaultName() const override;
76
77 static std::string GetDefaultName();
78 bool storeLocationGraph(const armarx::data::PackagePath& packagePath,
79 const Ice::Current& current) override;
80
81
82 protected:
83 /// @see PropertyUser::createPropertyDefinitions()
85
86 /// @see armarx::ManagedIceObject::onInitComponent()
87 void onInitComponent() override;
88
89 /// @see armarx::ManagedIceObject::onConnectComponent()
90 void onConnectComponent() override;
91
92 /// @see armarx::ManagedIceObject::onDisconnectComponent()
93 void onDisconnectComponent() override;
94
95 /// @see armarx::ManagedIceObject::onExitComponent()
96 void onExitComponent() override;
97
98
99 void createRemoteGuiTab();
100 void RemoteGui_update() override;
101
102
103 private:
104 void visuRun();
105 void loadSnapshot();
106
107 void loadSpecialRooms();
108
109
110 private:
111 struct CoreSegmentProperties
112 {
113 std::int64_t maxHistorySize = 100;
114 };
115
116 /// Properties shown in the Scenario GUI.
117 struct Properties
118 {
119 std::string packageToLoad = "PriorKnowledgeData";
120 std::string snapshotToLoad = "";
121
123 {
124 bool visuLocations = true;
125 bool visuGraphEdges = true;
127 };
128
129 float visuFrequency = 2;
130
131 bool visuCostmaps = true;
132 float zOffsetCostmap = 5; // [mm]
133
134 bool visuHumans = true;
135 bool visuTransparent = false;
136 int visuHumanMaxAgeMs = 1000;
137
138 bool visuRooms = true;
139 bool visuLaserScannerFeatures = true;
140
141 LocationGraph locationGraph;
142
144 {
145 CoreSegmentProperties parameterization;
146 CoreSegmentProperties costmap{.maxHistorySize = 20};
147 CoreSegmentProperties costmap3d{.maxHistorySize = 10};
148 CoreSegmentProperties resultsGlobalPlanner;
149 CoreSegmentProperties resultsLocalPlanner;
150 CoreSegmentProperties events;
151 CoreSegmentProperties exceptions;
152 CoreSegmentProperties location;
153 CoreSegmentProperties graph;
154 CoreSegmentProperties human;
155 CoreSegmentProperties laserScannerFeatures{.maxHistorySize = 20};
156 CoreSegmentProperties rooms;
157
158 } coreSeg;
159 };
160
161 Properties properties;
162 mutable std::mutex propertiesMutex;
163
164 /// Tab shown in the Remote GUI.
165 struct RemoteGuiTab : armarx::RemoteGui::Client::Tab
166 {
178
179 LocationGraph locationGraph;
180 };
181
182 RemoteGuiTab tab;
183
184 struct Tasks
185 {
187 };
188
189 Tasks tasks;
190
192 };
193
194} // namespace armarx::navigation::components::navigation_memory
Provides a ready-to-use ArViz client arviz as member variable.
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition Component.h:94
IceUtil::Handle< RunningTask< T > > pointer_type
Shared pointer type for convenience.
Base class of memory server components.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
bool storeLocationGraph(const armarx::data::PackagePath &packagePath, const Ice::Current &current) override
Provides access to the armarx::objpose::ObjectPoseStorageInterface (aka the object memory).
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.