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
35namespace armarx
36{
37 /**
38 * @class KITProstheticHandUnitPropertyDefinitions
39 * @brief
40 */
42 {
43 public:
46 {
47 defineRequiredProperty<std::string>("MAC", "The KIT Prosthetic Hand's Bluetooth MAC");
48 defineOptionalProperty<std::string>("RemoteGuiName", "", "Name of the remote gui");
49 defineOptionalProperty<std::string>("DebugObserverName",
50 "DebugObserver",
51 "Name of the debug observer that should be used");
52 }
53 };
54
55 /**
56 * @defgroup Component-KITProstheticHandUnit KITProstheticHandUnit
57 * @ingroup RobotAPI-Components
58 * A description of the component KITProstheticHandUnit.
59 *
60 * @class KITProstheticHandUnit
61 * @ingroup Component-KITProstheticHandUnit
62 * @brief Brief description of class KITProstheticHandUnit.
63 *
64 * Detailed description of class KITProstheticHandUnit.
65 */
67 {
68 public:
69 /**
70 * @see armarx::ManagedIceObject::getDefaultName()
71 */
72 std::string
73 getDefaultName() const override
74 {
75 return "KITProstheticHandUnit";
76 }
77
78 void onInitHandUnit() override;
79 void onStartHandUnit() override;
80 void onExitHandUnit() override;
81 void setJointAngles(const NameValueMap& targetJointAngles,
82 const Ice::Current& = Ice::emptyCurrent) override;
83 NameValueMap getCurrentJointValues(const Ice::Current&) override;
84
85 void addShape(const std::string& name, const std::map<std::string, float>& shape);
86 void addShapeName(const std::string& name);
87
88
89 void setShape(const std::string& shapeName,
90 const Ice::Current& c = Ice::emptyCurrent) override;
91
92 protected:
93 /**
94 * @see PropertyUser::createPropertyDefinitions()
95 */
97
98 private:
99 std::unique_ptr<BLEProthesisInterface> _driver;
100 std::map<std::string, std::map<std::string, float>> _shapes;
101
102 DebugObserverInterfacePrx _debugObserver;
103 //gui
104 RemoteGuiInterfacePrx _remoteGuiPrx;
106 RemoteGui::TabProxy _guiTab;
107 float _lastGuiValueThumb{0};
108 float _lastGuiValueFingers{0};
109 };
110} // namespace armarx
constexpr T c
Defines all necessary properties for armarx::HandUnit.
Definition HandUnit.h:43
HandUnitPropertyDefinitions(std::string prefix)
Definition HandUnit.h:45
Base unit for high-level access to robot hands.
Definition HandUnit.h:71
Brief description of class KITProstheticHandUnit.
void addShapeName(const std::string &name)
NameValueMap getCurrentJointValues(const Ice::Current &) override
void setShape(const std::string &shapeName, const Ice::Current &c=Ice::emptyCurrent) override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void addShape(const std::string &name, const std::map< std::string, float > &shape)
void setJointAngles(const NameValueMap &targetJointAngles, const Ice::Current &=Ice::emptyCurrent) override
std::string getDefaultName() const override
IceUtil::Handle< PeriodicTask< T > > pointer_type
Shared pointer type for convenience.
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)
PropertyDefinition< PropertyType > & defineRequiredProperty(const std::string &name, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
This file offers overloads of toIce() and fromIce() functions for STL container types.
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface > DebugObserverInterfacePrx
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.