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 mobile_manipulation::ArmarXObjects::handover_visualization
17 * @author Fabian Reister ( fabian dot reister at kit dot edu )
18 * @date 2022
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 <VirtualRobot/VirtualRobot.h>
27
31
35
36#include <armarx/navigation/components/social_cost_map/ComponentInterface.h>
40
43
45{
46
47 class Component :
48 virtual public armarx::Component,
53 {
54 public:
55 Component();
56
57 /// @see armarx::ManagedIceObject::getDefaultName()
58 std::string getDefaultName() const override;
59
60 /// Get the component's default name.
61 static std::string GetDefaultName();
62
63
64 protected:
65 /// @see PropertyUser::createPropertyDefinitions()
67
68 /// @see armarx::ManagedIceObject::onInitComponent()
69 void onInitComponent() override;
70
71 /// @see armarx::ManagedIceObject::onConnectComponent()
72 void onConnectComponent() override;
73
74 /// @see armarx::ManagedIceObject::onDisconnectComponent()
75 void onDisconnectComponent() override;
76
77 /// @see armarx::ManagedIceObject::onExitComponent()
78 void onExitComponent() override;
79
80
81 /* (Requires armarx::LightweightRemoteGuiComponentPluginUser.)
82 /// This function should be called once in onConnect() or when you
83 /// need to re-create the Remote GUI tab.
84 void createRemoteGuiTab();
85
86 /// After calling `RemoteGui_startRunningTask`, this function is
87 /// called periodically in a separate thread. If you update variables,
88 /// make sure to synchronize access to them.
89 void RemoteGui_update() override;
90 */
91
92
93 private:
94 void visualizeOnce();
95
96
97 static const std::string defaultName;
98
99 // Private member variables go here.
100
101
102 /// Properties shown in the Scenario GUI.
103 struct Properties
104 {
105 std::string robotName = "Armar6";
106 float taskPeriodMs = 100;
107
108 struct
109 {
110 std::string providerName = "OpenNIPointCloudProvider";
111 std::string naviProviderName = "dynamic_scene_provider";
112 } human;
113
114 bool enableHumanPoseReader = true;
115 bool enableHumanPersonInstanceReader = true;
116 bool enableNavigationHumanPoseReader = false;
117
118 bool restrictToRooms = true;
119 std::string roomNames = "2.2.02-Dining Area"; // comma separated list
120 };
121
122 Properties properties;
123
124 template <typename T>
126
127 // ReaderWriterPlugin<armem::robot_state::VirtualRobotReader>* virtualRobotReaderPlugin =
128 // nullptr;
129
130 ReaderWriterPlugin<armarx::navigation::memory::client::rooms::Reader>*
131 navigationRoomReaderPlugin = nullptr;
132
133 ReaderWriterPlugin<armarx::armem::human::client::Reader>* humanPoseReaderPlugin = nullptr;
134 ReaderWriterPlugin<armarx::navigation::memory::client::human::Reader>*
135 navigationHumanPoseReaderPlugin = nullptr;
136
137 ReaderWriterPlugin<armarx::armem::human::client::PersonInstanceReader>*
138 humanPersonInstanceReaderPlugin = nullptr;
139
140 ReaderWriterPlugin<armarx::navigation::memory::client::costmap::Writer>*
141 costmapWriterPlugin = nullptr;
142
144
145 VirtualRobot::SceneObjectSetPtr objects;
146 };
147
148} // namespace armarx::navigation::components::social_cost_map
Provides a ready-to-use ArViz client arviz as member variable.
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition Component.h:94
Provides an objpose::ObjectPoseTopicPrx objectPoseTopic as member variable.
IceUtil::Handle< PeriodicTask< T > > pointer_type
Shared pointer type for convenience.
A component plugin offering client-side access to a reader or writer and manages the lifecycle,...
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition Component.cpp:81
static std::string GetDefaultName()
Get the component's default name.
This file is part of ArmarX.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.