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::control::components::skill_providers::collision_avoidance
17 * @author Meixner ( andre dot meixner at 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
27// #include <mutex>
28
30
31// #include <ArmarXGui/libraries/ArmarXGuiComponentPlugins/LightweightRemoteGuiComponentPlugin.h>
32
33#include <RobotAPI/interface/units/HandUnitInterface.h>
44
46#include <armarx/control/collision_avoidance/component/ComponentInterface.h>
47#include <armarx/control/njoint_controller/task_space/ControllerInterface.h>
48
50{
51
52 bool containsAll(std::string name, std::vector<std::string> list);
53 std::string toLower(const std::string& str);
54 std::vector<std::vector<std::string>> parseColumnConfig(const std::string& config);
55
56 class Component :
57 virtual public ::armarx::Component,
59 // , virtual public ::armarx::SkillProviderComponentPluginUser
60 ,
62 // , virtual public armarx::LightweightRemoteGuiComponentPluginUser
63 ,
66 {
67 public:
68 Component();
69
70 /// @see armarx::ManagedIceObject::getDefaultName()
71 std::string getDefaultName() const override;
72
73 /// Get the component's default name.
74 static std::string GetDefaultName();
75
76
77 protected:
78 /// @see PropertyUser::createPropertyDefinitions()
80
81 /// @see armarx::ManagedIceObject::onInitComponent()
82 void onInitComponent() override;
83
84 /// @see armarx::ManagedIceObject::onConnectComponent()
85 void onConnectComponent() override;
86
87 /// @see armarx::ManagedIceObject::onDisconnectComponent()
88 void onDisconnectComponent() override;
89
90 /// @see armarx::ManagedIceObject::onExitComponent()
91 void onExitComponent() override;
92
93
94 /* (Requires armarx::LightweightRemoteGuiComponentPluginUser.)
95 /// This function should be called once in onConnect() or when you
96 /// need to re-create the Remote GUI tab.
97 void createRemoteGuiTab();
98
99 /// After calling `RemoteGui_startRunningTask`, this function is
100 /// called periodically in a separate thread. If you update variables,
101 /// make sure to synchronize access to them.
102 void RemoteGui_update() override;
103 */
104
105 public:
106 void sendCollisionObjectsToController(const Ice::StringSeq& objectIDs, const Ice::Current&);
107 void deleteCollisionObjects(const Ice::Current&);
108
109 private:
110 // Private methods go here.
111
112 // Forward declare `Properties` if you used it before its defined.
113 // struct Properties;
114
115 /* (Requires the armarx::ArVizComponentPluginUser.)
116 /// Draw some boxes in ArViz.
117 void drawBoxes(const Properties& p, viz::Client& arviz);
118 */
119
120 private:
121 static const std::string defaultName;
122
123 // Private member variables go here.
124 armarx::control::TSColAvoidCtrlInterfacePrx controller;
127 armarx::armem::obj::instance::Reader objectInstanceReader;
129
130 /// Properties shown in the Scenario GUI.
131 struct Properties
132 {
133 std::string controllerNames = "col:right";
134 };
135
136 Properties properties;
137 /* Use a mutex if you access variables from different threads
138 * (e.g. ice functions and RemoteGui_update()).
139 std::mutex propertiesMutex;
140 */
141
142 /* (Requires the armarx::LightweightRemoteGuiComponentPluginUser.)
143 /// Tab shown in the Remote GUI.
144 struct RemoteGuiTab : armarx::RemoteGui::Client::Tab
145 {
146 armarx::RemoteGui::Client::LineEdit boxLayerName;
147 armarx::RemoteGui::Client::IntSpinBox numBoxes;
148
149 armarx::RemoteGui::Client::Button drawBoxes;
150 };
151 RemoteGuiTab tab;
152 */
153 };
154
155} // namespace armarx::control::components::collision_avoidance
std::string str(const T &t)
Provides a ready-to-use ArViz client arviz as member variable.
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition Component.h:94
::armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition Component.cpp:51
void sendCollisionObjectsToController(const Ice::StringSeq &objectIDs, const Ice::Current &)
static std::string GetDefaultName()
Get the component's default name.
client::plugins::PluginUser ClientPluginUser
bool containsAll(std::string name, std::vector< std::string > list)
std::vector< std::vector< std::string > > parseColumnConfig(const std::string &config)
std::string toLower(const std::string &str)
::IceInternal::ProxyHandle<::IceProxy::armarx::RobotUnitInterface > RobotUnitInterfacePrx
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.