XBotInterface  2.4.1
XBotInterface provides a generic API to model and control a robot.
Hand.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 IIT-ADVR
3  * Author: Arturo Laurenzi, Luca Muratore
4  * email: arturo.laurenzi@iit.it, luca.muratore@iit.it
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>
18 */
19 
20 #ifndef __XBOT_HAND_H__
21 #define __XBOT_HAND_H__
22 
23 #include <string>
24 #include <memory>
25 #include <iostream>
26 
27 
28 namespace XBot {
29 
34  class Hand {
35 
36 // class RobotInterface;
37 
38 public:
39 
40  typedef std::shared_ptr<Hand> Ptr;
41  typedef std::shared_ptr<const Hand> ConstPtr;
42 
43 // friend XBot::RobotInterface;
44 
51  Hand(int hand_id, std::string hand_name);
52 
58  int getHandId();
59 
65  const std::string& getHandName();
66 
72  void grasp(double grasp_percentage);
73 
79  double getGraspReference();
80 
86  double getGraspState() const;
87 
94  void setGraspState(double grasp_state);
95 
96 private:
97 
98  int _hand_id;
99  std::string _hand_name;
100 
101  double _grasp_percentage;
102 
103  double _grasp_state;
104 
105  };
106 }
107 #endif
XBot::Hand::getHandId
int getHandId()
get the hand id
Definition: Hand.cpp:30
XBot::Hand::setGraspState
void setGraspState(double grasp_state)
set the grasp state read from the hand
Definition: Hand.cpp:58
XBot::Hand::getHandName
const std::string & getHandName()
get the hand name
Definition: Hand.cpp:36
XBot::Hand::Ptr
std::shared_ptr< Hand > Ptr
Definition: Hand.h:40
XBot::Hand::getGraspState
double getGraspState() const
get actual grasp percentage
Definition: Hand.cpp:53
XBot::Hand::Hand
Hand(int hand_id, std::string hand_name)
Constructor with the hand id.
Definition: Hand.cpp:25
XBot::Hand
Hand.
Definition: Hand.h:34
XBot::Hand::ConstPtr
std::shared_ptr< const Hand > ConstPtr
Definition: Hand.h:41
XBot::Hand::grasp
void grasp(double grasp_percentage)
grasp till grasp_percentage
Definition: Hand.cpp:42
XBot
Definition: IXBotModel.h:20
XBot::Hand::getGraspReference
double getGraspReference()
get the grasp reference set with grasp_percentage
Definition: Hand.cpp:47