Visual Servoing Platform  version 3.6.1 under development (2024-11-15)
vpReflexTakktile2.h
1 /****************************************************************************
2  *
3  * ViSP, open source Visual Servoing Platform software.
4  * Copyright (C) 2005 - 2023 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * See the file LICENSE.txt at the root directory of this source
11  * distribution for additional information about the GNU GPL.
12  *
13  * For using ViSP with software that can not be combined with the GNU
14  * GPL, please contact Inria about acquiring a ViSP Professional
15  * Edition License.
16  *
17  * See https://visp.inria.fr for more information.
18  *
19  * This software was developed at:
20  * Inria Rennes - Bretagne Atlantique
21  * Campus Universitaire de Beaulieu
22  * 35042 Rennes Cedex
23  * France
24  *
25  * If you have questions regarding the use of this file, please contact
26  * Inria at visp@inria.fr
27  *
28  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30  *
31  * Description:
32  * Interface for the Reflex Takktile 2 hand from Right Hand Robotics.
33  *
34 *****************************************************************************/
35 
36 #ifndef _vpReflexTakktile2_h_
37 #define _vpReflexTakktile2_h_
38 
39 #include <visp3/core/vpConfig.h>
40 #ifdef VISP_HAVE_TAKKTILE2
41 
42 #include <string>
43 #include <vector>
44 
45 #include <visp3/core/vpColVector.h>
46 
47 BEGIN_VISP_NAMESPACE
67 class VISP_EXPORT vpReflexTakktile2
68 {
69 public:
70  class HandInfo
71  {
72  public:
73  std::vector<float> proximal;
74  std::vector<float> distal_approx;
75  std::vector<std::vector<int> > pressure;
76  std::vector<std::vector<bool> > contact;
77 
78  std::vector<float> joint_angle;
79  std::vector<float> raw_angle;
80  std::vector<float> velocity;
81  std::vector<float> load;
82  std::vector<float> voltage;
83 
84  std::vector<uint32_t> temperature;
85  std::vector<std::string> error_state;
86 
87  HandInfo();
88  ~HandInfo() { }
89 
90  friend VISP_EXPORT std::ostream &operator<<(std::ostream &os, const HandInfo &hand);
91  };
92 
94  virtual ~vpReflexTakktile2();
95 
96  void calibrate();
97 
98  void disableTorque();
99 
100  HandInfo getHandInfo();
101 
102  int getNumFingers() const;
103  int getNumSensorsPerFinger() const;
104  int getNumServos() const;
105 
106  vpColVector getPosition() const;
107  vpColVector getVelocity() const;
108 
109  void open();
110 
115  void setFingerConfigFile(const std::string &finger_file_name) { m_finger_file_name = finger_file_name; }
116 
121  void setMotorConfigFile(const std::string &motor_file_name) { m_motor_file_name = motor_file_name; }
122 
128  void setNetworkInterface(const std::string &network_interface = "eth0") { m_network_interface = network_interface; }
129 
130  void setPosition(const vpColVector &targets);
131 
136  void setTactileConfigFile(const std::string &tactile_file_name) { m_tactile_file_name = tactile_file_name; }
137 
138  void setTactileThreshold(int threshold);
139  void setTactileThreshold(const std::vector<int> &thresholds);
140 
141  void setPositioningVelocity(const vpColVector &targets);
142  void setVelocityUntilAnyContact(const vpColVector &targets);
143  void setVelocityUntilEachContact(const vpColVector &targets);
144 
145  void wait(int milliseconds);
146 
147 protected:
148  std::string m_network_interface;
149  std::string m_finger_file_name;
150  std::string m_tactile_file_name;
151  std::string m_motor_file_name;
153 
154 private:
155  // Implementation
156  class Impl;
157  Impl *m_impl;
158 };
159 END_VISP_NAMESPACE
160 #endif
161 #endif
Implementation of column vector and the associated operations.
Definition: vpColVector.h:191
std::vector< uint32_t > temperature
std::vector< float > joint_angle
std::vector< std::vector< bool > > contact
std::vector< std::vector< int > > pressure
std::vector< std::string > error_state
std::vector< float > load
std::vector< float > raw_angle
std::vector< float > proximal
std::vector< float > voltage
std::vector< float > distal_approx
std::vector< float > velocity
std::string m_finger_file_name
std::string m_tactile_file_name
std::string m_network_interface
void setMotorConfigFile(const std::string &motor_file_name)
void setTactileConfigFile(const std::string &tactile_file_name)
void setNetworkInterface(const std::string &network_interface="eth0")
std::string m_motor_file_name
void setFingerConfigFile(const std::string &finger_file_name)