KinematicLimb< iKinLimb_t > Class Template Reference

The class modelling an iCub limb. More...

Inheritance diagram for KinematicLimb< iKinLimb_t >:

Public Types

typedef iKinLimb_t iKinLimb
 The type of limb.
 

Public Member Functions

 KinematicLimb ()
 Constructor.
 
 KinematicLimb (const std::string &type)
 Constructor.
 
 ~KinematicLimb ()
 Destructor.
 
PhyJointcreateJoint (int linkID, bool invertAxis=true, bool doConnection=true, Qt::ConnectionType connType=Qt::DirectConnection, unsigned int dof=0)
 Creates and returns a joint associated with a link in this chain.
 
const KinematicLinkInfogetLinkInfo (int i) const
 Returns a reference to the information object for the i-th link.
 
KinematicLinkInfogetLinkInfo (int i)
 Returns a reference to the information object for the i-th link.
 
WObjectgetRootObject () const
 Returns the world object corresponding to this link.
 
const wMatrixgetWorldMatrix () const
 Returns the matrix to transform coordinates relative to the kinematic chain root frame to the world root frame.
 
void setRootObject (WObject *rootObject)
 Sets root object of the kinematic chain, to which the first link is connected.
 
void setWorldMatrix (const wMatrix *mtr)
 Sets the matrix to transform coordinates relative to the kinematic chain root frame to the world root frame for all link elements.
 
void updateInformationFromiKin ()
 Updates link information from iKin on all links.
 
void updateMatrixFromiKin (int updateObjMatrixFromLink=0, int updateObjMatrixUpToLink=-1)
 Updates link angles and the world object matrix.
 

Detailed Description

template<class iKinLimb_t>
class farsa::KinematicLimb< iKinLimb_t >

The class modelling an iCub limb.

This class inherits from a class describing the kinematic of an iCub link (e.g. iCubArm, iCubLeg...) and keeps a link of KinematicLinkInfo objects. The iKinLimb template parameter is the actual type of limb.

Note
You should manually set the WObject for each link by calling getLinkInfo(i).setWObject()
Warning
NEVER disable links, we strongly rely on all links being active

Definition at line 1176 of file phyicubhelpers.h.

Member Typedef Documentation

typedef iKinLimb_t iKinLimb

The type of limb.

Definition at line 1182 of file phyicubhelpers.h.

Constructor & Destructor Documentation

KinematicLimb ( )
inline

Constructor.

Definition at line 1188 of file phyicubhelpers.h.

KinematicLimb ( const std::string &  type)
inline

Constructor.

Use this only with limbs having a constructor accepting strings

Parameters
typeThe string describing the type of link (generally "left" or "right")

Definition at line 1204 of file phyicubhelpers.h.

~KinematicLimb ( )
inline

Destructor.

Definition at line 1215 of file phyicubhelpers.h.

Member Function Documentation

PhyJoint* createJoint ( int  linkID,
bool  invertAxis = true,
bool  doConnection = true,
Qt::ConnectionType  connType = Qt::DirectConnection,
unsigned int  dof = 0 
)
inline

Creates and returns a joint associated with a link in this chain.

The joint previously associated with this link is NOT destroyed. We create a PhyJoint object and keep a reference to it (in the LinkInfo object), but we don't have any responsability over it (i.e. we never destroy it).

Note
If the parent or the child object is of type PhyObjectsGroup, the head object of the group is used
Parameters
linkIDthe id of the link for which the joint is to be created. The joint will be between the object in the link having the linkID id and the one with link id (linkID-1). If linkID is 0 the joint will be connected to the root object.
invertAxisif true we inverted axis of the joint
doConnectionif true also connects the joint dof changedPosition signal to the KinematicLinkInfo setLinkAngle slot
connTypethe signal-slot connection type
dofthe dof of the joint to use
Returns
the newly created joint

Definition at line 1370 of file phyicubhelpers.h.

Referenced by PhyiCub::PhyiCub().

const KinematicLinkInfo& getLinkInfo ( int  i) const
inline

Returns a reference to the information object for the i-th link.

Parameters
ithe id of the link whose information is requested
Returns
link information

Definition at line 1226 of file phyicubhelpers.h.

Referenced by PhyiCub::configurePosture(), and PhyiCub::PhyiCub().

KinematicLinkInfo& getLinkInfo ( int  i)
inline

Returns a reference to the information object for the i-th link.

Parameters
ithe id of the link whose information is requested
Returns
link information

Definition at line 1238 of file phyicubhelpers.h.

WObject* getRootObject ( ) const
inline

Returns the world object corresponding to this link.

Returns
the world object corresponding to this link

Definition at line 1342 of file phyicubhelpers.h.

const wMatrix& getWorldMatrix ( ) const
inline

Returns the matrix to transform coordinates relative to the kinematic chain root frame to the world root frame.

See the description of KinematicLinkInfo::getWorldMatrix()

Returns
the matrix to transform coordinates relative to the kinematic chain root frame to the world root frame

Definition at line 1268 of file phyicubhelpers.h.

void setRootObject ( WObject rootObject)
inline

Sets root object of the kinematic chain, to which the first link is connected.

This is only needed to set the child object in the joint of the first link

Parameters
wObjectthe root world object

Definition at line 1332 of file phyicubhelpers.h.

Referenced by PhyiCub::PhyiCub().

void setWorldMatrix ( const wMatrix mtr)
inline

Sets the matrix to transform coordinates relative to the kinematic chain root frame to the world root frame for all link elements.

See the description of KinematicLinkInfo::setWorldMatrix()

Parameters
mtra pointer to the new world matrix (if NULL we use an identity matrix)

Definition at line 1252 of file phyicubhelpers.h.

Referenced by PhyiCub::PhyiCub().

void updateInformationFromiKin ( )
inline

Updates link information from iKin on all links.

This only updates the information about the link (top, bottom, height, axis), it doesn't touch the WObject matrix.

Definition at line 1279 of file phyicubhelpers.h.

Referenced by PhyiCub::PhyiCub().

void updateMatrixFromiKin ( int  updateObjMatrixFromLink = 0,
int  updateObjMatrixUpToLink = -1 
)
inline

Updates link angles and the world object matrix.

This first updates all the links, then sets the angles for all links of the chain, and finally reads the new iKin matrix and sets objects matrixes from that

Parameters
updateObjMatrixFromLinkobjects associated with links with an ID equal or greater than this will have their tranformation matrix updated, others don't.
updateObjMatrixUpToLinkobjects associated with links with an ID equal or less than this will have their tranformation matrix updated, others don't. Negative values means up to the last link

Definition at line 1304 of file phyicubhelpers.h.

Referenced by PhyiCub::changedMatrix(), PhyiCub::configurePosture(), PhyiCub::postUpdate(), and PhyiCub::preUpdate().


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