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  */
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  */
66  class KITProstheticHandUnit : virtual public armarx::HandUnit
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
armarx::KITProstheticHandUnit::onInitHandUnit
void onInitHandUnit() override
Definition: KITProstheticHandUnit.cpp:43
armarx::HandUnit
Base unit for high-level access to robot hands.
Definition: HandUnit.h:70
armarx::KITProstheticHandUnit::addShape
void addShape(const std::string &name, const std::map< std::string, float > &shape)
Definition: KITProstheticHandUnit.cpp:205
armarx::KITProstheticHandUnit::setShape
void setShape(const std::string &shapeName, const Ice::Current &c=Ice::emptyCurrent) override
Definition: KITProstheticHandUnit.cpp:221
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:345
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:46
armarx::KITProstheticHandUnitPropertyDefinitions
Definition: KITProstheticHandUnit.h:41
armarx::KITProstheticHandUnit::onStartHandUnit
void onStartHandUnit() override
Definition: KITProstheticHandUnit.cpp:66
armarx::KITProstheticHandUnit::onExitHandUnit
void onExitHandUnit() override
Definition: KITProstheticHandUnit.cpp:153
armarx::KITProstheticHandUnitPropertyDefinitions::KITProstheticHandUnitPropertyDefinitions
KITProstheticHandUnitPropertyDefinitions(std::string prefix)
Definition: KITProstheticHandUnit.h:44
armarx::RemoteGui::TabProxy
Definition: WidgetProxy.h:17
HandUnit.h
armarx::KITProstheticHandUnit::getDefaultName
std::string getDefaultName() const override
Definition: KITProstheticHandUnit.h:73
WidgetProxy.h
TaskUtil.h
armarx::HandUnitPropertyDefinitions
Defines all necessary properties for armarx::HandUnit.
Definition: HandUnit.h:42
Component.h
armarx::control::njoint_controller::platform::platform_follower_controller::NameValueMap
std::map< std::string, float > NameValueMap
Definition: PlatformFollowerController.h:88
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface >
armarx::KITProstheticHandUnit::addShapeName
void addShapeName(const std::string &name)
Definition: KITProstheticHandUnit.cpp:213
BLEProthesisInterface.h
armarx::KITProstheticHandUnit::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: KITProstheticHandUnit.cpp:36
armarx::KITProstheticHandUnit
Brief description of class KITProstheticHandUnit.
Definition: KITProstheticHandUnit.h:66
armarx::KITProstheticHandUnit::setJointAngles
void setJointAngles(const NameValueMap &targetJointAngles, const Ice::Current &=Ice::emptyCurrent) override
Definition: KITProstheticHandUnit.cpp:159
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::SimplePeriodicTask
Usage:
Definition: ApplicationNetworkStats.h:32
armarx::KITProstheticHandUnit::getCurrentJointValues
NameValueMap getCurrentJointValues(const Ice::Current &) override
Definition: KITProstheticHandUnit.cpp:196