GamepadUnitObserver.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package RobotAPI::units
19  * @author David Schiebener <schiebener at kit dot edu>
20  * @date 2014
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
25 #pragma once
26 
27 #include <RobotAPI/interface/units/GamepadUnit.h>
29 #include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
31 
32 #include <mutex>
33 
34 namespace armarx
35 {
36  /**
37  * \class GamepadUnitObserverPropertyDefinitions
38  * \brief
39  */
42  {
43  public:
46  {
47  defineOptionalProperty<std::string>("GamepadTopicName", "GamepadValues", "Name of the Gamepad Topic");
48  defineOptionalProperty<std::string>("DebugDrawerTopic", "DebugDrawerUpdates", "Name of the DebugDrawerTopic");
49  }
50  };
51 
52 
53  /**
54  * \class GamepadUnitObserver
55  * \ingroup RobotAPI-SensorActorUnits-observers
56  * \brief Observer monitoring @IMU sensor values
57  *
58  * The GamepadUnitObserver monitors @IMU sensor values published by GamepadUnit-implementations and offers condition checks on these values.
59  * Available condition checks are: *updated*, *larger*, *equals* and *smaller*.
60  */
62  virtual public Observer,
63  virtual public GamepadUnitObserverInterface
64  {
65  public:
67 
68  std::string getDefaultName() const override
69  {
70  return "GamepadUnitObserver";
71  }
72  void onInitObserver() override;
73  void onConnectObserver() override;
74  void onExitObserver() override;
75 
76  /**
77  * @see PropertyUser::createPropertyDefinitions()
78  */
80 
81 
82  private:
83  std::mutex dataMutex;
84  DebugDrawerInterfacePrx debugDrawerPrx;
85 
86 
87  // GamepadUnitListener interface
88  public:
89  void reportGamepadState(const std::string& device, const std::string& name, const GamepadData& data, const TimestampBasePtr& timestamp, const Ice::Current& c) override;
90  };
91 }
92 
armarx::GamepadUnitObserverPropertyDefinitions
Definition: GamepadUnitObserver.h:40
armarx::GamepadUnitObserver
Observer monitoring @IMU sensor values.
Definition: GamepadUnitObserver.h:61
armarx::GamepadUnitObserver::createPropertyDefinitions
PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: GamepadUnitObserver.cpp:65
armarx::GamepadUnitObserver::reportGamepadState
void reportGamepadState(const std::string &device, const std::string &name, const GamepadData &data, const TimestampBasePtr &timestamp, const Ice::Current &c) override
Definition: GamepadUnitObserver.cpp:70
armarx::Observer
Baseclass for all ArmarX Observers.
Definition: Observer.h:80
Pose.h
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
Observer.h
armarx::GamepadUnitObserver::onConnectObserver
void onConnectObserver() override
Framework hook.
Definition: GamepadUnitObserver.cpp:52
armarx::GamepadUnitObserver::GamepadUnitObserver
GamepadUnitObserver()
Definition: GamepadUnitObserver.h:66
armarx::GamepadUnitObserver::onInitObserver
void onInitObserver() override
Framework hook.
Definition: GamepadUnitObserver.cpp:38
armarx::GamepadUnitObserver::onExitObserver
void onExitObserver() override
Framework hook.
Definition: GamepadUnitObserver.cpp:58
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
armarx::GamepadUnitObserver::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: GamepadUnitObserver.h:68
IceUtil::Handle
Definition: forward_declarations.h:29
IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface >
armarx::ObserverPropertyDefinitions
Definition: Observer.h:50
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::GamepadUnitObserverPropertyDefinitions::GamepadUnitObserverPropertyDefinitions
GamepadUnitObserverPropertyDefinitions(std::string prefix)
Definition: GamepadUnitObserver.h:44