iCub-main
|
A base class for computing forces and torques in a serial link chain. More...
#include <iDynInv.h>
Public Member Functions | |
OneLinkNewtonEuler (iDyn::iDynLink *dlink=NULL) | |
Default constructor. | |
OneLinkNewtonEuler (const NewEulMode _mode, unsigned int verb=iCub::skinDynLib::NO_VERBOSE, iDyn::iDynLink *dlink=NULL) | |
Constructor, with initialization of some data. | |
virtual | ~OneLinkNewtonEuler () |
Destructor. | |
void | zero () |
Set everything to zero; R is set to an identity matrix. | |
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. | |
virtual bool | setAsBase (const yarp::sig::Vector &_F, const yarp::sig::Vector &_Mu) |
virtual bool | setAsFinal (const yarp::sig::Vector &_F, const yarp::sig::Vector &_Mu) |
Set the frame as the final one: this is useful to initialize the backward phase of Newton-Euler's method, by setting F and Mu; R is an identity matrix. | |
virtual bool | setAsFinal (const yarp::sig::Vector &_w, const yarp::sig::Vector &_dw, const yarp::sig::Vector &_ddp) |
Set the frame as the final one: this is useful to initialize the backward phase of Euler's method, by setting w, dw and ddp; R is an identity matrix. | |
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. | |
virtual bool | setMeasuredTorque (const double _Tau) |
Set measured torque in a joint torque sensor frame | |
virtual std::string | toString () const |
Useful to print some information. | |
void | setVerbose (unsigned int verb=iCub::skinDynLib::VERBOSE) |
Set the verbosity level of comments during operations. | |
void | setMode (const NewEulMode _mode) |
Set the operation mode (static,dynamic etc) | |
bool | setZM (const yarp::sig::Vector &_zm) |
Set the zM vector. | |
void | setInfo (const std::string &_info) |
Set some information about this OneLink class. | |
NewEulMode | getMode () const |
yarp::sig::Vector | getZM () const |
std::string | getInfo () const |
virtual const yarp::sig::Vector & | getAngVel () const |
virtual const yarp::sig::Vector & | getAngAcc () const |
virtual const yarp::sig::Vector & | getAngAccM () const |
virtual const yarp::sig::Vector & | getLinAcc () const |
virtual const yarp::sig::Vector & | getLinAccC () const |
virtual const yarp::sig::Vector & | getForce () const |
virtual const yarp::sig::Vector & | getMoment (bool isBase=false) const |
virtual double | getTorque () const |
virtual double | getIm () const |
virtual double | getFs () const |
virtual double | getFv () const |
virtual double | getD2q () const |
virtual double | getDq () const |
virtual double | getKr () const |
virtual double | getMass () const |
virtual const yarp::sig::Matrix & | getInertia () const |
virtual const yarp::sig::Matrix & | getH () |
virtual const yarp::sig::Matrix & | getR () |
virtual const yarp::sig::Matrix & | getRC () |
virtual const yarp::sig::Vector & | getr (bool proj=false) |
virtual const yarp::sig::Vector & | getrC (bool proj=false) |
void | ForwardKinematics (OneLinkNewtonEuler *prev) |
[Forward Newton-Euler] Compute w, dw, ddp, ddpC, dwM | |
void | BackwardKinematics (OneLinkNewtonEuler *prev) |
[Backward Kinematic computation] Compute w, dw, ddp, ddpC, dwM | |
void | BackwardWrench (OneLinkNewtonEuler *next) |
[Backward Newton-Euler] Compute F, Mu, Tau | |
void | ForwardWrench (OneLinkNewtonEuler *prev) |
[Inverse Newton-Euler] Compute F, Mu, Tau | |
virtual void | computeTorque (OneLinkNewtonEuler *prev) |
[all] Compute joint torque; moment must be pre-computed | |
Protected Member Functions | |
virtual 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. | |
virtual 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. | |
virtual 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) | |
virtual 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) | |
virtual 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) | |
virtual 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) | |
virtual 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) | |
virtual 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) | |
void | computeAngVel (OneLinkNewtonEuler *prev) |
[Forward Newton-Euler] compute angular velocity of the link | |
void | computeAngVelBackward (OneLinkNewtonEuler *prev) |
[Forward Newton-Euler] compute angular velocity of the previous link frame | |
void | computeAngAcc (OneLinkNewtonEuler *prev) |
[Forward Newton-Euler] compute angular acceleration of the link | |
void | computeAngAccBackward (OneLinkNewtonEuler *prev) |
[Forward Newton-Euler] compute angular acceleration of the previous link frame | |
void | computeLinAcc (OneLinkNewtonEuler *prev) |
[Forward Newton-Euler] compute linear acceleration of the reference frame of the link | |
void | computeLinAccBackward (OneLinkNewtonEuler *prev) |
[Forward Newton-Euler] compute linear acceleration of the reference frame of the previous link | |
void | computeLinAccC () |
[Forward Newton-Euler] compute linear acceleration of the center of mass | |
void | computeAngAccM (OneLinkNewtonEuler *prev) |
[Forward Newton-Euler] compute angular acceleration of the rotor | |
void | computeForceBackward (OneLinkNewtonEuler *next) |
[Backward Newton-Euler] compute force from the following link | |
void | computeForceForward (OneLinkNewtonEuler *prev) |
[Inverse Newton-Euler] compute force from the previous link | |
void | computeMomentBackward (OneLinkNewtonEuler *next) |
[Backward Newton-Euler] compute moment from the following link | |
void | computeMomentForward (OneLinkNewtonEuler *prev) |
[Inverse Newton-Euler] compute moment from the previous link | |
Protected Attributes | |
NewEulMode | mode |
STATIC/DYNAMIC/DYNAMIC_W_ROTOR/DYNAMIC_CORIOLIS_GRAVITY. | |
std::string | info |
info or useful notes | |
unsigned int | verbose |
verbosity flag | |
yarp::sig::Vector | z0 |
z0=[0 0 1]' | |
yarp::sig::Vector | zm |
z^{i-1}_{m_{i}} versor rotating solidally with link i, projected in frame i ==>> constant | |
iDyn::iDynLink * | link |
the corresponding iDynLink | |
A base class for computing forces and torques in a serial link chain.
OneLinkNewtonEuler::OneLinkNewtonEuler | ( | iDyn::iDynLink * | dlink = NULL | ) |
Default constructor.
Definition at line 46 of file iDynInv.cpp.
OneLinkNewtonEuler::OneLinkNewtonEuler | ( | const NewEulMode | _mode, |
unsigned int | verb = iCub::skinDynLib::NO_VERBOSE , |
||
iDyn::iDynLink * | dlink = NULL |
||
) |
Constructor, with initialization of some data.
Definition at line 56 of file iDynInv.cpp.
|
inlinevirtual |
void OneLinkNewtonEuler::BackwardKinematics | ( | OneLinkNewtonEuler * | prev | ) |
[Backward Kinematic computation] Compute w, dw, ddp, ddpC, dwM
prev | the OneLinkNewtonEuler class of the previous link |
Definition at line 729 of file iDynInv.cpp.
void OneLinkNewtonEuler::BackwardWrench | ( | OneLinkNewtonEuler * | next | ) |
[Backward Newton-Euler] Compute F, Mu, Tau
next | the OneLinkNewtonEuler class of the following link |
Definition at line 737 of file iDynInv.cpp.
|
protected |
[Forward Newton-Euler] compute angular acceleration of the link
prev | the OneLinkNewtonEuler class of the previous link |
Definition at line 428 of file iDynInv.cpp.
|
protected |
[Forward Newton-Euler] compute angular acceleration of the previous link frame
prev | the OneLinkNewtonEuler class of the previous link |
Definition at line 460 of file iDynInv.cpp.
|
protected |
[Forward Newton-Euler] compute angular acceleration of the rotor
prev | the OneLinkNewtonEuler class of the previous link |
Definition at line 563 of file iDynInv.cpp.
|
protected |
[Forward Newton-Euler] compute angular velocity of the link
prev | the OneLinkNewtonEuler class of the previous link |
Definition at line 388 of file iDynInv.cpp.
|
protected |
[Forward Newton-Euler] compute angular velocity of the previous link frame
prev | the OneLinkNewtonEuler class of the previous link |
Definition at line 408 of file iDynInv.cpp.
|
protected |
[Backward Newton-Euler] compute force from the following link
next | the OneLinkNewtonEuler class of the following link |
Definition at line 581 of file iDynInv.cpp.
|
protected |
[Inverse Newton-Euler] compute force from the previous link
prev | the OneLinkNewtonEuler class of the previous link |
Definition at line 588 of file iDynInv.cpp.
|
protected |
[Forward Newton-Euler] compute linear acceleration of the reference frame of the link
prev | the OneLinkNewtonEuler class of the previous link |
Definition at line 492 of file iDynInv.cpp.
|
protected |
[Forward Newton-Euler] compute linear acceleration of the reference frame of the previous link
prev | the OneLinkNewtonEuler class of the previous link |
Definition at line 517 of file iDynInv.cpp.
|
protected |
[Forward Newton-Euler] compute linear acceleration of the center of mass
Definition at line 542 of file iDynInv.cpp.
|
protected |
[Backward Newton-Euler] compute moment from the following link
next | the OneLinkNewtonEuler class of the following link |
Definition at line 596 of file iDynInv.cpp.
|
protected |
[Inverse Newton-Euler] compute moment from the previous link
prev | the OneLinkNewtonEuler class of the previous link |
Definition at line 642 of file iDynInv.cpp.
|
virtual |
[all] Compute joint torque; moment must be pre-computed
next | the OneLinkNewtonEuler class of the following link |
Definition at line 698 of file iDynInv.cpp.
void OneLinkNewtonEuler::ForwardKinematics | ( | OneLinkNewtonEuler * | prev | ) |
[Forward Newton-Euler] Compute w, dw, ddp, ddpC, dwM
prev | the OneLinkNewtonEuler class of the previous link |
Definition at line 720 of file iDynInv.cpp.
void OneLinkNewtonEuler::ForwardWrench | ( | OneLinkNewtonEuler * | prev | ) |
[Inverse Newton-Euler] Compute F, Mu, Tau
prev | the OneLinkNewtonEuler class of the previous link |
Definition at line 743 of file iDynInv.cpp.
|
virtual |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 340 of file iDynInv.cpp.
|
virtual |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 342 of file iDynInv.cpp.
|
virtual |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 338 of file iDynInv.cpp.
|
virtual |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 364 of file iDynInv.cpp.
|
virtual |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 366 of file iDynInv.cpp.
|
virtual |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 348 of file iDynInv.cpp.
|
virtual |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 370 of file iDynInv.cpp.
|
virtual |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 372 of file iDynInv.cpp.
|
virtual |
Reimplemented in iCub::iDyn::FinalLinkNewtonEuler.
Definition at line 356 of file iDynInv.cpp.
|
virtual |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 362 of file iDynInv.cpp.
|
virtual |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 376 of file iDynInv.cpp.
string OneLinkNewtonEuler::getInfo | ( | ) | const |
Definition at line 354 of file iDynInv.cpp.
|
virtual |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 368 of file iDynInv.cpp.
|
virtual |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 344 of file iDynInv.cpp.
|
virtual |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 346 of file iDynInv.cpp.
|
virtual |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 374 of file iDynInv.cpp.
NewEulMode OneLinkNewtonEuler::getMode | ( | ) | const |
Definition at line 334 of file iDynInv.cpp.
|
virtual |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 350 of file iDynInv.cpp.
|
virtual |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 358 of file iDynInv.cpp.
|
virtual |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 378 of file iDynInv.cpp.
|
virtual |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 360 of file iDynInv.cpp.
|
virtual |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 380 of file iDynInv.cpp.
|
virtual |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 352 of file iDynInv.cpp.
Vector OneLinkNewtonEuler::getZM | ( | ) | const |
Definition at line 336 of file iDynInv.cpp.
|
protectedvirtual |
Set the OneLink angular acceleration (dw), ie the corresponding iDynLink angular acceleration (dw) (in the child classes derived from OneLink, it depends)
_dw | angular acceleration |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 196 of file iDynInv.cpp.
|
protectedvirtual |
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)
_dwM | angular acceleration of the motor |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 241 of file iDynInv.cpp.
|
protectedvirtual |
Set the OneLink angular velocity (w), ie the corresponding iDynLink angular velocity (w) (in the child classes derived from OneLink, it depends)
_w | angular velocity |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 181 of file iDynInv.cpp.
|
virtual |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler.
|
virtual |
Virtual method to set the frame as the base one: this is useful to initialize the forward phase of Newton-Euler's method.
The BaseLink class is used to this scope.
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler.
|
virtual |
Set the frame as the final one: this is useful to initialize the backward phase of Newton-Euler's method, by setting F and Mu; R is an identity matrix.
_F | the final force |
_Mu | the final moment |
Reimplemented in iCub::iDyn::FinalLinkNewtonEuler.
|
virtual |
Set the frame as the final one: this is useful to initialize the backward phase of Euler's method, by setting w, dw and ddp; R is an identity matrix.
_w | the final angular velocity |
_dw | the final angular acceleration |
_ddp | the final linear acceleration |
Reimplemented in iCub::iDyn::FinalLinkNewtonEuler.
|
protectedvirtual |
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.
_F | a (3x1) vector of forces |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 146 of file iDynInv.cpp.
void OneLinkNewtonEuler::setInfo | ( | const std::string & | _info | ) |
Set some information about this OneLink class.
_info | a string |
Definition at line 256 of file iDynInv.cpp.
|
protectedvirtual |
Set the OneLink linear acceleration (ddp), ie the corresponding iDynLink linear acceleration (ddp) (in the child classes derived from OneLink, it depends)
_ddp | linear acceleration |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 211 of file iDynInv.cpp.
|
protectedvirtual |
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)
_ddpC | linear acceleration of the COM |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 226 of file iDynInv.cpp.
|
virtual |
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.
_F | the sensor force |
_Mu | the sensor moment |
Reimplemented in iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 261 of file iDynInv.cpp.
|
virtual |
Set measured torque in a joint torque sensor frame
_Tau | the sensor torque |
Definition at line 286 of file iDynInv.cpp.
void OneLinkNewtonEuler::setMode | ( | const NewEulMode | _mode | ) |
Set the operation mode (static,dynamic etc)
_mode | the NewEulMode defining the type of operations |
Definition at line 122 of file iDynInv.cpp.
|
protectedvirtual |
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.
_Mu | a 3x1 vector of moments |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 161 of file iDynInv.cpp.
|
protectedvirtual |
Set the OneLink torque, ie the corresponding iDynLink joint torque (nothing in the child classes derived from OneLink, such as SensorLink)
_Tau | a real torque value |
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 176 of file iDynInv.cpp.
void OneLinkNewtonEuler::setVerbose | ( | unsigned int | verb = iCub::skinDynLib::VERBOSE | ) |
Set the verbosity level of comments during operations.
verb,a | boolean flag |
Definition at line 117 of file iDynInv.cpp.
bool OneLinkNewtonEuler::setZM | ( | const yarp::sig::Vector & | _zm | ) |
Set the zM vector.
_zm | a (3x1) vector zM |
Definition at line 127 of file iDynInv.cpp.
|
virtual |
Useful to print some information.
Reimplemented in iCub::iDyn::BaseLinkNewtonEuler, iCub::iDyn::FinalLinkNewtonEuler, and iCub::iDyn::SensorLinkNewtonEuler.
Definition at line 301 of file iDynInv.cpp.
void OneLinkNewtonEuler::zero | ( | ) |
Set everything to zero; R is set to an identity matrix.
Definition at line 66 of file iDynInv.cpp.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |