iCub-main
Public Member Functions | Protected Attributes | List of all members
iCub::iDyn::FinalLinkNewtonEuler Class Reference

A class for setting a virtual final link: this is useful to initialize the backward phase of Newton-Euler's method, by setting F, Mu; H is an identity matrix, while ddpC=ddp; Note that this is a virtual link, since there's no iDynLink attached: it is just necessary to make the recursive Newton-Euler computations. More...

#include <iDynInv.h>

+ Inheritance diagram for iCub::iDyn::FinalLinkNewtonEuler:

Public Member Functions

 FinalLinkNewtonEuler (const yarp::sig::Matrix &_HN, const NewEulMode _mode, unsigned int verb=iCub::skinDynLib::NO_VERBOSE)
 Default constructor. More...
 
 FinalLinkNewtonEuler (const yarp::sig::Matrix &_HN, const yarp::sig::Vector &_F, const yarp::sig::Vector &_Mu, const NewEulMode _mode, unsigned int verb=iCub::skinDynLib::NO_VERBOSE)
 Constructor, initializing the final frame data. More...
 
bool setAsFinal (const yarp::sig::Vector &_F, const yarp::sig::Vector &_Mu)
 Set the final frame data. More...
 
bool setAsFinal (const yarp::sig::Vector &_w, const yarp::sig::Vector &_dw, const yarp::sig::Vector &_ddp)
 Set the final frame data. More...
 
const yarp::sig::Vector & getForce () const
 
const yarp::sig::Vector & getMoment (bool isBase=false) const
 
const yarp::sig::Vector & getAngVel () const
 
const yarp::sig::Vector & getAngAcc () const
 
const yarp::sig::Vector & getAngAccM () const
 
const yarp::sig::Vector & getLinAcc () const
 
const yarp::sig::Vector & getLinAccC () const
 
double getTorque () const
 
const yarp::sig::Matrix & getH ()
 
const yarp::sig::Matrix & getR ()
 
const yarp::sig::Matrix & getRC ()
 
double getIm () const
 
double getFs () const
 
double getFv () const
 
double getD2q () const
 
double getDq () const
 
double getKr () const
 
double getMass () const
 
const yarp::sig::Matrix & getInertia () const
 
const yarp::sig::Vector & getr (bool proj=false)
 
const yarp::sig::Vector & getrC (bool proj=false)
 
bool setForce (const yarp::sig::Vector &_F)
 Set the OneLink force: either the corresponding iDynLink force, or the one declared as member in the child classes derived from OneLink, such as SensorLink. More...
 
bool setMoment (const yarp::sig::Vector &_Mu)
 Set the OneLink moment: either the corresponding iDynLink moment, or the one declared as member in the child classes derived from OneLink, such as SensorLink. More...
 
void setTorque (const double _Tau)
 Set the OneLink torque, ie the corresponding iDynLink joint torque (nothing in the child classes derived from OneLink, such as SensorLink) More...
 
bool setAngVel (const yarp::sig::Vector &_w)
 Set the OneLink angular velocity (w), ie the corresponding iDynLink angular velocity (w) (in the child classes derived from OneLink, it depends) More...
 
bool setAngAcc (const yarp::sig::Vector &_dw)
 Set the OneLink angular acceleration (dw), ie the corresponding iDynLink angular acceleration (dw) (in the child classes derived from OneLink, it depends) More...
 
bool setLinAcc (const yarp::sig::Vector &_ddp)
 Set the OneLink linear acceleration (ddp), ie the corresponding iDynLink linear acceleration (ddp) (in the child classes derived from OneLink, it depends) More...
 
bool setLinAccC (const yarp::sig::Vector &_ddpC)
 Set the OneLink linear acceleration of the COM (ddpC), ie the corresponding iDynLink linear acceleration of the COM (ddpC) (nothing in the child classes derived from OneLink, except for SensorLink) More...
 
bool setAngAccM (const yarp::sig::Vector &_dwM)
 Set the OneLink angular acceleration of the motor (dwM), ie the corresponding iDynLink angular acceleration of the COM (dwM) (nothing in the child classes derived from OneLink) More...
 
std::string toString () const
 Useful to print some information. More...
 
- Public Member Functions inherited from iCub::iDyn::OneLinkNewtonEuler
 OneLinkNewtonEuler (iDyn::iDynLink *dlink=NULL)
 Default constructor. More...
 
 OneLinkNewtonEuler (const NewEulMode _mode, unsigned int verb=iCub::skinDynLib::NO_VERBOSE, iDyn::iDynLink *dlink=NULL)
 Constructor, with initialization of some data. More...
 
virtual ~OneLinkNewtonEuler ()
 Destructor. More...
 
void zero ()
 Set everything to zero; R is set to an identity matrix. More...
 
virtual bool setAsBase (const yarp::sig::Vector &_w, const yarp::sig::Vector &_dw, const yarp::sig::Vector &_ddp)
 Virtual method to set the frame as the base one: this is useful to initialize the forward phase of Newton-Euler's method. More...
 
virtual bool setAsBase (const yarp::sig::Vector &_F, const yarp::sig::Vector &_Mu)
 
virtual bool setMeasuredFMu (const yarp::sig::Vector &_F, const yarp::sig::Vector &_Mu)
 Set measured force and moment in a 'sensor' frame: this is useful to initialize the forward phase of the Inverse Newton-Euler's method, by setting F and Mu, measured by the corresponding F/T sensor. More...
 
virtual bool setMeasuredTorque (const double _Tau)
 Set measured torque in a joint torque sensor frame
More...
 
void setVerbose (unsigned int verb=iCub::skinDynLib::VERBOSE)
 Set the verbosity level of comments during operations. More...
 
void setMode (const NewEulMode _mode)
 Set the operation mode (static,dynamic etc) More...
 
bool setZM (const yarp::sig::Vector &_zm)
 Set the zM vector. More...
 
void setInfo (const std::string &_info)
 Set some information about this OneLink class. More...
 
NewEulMode getMode () const
 
yarp::sig::Vector getZM () const
 
std::string getInfo () const
 
void ForwardKinematics (OneLinkNewtonEuler *prev)
 [Forward Newton-Euler] Compute w, dw, ddp, ddpC, dwM More...
 
void BackwardKinematics (OneLinkNewtonEuler *prev)
 [Backward Kinematic computation] Compute w, dw, ddp, ddpC, dwM More...
 
void BackwardWrench (OneLinkNewtonEuler *next)
 [Backward Newton-Euler] Compute F, Mu, Tau More...
 
void ForwardWrench (OneLinkNewtonEuler *prev)
 [Inverse Newton-Euler] Compute F, Mu, Tau More...
 
virtual void computeTorque (OneLinkNewtonEuler *prev)
 [all] Compute joint torque; moment must be pre-computed More...
 

Protected Attributes

yarp::sig::Vector w
 initial angular velocity More...
 
yarp::sig::Vector dw
 initial angular acceleration More...
 
yarp::sig::Vector ddp
 initial linear acceleration More...
 
yarp::sig::Vector F
 final force More...
 
yarp::sig::Vector Mu
 final moment More...
 
yarp::sig::Matrix HN
 final roto-traslation (if necessary) More...
 
const yarp::sig::Matrix eye4x4
 
const yarp::sig::Matrix eye3x3
 
const yarp::sig::Matrix zeros3x3
 
const yarp::sig::Vector zeros3
 
- Protected Attributes inherited from iCub::iDyn::OneLinkNewtonEuler
NewEulMode mode
 STATIC/DYNAMIC/DYNAMIC_W_ROTOR/DYNAMIC_CORIOLIS_GRAVITY. More...
 
std::string info
 info or useful notes More...
 
unsigned int verbose
 verbosity flag More...
 
yarp::sig::Vector z0
 z0=[0 0 1]' More...
 
yarp::sig::Vector zm
 z^{i-1}_{m_{i}} versor rotating solidally with link i, projected in frame i ==>> constant More...
 
iDyn::iDynLinklink
 the corresponding iDynLink More...
 

Additional Inherited Members

- Protected Member Functions inherited from iCub::iDyn::OneLinkNewtonEuler
void computeAngVel (OneLinkNewtonEuler *prev)
 [Forward Newton-Euler] compute angular velocity of the link More...
 
void computeAngVelBackward (OneLinkNewtonEuler *prev)
 [Forward Newton-Euler] compute angular velocity of the previous link frame More...
 
void computeAngAcc (OneLinkNewtonEuler *prev)
 [Forward Newton-Euler] compute angular acceleration of the link More...
 
void computeAngAccBackward (OneLinkNewtonEuler *prev)
 [Forward Newton-Euler] compute angular acceleration of the previous link frame More...
 
void computeLinAcc (OneLinkNewtonEuler *prev)
 [Forward Newton-Euler] compute linear acceleration of the reference frame of the link More...
 
void computeLinAccBackward (OneLinkNewtonEuler *prev)
 [Forward Newton-Euler] compute linear acceleration of the reference frame of the previous link More...
 
void computeLinAccC ()
 [Forward Newton-Euler] compute linear acceleration of the center of mass More...
 
void computeAngAccM (OneLinkNewtonEuler *prev)
 [Forward Newton-Euler] compute angular acceleration of the rotor More...
 
void computeForceBackward (OneLinkNewtonEuler *next)
 [Backward Newton-Euler] compute force from the following link More...
 
void computeForceForward (OneLinkNewtonEuler *prev)
 [Inverse Newton-Euler] compute force from the previous link More...
 
void computeMomentBackward (OneLinkNewtonEuler *next)
 [Backward Newton-Euler] compute moment from the following link More...
 
void computeMomentForward (OneLinkNewtonEuler *prev)
 [Inverse Newton-Euler] compute moment from the previous link More...
 

Detailed Description

A class for setting a virtual final link: this is useful to initialize the backward phase of Newton-Euler's method, by setting F, Mu; H is an identity matrix, while ddpC=ddp; Note that this is a virtual link, since there's no iDynLink attached: it is just necessary to make the recursive Newton-Euler computations.

Definition at line 610 of file iDynInv.h.

Constructor & Destructor Documentation

◆ FinalLinkNewtonEuler() [1/2]

FinalLinkNewtonEuler::FinalLinkNewtonEuler ( const yarp::sig::Matrix &  _HN,
const NewEulMode  _mode,
unsigned int  verb = iCub::skinDynLib::NO_VERBOSE 
)

Default constructor.

Parameters
_modethe analysis mode (static/dynamic)
verbflag for verbosity

Definition at line 1011 of file iDynInv.cpp.

◆ FinalLinkNewtonEuler() [2/2]

iCub::iDyn::FinalLinkNewtonEuler::FinalLinkNewtonEuler ( const yarp::sig::Matrix &  _HN,
const yarp::sig::Vector &  _F,
const yarp::sig::Vector &  _Mu,
const NewEulMode  _mode,
unsigned int  verb = iCub::skinDynLib::NO_VERBOSE 
)

Constructor, initializing the final frame data.

Parameters
_Fthe final force
_Muthe final moment
_modethe analysis mode (static/dynamic)
verbflag for verbosity

Member Function Documentation

◆ getAngAcc()

const Vector & FinalLinkNewtonEuler::getAngAcc ( ) const
virtual
Returns
dw = angular acceleration (3x1)

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1128 of file iDynInv.cpp.

◆ getAngAccM()

const Vector & FinalLinkNewtonEuler::getAngAccM ( ) const
virtual
Returns
dwM = angular acceleration of the rotor (3x1)

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1129 of file iDynInv.cpp.

◆ getAngVel()

const Vector & FinalLinkNewtonEuler::getAngVel ( ) const
virtual
Returns
w = angular velocity (3x1)

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1127 of file iDynInv.cpp.

◆ getD2q()

double FinalLinkNewtonEuler::getD2q ( ) const
virtual
Returns
ddq = d2q = joint acceleration

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1139 of file iDynInv.cpp.

◆ getDq()

double FinalLinkNewtonEuler::getDq ( ) const
virtual
Returns
dq = dq = joint velocity

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1140 of file iDynInv.cpp.

◆ getForce()

const Vector & FinalLinkNewtonEuler::getForce ( ) const
virtual
Returns
F = force (3x1)

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1123 of file iDynInv.cpp.

◆ getFs()

double FinalLinkNewtonEuler::getFs ( ) const
virtual
Returns
Fs = static friction

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1137 of file iDynInv.cpp.

◆ getFv()

double FinalLinkNewtonEuler::getFv ( ) const
virtual
Returns
Fv = viscous friction

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1138 of file iDynInv.cpp.

◆ getH()

const Matrix & FinalLinkNewtonEuler::getH ( )
virtual
Returns
H = (4x4) the Denavit-Hartenberg roto-translational matrix describing the link

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1133 of file iDynInv.cpp.

◆ getIm()

double FinalLinkNewtonEuler::getIm ( ) const
virtual
Returns
Im

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1136 of file iDynInv.cpp.

◆ getInertia()

const Matrix & FinalLinkNewtonEuler::getInertia ( ) const
virtual
Returns
I = inertia of the link

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1143 of file iDynInv.cpp.

◆ getKr()

double FinalLinkNewtonEuler::getKr ( ) const
virtual
Returns
Kr

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1141 of file iDynInv.cpp.

◆ getLinAcc()

const Vector & FinalLinkNewtonEuler::getLinAcc ( ) const
virtual
Returns
ddp = d2p = linear acceleration (3x1)

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1130 of file iDynInv.cpp.

◆ getLinAccC()

const Vector & FinalLinkNewtonEuler::getLinAccC ( ) const
virtual
Returns
ddpC = d2pC = linear acceleration of the center of mass (3x1)

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1131 of file iDynInv.cpp.

◆ getMass()

double FinalLinkNewtonEuler::getMass ( ) const
virtual
Returns
m = mass of the link

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1142 of file iDynInv.cpp.

◆ getMoment()

const Vector & FinalLinkNewtonEuler::getMoment ( bool  isBase = false) const
virtual
Returns
Mu = moment (3x1)

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1125 of file iDynInv.cpp.

◆ getR()

const Matrix & FinalLinkNewtonEuler::getR ( )
virtual
Returns
R = (3x3) rotational matrix from the Denavit-Hartenberg roto-translational matrix describing the link

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1134 of file iDynInv.cpp.

◆ getr()

const Vector & FinalLinkNewtonEuler::getr ( bool  proj = false)
virtual
Returns
r = (3x1) distance vector from the Denavit-Hartenberg roto-translational matrix describing the distance vector between frames and <i-1>

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1144 of file iDynInv.cpp.

◆ getRC()

const Matrix & FinalLinkNewtonEuler::getRC ( )
virtual
Returns
RC = (3x3) rotational matrix from the roto-translational matrix of the link COM

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1135 of file iDynInv.cpp.

◆ getrC()

const Vector & FinalLinkNewtonEuler::getrC ( bool  proj = false)
virtual
Returns
rC = (3x1) distance vector from the roto-translational matrix of the link COM, describing the distance vector between COM and frame

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1145 of file iDynInv.cpp.

◆ getTorque()

double FinalLinkNewtonEuler::getTorque ( ) const
virtual
Returns
Tau = torque (1x1)

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1132 of file iDynInv.cpp.

◆ setAngAcc()

bool FinalLinkNewtonEuler::setAngAcc ( const yarp::sig::Vector &  _dw)
virtual

Set the OneLink angular acceleration (dw), ie the corresponding iDynLink angular acceleration (dw) (in the child classes derived from OneLink, it depends)

Parameters
_dwangular acceleration

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1190 of file iDynInv.cpp.

◆ setAngAccM()

bool FinalLinkNewtonEuler::setAngAccM ( const yarp::sig::Vector &  _dwM)
virtual

Set the OneLink angular acceleration of the motor (dwM), ie the corresponding iDynLink angular acceleration of the COM (dwM) (nothing in the child classes derived from OneLink)

Parameters
_dwMangular acceleration of the motor

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1213 of file iDynInv.cpp.

◆ setAngVel()

bool FinalLinkNewtonEuler::setAngVel ( const yarp::sig::Vector &  _w)
virtual

Set the OneLink angular velocity (w), ie the corresponding iDynLink angular velocity (w) (in the child classes derived from OneLink, it depends)

Parameters
_wangular velocity

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1181 of file iDynInv.cpp.

◆ setAsFinal() [1/2]

bool iCub::iDyn::FinalLinkNewtonEuler::setAsFinal ( const yarp::sig::Vector &  _F,
const yarp::sig::Vector &  _Mu 
)
virtual

Set the final frame data.

Parameters
_Fthe final force
_Muthe final moment
Returns
true if dimensions are correct, false otherwise

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

◆ setAsFinal() [2/2]

bool iCub::iDyn::FinalLinkNewtonEuler::setAsFinal ( const yarp::sig::Vector &  _w,
const yarp::sig::Vector &  _dw,
const yarp::sig::Vector &  _ddp 
)
virtual

Set the final frame data.

Parameters
_wthe final force
_dwthe final force
_ddpthe final moment
Returns
true if dimensions are correct, false otherwise

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

◆ setForce()

bool FinalLinkNewtonEuler::setForce ( const yarp::sig::Vector &  _F)
virtual

Set the OneLink force: either the corresponding iDynLink force, or the one declared as member in the child classes derived from OneLink, such as SensorLink.

Parameters
_Fa (3x1) vector of forces
Returns
true if size is correct, false otherwise

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1147 of file iDynInv.cpp.

◆ setLinAcc()

bool FinalLinkNewtonEuler::setLinAcc ( const yarp::sig::Vector &  _ddp)
virtual

Set the OneLink linear acceleration (ddp), ie the corresponding iDynLink linear acceleration (ddp) (in the child classes derived from OneLink, it depends)

Parameters
_ddplinear acceleration

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1198 of file iDynInv.cpp.

◆ setLinAccC()

bool FinalLinkNewtonEuler::setLinAccC ( const yarp::sig::Vector &  _ddpC)
virtual

Set the OneLink linear acceleration of the COM (ddpC), ie the corresponding iDynLink linear acceleration of the COM (ddpC) (nothing in the child classes derived from OneLink, except for SensorLink)

Parameters
_ddpClinear acceleration of the COM

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1206 of file iDynInv.cpp.

◆ setMoment()

bool FinalLinkNewtonEuler::setMoment ( const yarp::sig::Vector &  _Mu)
virtual

Set the OneLink moment: either the corresponding iDynLink moment, or the one declared as member in the child classes derived from OneLink, such as SensorLink.

Parameters
_Mua 3x1 vector of moments
Returns
true if size is correct, false otherwise

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1163 of file iDynInv.cpp.

◆ setTorque()

void FinalLinkNewtonEuler::setTorque ( const double  _Tau)
virtual

Set the OneLink torque, ie the corresponding iDynLink joint torque (nothing in the child classes derived from OneLink, such as SensorLink)

Parameters
_Taua real torque value

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1179 of file iDynInv.cpp.

◆ toString()

string FinalLinkNewtonEuler::toString ( ) const
virtual

Useful to print some information.

Reimplemented from iCub::iDyn::OneLinkNewtonEuler.

Definition at line 1103 of file iDynInv.cpp.

Member Data Documentation

◆ ddp

yarp::sig::Vector iCub::iDyn::FinalLinkNewtonEuler::ddp
protected

initial linear acceleration

Definition at line 618 of file iDynInv.h.

◆ dw

yarp::sig::Vector iCub::iDyn::FinalLinkNewtonEuler::dw
protected

initial angular acceleration

Definition at line 616 of file iDynInv.h.

◆ eye3x3

const yarp::sig::Matrix iCub::iDyn::FinalLinkNewtonEuler::eye3x3
protected

Definition at line 628 of file iDynInv.h.

◆ eye4x4

const yarp::sig::Matrix iCub::iDyn::FinalLinkNewtonEuler::eye4x4
protected

Definition at line 627 of file iDynInv.h.

◆ F

yarp::sig::Vector iCub::iDyn::FinalLinkNewtonEuler::F
protected

final force

Definition at line 620 of file iDynInv.h.

◆ HN

yarp::sig::Matrix iCub::iDyn::FinalLinkNewtonEuler::HN
protected

final roto-traslation (if necessary)

Definition at line 624 of file iDynInv.h.

◆ Mu

yarp::sig::Vector iCub::iDyn::FinalLinkNewtonEuler::Mu
protected

final moment

Definition at line 622 of file iDynInv.h.

◆ w

yarp::sig::Vector iCub::iDyn::FinalLinkNewtonEuler::w
protected

initial angular velocity

Definition at line 614 of file iDynInv.h.

◆ zeros3

const yarp::sig::Vector iCub::iDyn::FinalLinkNewtonEuler::zeros3
protected

Definition at line 630 of file iDynInv.h.

◆ zeros3x3

const yarp::sig::Matrix iCub::iDyn::FinalLinkNewtonEuler::zeros3x3
protected

Definition at line 629 of file iDynInv.h.


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