iCub-main
|
A base class for defining a Link with standard Denavit-Hartenberg convention, providing kinematic and dynamic information. More...
#include <iDyn.h>
Public Member Functions | |
bool | setDynamicParameters (const double _m, const yarp::sig::Matrix &_HC, const yarp::sig::Matrix &_I, const double _kr, const double _Fv, const double _Fs, const double _Im) |
Set the dynamic parameters of both Link and motor. More... | |
bool | setDynamicParameters (const double _m, const yarp::sig::Matrix &_HC, const yarp::sig::Matrix &_I) |
Set the dynamic parameters of the Link. More... | |
bool | setStaticParameters (const double _m, const yarp::sig::Matrix &_HC) |
Set the dynamic parameters of the Link if the chain is in a static situation (inertia is null). More... | |
bool | setInertia (const yarp::sig::Matrix &_I) |
Sets the link inertia. More... | |
void | setInertia (const double Ixx, const double Ixy, const double Ixz, const double Iyy, const double Iyz, const double Izz) |
Sets the link inertia matrix by setting the 6 inertial parameters. More... | |
void | setMass (const double _m) |
Sets the link mass. More... | |
double | setAng (const double _teta) |
Sets the joint position (position constraints are evaluated). More... | |
double | setDAng (const double _dteta) |
Sets the joint velocity. More... | |
double | setD2Ang (const double _ddteta) |
Sets the joint acceleration. More... | |
const yarp::sig::Vector & | getLinVel () const |
Gets the linear velocity of the link. More... | |
const yarp::sig::Vector & | getLinVelC () const |
Gets the linear velocity of the COM. More... | |
void | setAngPosVelAcc (const double _teta, const double _dteta, const double _ddteta) |
Sets the joint angle position, velocity, acceleration. More... | |
bool | setCOM (const yarp::sig::Matrix &_HC) |
Set the roto-translation matrix from i to COM. More... | |
bool | setCOM (const yarp::sig::Vector &_rC) |
Set the distance vector from i to COM; the rotation is not modified (set to identity as default) More... | |
void | setCOM (const double _rCx, const double _rCy, const double _rCz) |
Set the roto-translation matrix from i to COM, where the rotational part is and identity matrix, and the traslation is specified by the three parameters. More... | |
bool | setForce (const yarp::sig::Vector &_F) |
Sets the joint force, in the link frame: F^i_i. More... | |
bool | setMoment (const yarp::sig::Vector &_Mu) |
Sets the joint moment, in the link frame: Mu^i_i. More... | |
bool | setForceMoment (const yarp::sig::Vector &_F, const yarp::sig::Vector &_Mu) |
Sets the joint force and moment, in the link frame: F^i_i , Mu^i_i. More... | |
void | setTorque (const double _Tau) |
Sets the joint moment, in the link frame: Tau_i. More... | |
const yarp::sig::Matrix & | getInertia () const |
Get the inertia matrix. More... | |
double | getMass () const |
Get the link mass. More... | |
double | getIm () const |
double | getKr () const |
double | getFs () const |
double | getFv () const |
const yarp::sig::Matrix & | getCOM () const |
Get the roto-translational matrix describing the COM. More... | |
double | getDAng () const |
Get the joint velocity. More... | |
double | getD2Ang () const |
Get the joint acceleration. More... | |
const yarp::sig::Vector & | getW () const |
Get the angular velocity of the link. More... | |
const yarp::sig::Vector & | getdW () const |
Get the angular acceleration of the link. More... | |
const yarp::sig::Vector & | getdWM () const |
Get the angular acceleration of the motor. More... | |
const yarp::sig::Vector & | getLinAcc () const |
Get the linear acceleration of the link. More... | |
const yarp::sig::Vector & | getLinAccC () const |
Get the linear acceleration of the COM. More... | |
const yarp::sig::Vector & | getForce () const |
Get the link force. More... | |
const yarp::sig::Vector & | getMoment () const |
Get the link moment. More... | |
double | getTorque () const |
Get the joint torque. More... | |
const yarp::sig::Matrix & | getH () |
Redefine the getH of iKinLink so that it does not compute the H matrix if the joint angles have not changed since the last call to this method. More... | |
const yarp::sig::Matrix & | getR () |
Get the link rotational matrix, from the Denavit-Hartenberg matrix. More... | |
const yarp::sig::Matrix & | getRC () const |
Get the link COM's rotational matrix, from the COM matrix. More... | |
const yarp::sig::Vector & | getr (bool proj=false) |
Get the link distance vector r, or r*R if projection is specified. More... | |
const yarp::sig::Vector & | getrC (bool proj=false) const |
Get the COM distance vector rC, or rC*R if projection is specified. More... | |
iDynLink (double _A, double _D, double _Alpha, double _Offset, double _Min=-iCub::ctrl::CTRL_PI, double _Max=iCub::ctrl::CTRL_PI) | |
Constructor, with initialization of kinematic data; dynamic data are set to zero, while the roto-translational matrix for the COM. More... | |
iDynLink (const double _m, const yarp::sig::Matrix &_HC, const yarp::sig::Matrix &_I, double _A, double _D, double _Alpha, double _Offset, double _Min=-iCub::ctrl::CTRL_PI, double _Max=iCub::ctrl::CTRL_PI) | |
Constructor, with initialization of kinematic and dynamic data. More... | |
iDynLink (const double _m, const yarp::sig::Vector &_C, const yarp::sig::Matrix &_I, double _A, double _D, double _Alpha, double _Offset, double _Min=-iCub::ctrl::CTRL_PI, double _Max=iCub::ctrl::CTRL_PI) | |
Constructor, with initialization of kinematic and dynamic data. More... | |
iDynLink (const double _m, const double _rCx, const double _rCy, const double _rCz, const double Ixx, const double Ixy, const double Ixz, const double Iyy, const double Iyz, const double Izz, double _A, double _D, double _Alpha, double _Offset, double _Min=-iCub::ctrl::CTRL_PI, double _Max=iCub::ctrl::CTRL_PI) | |
Constructor, with initialization of kinematic and dynamic data. More... | |
iDynLink (const iDynLink &c) | |
Copy constructor. More... | |
void | zero () |
Set all dynamic parameters to zero. More... | |
iDynLink & | operator= (const iDynLink &c) |
Overload of operator =. More... | |
Public Member Functions inherited from iCub::iKin::iKinLink | |
iKinLink (double _A, double _D, double _Alpha, double _Offset, double _Min=-iCub::ctrl::CTRL_PI, double _Max=iCub::ctrl::CTRL_PI) | |
Constructor. More... | |
iKinLink (const iKinLink &l) | |
Creates a new Link from an already existing Link object. More... | |
iKinLink & | operator= (const iKinLink &l) |
Copies a Link object into the current one. More... | |
void | setConstraint (bool _constrained) |
Sets the constraint status. More... | |
bool | getConstraint () const |
Returns the constraint status. More... | |
void | setVerbosity (unsigned int _verbose) |
Sets Link verbosity level. More... | |
unsigned int | getVerbosity () const |
Returns the current Link verbosity level. More... | |
bool | isBlocked () const |
Returns the Link blocking status. More... | |
double | getA () const |
Returns the Link length A. More... | |
void | setA (const double _A) |
Sets the Link length A. More... | |
double | getD () const |
Returns the Link offset D. More... | |
void | setD (const double _D) |
Sets the Link offset D. More... | |
double | getAlpha () const |
Returns the Link twist Alpha. More... | |
void | setAlpha (const double _Alpha) |
Sets the Link twist Alpha. More... | |
double | getOffset () const |
Returns the joint angle offset. More... | |
void | setOffset (const double _Offset) |
Sets the joint angle offset. More... | |
double | getMin () const |
Returns the joint angle lower bound. More... | |
void | setMin (const double _Min) |
Sets the joint angle lower bound. More... | |
double | getMax () const |
Returns the joint angle upper bound. More... | |
void | setMax (const double _Max) |
Sets the joint angle higher bound. More... | |
double | getAng () const |
Returns the current joint angle value. More... | |
double | setAng (double _Ang) |
Sets the joint angle value. More... | |
yarp::sig::Matrix | getH (bool c_override=false) |
Computes the homogeneous transformation matrix H of the Link. More... | |
yarp::sig::Matrix | getH (double _Ang, bool c_override=false) |
Same as getH() with specification of new joint angle position. More... | |
yarp::sig::Matrix | getDnH (unsigned int n=1, bool c_override=false) |
Computes the derivative of order n of the homogeneous transformation matrix H with respect to the joint angle. More... | |
virtual | ~iKinLink () |
Default destructor. More... | |
virtual void | setPosVelAcc (const double, const double, const double) |
virtual bool | setForce (const yarp::sig::Vector &, const yarp::sig::Vector &) |
virtual const yarp::sig::Matrix & | getRC () |
virtual const yarp::sig::Vector & | getr () |
virtual const yarp::sig::Vector & | getrC () |
Protected Member Functions | |
iDynLink () | |
Default constructor : not implemented. More... | |
virtual void | clone (const iDynLink &l) |
Clone function. More... | |
virtual void | updateHstore () |
Protected Member Functions inherited from iCub::iKin::iKinLink | |
iKinLink () | |
virtual void | clone (const iKinLink &l) |
bool | isCumulative () |
void | block () |
void | block (double _Ang) |
void | release () |
void | rmCumH () |
void | addCumH (const yarp::sig::Matrix &_cumH) |
Protected Attributes | |
yarp::sig::Matrix | H_store |
yarp::sig::Matrix | R_store |
yarp::sig::Vector | r_store |
yarp::sig::Vector | r_proj_store |
bool | H_store_valid |
double | m |
m_i, mass More... | |
yarp::sig::Matrix | HC |
4x4, H^i_{C_i} = R^i_{C_i}, r^i_{i,C_i}, roto-translation matrix from i to Ci, constant More... | |
yarp::sig::Matrix | RC |
3x3, R^i_{C_i} rotational part of HC, constant More... | |
yarp::sig::Vector | rc |
3x1, r^i_{i,C_i}, translational part of HC, constant More... | |
yarp::sig::Vector | rc_proj |
yarp::sig::Matrix | I |
3x3, I^i_i, inertia matrix, constant More... | |
double | dq |
dq, joint vel More... | |
double | ddq |
ddq=d2q, joint acc More... | |
yarp::sig::Vector | w |
1x3, w^i_i angular velocity More... | |
yarp::sig::Vector | dw |
1x3, dw^i_i angular acceleration More... | |
yarp::sig::Vector | dwM |
1x3, dw^{i-1}_{m_i} angular acceleration of rotor More... | |
yarp::sig::Vector | dp |
1x3, dp^i_i linear velocity of frame i More... | |
yarp::sig::Vector | dpC |
1x3, dp^i_{C_i} linear velocity of center of mass C_i More... | |
yarp::sig::Vector | ddp |
1x3, d2p=ddp^i_i linear acceleration of frame i More... | |
yarp::sig::Vector | ddpC |
1x3, d2p=ddp^i_{C_i} linear acceleration of center of mass C_i More... | |
yarp::sig::Vector | F |
1x3, f^i_i force More... | |
yarp::sig::Vector | Mu |
1x3, mu^i_i moment More... | |
double | Tau |
tau_i joint torque More... | |
double | Im |
I_{m_i} rotor inertia. More... | |
double | kr |
k_{r,i} inertia constant More... | |
double | Fv |
F_{v,i} viscous friction. More... | |
double | Fs |
F_{s,i} static friction. More... | |
Protected Attributes inherited from iCub::iKin::iKinLink | |
double | A |
double | D |
double | Alpha |
double | Offset |
double | c_alpha |
double | s_alpha |
double | Min |
double | Max |
double | Ang |
bool | blocked |
bool | cumulative |
bool | constrained |
unsigned int | verbose |
yarp::sig::Matrix | H |
yarp::sig::Matrix | cumH |
yarp::sig::Matrix | DnH |
const yarp::sig::Matrix | zeros1x1 |
const yarp::sig::Vector | zeros1 |
Friends | |
class | iDynChain |
class | OneLinkNewtonEuler |
A base class for defining a Link with standard Denavit-Hartenberg convention, providing kinematic and dynamic information.
|
protected |
Default constructor : not implemented.
iDynLink::iDynLink | ( | double | _A, |
double | _D, | ||
double | _Alpha, | ||
double | _Offset, | ||
double | _Min = -iCub::ctrl::CTRL_PI , |
||
double | _Max = iCub::ctrl::CTRL_PI |
||
) |
Constructor, with initialization of kinematic data; dynamic data are set to zero, while the roto-translational matrix for the COM.
_A | is the link length |
_D | is the link offset |
_Alpha | is the link twist |
_Offset | is the joint angle offset in [-pi,pi] |
_Min | is the joint angle lower bound in [-pi,pi] (-pi by default) |
_Max | is the joint angle higher bound in [-pi,pi] (pi by default) |
iCub::iDyn::iDynLink::iDynLink | ( | const double | _m, |
const yarp::sig::Matrix & | _HC, | ||
const yarp::sig::Matrix & | _I, | ||
double | _A, | ||
double | _D, | ||
double | _Alpha, | ||
double | _Offset, | ||
double | _Min = -iCub::ctrl::CTRL_PI , |
||
double | _Max = iCub::ctrl::CTRL_PI |
||
) |
Constructor, with initialization of kinematic and dynamic data.
_m | is the Link mass |
_HC | is the rototranslation matrix from the link frame to the center of mass |
_I | is the Inertia matrix |
_A | is the Link length |
_D | is the Link offset |
_Alpha | is the Link twist |
_Offset | is the joint angle offset in [-pi,pi] |
_Min | is the joint angle lower bound in [-pi,pi] (-pi by default) |
_Max | is the joint angle higher bound in [-pi,pi] (pi by default) |
iCub::iDyn::iDynLink::iDynLink | ( | const double | _m, |
const yarp::sig::Vector & | _C, | ||
const yarp::sig::Matrix & | _I, | ||
double | _A, | ||
double | _D, | ||
double | _Alpha, | ||
double | _Offset, | ||
double | _Min = -iCub::ctrl::CTRL_PI , |
||
double | _Max = iCub::ctrl::CTRL_PI |
||
) |
Constructor, with initialization of kinematic and dynamic data.
_m | is the Link mass |
_C | is the distance vector of COM wrt the link frame, the orientation of COM is the same of the link |
_I | is the Inertia matrix |
_A | is the Link length |
_D | is the Link offset |
_Alpha | is the Link twist |
_Offset | is the joint angle offset in [-pi,pi] |
_Min | is the joint angle lower bound in [-pi,pi] (-pi by default) |
_Max | is the joint angle higher bound in [-pi,pi] (pi by default) |
iDynLink::iDynLink | ( | const double | _m, |
const double | _rCx, | ||
const double | _rCy, | ||
const double | _rCz, | ||
const double | Ixx, | ||
const double | Ixy, | ||
const double | Ixz, | ||
const double | Iyy, | ||
const double | Iyz, | ||
const double | Izz, | ||
double | _A, | ||
double | _D, | ||
double | _Alpha, | ||
double | _Offset, | ||
double | _Min = -iCub::ctrl::CTRL_PI , |
||
double | _Max = iCub::ctrl::CTRL_PI |
||
) |
Constructor, with initialization of kinematic and dynamic data.
_m | is the Link mass |
_rCx | is the x component of the distance vector of COM wrt the link frame |
_rCy | is the y component of the distance vector of COM wrt the link frame |
_rCz | is the z component of the distance vector of COM wrt the link frame |
Ixx | is the xx component of the inertia matrix of the link |
Ixy | is the xy component of the inertia matrix of the link |
Ixz | is the xz component of the inertia matrix of the link |
Iyy | is the yy component of the inertia matrix of the link |
Iyz | is the yz component of the inertia matrix of the link |
Izz | is the zz component of the inertia matrix of the link |
_A | is the Link length |
_D | is the Link offset |
_Alpha | is the Link twist |
_Offset | is the joint angle offset in [-pi,pi] |
_Min | is the joint angle lower bound in [-pi,pi] (-pi by default) |
_Max | is the joint angle higher bound in [-pi,pi] (pi by default) |
|
protectedvirtual |
|
virtual |
Get the roto-translational matrix describing the COM.
Reimplemented from iCub::iKin::iKinLink.
|
virtual |
Get the joint acceleration.
Reimplemented from iCub::iKin::iKinLink.
|
virtual |
|
virtual |
Get the angular acceleration of the link.
Reimplemented from iCub::iKin::iKinLink.
|
virtual |
Get the angular acceleration of the motor.
Reimplemented from iCub::iKin::iKinLink.
|
virtual |
|
virtual |
Reimplemented from iCub::iKin::iKinLink.
|
virtual |
Reimplemented from iCub::iKin::iKinLink.
const Matrix & iDynLink::getH | ( | ) |
|
virtual |
Reimplemented from iCub::iKin::iKinLink.
|
virtual |
|
virtual |
Reimplemented from iCub::iKin::iKinLink.
|
virtual |
Get the linear acceleration of the link.
Reimplemented from iCub::iKin::iKinLink.
|
virtual |
Get the linear acceleration of the COM.
Reimplemented from iCub::iKin::iKinLink.
|
virtual |
Gets the linear velocity of the link.
Reimplemented from iCub::iKin::iKinLink.
|
virtual |
Gets the linear velocity of the COM.
Reimplemented from iCub::iKin::iKinLink.
|
virtual |
|
virtual |
|
virtual |
Get the link rotational matrix, from the Denavit-Hartenberg matrix.
Reimplemented from iCub::iKin::iKinLink.
const Vector & iDynLink::getr | ( | bool | proj = false | ) |
const Matrix & iDynLink::getRC | ( | ) | const |
const Vector & iDynLink::getrC | ( | bool | proj = false | ) | const |
|
virtual |
|
virtual |
Get the angular velocity of the link.
Reimplemented from iCub::iKin::iKinLink.
double iDynLink::setAng | ( | const double | _teta | ) |
void iDynLink::setAngPosVelAcc | ( | const double | _teta, |
const double | _dteta, | ||
const double | _ddteta | ||
) |
void iDynLink::setCOM | ( | const double | _rCx, |
const double | _rCy, | ||
const double | _rCz | ||
) |
Set the roto-translation matrix from i to COM, where the rotational part is and identity matrix, and the traslation is specified by the three parameters.
_rCx | is the x component of the distance vector of COM wrt the link frame |
_rCy | is the y component of the distance vector of COM wrt the link frame |
_rCz | is the z component of the distance vector of COM wrt the link frame |
|
virtual |
Set the roto-translation matrix from i to COM.
_HC | is the roto-translational matrix describing the rotation of the link reference frame w.r.t. the COM and the distance vector bewteen them |
Reimplemented from iCub::iKin::iKinLink.
|
virtual |
Set the distance vector from i to COM; the rotation is not modified (set to identity as default)
_rC | is distance vector bewteen the link reference frame and the COM |
Reimplemented from iCub::iKin::iKinLink.
|
virtual |
Sets the joint acceleration.
_ddteta | is the new acceleration value |
Reimplemented from iCub::iKin::iKinLink.
|
virtual |
Sets the joint velocity.
_dteta | is the new velocity value |
Reimplemented from iCub::iKin::iKinLink.
|
virtual |
Set the dynamic parameters of the Link.
_m | is the Link mass |
_HC | is the rototranslation matrix from the link frame to the center of mass |
_I | is the Inertia matrix |
Reimplemented from iCub::iKin::iKinLink.
|
virtual |
Set the dynamic parameters of both Link and motor.
_m | is the Link mass |
_HC | is the rototranslation matrix from the link frame to the center of mass |
_I | is the Inertia matrix |
_kr | is the rotor constant |
_Fv | is the viscous friction constant |
_Fs | is the static friction constant |
_Im | is the rotor inertia |
Reimplemented from iCub::iKin::iKinLink.
bool iDynLink::setForce | ( | const yarp::sig::Vector & | _F | ) |
bool iDynLink::setForceMoment | ( | const yarp::sig::Vector & | _F, |
const yarp::sig::Vector & | _Mu | ||
) |
void iDynLink::setInertia | ( | const double | Ixx, |
const double | Ixy, | ||
const double | Ixz, | ||
const double | Iyy, | ||
const double | Iyz, | ||
const double | Izz | ||
) |
Sets the link inertia matrix by setting the 6 inertial parameters.
Ixx | is the xx component of the inertia matrix of the link |
Ixy | is the xy component of the inertia matrix of the link |
Ixz | is the xz component of the inertia matrix of the link |
Iyy | is the yy component of the inertia matrix of the link |
Iyz | is the yz component of the inertia matrix of the link |
Izz | is the zz component of the inertia matrix of the link |
|
virtual |
Sets the link inertia.
_I | is the inertia matrix |
Reimplemented from iCub::iKin::iKinLink.
|
virtual |
|
virtual |
Sets the joint moment, in the link frame: Mu^i_i.
_Mu | is the measured/computed moment |
Reimplemented from iCub::iKin::iKinLink.
|
virtual |
Set the dynamic parameters of the Link if the chain is in a static situation (inertia is null).
_m | is the Link mass |
_HC | is the rototranslation matrix from the link frame to the center of mass |
Reimplemented from iCub::iKin::iKinLink.
|
virtual |
Sets the joint moment, in the link frame: Tau_i.
_Tau | is the measured/computed moment |
Reimplemented from iCub::iKin::iKinLink.
void iDynLink::zero | ( | void | ) |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |