KITProstheticHandUnit.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::KITProstheticHandUnit
17  * @author Raphael Grimm ( raphael dot grimm at kit dot edu )
18  * @date 2018
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
27 #include <ArmarXCore/interface/observers/ObserverInterface.h>
28 
29 #include <ArmarXGui/interface/RemoteGuiInterface.h>
31 
34 
35 namespace armarx
36 {
37  /**
38  * @class KITProstheticHandUnitPropertyDefinitions
39  * @brief
40  */
43  {
44  public:
47  {
48  defineRequiredProperty<std::string>("MAC", "The KIT Prosthetic Hand's Bluetooth MAC");
49  defineOptionalProperty<std::string>("RemoteGuiName", "", "Name of the remote gui");
50  defineOptionalProperty<std::string>("DebugObserverName", "DebugObserver", "Name of the debug observer that should be used");
51  }
52  };
53 
54  /**
55  * @defgroup Component-KITProstheticHandUnit KITProstheticHandUnit
56  * @ingroup RobotAPI-Components
57  * A description of the component KITProstheticHandUnit.
58  *
59  * @class KITProstheticHandUnit
60  * @ingroup Component-KITProstheticHandUnit
61  * @brief Brief description of class KITProstheticHandUnit.
62  *
63  * Detailed description of class KITProstheticHandUnit.
64  */
66  virtual public armarx::HandUnit
67  {
68  public:
69  /**
70  * @see armarx::ManagedIceObject::getDefaultName()
71  */
72  std::string getDefaultName() const override
73  {
74  return "KITProstheticHandUnit";
75  }
76 
77  void onInitHandUnit() override;
78  void onStartHandUnit() override;
79  void onExitHandUnit() override;
80  void setJointAngles(const NameValueMap& targetJointAngles, const Ice::Current& = Ice::emptyCurrent) override;
81  NameValueMap getCurrentJointValues(const Ice::Current&) override;
82 
83  void addShape(const std::string& name, const std::map<std::string, float>& shape);
84  void addShapeName(const std::string& name);
85 
86 
87  void setShape(const std::string& shapeName, const Ice::Current& c = Ice::emptyCurrent) override;
88 
89  protected:
90 
91  /**
92  * @see PropertyUser::createPropertyDefinitions()
93  */
95  private:
96  std::unique_ptr<BLEProthesisInterface> _driver;
97  std::map<std::string, std::map<std::string, float>> _shapes;
98 
99  DebugObserverInterfacePrx _debugObserver;
100  //gui
101  RemoteGuiInterfacePrx _remoteGuiPrx;
103  RemoteGui::TabProxy _guiTab;
104  float _lastGuiValueThumb{0};
105  float _lastGuiValueFingers{0};
106  };
107 }
armarx::KITProstheticHandUnit::onInitHandUnit
void onInitHandUnit() override
Definition: KITProstheticHandUnit.cpp:40
armarx::HandUnit
Base unit for high-level access to robot hands.
Definition: HandUnit.h:71
armarx::KITProstheticHandUnit::addShape
void addShape(const std::string &name, const std::map< std::string, float > &shape)
Definition: KITProstheticHandUnit.cpp:187
armarx::KITProstheticHandUnit::setShape
void setShape(const std::string &shapeName, const Ice::Current &c=Ice::emptyCurrent) override
Definition: KITProstheticHandUnit.cpp:200
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
armarx::navigation::platform_controller::platform_global_trajectory::NameValueMap
std::map< std::string, float > NameValueMap
Definition: PlatformGlobalTrajectoryController.h:93
armarx::KITProstheticHandUnitPropertyDefinitions
Definition: KITProstheticHandUnit.h:41
armarx::KITProstheticHandUnit::onStartHandUnit
void onStartHandUnit() override
Definition: KITProstheticHandUnit.cpp:62
armarx::KITProstheticHandUnit::onExitHandUnit
void onExitHandUnit() override
Definition: KITProstheticHandUnit.cpp:141
armarx::KITProstheticHandUnitPropertyDefinitions::KITProstheticHandUnitPropertyDefinitions
KITProstheticHandUnitPropertyDefinitions(std::string prefix)
Definition: KITProstheticHandUnit.h:45
armarx::RemoteGui::TabProxy
Definition: WidgetProxy.h:17
HandUnit.h
armarx::KITProstheticHandUnit::getDefaultName
std::string getDefaultName() const override
Definition: KITProstheticHandUnit.h:72
WidgetProxy.h
TaskUtil.h
armarx::HandUnitPropertyDefinitions
Defines all necessary properties for armarx::HandUnit.
Definition: HandUnit.h:44
Component.h
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface >
armarx::KITProstheticHandUnit::addShapeName
void addShapeName(const std::string &name)
Definition: KITProstheticHandUnit.cpp:193
BLEProthesisInterface.h
armarx::KITProstheticHandUnit::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: KITProstheticHandUnit.cpp:34
armarx::KITProstheticHandUnit
Brief description of class KITProstheticHandUnit.
Definition: KITProstheticHandUnit.h:65
armarx::KITProstheticHandUnit::setJointAngles
void setJointAngles(const NameValueMap &targetJointAngles, const Ice::Current &=Ice::emptyCurrent) override
Definition: KITProstheticHandUnit.cpp:146
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::SimplePeriodicTask
Usage:
Definition: ApplicationNetworkStats.h:32
armarx::KITProstheticHandUnit::getCurrentJointValues
NameValueMap getCurrentJointValues(const Ice::Current &) override
Definition: KITProstheticHandUnit.cpp:179