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. | |
bool | setDynamicParameters (const double _m, const yarp::sig::Matrix &_HC, const yarp::sig::Matrix &_I) |
Set the dynamic parameters of the Link. | |
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). | |
bool | setInertia (const yarp::sig::Matrix &_I) |
Sets the link inertia. | |
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. | |
void | setMass (const double _m) |
Sets the link mass. | |
double | setAng (const double _teta) |
Sets the joint position (position constraints are evaluated). | |
double | setDAng (const double _dteta) |
Sets the joint velocity. | |
double | setD2Ang (const double _ddteta) |
Sets the joint acceleration. | |
const yarp::sig::Vector & | getLinVel () const |
Gets the linear velocity of the link. | |
const yarp::sig::Vector & | getLinVelC () const |
Gets the linear velocity of the COM. | |
void | setAngPosVelAcc (const double _teta, const double _dteta, const double _ddteta) |
Sets the joint angle position, velocity, acceleration. | |
bool | setCOM (const yarp::sig::Matrix &_HC) |
Set the roto-translation matrix from i to COM. | |
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) | |
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. | |
bool | setForce (const yarp::sig::Vector &_F) |
Sets the joint force, in the link frame: F^i_i. | |
bool | setMoment (const yarp::sig::Vector &_Mu) |
Sets the joint moment, in the link frame: Mu^i_i. | |
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. | |
void | setTorque (const double _Tau) |
Sets the joint moment, in the link frame: Tau_i. | |
const yarp::sig::Matrix & | getInertia () const |
Get the inertia matrix. | |
double | getMass () const |
Get the link mass. | |
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. | |
double | getDAng () const |
Get the joint velocity. | |
double | getD2Ang () const |
Get the joint acceleration. | |
const yarp::sig::Vector & | getW () const |
Get the angular velocity of the link. | |
const yarp::sig::Vector & | getdW () const |
Get the angular acceleration of the link. | |
const yarp::sig::Vector & | getdWM () const |
Get the angular acceleration of the motor. | |
const yarp::sig::Vector & | getLinAcc () const |
Get the linear acceleration of the link. | |
const yarp::sig::Vector & | getLinAccC () const |
Get the linear acceleration of the COM. | |
const yarp::sig::Vector & | getForce () const |
Get the link force. | |
const yarp::sig::Vector & | getMoment () const |
Get the link moment. | |
double | getTorque () const |
Get the joint torque. | |
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. | |
const yarp::sig::Matrix & | getR () |
Get the link rotational matrix, from the Denavit-Hartenberg matrix. | |
const yarp::sig::Matrix & | getRC () const |
Get the link COM's rotational matrix, from the COM matrix. | |
const yarp::sig::Vector & | getr (bool proj=false) |
Get the link distance vector r, or r*R if projection is specified. | |
const yarp::sig::Vector & | getrC (bool proj=false) const |
Get the COM distance vector rC, or rC*R if projection is specified. | |
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. | |
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. | |
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. | |
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. | |
iDynLink (const iDynLink &c) | |
Copy constructor. | |
void | zero () |
Set all dynamic parameters to zero. | |
iDynLink & | operator= (const iDynLink &c) |
Overload of operator =. | |
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. | |
iKinLink (const iKinLink &l) | |
Creates a new Link from an already existing Link object. | |
iKinLink & | operator= (const iKinLink &l) |
Copies a Link object into the current one. | |
void | setConstraint (bool _constrained) |
Sets the constraint status. | |
bool | getConstraint () const |
Returns the constraint status. | |
void | setVerbosity (unsigned int _verbose) |
Sets Link verbosity level. | |
unsigned int | getVerbosity () const |
Returns the current Link verbosity level. | |
bool | isBlocked () const |
Returns the Link blocking status. | |
double | getA () const |
Returns the Link length A. | |
void | setA (const double _A) |
Sets the Link length A. | |
double | getD () const |
Returns the Link offset D. | |
void | setD (const double _D) |
Sets the Link offset D. | |
double | getAlpha () const |
Returns the Link twist Alpha. | |
void | setAlpha (const double _Alpha) |
Sets the Link twist Alpha. | |
double | getOffset () const |
Returns the joint angle offset. | |
void | setOffset (const double _Offset) |
Sets the joint angle offset. | |
double | getMin () const |
Returns the joint angle lower bound. | |
void | setMin (const double _Min) |
Sets the joint angle lower bound. | |
double | getMax () const |
Returns the joint angle upper bound. | |
void | setMax (const double _Max) |
Sets the joint angle higher bound. | |
double | getAng () const |
Returns the current joint angle value. | |
double | setAng (double _Ang) |
Sets the joint angle value. | |
yarp::sig::Matrix | getH (bool c_override=false) |
Computes the homogeneous transformation matrix H of the Link. | |
yarp::sig::Matrix | getH (double _Ang, bool c_override=false) |
Same as getH() with specification of new joint angle position. | |
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. | |
virtual | ~iKinLink () |
Default destructor. | |
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. | |
virtual void | clone (const iDynLink &l) |
Clone function. | |
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 | |
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 | |
yarp::sig::Matrix | RC |
3x3, R^i_{C_i} rotational part of HC, constant | |
yarp::sig::Vector | rc |
3x1, r^i_{i,C_i}, translational part of HC, constant | |
yarp::sig::Vector | rc_proj |
yarp::sig::Matrix | I |
3x3, I^i_i, inertia matrix, constant | |
double | dq |
dq, joint vel | |
double | ddq |
ddq=d2q, joint acc | |
yarp::sig::Vector | w |
1x3, w^i_i angular velocity | |
yarp::sig::Vector | dw |
1x3, dw^i_i angular acceleration | |
yarp::sig::Vector | dwM |
1x3, dw^{i-1}_{m_i} angular acceleration of rotor | |
yarp::sig::Vector | dp |
1x3, dp^i_i linear velocity of frame i | |
yarp::sig::Vector | dpC |
1x3, dp^i_{C_i} linear velocity of center of mass C_i | |
yarp::sig::Vector | ddp |
1x3, d2p=ddp^i_i linear acceleration of frame i | |
yarp::sig::Vector | ddpC |
1x3, d2p=ddp^i_{C_i} linear acceleration of center of mass C_i | |
yarp::sig::Vector | F |
1x3, f^i_i force | |
yarp::sig::Vector | Mu |
1x3, mu^i_i moment | |
double | Tau |
tau_i joint torque | |
double | Im |
I_{m_i} rotor inertia. | |
double | kr |
k_{r,i} inertia constant | |
double | Fv |
F_{v,i} viscous friction. | |
double | Fs |
F_{s,i} static friction. | |
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 | ( | ) |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |