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

A class for defining generic Limb. More...

#include <iKinFwd.h>

+ Inheritance diagram for iCub::iKin::iKinLimb:

Public Member Functions

 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 bool alignJointsBounds (const std::deque< yarp::dev::IControlLimits * > &)
 Alignes the Limb joints bounds with current values set aboard the robot. 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 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 allocate (const std::string &_type)
 
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::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 generic Limb.

Definition at line 873 of file iKinFwd.h.

Constructor & Destructor Documentation

◆ iKinLimb() [1/4]

iKinLimb::iKinLimb ( )

Default constructor.

Definition at line 1315 of file iKinFwd.cpp.

◆ iKinLimb() [2/4]

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

Constructor.

Parameters
_typeis a string to discriminate between "left" and "right" limb

Definition at line 1322 of file iKinFwd.cpp.

◆ iKinLimb() [3/4]

iKinLimb::iKinLimb ( const iKinLimb limb)

Creates a new Limb from an already existing Limb object.

Parameters
limbis the Limb to be copied.

Definition at line 1329 of file iKinFwd.cpp.

◆ iKinLimb() [4/4]

iCub::iKin::iKinLimb::iKinLimb ( const yarp::os::Property &  options)

Creates a new Limb from a list of properties wherein links parameters are specified.

Parameters
optionsis the list of links properties.
See also
fromLinksProperties

◆ ~iKinLimb()

iKinLimb::~iKinLimb ( )
virtual

Destructor.

Definition at line 1508 of file iKinFwd.cpp.

Member Function Documentation

◆ addLink()

bool iCub::iKin::iKinLimb::addLink ( const unsigned int  i,
iKinLink l 
)
inlineprotected

Definition at line 895 of file iKinFwd.h.

◆ alignJointsBounds()

virtual bool iCub::iKin::iKinLimb::alignJointsBounds ( const std::deque< yarp::dev::IControlLimits * > &  )
inlinevirtual

Alignes the Limb joints bounds with current values set aboard the robot.

Parameters
limis the ordered list of control interfaces that allows to access the Limb limits.
Returns
true/false on success/failure.
Note
This method is empty in iKinLimb because it's limb-specific: see the implementations for iCubLimbs.

Reimplemented in iCub::iKin::iCubInertialSensor, iCub::iKin::iCubEye, iCub::iKin::iCubLeg, iCub::iKin::iCubFinger, iCub::iKin::iCubArm, and iCub::iKin::iCubTorso.

Definition at line 1031 of file iKinFwd.h.

◆ allocate()

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

◆ asChain()

iKinChain* iCub::iKin::iKinLimb::asChain ( )
inline

Returns a pointer to the Limb seen as Chain object.

Useful to to operate on the Links of Limb.

Returns
a pointer to a Chain object with the same Links of Limb.

Definition at line 1013 of file iKinFwd.h.

◆ clear()

void iCub::iKin::iKinLimb::clear ( )
inlineprotected

Definition at line 898 of file iKinFwd.h.

◆ clone()

void iKinLimb::clone ( const iKinLimb limb)
protectedvirtual

Definition at line 1522 of file iKinFwd.cpp.

◆ dispose()

void iKinLimb::dispose ( )
protectedvirtual

Reimplemented from iCub::iKin::iKinChain.

Definition at line 1534 of file iKinFwd.cpp.

◆ fromLinksProperties()

bool iKinLimb::fromLinksProperties ( const yarp::os::Property &  options)

Initializes the Limb from a list of properties wherein links parameters are specified.

Parameters
optionsis the list of links properties.
Note
Available options are:

type <string>: specifies the limb handedness [left/right] (default=right).

H0 <list of 4x4 doubles (per rows)>: specifies the rigid roto-translation matrix from the root reference frame to the 0th frame (default=eye(4,4)).

HN <list of 4x4 doubles (per rows)>: specifies the rigid roto-translation matrix from the Nth frame to the end-effector (default=eye(4,4)).

numLinks <int>: specifies the expected number of links.

A <double>: specifies the link length m.

D <double>: specifies the link offset m.

alpha <double>: specifies the link twist deg.

offset <double>: specifies the joint angle offset deg.

min <double>: specifies the joint angle lower bound deg.

max <double>: specifies the joint angle upper bound deg.

blocked <double>: blocks the link at the specified value [deg] (default=released).

Note
The list should look like as the following:
type right
H0 (1.0 2.0 3.0 ...)
HN (1.0 2.0 3.0 ...)
numLinks 4
link_0 (option1 value1) (option2 value2) ...
link_1 (option1 value1) ...
...
yarp::sig::Matrix H0
Definition: iKinFwd.h:360
yarp::sig::Matrix HN
Definition: iKinFwd.h:361
std::string type
Definition: iKinFwd.h:877
Note
Please note how the link options (e.g. A, D, alpha ...) are to be given using the group identifiers link_#.
Returns
true iff correctly configured.

Definition at line 1387 of file iKinFwd.cpp.

◆ getMatrixFromProperties()

void iKinLimb::getMatrixFromProperties ( const yarp::os::Property &  options,
const std::string &  tag,
yarp::sig::Matrix &  H 
)
protectedvirtual

Definition at line 1351 of file iKinFwd.cpp.

◆ getType()

std::string iCub::iKin::iKinLimb::getType ( ) const
inline

Returns the Limb type as a string.

Returns
the type as a string {"left", "right"}.

Definition at line 1019 of file iKinFwd.h.

◆ isValid()

bool iCub::iKin::iKinLimb::isValid ( ) const
inline

Checks if the limb has been properly configured.

Returns
true iff correctly configured.

Definition at line 998 of file iKinFwd.h.

◆ operator()()

iKinLink& iCub::iKin::iKinLimb::operator() ( const unsigned int  i)
inlineprotected

Definition at line 894 of file iKinFwd.h.

◆ operator--()

iKinChain& iCub::iKin::iKinLimb::operator-- ( int  )
inlineprotected

Definition at line 892 of file iKinFwd.h.

◆ operator<<()

iKinChain& iCub::iKin::iKinLimb::operator<< ( iKinLink l)
inlineprotected

Definition at line 891 of file iKinFwd.h.

◆ operator=() [1/2]

iKinChain& iCub::iKin::iKinLimb::operator= ( const iKinChain c)
inlineprotected

Definition at line 890 of file iKinFwd.h.

◆ operator=() [2/2]

iKinLimb & iKinLimb::operator= ( const iKinLimb limb)

Copies a Limb object into the current one.

Parameters
limbis a reference to an object of type iKinLimb.
Returns
a reference to the current object.

Definition at line 1498 of file iKinFwd.cpp.

◆ operator[]()

iKinLink& iCub::iKin::iKinLimb::operator[] ( const unsigned int  i)
inlineprotected

Definition at line 893 of file iKinFwd.h.

◆ popLink()

void iCub::iKin::iKinLimb::popLink ( )
inlineprotected

Definition at line 899 of file iKinFwd.h.

◆ pushLink() [1/2]

void iCub::iKin::iKinLimb::pushLink ( iKinLink l)
inlineprotected

Definition at line 897 of file iKinFwd.h.

◆ pushLink() [2/2]

void iKinLimb::pushLink ( iKinLink pl)
protected

Definition at line 1343 of file iKinFwd.cpp.

◆ rmLink()

bool iCub::iKin::iKinLimb::rmLink ( const unsigned int  i)
inlineprotected

Definition at line 896 of file iKinFwd.h.

◆ setMatrixToProperties()

void iKinLimb::setMatrixToProperties ( yarp::os::Property &  options,
const std::string &  tag,
yarp::sig::Matrix &  H 
)
protectedvirtual

Definition at line 1374 of file iKinFwd.cpp.

◆ toLinksProperties()

bool iKinLimb::toLinksProperties ( yarp::os::Property &  options)

Provides the links attributes listed in a property object.

Parameters
optionsis the list of links properties.
Returns
true iff successful.

Definition at line 1443 of file iKinFwd.cpp.

Member Data Documentation

◆ linkList

std::deque<iKinLink*> iCub::iKin::iKinLimb::linkList
protected

Definition at line 876 of file iKinFwd.h.

◆ type

std::string iCub::iKin::iKinLimb::type
protected

Definition at line 877 of file iKinFwd.h.


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