ethercatcpp
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
ethercatcpp::ShadowHand Class Reference

This class describe the full EtherCAT driver for the shadow hand. More...

#include <shadow_hand.h>

Inheritance diagram for ethercatcpp::ShadowHand:
Inheritance graph

Public Member Functions

 ShadowHand (shadow::HandID hand_id, shadow::BiotacMode biotac_electrode_mode, shadow::ControlMode control_mode, std::unique_ptr< math::Interpolator< std::array< uint16_t, shadow::joint_count >, std::array< double, shadow::joint_count >>> joint_position_interpolator)
 Constructor of ShadowHand class. More...
 
 ShadowHand (shadow::HandID hand_id, shadow::BiotacMode biotac_electrode_mode, shadow::ControlMode control_mode)
 Constructor of ShadowHand class. More...
 
 ~ShadowHand ()
 
const shadow::RawHandStatestate () const
 read only access to hand state More...
 
const shadow::RawHandCommandcommand () const
 read only access to hand command More...
 
shadow::RawHandCommandcommand ()
 read/write access to hand command More...
 
void read_joints_torques ()
 read torques of hand's joints More...
 
void read_raw_joints_positions ()
 read raw positions of hand's joints More...
 
void read_joints_positions ()
 read positions of hand's joints More...
 
void read_biotacs_pressures ()
 read pressure of biotac sensors More...
 
void read_biotacs_temperatures ()
 read temperatures of biotac sensors More...
 
void read_biotacs_electrodes ()
 read contact electrodes values of biotac sensors More...
 
void read ()
 read all hand state data More...
 
void write_joints_commands ()
 write joints commands More...
 
void write ()
 write joints commands More...
 
void print_fingers_positions ()
 Function used to print all fingers positions. More...
 
void print_fingers_torques ()
 Function used to print all fingers torques. More...
 
void print_biotacs_data ()
 Function used to print all biotacs datas (presure, temperature and electrode impedance) for all fingers. Electrodes impedances datas are updated anly if class is contruct with "WITH_BIOTACS_ELECTRODES" flag. More...
 
- Public Member Functions inherited from ethercatcpp::BusDevice
 BusDevice ()
 Constructor of BusDevice class. More...
 
virtual ~BusDevice ()
 
void add (Device &device)
 Add a device (slave or bus) in the bus. More...
 
- Public Member Functions inherited from ethercatcpp::Device
 Device ()
 
virtual ~Device ()
 

Static Public Member Functions

static std::unique_ptr< math::Interpolator< std::array< uint16_t, shadow::joint_count >, std::array< double, shadow::joint_count > > > default_joint_calibrator (shadow::HandID hand_id)
 

Private Member Functions

pImpl & impl ()
 

Private Attributes

std::unique_ptr< pImpl > impl_
 
shadow::RawHandState state_
 
shadow::RawHandCommand command_
 

Additional Inherited Members

Detailed Description

This class describe the full EtherCAT driver for the shadow hand.

It is the main driver, only used this one to control a shadow hand because Shadow hand is composed with two slaves (a fake and a controller). This class describe the full controller and permit communication between the shadow hand controller and an ethercat bus.

Examples
shadow_one_hand.cpp, shadow_one_hand_torque.cpp, shadow_two_hands_mono.cpp, and shadow_two_hands_multi.cpp.

Constructor & Destructor Documentation

◆ ShadowHand() [1/2]

ethercatcpp::ShadowHand::ShadowHand ( shadow::HandID  hand_id,
shadow::BiotacMode  biotac_electrode_mode,
shadow::ControlMode  control_mode,
std::unique_ptr< math::Interpolator< std::array< uint16_t, shadow::joint_count >, std::array< double, shadow::joint_count >>>  joint_position_interpolator 
)

Constructor of ShadowHand class.

The constructor must have an information on witch hand is used (left or right) and if user needs biotacs eletrode data or not.

Parameters
[in]hand_idtells if this is a left or right hand
[in]biotac_electrode_modeis a BiotacMode which indicates if user need biotac electrodes data
[in]control_modethe control mode for the hand: torque or PWM
[in]joint_position_interpolatorinterpolator used to get joint position in radians from raw units (encoder counts)

◆ ShadowHand() [2/2]

ethercatcpp::ShadowHand::ShadowHand ( shadow::HandID  hand_id,
shadow::BiotacMode  biotac_electrode_mode,
shadow::ControlMode  control_mode 
)

Constructor of ShadowHand class.

The constructor must have an information on witch hand is used (left or right) and if user needs biotacs eletrode data or not.

Parameters
[in]hand_idtells if this is a left or right hand
[in]biotac_electrode_modeis a BiotacMode which indicates if user need biotac electrodes data
[in]control_modethe control mode for the hand: torque or PWM

◆ ~ShadowHand()

ethercatcpp::ShadowHand::~ShadowHand ( )

Member Function Documentation

◆ command() [1/2]

shadow::RawHandCommand& ethercatcpp::ShadowHand::command ( )

read/write access to hand command

Returns
const RawHandState&

◆ command() [2/2]

const shadow::RawHandCommand& ethercatcpp::ShadowHand::command ( ) const

read only access to hand command

Returns
const RawHandState&
Examples
shadow_one_hand.cpp, and shadow_one_hand_torque.cpp.

◆ default_joint_calibrator()

static std::unique_ptr< math::Interpolator<std::array<uint16_t, shadow::joint_count>, std::array<double, shadow::joint_count> > > ethercatcpp::ShadowHand::default_joint_calibrator ( shadow::HandID  hand_id)
static

◆ impl()

pImpl& ethercatcpp::ShadowHand::impl ( )
inlineprivate

◆ print_biotacs_data()

void ethercatcpp::ShadowHand::print_biotacs_data ( )

Function used to print all biotacs datas (presure, temperature and electrode impedance) for all fingers. Electrodes impedances datas are updated anly if class is contruct with "WITH_BIOTACS_ELECTRODES" flag.

◆ print_fingers_positions()

void ethercatcpp::ShadowHand::print_fingers_positions ( )

Function used to print all fingers positions.

◆ print_fingers_torques()

void ethercatcpp::ShadowHand::print_fingers_torques ( )

Function used to print all fingers torques.

◆ read()

void ethercatcpp::ShadowHand::read ( )

◆ read_biotacs_electrodes()

void ethercatcpp::ShadowHand::read_biotacs_electrodes ( )

read contact electrodes values of biotac sensors

◆ read_biotacs_pressures()

void ethercatcpp::ShadowHand::read_biotacs_pressures ( )

read pressure of biotac sensors

◆ read_biotacs_temperatures()

void ethercatcpp::ShadowHand::read_biotacs_temperatures ( )

read temperatures of biotac sensors

◆ read_joints_positions()

void ethercatcpp::ShadowHand::read_joints_positions ( )

read positions of hand's joints

◆ read_joints_torques()

void ethercatcpp::ShadowHand::read_joints_torques ( )

read torques of hand's joints

◆ read_raw_joints_positions()

void ethercatcpp::ShadowHand::read_raw_joints_positions ( )

read raw positions of hand's joints

◆ state()

const shadow::RawHandState& ethercatcpp::ShadowHand::state ( ) const

read only access to hand state

Returns
const RawHandState&
Examples
shadow_one_hand.cpp.

◆ write()

void ethercatcpp::ShadowHand::write ( )

◆ write_joints_commands()

void ethercatcpp::ShadowHand::write_joints_commands ( )

write joints commands

Member Data Documentation

◆ command_

shadow::RawHandCommand ethercatcpp::ShadowHand::command_
private

◆ impl_

std::unique_ptr<pImpl> ethercatcpp::ShadowHand::impl_
private

◆ state_

shadow::RawHandState ethercatcpp::ShadowHand::state_
private

The documentation for this class was generated from the following file: