The class modelling an iCub limb. More...
Public Types | |
typedef iKinLimb_t | iKinLimb |
The type of limb. | |
Public Member Functions | |
KinematicLimb () | |
Constructor. | |
KinematicLimb (const std::string &type) | |
Constructor. | |
~KinematicLimb () | |
Destructor. | |
PhyJoint * | createJoint (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 KinematicLinkInfo & | getLinkInfo (int i) const |
Returns a reference to the information object for the i-th link. | |
KinematicLinkInfo & | getLinkInfo (int i) |
Returns a reference to the information object for the i-th link. | |
WObject * | getRootObject () const |
Returns the world object corresponding to this link. | |
const wMatrix & | getWorldMatrix () 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
|
inline |
Constructor.
Definition at line 1188 of file phyicubhelpers.h.
|
inline |
Constructor.
Use this only with limbs having a constructor accepting strings
- Parameters
-
type The string describing the type of link (generally "left" or "right")
Definition at line 1204 of file phyicubhelpers.h.
|
inline |
Destructor.
Definition at line 1215 of file phyicubhelpers.h.
Member Function Documentation
|
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
-
linkID the 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. invertAxis if true we inverted axis of the joint doConnection if true also connects the joint dof changedPosition signal to the KinematicLinkInfo setLinkAngle slot connType the signal-slot connection type dof the dof of the joint to use
- Returns
- the newly created joint
Definition at line 1370 of file phyicubhelpers.h.
Referenced by PhyiCub::PhyiCub().
|
inline |
Returns a reference to the information object for the i-th link.
- Parameters
-
i the 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().
|
inline |
Returns a reference to the information object for the i-th link.
- Parameters
-
i the id of the link whose information is requested
- Returns
- link information
Definition at line 1238 of file phyicubhelpers.h.
|
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.
|
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.
|
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
-
wObject the root world object
Definition at line 1332 of file phyicubhelpers.h.
Referenced by PhyiCub::PhyiCub().
|
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
-
mtr a 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().
|
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().
|
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
-
updateObjMatrixFromLink objects associated with links with an ID equal or greater than this will have their tranformation matrix updated, others don't. updateObjMatrixUpToLink objects 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:
- worldsim/include/phyicubhelpers.h