iCub-main
|
A Base class for defining a Serial Link Chain. More...
#include <iKinFwd.h>
Public Member Functions | |
iKinChain () | |
Default constructor. More... | |
iKinChain (const iKinChain &c) | |
Creates a new Chain from an already existing Chain object. More... | |
iKinChain & | operator= (const iKinChain &c) |
Copies a Chain object into the current one. More... | |
iKinChain & | operator<< (iKinLink &l) |
Adds a Link at the bottom of the Chain. More... | |
iKinChain & | operator-- (int) |
Removes a Link from the bottom of the Chain. More... | |
iKinLink & | operator[] (const unsigned int i) |
Returns a reference to the ith Link of the Chain. More... | |
iKinLink & | operator() (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 | clone (const iKinChain &c) |
virtual void | build () |
virtual void | dispose () |
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 | |
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 |
iKinChain::iKinChain | ( | ) |
Default constructor.
Definition at line 256 of file iKinFwd.cpp.
iKinChain::iKinChain | ( | const iKinChain & | c | ) |
Creates a new Chain from an already existing Chain object.
c | is the Chain to be copied. |
Definition at line 283 of file iKinFwd.cpp.
|
virtual |
Destructor.
Definition at line 1300 of file iKinFwd.cpp.
bool iKinChain::addLink | ( | const unsigned int | i, |
iKinLink & | l | ||
) |
Adds a Link at the position ith within the Chain.
i | is the ith position where the Link is to be added. |
l | is the Link to be added. |
Definition at line 299 of file iKinFwd.cpp.
Matrix iKinChain::AnaJacobian | ( | const unsigned int | i, |
unsigned int | col | ||
) |
Returns the analitical Jacobian of the ith link.
i | is the Link number. |
col | selects the part of the derived homogeneous matrix to be put in the upper side of the Jacobian matrix: 0 => x, 1 => y, 2 => z, 3 => p |
Definition at line 911 of file iKinFwd.cpp.
yarp::sig::Matrix iCub::iKin::iKinChain::AnaJacobian | ( | const yarp::sig::Vector & | q, |
unsigned int | col = 3 |
||
) |
Returns the analitical Jacobian of the end-effector computed in q.
q | is the vector of new DOF values. |
col | selects the part of the derived homogeneous matrix to be put in the upper side of the Jacobian matrix: 0 => x, 1 => y, 2 => z, 3 => p (default) |
Matrix iKinChain::AnaJacobian | ( | unsigned int | col = 3 | ) |
Returns the analitical Jacobian of the end-effector.
col | selects the part of the derived homogeneous matrix to be put in the upper side of the Jacobian matrix: 0 => x, 1 => y, 2 => z, 3 => p (default) |
Definition at line 957 of file iKinFwd.cpp.
|
inline |
bool iKinChain::blockLink | ( | const unsigned int | i, |
double | Ang | ||
) |
Blocks the ith Link at the a certain value of its joint angle.
Chain DOF reduced by one.
i | is the Link number. |
Ang | is the value of joint angle to which the Link is blocked. |
Definition at line 394 of file iKinFwd.cpp.
|
protectedvirtual |
Reimplemented in iCub::iDyn::iDynChain.
Definition at line 514 of file iKinFwd.cpp.
void iKinChain::clear | ( | ) |
Removes all Links.
Definition at line 353 of file iKinFwd.cpp.
|
protectedvirtual |
Definition at line 264 of file iKinFwd.cpp.
|
protected |
Definition at line 686 of file iKinFwd.cpp.
|
protectedvirtual |
Reimplemented in iCub::iKin::iKinLimb, iCub::iDyn::iDynLimb, and iCub::iDyn::iDynChain.
Definition at line 1307 of file iKinFwd.cpp.
yarp::sig::Matrix iCub::iKin::iKinChain::DJacobian | ( | const unsigned int | lnk, |
const yarp::sig::Vector & | dq | ||
) |
Compute the time derivative of the geometric Jacobian (link version).
lnk | is the Link number up to which consider the computation. |
dq | the (lnk-1)x1 joint velocity vector. |
yarp::sig::Matrix iCub::iKin::iKinChain::DJacobian | ( | const yarp::sig::Vector & | dq | ) |
Compute the time derivative of the geometric Jacobian.
dq | the joint velocities. |
|
protected |
Definition at line 673 of file iKinFwd.cpp.
Vector iKinChain::EndEffPose | ( | const bool | axisRep = true | ) |
Returns the coordinates of end-effector.
Two notations are provided: the first with Euler Angles (XYZ form=>6x1 output vector) and second with axis/angle representation (default=>7x1 output vector).
axisRep | if true returns the axis/angle notation. |
Definition at line 850 of file iKinFwd.cpp.
yarp::sig::Vector iCub::iKin::iKinChain::EndEffPose | ( | const yarp::sig::Vector & | q, |
const bool | axisRep = true |
||
) |
Returns the coordinates of end-effector computed in q.
Two notations are provided: the first with Euler Angles (XYZ form=>6x1 output vector) and second with axis/angle representation (default=>7x1 output vector).
q | is the vector of new DOF values. |
axisRep | if true returns the axis/angle notation. |
Vector iKinChain::EndEffPosition | ( | ) |
Returns the 3D coordinates of end-effector position.
Definition at line 894 of file iKinFwd.cpp.
yarp::sig::Vector iCub::iKin::iKinChain::EndEffPosition | ( | const yarp::sig::Vector & | q | ) |
Returns the 3D coordinates of end-effector position computed in q.
q | is the vector of new DOF values. |
Vector iKinChain::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.
Fast Version: to be used in conjunction with prepareForHessian().
i | is the index of the first DOF. |
j | is the index of the second DOF. |
Definition at line 1117 of file iKinFwd.cpp.
Vector iKinChain::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.
Fast Version: to be used in conjunction with prepareForHessian(lnk).
lnk | is the Link number up to which consider the computation. |
i | is the index of the first link. |
j | is the index of the second link. |
Definition at line 1173 of file iKinFwd.cpp.
Matrix iKinChain::GeoJacobian | ( | ) |
Returns the geometric Jacobian of the end-effector.
Definition at line 1048 of file iKinFwd.cpp.
Matrix iKinChain::GeoJacobian | ( | const unsigned int | i | ) |
Returns the geometric Jacobian of the ith link.
i | is the Link number. |
Definition at line 1012 of file iKinFwd.cpp.
yarp::sig::Matrix iCub::iKin::iKinChain::GeoJacobian | ( | const yarp::sig::Vector & | q | ) |
Returns the geometric Jacobian of the end-effector computed in q.
q | is the vector of new DOF values. |
Vector iKinChain::getAng | ( | ) |
Returns the current free joint angles values.
Definition at line 611 of file iKinFwd.cpp.
double iKinChain::getAng | ( | const unsigned int | i | ) |
Returns the current angle of ith joint.
i | is the Link number. |
Definition at line 645 of file iKinFwd.cpp.
|
inline |
|
inline |
Matrix iKinChain::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).
Definition at line 778 of file iKinFwd.cpp.
Matrix iKinChain::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.
The second parameter if true enables the spannig over the full set of links, i.e. the blocked links as well.
i | is the Link number. |
allLink | if true enables the spanning over the full set of links (false by default). |
Definition at line 732 of file iKinFwd.cpp.
yarp::sig::Matrix iCub::iKin::iKinChain::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).
q | is the vector of new DOF values. |
|
inline |
|
inline |
|
inline |
|
inline |
Vector iKinChain::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.
i | is the index of the first DOF. |
j | is the index of the second DOF. |
Definition at line 1094 of file iKinFwd.cpp.
Vector iKinChain::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.
lnk | is the Link number up to which consider the computation. |
i | is the index of the first link. |
j | is the index of the second link. |
Definition at line 1149 of file iKinFwd.cpp.
bool iKinChain::isLinkBlocked | ( | const unsigned int | i | ) |
Queries whether the ith Link is blocked.
i | is the Link number. |
Definition at line 483 of file iKinFwd.cpp.
|
inline |
iKinChain & iKinChain::operator-- | ( | int | ) |
Removes a Link from the bottom of the Chain.
Definition at line 385 of file iKinFwd.cpp.
Adds a Link at the bottom of the Chain.
l | is the Link to be added. |
Definition at line 366 of file iKinFwd.cpp.
Copies a Chain object into the current one.
c | is a reference to an object of type iKinChain. |
Definition at line 290 of file iKinFwd.cpp.
|
inline |
void iKinChain::popLink | ( | ) |
Removes a Link from the bottom of the Chain.
Definition at line 375 of file iKinFwd.cpp.
Vector iKinChain::Pose | ( | const unsigned int | i, |
const bool | axisRep = true |
||
) |
Returns the coordinates of ith Link.
Two notations are provided: the first with Euler Angles (XYZ form=>6x1 output vector) and second with axis/angle representation (default=>7x1 output vector).
i | is the Link number. |
axisRep | if true returns the axis/angle notation. |
Definition at line 803 of file iKinFwd.cpp.
Vector iKinChain::Position | ( | const unsigned int | i | ) |
Returns the 3D position coordinates of ith Link.
i | is the Link number. |
Definition at line 842 of file iKinFwd.cpp.
void iKinChain::prepareForHessian | ( | ) |
Prepares computation for a successive call to fastHessian_ij().
Definition at line 1102 of file iKinFwd.cpp.
void iKinChain::prepareForHessian | ( | const unsigned int | lnk | ) |
Prepares computation for a successive call to fastHessian_ij() (link version).
lnk | is the Link number up to which consider the computation. |
Definition at line 1158 of file iKinFwd.cpp.
void iKinChain::pushLink | ( | iKinLink & | l | ) |
Adds a Link at the bottom of the Chain.
l | is the Link to be added. |
Definition at line 343 of file iKinFwd.cpp.
bool iKinChain::releaseLink | ( | const unsigned int | i | ) |
Releases the ith Link.
Chain DOF augmented by one.
i | is the Link number. |
Definition at line 463 of file iKinFwd.cpp.
bool iKinChain::rmLink | ( | const unsigned int | i | ) |
Removes the ith Link from the Chain.
i | is the ith position from which the Link is to be removed. |
Definition at line 321 of file iKinFwd.cpp.
|
protected |
Definition at line 659 of file iKinFwd.cpp.
void iKinChain::setAllConstraints | ( | bool | _constrained | ) |
Sets the constraint status of all chain links.
_constrained | is the new constraint status. |
Definition at line 498 of file iKinFwd.cpp.
void iKinChain::setAllLinkVerbosity | ( | unsigned int | _verbose | ) |
Sets the verbosity level of all Links belonging to the Chain.
_verbose | is the verbosity level. |
Definition at line 506 of file iKinFwd.cpp.
double iKinChain::setAng | ( | const unsigned int | i, |
double | _Ang | ||
) |
Sets the ith joint angle.
i | is the Link number. |
Ang | the new angle's value. |
Definition at line 623 of file iKinFwd.cpp.
yarp::sig::Vector iCub::iKin::iKinChain::setAng | ( | const yarp::sig::Vector & | q | ) |
Sets the free joint angles to values of q[i].
q | is a vector containing values for DOF. |
bool iKinChain::setBlockingValue | ( | const unsigned int | i, |
double | Ang | ||
) |
Changes the value of the ith blocked Link.
Avoid the overhead required for DOFs handling.
i | is the Link number. |
Ang | is the new value of joint angle to which the Link is blocked. |
Definition at line 414 of file iKinFwd.cpp.
|
inline |
bool iKinChain::setH0 | ( | const yarp::sig::Matrix & | _H0 | ) |
Sets H0, the rigid roto-translation matrix from the root reference frame to the 0th frame.
H0 |
Definition at line 562 of file iKinFwd.cpp.
bool iKinChain::setHN | ( | const yarp::sig::Matrix & | _HN | ) |
Sets HN, the rigid roto-translation matrix from the Nth frame to the end-effector.
HN |
Definition at line 580 of file iKinFwd.cpp.
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |