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 armarx::navigation::components::costmap_merger
17 * @author Tobias Gröger ( tobias dot groeger at student dot kit dot edu )
18 * @date 2025
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23
24#pragma once
25
26#include <mutex>
27#include <string>
28#include <vector>
29
32
36
37#include <armarx/navigation/components/costmap_merger/ComponentInterface.h>
40
42{
43
44 class Component :
45 virtual public armarx::Component,
48 {
49 public:
50 Component();
51
52 /// @see armarx::ManagedIceObject::getDefaultName()
53 std::string getDefaultName() const override;
54
55 /// Get the component's default name.
56 static std::string GetDefaultName();
57
58
59 protected:
60 /// @see PropertyUser::createPropertyDefinitions()
62
63 /// @see armarx::ManagedIceObject::onInitComponent()
64 void onInitComponent() override;
65
66 /// @see armarx::ManagedIceObject::onConnectComponent()
67 void onConnectComponent() override;
68
69 /// @see armarx::ManagedIceObject::onDisconnectComponent()
70 void onDisconnectComponent() override;
71
72 /// @see armarx::ManagedIceObject::onExitComponent()
73 void onExitComponent() override;
74
75
77
79 const std::vector<armem::MemoryID>& snapshotIDs);
80
81 private:
82 static const std::string defaultName;
83
84 struct Properties
85 {
86 std::vector<std::string> costmapsToMerge;
87 std::string outputCostmapName = "distance_to_obstacles";
88 };
89
90 Properties properties;
91
93 costmapReaderPlugin = nullptr;
94
96 costmapWriterPlugin = nullptr;
97
98 std::mutex mergeCostmapMtx;
99 };
100
101} // namespace armarx::navigation::components::costmap_merger
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition Component.h:94
A component plugin offering client-side access to a reader or writer and manages the lifecycle,...
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition Component.cpp:68
void processObjectInstance(const armem::MemoryID &id, const std::vector< armem::MemoryID > &snapshotIDs)
static std::string GetDefaultName()
Get the component's default name.
client::plugins::ListeningPluginUser ListeningClientPluginUser
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.