iCub-main
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
iCub::iKin::iCubFinger Class Reference

A class for defining the iCub Finger. More...

#include <iKinFwd.h>

+ Inheritance diagram for iCub::iKin::iCubFinger:

Public Member Functions

 iCubFinger ()
 Default constructor. More...
 
 iCubFinger (const std::string &_type)
 Constructor. More...
 
 iCubFinger (const iCubFinger &finger)
 Creates a new Finger from an already existing object. More...
 
iCubFingeroperator= (const iCubFinger &finger)
 Copies a Finger object into the current one. More...
 
virtual bool alignJointsBounds (const std::deque< yarp::dev::IControlLimits * > &lim)
 Alignes the finger joints bounds with current values set aboard the iCub. More...
 
virtual bool getChainJoints (const yarp::sig::Vector &motorEncoders, yarp::sig::Vector &chainJoints)
 Retrieves the vector of actual finger's joint values (to be used in conjuction with the iKinLimb methods) from the vector of motor encoders. More...
 
virtual bool getChainJoints (const yarp::sig::Vector &motorEncoders, const yarp::sig::Vector &jointEncoders, yarp::sig::Vector &chainJoints, const yarp::sig::Matrix &jointEncodersBounds=yarp::math::zeros(1, 2))
 Retrieves the vector of actual finger's joint values (to be used in conjuction with the iKinLimb methods) from the vector of motor encoders and joint encoders. More...
 
- Public Member Functions inherited from iCub::iKin::iKinLimb
 iKinLimb ()
 Default constructor. More...
 
 iKinLimb (const std::string &_type)
 Constructor. More...
 
 iKinLimb (const iKinLimb &limb)
 Creates a new Limb from an already existing Limb object. More...
 
 iKinLimb (const yarp::os::Property &options)
 Creates a new Limb from a list of properties wherein links parameters are specified. More...
 
bool fromLinksProperties (const yarp::os::Property &options)
 Initializes the Limb from a list of properties wherein links parameters are specified. More...
 
bool toLinksProperties (yarp::os::Property &options)
 Provides the links attributes listed in a property object. More...
 
bool isValid () const
 Checks if the limb has been properly configured. More...
 
iKinLimboperator= (const iKinLimb &limb)
 Copies a Limb object into the current one. More...
 
iKinChainasChain ()
 Returns a pointer to the Limb seen as Chain object. More...
 
std::string getType () const
 Returns the Limb type as a string. More...
 
virtual ~iKinLimb ()
 Destructor. More...
 
- Public Member Functions inherited from iCub::iKin::iKinChain
 iKinChain ()
 Default constructor. More...
 
 iKinChain (const iKinChain &c)
 Creates a new Chain from an already existing Chain object. More...
 
iKinChainoperator= (const iKinChain &c)
 Copies a Chain object into the current one. More...
 
iKinChainoperator<< (iKinLink &l)
 Adds a Link at the bottom of the Chain. More...
 
iKinChainoperator-- (int)
 Removes a Link from the bottom of the Chain. More...
 
iKinLinkoperator[] (const unsigned int i)
 Returns a reference to the ith Link of the Chain. More...
 
iKinLinkoperator() (const unsigned int i)
 Returns a reference to the ith Link of the Chain considering only those Links related to DOF. More...
 
bool addLink (const unsigned int i, iKinLink &l)
 Adds a Link at the position ith within the Chain. More...
 
bool rmLink (const unsigned int i)
 Removes the ith Link from the Chain. More...
 
void pushLink (iKinLink &l)
 Adds a Link at the bottom of the Chain. More...
 
void clear ()
 Removes all Links. More...
 
void popLink ()
 Removes a Link from the bottom of the Chain. More...
 
bool blockLink (const unsigned int i, double Ang)
 Blocks the ith Link at the a certain value of its joint angle. More...
 
bool blockLink (const unsigned int i)
 Blocks the ith Link at the current value of its joint angle. More...
 
bool setBlockingValue (const unsigned int i, double Ang)
 Changes the value of the ith blocked Link. More...
 
bool releaseLink (const unsigned int i)
 Releases the ith Link. More...
 
bool isLinkBlocked (const unsigned int i)
 Queries whether the ith Link is blocked. More...
 
void setAllConstraints (bool _constrained)
 Sets the constraint status of all chain links. More...
 
void setConstraint (unsigned int i, bool _constrained)
 Sets the constraint status of ith link. More...
 
bool getConstraint (unsigned int i)
 Returns the constraint status of ith link. More...
 
void setAllLinkVerbosity (unsigned int _verbose)
 Sets the verbosity level of all Links belonging to the Chain. More...
 
void setVerbosity (unsigned int _verbose)
 Sets the verbosity level of the Chain. More...
 
unsigned int getVerbosity () const
 Returns the current Chain verbosity level. More...
 
unsigned int getN () const
 Returns the number of Links belonging to the Chain. More...
 
unsigned int getDOF () const
 Returns the current number of Chain's DOF. More...
 
yarp::sig::Matrix getH0 () const
 Returns H0, the rigid roto-translation matrix from the root reference frame to the 0th frame. More...
 
bool setH0 (const yarp::sig::Matrix &_H0)
 Sets H0, the rigid roto-translation matrix from the root reference frame to the 0th frame. More...
 
yarp::sig::Matrix getHN () const
 Returns HN, the rigid roto-translation matrix from the Nth frame to the end-effector. More...
 
bool setHN (const yarp::sig::Matrix &_HN)
 Sets HN, the rigid roto-translation matrix from the Nth frame to the end-effector. More...
 
yarp::sig::Vector setAng (const yarp::sig::Vector &q)
 Sets the free joint angles to values of q[i]. More...
 
yarp::sig::Vector getAng ()
 Returns the current free joint angles values. More...
 
double setAng (const unsigned int i, double _Ang)
 Sets the ith joint angle. More...
 
double getAng (const unsigned int i)
 Returns the current angle of ith joint. More...
 
yarp::sig::Matrix getH (const unsigned int i, const bool allLink=false)
 Returns the rigid roto-translation matrix from the root reference frame to the ith frame in Denavit-Hartenberg notation. More...
 
yarp::sig::Matrix getH ()
 Returns the rigid roto-translation matrix from the root reference frame to the end-effector frame in Denavit-Hartenberg notation (HN is taken into account). More...
 
yarp::sig::Matrix getH (const yarp::sig::Vector &q)
 Returns the rigid roto-translation matrix from the root reference frame to the end-effector frame in Denavit-Hartenberg notation (HN is taken into account). More...
 
yarp::sig::Vector Pose (const unsigned int i, const bool axisRep=true)
 Returns the coordinates of ith Link. More...
 
yarp::sig::Vector Position (const unsigned int i)
 Returns the 3D position coordinates of ith Link. More...
 
yarp::sig::Vector EndEffPose (const bool axisRep=true)
 Returns the coordinates of end-effector. More...
 
yarp::sig::Vector EndEffPose (const yarp::sig::Vector &q, const bool axisRep=true)
 Returns the coordinates of end-effector computed in q. More...
 
yarp::sig::Vector EndEffPosition ()
 Returns the 3D coordinates of end-effector position. More...
 
yarp::sig::Vector EndEffPosition (const yarp::sig::Vector &q)
 Returns the 3D coordinates of end-effector position computed in q. More...
 
yarp::sig::Matrix AnaJacobian (const unsigned int i, unsigned int col)
 Returns the analitical Jacobian of the ith link. More...
 
yarp::sig::Matrix AnaJacobian (unsigned int col=3)
 Returns the analitical Jacobian of the end-effector. More...
 
yarp::sig::Matrix AnaJacobian (const yarp::sig::Vector &q, unsigned int col=3)
 Returns the analitical Jacobian of the end-effector computed in q. More...
 
yarp::sig::Matrix GeoJacobian (const unsigned int i)
 Returns the geometric Jacobian of the ith link. More...
 
yarp::sig::Matrix GeoJacobian ()
 Returns the geometric Jacobian of the end-effector. More...
 
yarp::sig::Matrix GeoJacobian (const yarp::sig::Vector &q)
 Returns the geometric Jacobian of the end-effector computed in q. More...
 
yarp::sig::Vector Hessian_ij (const unsigned int i, const unsigned int j)
 Returns the 6x1 vector \( \partial{^2}F\left(q\right)/\partial q_i \partial q_j, \) where \( F\left(q\right) \) is the forward kinematic function and \( \left(q_i,q_j\right) \) is the DOF couple. More...
 
void prepareForHessian ()
 Prepares computation for a successive call to fastHessian_ij(). More...
 
yarp::sig::Vector fastHessian_ij (const unsigned int i, const unsigned int j)
 Returns the 6x1 vector \( \partial{^2}F\left(q\right)/\partial q_i \partial q_j, \) where \( F\left(q\right) \) is the forward kinematic function and \( \left(q_i,q_j\right) \) is the DOF couple. More...
 
yarp::sig::Vector Hessian_ij (const unsigned int lnk, const unsigned int i, const unsigned int j)
 Returns the 6x1 vector \( \partial{^2}F\left(q\right)/\partial q_i \partial q_j, \) where \( F\left(q\right) \) is the forward kinematic function and \( \left(q_i,q_j\right) \) is the couple of links. More...
 
void prepareForHessian (const unsigned int lnk)
 Prepares computation for a successive call to fastHessian_ij() (link version). More...
 
yarp::sig::Vector fastHessian_ij (const unsigned int lnk, const unsigned int i, const unsigned int j)
 Returns the 6x1 vector \( \partial{^2}F\left(q\right)/\partial q_i \partial q_j, \) where \( F\left(q\right) \) is the forward kinematic function and \( \left(q_i,q_j\right) \) is the couple of links. More...
 
yarp::sig::Matrix DJacobian (const yarp::sig::Vector &dq)
 Compute the time derivative of the geometric Jacobian. More...
 
yarp::sig::Matrix DJacobian (const unsigned int lnk, const yarp::sig::Vector &dq)
 Compute the time derivative of the geometric Jacobian (link version). More...
 
virtual ~iKinChain ()
 Destructor. More...
 

Protected Member Functions

virtual void allocate (const std::string &_type)
 
virtual void clone (const iCubFinger &finger)
 
- Protected Member Functions inherited from iCub::iKin::iKinLimb
virtual void getMatrixFromProperties (const yarp::os::Property &options, const std::string &tag, yarp::sig::Matrix &H)
 
virtual void setMatrixToProperties (yarp::os::Property &options, const std::string &tag, yarp::sig::Matrix &H)
 
virtual void clone (const iKinLimb &limb)
 
virtual void dispose ()
 
iKinChainoperator= (const iKinChain &c)
 
iKinChainoperator<< (iKinLink &l)
 
iKinChainoperator-- (int)
 
iKinLinkoperator[] (const unsigned int i)
 
iKinLinkoperator() (const unsigned int i)
 
bool addLink (const unsigned int i, iKinLink &l)
 
bool rmLink (const unsigned int i)
 
void pushLink (iKinLink &l)
 
void clear ()
 
void popLink ()
 
void pushLink (iKinLink *pl)
 
- Protected Member Functions inherited from iCub::iKin::iKinChain
virtual void clone (const iKinChain &c)
 
virtual void build ()
 
yarp::sig::Vector RotAng (const yarp::sig::Matrix &R)
 
yarp::sig::Vector dRotAng (const yarp::sig::Matrix &R, const yarp::sig::Matrix &dR)
 
yarp::sig::Vector d2RotAng (const yarp::sig::Matrix &R, const yarp::sig::Matrix &dRi, const yarp::sig::Matrix &dRj, const yarp::sig::Matrix &d2R)
 

Protected Attributes

std::string hand
 
std::string finger
 
std::string version
 
double fingers_abduction_max {0.0}
 
- Protected Attributes inherited from iCub::iKin::iKinLimb
std::deque< iKinLink * > linkList
 
std::string type
 
- Protected Attributes inherited from iCub::iKin::iKinChain
unsigned int N
 
unsigned int DOF
 
unsigned int verbose
 
yarp::sig::Matrix H0
 
yarp::sig::Matrix HN
 
yarp::sig::Vector curr_q
 
std::deque< iKinLink * > allList
 
std::deque< iKinLink * > quickList
 
std::deque< unsigned int > hash
 
std::deque< unsigned int > hash_dof
 
yarp::sig::Matrix hess_J
 
yarp::sig::Matrix hess_Jlnk
 

Detailed Description

A class for defining the iCub Finger.


The outcomes of forward kinematics are relative to the reference frame attached to the corresponding iCubArm end-effector.

Definition at line 1233 of file iKinFwd.h.

Constructor & Destructor Documentation

◆ iCubFinger() [1/3]

iCubFinger::iCubFinger ( )

Default constructor.

Definition at line 1931 of file iKinFwd.cpp.

◆ iCubFinger() [2/3]

iCubFinger::iCubFinger ( const std::string &  _type)

Constructor.

Parameters
_typeis a string to discriminate between the finger's type which has to be passed in the form <hand>_<finger>_<version>, where hand accounts for "left"|"right", finger for "thumb"|"index"|"middle"|"ring"|"little", and version for "na"|"a"|"b".
Note
"na" (i.e. not-applicable) is the default hardware version for index, middle, ring and little finger, whereas "b" is the default for the thumb; "a" and "b" refer to different mechanical configurations, please see the manual.

Definition at line 1938 of file iKinFwd.cpp.

◆ iCubFinger() [3/3]

iCubFinger::iCubFinger ( const iCubFinger finger)

Creates a new Finger from an already existing object.

Parameters
sensoris the object to be copied.

Definition at line 1945 of file iKinFwd.cpp.

Member Function Documentation

◆ alignJointsBounds()

bool iCubFinger::alignJointsBounds ( const std::deque< yarp::dev::IControlLimits * > &  lim)
virtual

Alignes the finger joints bounds with current values set aboard the iCub.

Parameters
limis the ordered list of control interfaces that allows to access the Arm limits.
Returns
true/false on success/failure.

Reimplemented from iCub::iKin::iKinLimb.

Definition at line 2143 of file iKinFwd.cpp.

◆ allocate()

void iCubFinger::allocate ( const std::string &  _type)
protectedvirtual

Reimplemented from iCub::iKin::iKinLimb.

Definition at line 1972 of file iKinFwd.cpp.

◆ clone()

void iCubFinger::clone ( const iCubFinger finger)
protectedvirtual

Definition at line 1952 of file iKinFwd.cpp.

◆ getChainJoints() [1/2]

virtual bool iCub::iKin::iCubFinger::getChainJoints ( const yarp::sig::Vector &  motorEncoders,
const yarp::sig::Vector &  jointEncoders,
yarp::sig::Vector &  chainJoints,
const yarp::sig::Matrix &  jointEncodersBounds = yarp::math::zeros(1, 2) 
)
virtual

Retrieves the vector of actual finger's joint values (to be used in conjuction with the iKinLimb methods) from the vector of motor encoders and joint encoders.

Parameters
motorEncodersthe vector of motor encoders from which to extract the joint values of the finger. It can be composed of 16 or 9 elements, depending if it comprises the arm encoders as well or just the hand encoders.
jointEncodersthe vector of joint encoders from which to extract the joint values of the finger. It contains 15 analog numbers accounting for in order the proximal and the two distal phalanxes of the thumb, index, middle, ring and little fingers.
chainJointsthe vector containing the joints values to be used with the iKinLimb methods expressed in degrees.
jointEncodersBoundsthe matrix 15-by-2 containing the minimum and maximum bounds of analog readings. By default, the matrix (255 0; 255 0; ...) is used.
Returns
true/false on success/failure.

◆ getChainJoints() [2/2]

virtual bool iCub::iKin::iCubFinger::getChainJoints ( const yarp::sig::Vector &  motorEncoders,
yarp::sig::Vector &  chainJoints 
)
virtual

Retrieves the vector of actual finger's joint values (to be used in conjuction with the iKinLimb methods) from the vector of motor encoders.

Parameters
motorEncodersthe vector of motor encoders from which to extract the joint values of the finger. It can be composed of 16 or 9 elements, depending if it comprises the arm encoders as well or just the hand encoders.
chainJointsthe vector containing the joints values to be used with the iKinLimb methods.
Returns
true/false on success/failure.
Note
This method accounts also for the underactuated joints, meaning that the actual number of DOFs of the index, for example, is 4 and not 3: one for the abduction movement, one for the proximal movement and 2 coupled movements for the distal joint (equally partitioned).

◆ operator=()

iCubFinger & iCubFinger::operator= ( const iCubFinger finger)

Copies a Finger object into the current one.

Parameters
fingeris a reference to an object of type iCubFinger.
Returns
a reference to the current object.

Definition at line 1961 of file iKinFwd.cpp.

Member Data Documentation

◆ finger

std::string iCub::iKin::iCubFinger::finger
protected

Definition at line 1237 of file iKinFwd.h.

◆ fingers_abduction_max

double iCub::iKin::iCubFinger::fingers_abduction_max {0.0}
protected

Definition at line 1239 of file iKinFwd.h.

◆ hand

std::string iCub::iKin::iCubFinger::hand
protected

Definition at line 1236 of file iKinFwd.h.

◆ version

std::string iCub::iKin::iCubFinger::version
protected

Definition at line 1238 of file iKinFwd.h.


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