InterventionDebugger.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 RobotAPI::ArmarXObjects::InterventionDebugger
17 * @date 2026
18 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19 * GNU General Public License
20 */
21
22#pragma once
23
25#include <ArmarXCore/interface/components/EmergencyStopInterface.h>
26
30
31#include <RobotAPI/interface/units/GamepadUnit.h>
32
33namespace armarx
34{
35 using namespace armarx::RemoteGui::Client;
36
38 {
39 public:
42 {
44 "GamepadTopicName", "GamepadValues", "Name of the Gamepad Topic to publish to");
46 "EmergencyStopTopicName",
47 "EmergencyStop",
48 "Name of the Emergency Stop Topic to publish to");
50 "DeviceName", "InterventionDebugger", "Simulated gamepad device name");
52 "GamepadName", "VirtualGamepad", "Simulated gamepad name");
53 }
54 };
55
88
93
94 /**
95 * @defgroup Component-InterventionDebugger InterventionDebugger
96 * @ingroup RobotAPI-Components
97 *
98 * @class InterventionDebugger
99 * @ingroup Component-InterventionDebugger
100 * @brief Debug component for InterventionObserver.
101 *
102 * Provides a RemoteGui with clickable buttons and sliders to simulate
103 * gamepad input and emergency stop events. Publishes to the same topics
104 * that InterventionObserver subscribes to.
105 */
107 virtual public armarx::Component,
109 {
110 public:
112
113 std::string
114 getDefaultName() const override
115 {
116 return "InterventionDebugger";
117 }
118
119 static std::string
121 {
122 return "InterventionDebugger";
123 }
124
125 protected:
126 void onInitComponent() override;
127 void onConnectComponent() override;
128 void onDisconnectComponent() override;
129 void onExitComponent() override;
130
132
133 private:
134 void RemoteGui_update() override;
135
136 void createGamepadTab();
137 void updateGamepadTab();
138
139 void createEmergencyStopTab();
140 void updateEmergencyStopTab();
141
142 void publishGamepadState();
143 void publishEmergencyStopState(EmergencyStopState state);
144
145 private:
146 GamepadButtonsTab gamepadTab;
147 EmergencyStopTab estopTab;
148
149 GamepadUnitListenerPrx gamepadTopicPrx;
150 EmergencyStopListenerPrx emergencyStopTopicPrx;
151
152 std::string deviceName;
153 std::string gamepadName;
154
155 EmergencyStopState lastPublishedEstopState = EmergencyStopState::eEmergencyStopInactive;
156 };
157} // namespace armarx
Default component property definition container.
Definition Component.h:70
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
Definition Component.cpp:46
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition Component.h:94
void onInitComponent() override
Pure virtual hook for the subclass.
void onDisconnectComponent() override
Hook for subclass.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void onConnectComponent() override
Pure virtual hook for the subclass.
void onExitComponent() override
Hook for subclass.
std::string getDefaultName() const override
Retrieve default name of component.
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.