31#include <ArmarXCore/interface/components/EmergencyStopInterface.h>
33#include <RobotAPI/interface/components/InterventionObserverInterface.h>
34#include <RobotAPI/interface/units/PlatformUnitInterface.h>
53 "PlatformUnitName",
"Armar6IcePlatformUnit",
"Name of the platform unit to use");
55 "GamepadTopicName",
"GamepadValues",
"Name of the Gamepad Topic");
57 "EmergencyStopTopic",
"EmergencyStop",
"Name of the Emergency Stop Topic");
59 "AgentName",
"ARMAR-7",
"Agent name used in TaskOutcome commits");
61 "AssistanceSessionTimeoutSeconds",
63 "Seconds of inactivity before an assistance session is committed to memory");
87 virtual public InterventionObserverInterface,
99 return "InterventionObserver";
130 const std::string& name,
131 const GamepadData&
data,
133 const Ice::Current&
c)
override;
140 bool ensureMemoryConnection();
144 std::string queryLatestSkillName();
155 std::atomic_bool memoryConnected{
false};
157 std::mutex memoryConnectionMutex;
160 bool prevBackButton =
false;
161 bool prevStartButton =
false;
164 EmergencyStopState prevEmergencyStopState = EmergencyStopState::eEmergencyStopInactive;
166 std::string agentName;
167 static constexpr const char* providerName =
"InterventionObserver";
170 bool assistanceSessionActive =
false;
173 std::set<std::string> assistanceActionsInSession;
174 float assistanceSessionTimeoutSeconds = 2.0f;
175 std::string lastGamepadDevice;
176 std::string lastGamepadName;
Default component property definition container.
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
Baseclass for all ArmarX ManagedIceObjects requiring properties.
InterventionObserverPropertyDefinitions(std::string prefix)
void onInitComponent() override
void onDisconnectComponent() override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void reportEmergencyStopState(EmergencyStopState state, const Ice::Current &) override
void onConnectComponent() override
void reportGamepadState(const std::string &device, const std::string &name, const GamepadData &data, const TimestampBasePtr ×tamp, const Ice::Current &c) override
void onExitComponent() override
std::string getDefaultName() const override
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)
Reads data from a memory server.
Represents a point in time.
plugins::ListeningPluginUser ComponentPluginUser
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.