Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpReflexTakktile2 Class Reference

#include <vpReflexTakktile2.h>

Classes

class  HandInfo

Public Member Functions

 vpReflexTakktile2 ()
virtual ~vpReflexTakktile2 ()
void calibrate ()
void disableTorque ()
HandInfo getHandInfo ()
int getNumFingers () const
int getNumSensorsPerFinger () const
int getNumServos () const
vpColVector getPosition () const
vpColVector getVelocity () const
void open ()
void setFingerConfigFile (const std::string &finger_file_name)
void setMotorConfigFile (const std::string &motor_file_name)
void setNetworkInterface (const std::string &network_interface="eth0")
void setPosition (const vpColVector &targets)
void setTactileConfigFile (const std::string &tactile_file_name)
void setTactileThreshold (int threshold)
void setTactileThreshold (const std::vector< int > &thresholds)
void setPositioningVelocity (const vpColVector &targets)
void setVelocityUntilAnyContact (const vpColVector &targets)
void setVelocityUntilEachContact (const vpColVector &targets)
void wait (int milliseconds)

Protected Attributes

std::string m_network_interface
std::string m_finger_file_name
std::string m_tactile_file_name
std::string m_motor_file_name
HandInfo m_hand_info

Detailed Description

Right Hand Robotics Reflex Takktile 2 hand controller.

See https://www.labs.righthandrobotics.com/docs for more details.

This class was tested with the Reflex Takktile2 hand.

To communicate by Ethernet with the hand we recommend to setup computer network with a static configuration:

IP: 10.1.1.10
Gateway: 254.0.0.0
Examples
takktile2-control.cpp, and takktile2-read-data.cpp.

Definition at line 65 of file vpReflexTakktile2.h.

Constructor & Destructor Documentation

◆ vpReflexTakktile2()

vpReflexTakktile2::vpReflexTakktile2 ( )

Default constructor.

Definition at line 119 of file vpReflexTakktile2.cpp.

References m_finger_file_name, m_hand_info, m_motor_file_name, m_network_interface, and m_tactile_file_name.

◆ ~vpReflexTakktile2()

vpReflexTakktile2::~vpReflexTakktile2 ( )
virtual

Destructor.

Definition at line 127 of file vpReflexTakktile2.cpp.

Member Function Documentation

◆ calibrate()

void vpReflexTakktile2::calibrate ( )

Calibrates the tactile sensors and fingers.

Examples
takktile2-control.cpp.

Definition at line 132 of file vpReflexTakktile2.cpp.

◆ disableTorque()

void vpReflexTakktile2::disableTorque ( )

Puts the dynamixels motors into idle mode.

Examples
takktile2-control.cpp.

Definition at line 137 of file vpReflexTakktile2.cpp.

◆ getHandInfo()

vpReflexTakktile2::HandInfo vpReflexTakktile2::getHandInfo ( )

Returns hand info data.

Examples
takktile2-read-data.cpp.

Definition at line 142 of file vpReflexTakktile2.cpp.

References m_hand_info.

◆ getNumFingers()

int vpReflexTakktile2::getNumFingers ( ) const
Returns
Number of fingers.

Definition at line 173 of file vpReflexTakktile2.cpp.

◆ getNumSensorsPerFinger()

int vpReflexTakktile2::getNumSensorsPerFinger ( ) const
Returns
Number of sensors per finger.

Definition at line 178 of file vpReflexTakktile2.cpp.

◆ getNumServos()

int vpReflexTakktile2::getNumServos ( ) const
Returns
Number of servos.

Definition at line 168 of file vpReflexTakktile2.cpp.

◆ getPosition()

vpColVector vpReflexTakktile2::getPosition ( ) const
Returns
4-dim vector corresponding to the position in [rad] of finger 1, 2 and 3 and preshape respectively.

Definition at line 184 of file vpReflexTakktile2.cpp.

◆ getVelocity()

vpColVector vpReflexTakktile2::getVelocity ( ) const
Returns
4-dim vector corresponding to the velocity in [rad/s] of finger 1, 2 and 3 and preshape respectively.

Definition at line 197 of file vpReflexTakktile2.cpp.

◆ open()

void vpReflexTakktile2::open ( )

Open Ethernet connection to Reflex Takktile 2 hand.

Examples
takktile2-control.cpp, and takktile2-read-data.cpp.

Definition at line 314 of file vpReflexTakktile2.cpp.

References m_finger_file_name, m_motor_file_name, m_network_interface, and m_tactile_file_name.

◆ setFingerConfigFile()

void vpReflexTakktile2::setFingerConfigFile ( const std::string & finger_file_name)
inline

Set yaml file used to calibrate fingers.

Parameters
finger_file_name: Finger calibration file.
Examples
takktile2-control.cpp, and takktile2-read-data.cpp.

Definition at line 113 of file vpReflexTakktile2.h.

References m_finger_file_name.

◆ setMotorConfigFile()

void vpReflexTakktile2::setMotorConfigFile ( const std::string & motor_file_name)
inline

Set yaml file used to define motor constants.

Parameters
motor_file_name: Motor constant file.
Examples
takktile2-control.cpp, and takktile2-read-data.cpp.

Definition at line 119 of file vpReflexTakktile2.h.

References m_motor_file_name.

◆ setNetworkInterface()

void vpReflexTakktile2::setNetworkInterface ( const std::string & network_interface = "eth0")
inline

Set network interface name.

Parameters
network_interface: Network interface name used to communicate with the Right Hand. Use ifconfig command to know the name of this interface.
Examples
takktile2-control.cpp, and takktile2-read-data.cpp.

Definition at line 126 of file vpReflexTakktile2.h.

References m_network_interface.

◆ setPosition()

void vpReflexTakktile2::setPosition ( const vpColVector & targets)

Set hand position. This function commands the motors from radians, using the zero references from yaml/finger_calibrate.yaml file to translate into the raw Dynamixel values.

Parameters
targets: 4-dim vector with angular positions in [rad] for finger 1, 2, 3 and preshape respectively.
See also
setPositioningVelocity()
Examples
takktile2-control.cpp.

Definition at line 214 of file vpReflexTakktile2.cpp.

References vpException::dimensionError, and vpArray2D< Type >::size().

◆ setPositioningVelocity()

void vpReflexTakktile2::setPositioningVelocity ( const vpColVector & targets)

Changes the positioning speed of the motor.

Parameters
targets: 4-dim vector with angular velocities in [rad/s] for finger 1, 2, 3 and preshape respectively.
See also
setPosition()
Examples
takktile2-control.cpp.

Definition at line 262 of file vpReflexTakktile2.cpp.

References vpException::dimensionError, and vpArray2D< Type >::size().

◆ setTactileConfigFile()

void vpReflexTakktile2::setTactileConfigFile ( const std::string & tactile_file_name)
inline

Set yaml file used to calibrate tactile sensors.

Parameters
tactile_file_name: Tactile calibration file.
Examples
takktile2-control.cpp, and takktile2-read-data.cpp.

Definition at line 134 of file vpReflexTakktile2.h.

References m_tactile_file_name.

◆ setTactileThreshold() [1/2]

void vpReflexTakktile2::setTactileThreshold ( const std::vector< int > & thresholds)

Sets the threshold level to each tactile sensor for reporting contact.

Parameters
thresholds: This vector is of dim the number of fingers multiplied by the number of tactile sensors per finger. Values are between 0 and 1000.
See also
setTactileThreshold(int)

Definition at line 242 of file vpReflexTakktile2.cpp.

References vpException::dimensionError.

◆ setTactileThreshold() [2/2]

void vpReflexTakktile2::setTactileThreshold ( int threshold)

Sets the same tactile threshold level to all tactile sensors for reporting contact.

Parameters
threshold: Value between 0 and 1000.
See also
setTactileThreshold(std::vector<int> &)
Examples
takktile2-control.cpp.

Definition at line 233 of file vpReflexTakktile2.cpp.

◆ setVelocityUntilAnyContact()

void vpReflexTakktile2::setVelocityUntilAnyContact ( const vpColVector & targets)

Moves the fingers in until any of them makes contact with an object.

Parameters
targets: 4-dim vector with angular velocities in [rad/s] for finger 1, 2, 3 and preshape respectively.
Examples
takktile2-control.cpp.

Definition at line 280 of file vpReflexTakktile2.cpp.

References vpException::dimensionError, and vpArray2D< Type >::size().

◆ setVelocityUntilEachContact()

void vpReflexTakktile2::setVelocityUntilEachContact ( const vpColVector & targets)

Moves the fingers in until each finger makes contact with an object.

Parameters
targets: 4-dim vector with angular velocities in [rad/s] for finger 1, 2, 3 and preshape respectively.
Examples
takktile2-control.cpp.

Definition at line 298 of file vpReflexTakktile2.cpp.

References vpException::dimensionError, and vpArray2D< Type >::size().

◆ wait()

void vpReflexTakktile2::wait ( int milliseconds)

Tries to communicate with the Reflex Hand object.

Parameters
milliseconds: Duration in [ms].
Examples
takktile2-control.cpp, and takktile2-read-data.cpp.

Definition at line 325 of file vpReflexTakktile2.cpp.

Member Data Documentation

◆ m_finger_file_name

std::string vpReflexTakktile2::m_finger_file_name
protected

Definition at line 147 of file vpReflexTakktile2.h.

Referenced by open(), setFingerConfigFile(), and vpReflexTakktile2().

◆ m_hand_info

HandInfo vpReflexTakktile2::m_hand_info
protected

Definition at line 150 of file vpReflexTakktile2.h.

Referenced by getHandInfo(), and vpReflexTakktile2().

◆ m_motor_file_name

std::string vpReflexTakktile2::m_motor_file_name
protected

Definition at line 149 of file vpReflexTakktile2.h.

Referenced by open(), setMotorConfigFile(), and vpReflexTakktile2().

◆ m_network_interface

std::string vpReflexTakktile2::m_network_interface
protected

Definition at line 146 of file vpReflexTakktile2.h.

Referenced by open(), setNetworkInterface(), and vpReflexTakktile2().

◆ m_tactile_file_name

std::string vpReflexTakktile2::m_tactile_file_name
protected

Definition at line 148 of file vpReflexTakktile2.h.

Referenced by open(), setTactileConfigFile(), and vpReflexTakktile2().