iCub-main
Loading...
Searching...
No Matches
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.
 
 iKinLimb (const std::string &_type)
 Constructor.
 
 iKinLimb (const iKinLimb &limb)
 Creates a new Limb from an already existing Limb object.
 
 iKinLimb (const yarp::os::Property &options)
 Creates a new Limb from a list of properties wherein links parameters are specified.
 
bool fromLinksProperties (const yarp::os::Property &options)
 Initializes the Limb from a list of properties wherein links parameters are specified.
 
bool toLinksProperties (yarp::os::Property &options)
 Provides the links attributes listed in a property object.
 
bool isValid () const
 Checks if the limb has been properly configured.
 
iKinLimboperator= (const iKinLimb &limb)
 Copies a Limb object into the current one.
 
iKinChainasChain ()
 Returns a pointer to the Limb seen as Chain object.
 
std::string getType () const
 Returns the Limb type as a string.
 
virtual bool alignJointsBounds (const std::deque< yarp::dev::IControlLimits * > &)
 Alignes the Limb joints bounds with current values set aboard the robot.
 
virtual ~iKinLimb ()
 Destructor.
 
- Public Member Functions inherited from iCub::iKin::iKinChain
 iKinChain ()
 Default constructor.
 
 iKinChain (const iKinChain &c)
 Creates a new Chain from an already existing Chain object.
 
iKinChainoperator= (const iKinChain &c)
 Copies a Chain object into the current one.
 
iKinChainoperator<< (iKinLink &l)
 Adds a Link at the bottom of the Chain.
 
iKinChainoperator-- (int)
 Removes a Link from the bottom of the Chain.
 
iKinLinkoperator[] (const unsigned int i)
 Returns a reference to the ith Link of the Chain.
 
iKinLinkoperator() (const unsigned int i)
 Returns a reference to the ith Link of the Chain considering only those Links related to DOF.
 
bool addLink (const unsigned int i, iKinLink &l)
 Adds a Link at the position ith within the Chain.
 
bool rmLink (const unsigned int i)
 Removes the ith Link from the Chain.
 
void pushLink (iKinLink &l)
 Adds a Link at the bottom of the Chain.
 
void clear ()
 Removes all Links.
 
void popLink ()
 Removes a Link from the bottom of the Chain.
 
bool blockLink (const unsigned int i, double Ang)
 Blocks the ith Link at the a certain value of its joint angle.
 
bool blockLink (const unsigned int i)
 Blocks the ith Link at the current value of its joint angle.
 
bool setBlockingValue (const unsigned int i, double Ang)
 Changes the value of the ith blocked Link.
 
bool releaseLink (const unsigned int i)
 Releases the ith Link.
 
bool isLinkBlocked (const unsigned int i)
 Queries whether the ith Link is blocked.
 
void setAllConstraints (bool _constrained)
 Sets the constraint status of all chain links.
 
void setConstraint (unsigned int i, bool _constrained)
 Sets the constraint status of ith link.
 
bool getConstraint (unsigned int i)
 Returns the constraint status of ith link.
 
void setAllLinkVerbosity (unsigned int _verbose)
 Sets the verbosity level of all Links belonging to the Chain.
 
void setVerbosity (unsigned int _verbose)
 Sets the verbosity level of the Chain.
 
unsigned int getVerbosity () const
 Returns the current Chain verbosity level.
 
unsigned int getN () const
 Returns the number of Links belonging to the Chain.
 
unsigned int getDOF () const
 Returns the current number of Chain's DOF.
 
yarp::sig::Matrix getH0 () const
 Returns H0, the rigid roto-translation matrix from the root reference frame to the 0th frame.
 
bool setH0 (const yarp::sig::Matrix &_H0)
 Sets H0, the rigid roto-translation matrix from the root reference frame to the 0th frame.
 
yarp::sig::Matrix getHN () const
 Returns HN, the rigid roto-translation matrix from the Nth frame to the end-effector.
 
bool setHN (const yarp::sig::Matrix &_HN)
 Sets HN, the rigid roto-translation matrix from the Nth frame to the end-effector.
 
yarp::sig::Vector setAng (const yarp::sig::Vector &q)
 Sets the free joint angles to values of q[i].
 
yarp::sig::Vector getAng ()
 Returns the current free joint angles values.
 
double setAng (const unsigned int i, double _Ang)
 Sets the ith joint angle.
 
double getAng (const unsigned int i)
 Returns the current angle of ith joint.
 
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.
 
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).
 
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).
 
yarp::sig::Vector Pose (const unsigned int i, const bool axisRep=true)
 Returns the coordinates of ith Link.
 
yarp::sig::Vector Position (const unsigned int i)
 Returns the 3D position coordinates of ith Link.
 
yarp::sig::Vector EndEffPose (const bool axisRep=true)
 Returns the coordinates of end-effector.
 
yarp::sig::Vector EndEffPose (const yarp::sig::Vector &q, const bool axisRep=true)
 Returns the coordinates of end-effector computed in q.
 
yarp::sig::Vector EndEffPosition ()
 Returns the 3D coordinates of end-effector position.
 
yarp::sig::Vector EndEffPosition (const yarp::sig::Vector &q)
 Returns the 3D coordinates of end-effector position computed in q.
 
yarp::sig::Matrix AnaJacobian (const unsigned int i, unsigned int col)
 Returns the analitical Jacobian of the ith link.
 
yarp::sig::Matrix AnaJacobian (unsigned int col=3)
 Returns the analitical Jacobian of the end-effector.
 
yarp::sig::Matrix AnaJacobian (const yarp::sig::Vector &q, unsigned int col=3)
 Returns the analitical Jacobian of the end-effector computed in q.
 
yarp::sig::Matrix GeoJacobian (const unsigned int i)
 Returns the geometric Jacobian of the ith link.
 
yarp::sig::Matrix GeoJacobian ()
 Returns the geometric Jacobian of the end-effector.
 
yarp::sig::Matrix GeoJacobian (const yarp::sig::Vector &q)
 Returns the geometric Jacobian of the end-effector computed in q.
 
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.
 
void prepareForHessian ()
 Prepares computation for a successive call to fastHessian_ij().
 
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.
 
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.
 
void prepareForHessian (const unsigned int lnk)
 Prepares computation for a successive call to fastHessian_ij() (link version).
 
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.
 
yarp::sig::Matrix DJacobian (const yarp::sig::Vector &dq)
 Compute the time derivative of the geometric Jacobian.
 
yarp::sig::Matrix DJacobian (const unsigned int lnk, const yarp::sig::Vector &dq)
 Compute the time derivative of the geometric Jacobian (link version).
 
virtual ~iKinChain ()
 Destructor.
 

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 872 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 894 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::iCubTorso, iCub::iKin::iCubArm, iCub::iKin::iCubFinger, iCub::iKin::iCubLeg, iCub::iKin::iCubEye, and iCub::iKin::iCubInertialSensor.

Definition at line 1030 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 1012 of file iKinFwd.h.

◆ clear()

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

Definition at line 897 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] (default=0.0).

D <double>: specifies the link offset [m] (default=0.0).

alpha <double>: specifies the link twist [deg] (default=0.0).

offset <double>: specifies the joint angle offset [deg] (default=0.0).

min <double>: specifies the joint angle lower bound [deg] (default=0.0).

max <double>: specifies the joint angle upper bound [deg] (default=0.0).

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:359
yarp::sig::Matrix HN
Definition iKinFwd.h:360
std::string type
Definition iKinFwd.h:876
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 1018 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 997 of file iKinFwd.h.

◆ operator()()

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

Definition at line 893 of file iKinFwd.h.

◆ operator--()

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

Definition at line 891 of file iKinFwd.h.

◆ operator<<()

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

Definition at line 890 of file iKinFwd.h.

◆ operator=() [1/2]

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

Definition at line 889 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 892 of file iKinFwd.h.

◆ popLink()

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

Definition at line 898 of file iKinFwd.h.

◆ pushLink() [1/2]

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

Definition at line 896 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 895 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 875 of file iKinFwd.h.

◆ type

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

Definition at line 876 of file iKinFwd.h.


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