46 #include <yarp/sig/Vector.h>
47 #include <yarp/sig/Matrix.h>
65 const std::string
NewEulMode_s[4] = {
"static",
"dynamic",
"dynamic with motor/rotor",
"dynamic with only Coriolis and gravitational terms"};
71 const std::string
ChainComputationMode_s[4] = {
"Kinematic Forward - Wrench Forward",
"Kinematic Forward - Wrench Backward",
"Kinematic Backward - Wrench Forward",
"Kinematic Backward - Wrench Backward"};
77 class iCubArmNoTorsoDyn;
80 class iCubEyeNeckRefDyn;
81 class iCubInertialSensorDyn;
87 class iFTransformation;
106 yarp::sig::Vector
z0;
108 yarp::sig::Vector
zm;
122 virtual bool setForce(
const yarp::sig::Vector &_F);
130 virtual bool setMoment(
const yarp::sig::Vector &_Mu);
137 virtual void setTorque(
const double _Tau);
144 virtual bool setAngVel(
const yarp::sig::Vector &_w);
151 virtual bool setAngAcc(
const yarp::sig::Vector &_dw);
157 virtual bool setLinAcc(
const yarp::sig::Vector &_ddp);
164 virtual bool setLinAccC(
const yarp::sig::Vector &_ddpC);
171 virtual bool setAngAccM(
const yarp::sig::Vector &_dwM);
278 virtual bool setAsBase(
const yarp::sig::Vector &_w,
const yarp::sig::Vector &_dw,
const yarp::sig::Vector &_ddp);
279 virtual bool setAsBase(
const yarp::sig::Vector &_F,
const yarp::sig::Vector &_Mu);
287 virtual bool setAsFinal(
const yarp::sig::Vector &_F,
const yarp::sig::Vector &_Mu);
296 virtual bool setAsFinal(
const yarp::sig::Vector &_w,
const yarp::sig::Vector &_dw,
const yarp::sig::Vector &_ddp);
304 virtual bool setMeasuredFMu(
const yarp::sig::Vector &_F,
const yarp::sig::Vector &_Mu);
315 virtual std::string
toString()
const;
337 bool setZM(
const yarp::sig::Vector &_zm);
342 void setInfo(
const std::string &_info);
356 yarp::sig::Vector
getZM()
const;
364 virtual const yarp::sig::Vector&
getAngVel()
const;
368 virtual const yarp::sig::Vector&
getAngAcc()
const;
372 virtual const yarp::sig::Vector&
getAngAccM()
const;
376 virtual const yarp::sig::Vector&
getLinAcc()
const;
380 virtual const yarp::sig::Vector&
getLinAccC()
const;
384 virtual const yarp::sig::Vector&
getForce()
const;
388 virtual const yarp::sig::Vector&
getMoment(
bool isBase =
false)
const;
396 virtual double getIm()
const;
400 virtual double getFs()
const;
404 virtual double getFv()
const;
408 virtual double getD2q()
const;
412 virtual double getDq()
const;
416 virtual double getKr()
const;
420 virtual double getMass()
const;
424 virtual const yarp::sig::Matrix&
getInertia()
const;
428 virtual const yarp::sig::Matrix&
getH();
432 virtual const yarp::sig::Matrix&
getR();
436 virtual const yarp::sig::Matrix&
getRC();
440 virtual const yarp::sig::Vector&
getr(
bool proj=
false);
444 virtual const yarp::sig::Vector&
getrC(
bool proj=
false);
497 yarp::sig::Vector
dw;
501 yarp::sig::Matrix
H0;
505 yarp::sig::Vector
Mu;
535 BaseLinkNewtonEuler(
const yarp::sig::Matrix &_H0,
const yarp::sig::Vector &_w,
const yarp::sig::Vector &_dw,
544 bool setAsBase(
const yarp::sig::Vector &_w,
const yarp::sig::Vector &_dw,
const yarp::sig::Vector &_ddp);
550 bool setAsBase(
const yarp::sig::Vector &_F,
const yarp::sig::Vector &_Mu);
556 const yarp::sig::Vector&
getAngVel()
const;
557 const yarp::sig::Vector&
getAngAcc()
const;
559 const yarp::sig::Vector&
getLinAcc()
const;
565 const yarp::sig::Vector&
getForce()
const;
566 const yarp::sig::Vector&
getMoment(
bool isBase =
false)
const;
568 const yarp::sig::Matrix&
getR();
569 const yarp::sig::Matrix&
getRC();
570 double getIm()
const;
572 double getDq()
const;
573 double getKr()
const;
574 double getFs()
const;
575 double getFv()
const;
578 const yarp::sig::Vector&
getr(
bool proj=
false);
579 const yarp::sig::Vector&
getrC(
bool proj=
false);
585 bool setForce(
const yarp::sig::Vector &_F);
586 bool setMoment(
const yarp::sig::Vector &_Mu);
588 bool setAngVel(
const yarp::sig::Vector &_w);
589 bool setAngAcc(
const yarp::sig::Vector &_dw);
590 bool setLinAcc(
const yarp::sig::Vector &_ddp);
591 bool setLinAccC(
const yarp::sig::Vector &_ddpC);
592 bool setAngAccM(
const yarp::sig::Vector &_dwM);
616 yarp::sig::Vector
dw;
622 yarp::sig::Vector
Mu;
624 yarp::sig::Matrix
HN;
656 bool setAsFinal(
const yarp::sig::Vector &_F,
const yarp::sig::Vector &_Mu);
665 bool setAsFinal(
const yarp::sig::Vector &_w,
const yarp::sig::Vector &_dw,
const yarp::sig::Vector &_ddp);
671 const yarp::sig::Vector&
getForce()
const;
672 const yarp::sig::Vector&
getMoment(
bool isBase =
false)
const;
675 const yarp::sig::Vector&
getAngVel()
const;
676 const yarp::sig::Vector&
getAngAcc()
const;
678 const yarp::sig::Vector&
getLinAcc()
const;
681 const yarp::sig::Matrix&
getH();
682 const yarp::sig::Matrix&
getR();
683 const yarp::sig::Matrix&
getRC();
684 double getIm()
const;
685 double getFs()
const;
686 double getFv()
const;
688 double getDq()
const;
689 double getKr()
const;
692 const yarp::sig::Vector&
getr(
bool proj=
false);
693 const yarp::sig::Vector&
getrC(
bool proj=
false);
694 bool setForce(
const yarp::sig::Vector &_F);
695 bool setMoment(
const yarp::sig::Vector &_Mu);
697 bool setAngVel(
const yarp::sig::Vector &_w);
698 bool setAngAcc(
const yarp::sig::Vector &_dw);
699 bool setLinAcc(
const yarp::sig::Vector &_ddp);
700 bool setLinAccC(
const yarp::sig::Vector &_ddpC);
701 bool setAngAccM(
const yarp::sig::Vector &_dwM);
724 yarp::sig::Vector
Mu;
729 yarp::sig::Vector
dw;
744 yarp::sig::Matrix
RC;
747 yarp::sig::Vector
rc;
778 bool setMeasuredFMu(
const yarp::sig::Vector &_F,
const yarp::sig::Vector &_Mu);
787 bool setSensor(
const yarp::sig::Matrix &_H,
const yarp::sig::Matrix &_HC,
const double _m,
const yarp::sig::Matrix &_I);
819 const yarp::sig::Vector&
getAngVel()
const;
820 const yarp::sig::Vector&
getAngAcc()
const;
821 const yarp::sig::Vector&
getLinAcc()
const;
824 const yarp::sig::Vector&
getForce()
const;
825 const yarp::sig::Vector&
getMoment(
bool isBase =
false)
const;
827 double getIm()
const;
828 double getFs()
const;
829 double getFv()
const;
831 double getDq()
const;
832 double getKr()
const;
835 const yarp::sig::Matrix&
getH()
const;
839 const yarp::sig::Matrix&
getR();
840 const yarp::sig::Matrix&
getRC();
841 const yarp::sig::Vector&
getr(
bool proj=
false);
842 const yarp::sig::Vector&
getrC(
bool proj=
false);
844 bool setForce(
const yarp::sig::Vector &_F);
845 bool setMoment(
const yarp::sig::Vector &_Mu);
847 bool setAngVel(
const yarp::sig::Vector &_w);
848 bool setAngAcc(
const yarp::sig::Vector &_dw);
849 bool setLinAcc(
const yarp::sig::Vector &_ddp);
850 bool setLinAccC(
const yarp::sig::Vector &_ddpC);
851 bool setAngAccM(
const yarp::sig::Vector &_dwM);
872 virtual std::string
getType()
const;
924 bool getVelAccAfterForward(
unsigned int i, yarp::sig::Vector &w, yarp::sig::Vector &dw, yarp::sig::Vector &dwM, yarp::sig::Vector &ddp, yarp::sig::Vector &ddpC)
const;
935 void getVelAccBase(yarp::sig::Vector &w, yarp::sig::Vector &dw,yarp::sig::Vector &ddp)
const;
941 void getVelAccEnd(yarp::sig::Vector &w, yarp::sig::Vector &dw,yarp::sig::Vector &ddp)
const;
947 void getWrenchBase(yarp::sig::Vector &
F, yarp::sig::Vector &Mu)
const;
953 void getWrenchEnd(yarp::sig::Vector &
F, yarp::sig::Vector &Mu)
const;
961 void setInfo(
const std::string _info);
970 bool initKinematicBase(
const yarp::sig::Vector &w0,
const yarp::sig::Vector &dw0,
const yarp::sig::Vector &ddp0);
979 bool initKinematicEnd(
const yarp::sig::Vector &w0,
const yarp::sig::Vector &dw0,
const yarp::sig::Vector &ddp0);
987 bool initWrenchEnd(
const yarp::sig::Vector &F0,
const yarp::sig::Vector &Mu0);
995 bool initWrenchBase(
const yarp::sig::Vector &F0,
const yarp::sig::Vector &Mu0);
1274 bool setSensor(
unsigned int i,
const yarp::sig::Matrix &_H,
const yarp::sig::Matrix &_HC,
const double _m,
const yarp::sig::Matrix &_I);
1313 yarp::sig::Matrix
getH()
const;
1325 yarp::sig::Matrix
getCOM()
const;
1339 void setInfo(
const std::string &_info);
1349 bool setDynamicParameters(
const double _m,
const yarp::sig::Matrix &_HC,
const yarp::sig::Matrix &_I);
1698 yarp::sig::Vector
getForce(
const unsigned int iLink)
const;
1704 yarp::sig::Vector
getMoment(
const unsigned int iLink)
const;
1710 double getTorque(
const unsigned int iLink)
const;
A class for setting a virtual base link: this is useful to initialize the forward phase of Newton-Eul...
std::string toString() const
Useful to print some information.
const yarp::sig::Vector & getLinAccC() const
yarp::sig::Vector dw
initial angular acceleration
yarp::sig::Vector w
initial angular velocity
bool setMoment(const yarp::sig::Vector &_Mu)
Set the OneLink moment: either the corresponding iDynLink moment, or the one declared as member in th...
const yarp::sig::Matrix & getR()
const yarp::sig::Vector & getAngVel() const
const yarp::sig::Vector zeros3
const yarp::sig::Vector & getr(bool proj=false)
bool setAngAccM(const yarp::sig::Vector &_dwM)
Set the OneLink angular acceleration of the motor (dwM), ie the corresponding iDynLink angular accele...
yarp::sig::Vector Mu0
initial moment
bool setLinAcc(const yarp::sig::Vector &_ddp)
Set the OneLink linear acceleration (ddp), ie the corresponding iDynLink linear acceleration (ddp) (i...
BaseLinkNewtonEuler(const yarp::sig::Matrix &_H0, const yarp::sig::Vector &_w, const yarp::sig::Vector &_dw, const yarp::sig::Vector &_ddp, const NewEulMode _mode, unsigned int verb=iCub::skinDynLib::NO_VERBOSE)
Constructor, initializing the base data.
const yarp::sig::Vector & getMoment(bool isBase=false) const
yarp::sig::Vector ddp
initial linear acceleration
bool setForce(const yarp::sig::Vector &_F)
Set the OneLink force: either the corresponding iDynLink force, or the one declared as member in the ...
bool setAngAcc(const yarp::sig::Vector &_dw)
Set the OneLink angular acceleration (dw), ie the corresponding iDynLink angular acceleration (dw) (i...
bool setAngVel(const yarp::sig::Vector &_w)
Set the OneLink angular velocity (w), ie the corresponding iDynLink angular velocity (w) (in the chil...
yarp::sig::Matrix H0
base roto-traslation (if necessary)
void setTorque(const double _Tau)
Set the OneLink torque, ie the corresponding iDynLink joint torque (nothing in the child classes deri...
BaseLinkNewtonEuler(const yarp::sig::Matrix &_H0, const NewEulMode _mode, unsigned int verb=iCub::skinDynLib::NO_VERBOSE)
Default constructor.
const yarp::sig::Matrix & getInertia() const
const yarp::sig::Matrix zeros3x3
double Tau
corresponding torque
const yarp::sig::Matrix & getRC()
bool setAsBase(const yarp::sig::Vector &_w, const yarp::sig::Vector &_dw, const yarp::sig::Vector &_ddp)
Sets the base data.
const yarp::sig::Vector & getrC(bool proj=false)
yarp::sig::Vector Mu
initial moment
const yarp::sig::Matrix eye3x3
const yarp::sig::Vector & getAngAccM() const
const yarp::sig::Vector & getAngAcc() const
const yarp::sig::Vector & getLinAcc() const
bool setAsBase(const yarp::sig::Vector &_F, const yarp::sig::Vector &_Mu)
Sets the base data.
yarp::sig::Vector F
initial force
bool setLinAccC(const yarp::sig::Vector &_ddpC)
Set the OneLink linear acceleration of the COM (ddpC), ie the corresponding iDynLink linear accelerat...
const yarp::sig::Vector & getForce() const
A class for setting a virtual final link: this is useful to initialize the backward phase of Newton-E...
yarp::sig::Vector F
final force
bool setMoment(const yarp::sig::Vector &_Mu)
Set the OneLink moment: either the corresponding iDynLink moment, or the one declared as member in th...
const yarp::sig::Vector zeros3
const yarp::sig::Vector & getForce() const
bool setLinAccC(const yarp::sig::Vector &_ddpC)
Set the OneLink linear acceleration of the COM (ddpC), ie the corresponding iDynLink linear accelerat...
const yarp::sig::Vector & getAngVel() const
bool setForce(const yarp::sig::Vector &_F)
Set the OneLink force: either the corresponding iDynLink force, or the one declared as member in the ...
const yarp::sig::Vector & getr(bool proj=false)
const yarp::sig::Vector & getLinAccC() const
FinalLinkNewtonEuler(const yarp::sig::Matrix &_HN, const NewEulMode _mode, unsigned int verb=iCub::skinDynLib::NO_VERBOSE)
Default constructor.
const yarp::sig::Matrix & getH()
bool setAngAcc(const yarp::sig::Vector &_dw)
Set the OneLink angular acceleration (dw), ie the corresponding iDynLink angular acceleration (dw) (i...
bool setAngAccM(const yarp::sig::Vector &_dwM)
Set the OneLink angular acceleration of the motor (dwM), ie the corresponding iDynLink angular accele...
const yarp::sig::Vector & getLinAcc() const
yarp::sig::Vector w
initial angular velocity
const yarp::sig::Vector & getAngAccM() const
const yarp::sig::Matrix & getInertia() const
yarp::sig::Vector Mu
final moment
bool setAsFinal(const yarp::sig::Vector &_w, const yarp::sig::Vector &_dw, const yarp::sig::Vector &_ddp)
Set the final frame data.
const yarp::sig::Matrix eye3x3
void setTorque(const double _Tau)
Set the OneLink torque, ie the corresponding iDynLink joint torque (nothing in the child classes deri...
yarp::sig::Vector dw
initial angular acceleration
bool setAngVel(const yarp::sig::Vector &_w)
Set the OneLink angular velocity (w), ie the corresponding iDynLink angular velocity (w) (in the chil...
const yarp::sig::Matrix & getR()
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.
std::string toString() const
Useful to print some information.
yarp::sig::Vector ddp
initial linear acceleration
bool setLinAcc(const yarp::sig::Vector &_ddp)
Set the OneLink linear acceleration (ddp), ie the corresponding iDynLink linear acceleration (ddp) (i...
const yarp::sig::Vector & getMoment(bool isBase=false) const
const yarp::sig::Vector & getrC(bool proj=false)
const yarp::sig::Matrix & getRC()
yarp::sig::Matrix HN
final roto-traslation (if necessary)
bool setAsFinal(const yarp::sig::Vector &_F, const yarp::sig::Vector &_Mu)
Set the final frame data.
const yarp::sig::Matrix zeros3x3
const yarp::sig::Matrix eye4x4
const yarp::sig::Vector & getAngAcc() const
A class for computing forces and torques in a iDynChain.
void BackwardWrenchFromEnd()
[classic] Base function for backward of classical Newton-Euler.
bool getVelAccAfterForward(unsigned int i, yarp::sig::Vector &w, yarp::sig::Vector &dw, yarp::sig::Vector &dwM, yarp::sig::Vector &ddp, yarp::sig::Vector &ddpC) const
Useful to debug, getting the intermediate computations after the forward phase.
unsigned int nEndEff
the index of the end-effector in the chain (the last frame)
void BackwardWrenchFromEnd(const yarp::sig::Vector &F, const yarp::sig::Vector &Mu)
[classic] Backward of classical Newton-Euler, after initializing the final link
void getVelAccEnd(yarp::sig::Vector &w, yarp::sig::Vector &dw, yarp::sig::Vector &ddp) const
This method is used by iDynChain to retrieve kinematic information for connection with one or more iD...
std::string toString() const
Useful to print some information.
iDyn::iDynChain * chain
the real kinematic/dynamic chain of the robot
void ForwardKinematicFromBase()
[classic/inverse] Base function for forward of classical Newton-Euler.
bool initKinematicBase(const yarp::sig::Vector &w0, const yarp::sig::Vector &dw0, const yarp::sig::Vector &ddp0)
[classic] Initialize the base with measured or known kinematics variables
bool initWrenchEnd(const yarp::sig::Vector &F0, const yarp::sig::Vector &Mu0)
[classic] Initialize the end-effector finalLink with measured or known wrench
void setMode(const NewEulMode _mode)
NewEulMode getMode() const
void setInfo(const std::string _info)
void BackwardKinematicFromEnd(const yarp::sig::Vector &we, const yarp::sig::Vector &dwe, const yarp::sig::Vector &ddpe)
[inverse] Forward of classical Newton-Euler, after initializing the base link
void ForwardKinematicFromBase(const yarp::sig::Vector &w0, const yarp::sig::Vector &dw0, const yarp::sig::Vector &ddp0)
[classic/inverse] Forward of classical Newton-Euler, after initializing the base link
NewEulMode mode
static/dynamic/dynamicWrotor
void getWrenchEnd(yarp::sig::Vector &F, yarp::sig::Vector &Mu) const
This method is used by iDynChain to retrieve wrench information for connection with one or more iDynL...
void setVerbose(unsigned int verb=iCub::skinDynLib::VERBOSE)
bool ForwardWrenchToEnd(unsigned int lSens)
[inverse] Base function for inverse Newton-Euler: from the i-th link to the end, forward of forces an...
~OneChainNewtonEuler()
Standard destructor.
OneChainNewtonEuler(iDyn::iDynChain *_c, std::string _info, const NewEulMode _mode=DYNAMIC, unsigned int verb=iCub::skinDynLib::NO_VERBOSE)
Constructor (note: without FT sensor)
OneLinkNewtonEuler ** neChain
the chain of links/frames for Newton-Euler computations
void BackwardKinematicFromEnd()
[inverse] Base function for forward of classical Newton-Euler.
void ForwardWrenchFromBase(const yarp::sig::Vector &F, const yarp::sig::Vector &Mu)
[inverse] Base function for inverse Newton-Euler: from the i-th link to the base, backward of forces ...
bool initWrenchBase(const yarp::sig::Vector &F0, const yarp::sig::Vector &Mu0)
[inverse] Initialize the base with measured or known wrench
unsigned int verbose
verbosity flag
bool BackwardWrenchFromAtoB(unsigned int lA, unsigned int lB)
Base function for inverse Newton-Euler: from the lA-th link to the lB-th, backward of forces and mome...
bool BackwardWrenchToBase(unsigned int lSens)
[classic/inverse] Base function for inverse Newton-Euler: from the i-th link to the base,...
void getWrenchBase(yarp::sig::Vector &F, yarp::sig::Vector &Mu) const
This method is used by iDynChain to retrieve wrench information for connection with one or more iDynL...
void getVelAccBase(yarp::sig::Vector &w, yarp::sig::Vector &dw, yarp::sig::Vector &ddp) const
This method is used by iDynChain to retrieve kinematic information for connection with one or more iD...
void ForwardWrenchFromBase()
[inverse] Base function for inverse Newton-Euler: from the i-th link to the end, forward of forces an...
void computeTorques()
Computes all the torques in the chain, assuming that all the internal wrenches have been already comp...
std::string info
info or useful notes
unsigned int nLinks
number of links
std::string getInfo() const
bool getWrenchAfterForward(unsigned int i, yarp::sig::Vector &F, yarp::sig::Vector &Mu) const
Useful to debug, getting the intermediate computations after the forward phase.
bool initKinematicEnd(const yarp::sig::Vector &w0, const yarp::sig::Vector &dw0, const yarp::sig::Vector &ddp0)
[inverse] Initialize the end-effector finalLink with measured or known kinematics variables
bool ForwardWrenchFromAtoB(unsigned int lA, unsigned int lB)
Base function for inverse Newton-Euler: from the lA-th link to the lB-th, forward of forces and momen...
A base class for computing forces and torques in a serial link chain.
void computeLinAcc(OneLinkNewtonEuler *prev)
[Forward Newton-Euler] compute linear acceleration of the reference frame of the link
NewEulMode mode
STATIC/DYNAMIC/DYNAMIC_W_ROTOR/DYNAMIC_CORIOLIS_GRAVITY.
virtual const yarp::sig::Vector & getrC(bool proj=false)
virtual bool setLinAccC(const yarp::sig::Vector &_ddpC)
Set the OneLink linear acceleration of the COM (ddpC), ie the corresponding iDynLink linear accelerat...
virtual const yarp::sig::Vector & getForce() const
void setVerbose(unsigned int verb=iCub::skinDynLib::VERBOSE)
Set the verbosity level of comments during operations.
void setInfo(const std::string &_info)
Set some information about this OneLink class.
OneLinkNewtonEuler(iDyn::iDynLink *dlink=NULL)
Default constructor.
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 met...
virtual const yarp::sig::Matrix & getR()
virtual const yarp::sig::Vector & getAngVel() const
void computeForceBackward(OneLinkNewtonEuler *next)
[Backward Newton-Euler] compute force from the following link
virtual bool setMoment(const yarp::sig::Vector &_Mu)
Set the OneLink moment: either the corresponding iDynLink moment, or the one declared as member in th...
virtual bool setAngAcc(const yarp::sig::Vector &_dw)
Set the OneLink angular acceleration (dw), ie the corresponding iDynLink angular acceleration (dw) (i...
void BackwardWrench(OneLinkNewtonEuler *next)
[Backward Newton-Euler] Compute F, Mu, Tau
virtual const yarp::sig::Matrix & getInertia() const
virtual double getDq() const
virtual const yarp::sig::Vector & getMoment(bool isBase=false) const
void computeLinAccBackward(OneLinkNewtonEuler *prev)
[Forward Newton-Euler] compute linear acceleration of the reference frame of the previous link
virtual void computeTorque(OneLinkNewtonEuler *prev)
[all] Compute joint torque; moment must be pre-computed
virtual double getTorque() const
virtual const yarp::sig::Matrix & getH()
bool setZM(const yarp::sig::Vector &_zm)
Set the zM vector.
virtual bool setMeasuredTorque(const double _Tau)
Set measured torque in a joint torque sensor frame
void setMode(const NewEulMode _mode)
Set the operation mode (static,dynamic etc)
iDyn::iDynLink * link
the corresponding iDynLink
virtual const yarp::sig::Vector & getLinAccC() const
virtual const yarp::sig::Matrix & getRC()
virtual double getD2q() const
void zero()
Set everything to zero; R is set to an identity matrix.
virtual double getIm() const
std::string getInfo() const
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,...
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 Ne...
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 ...
std::string info
info or useful notes
virtual bool setLinAcc(const yarp::sig::Vector &_ddp)
Set the OneLink linear acceleration (ddp), ie the corresponding iDynLink linear acceleration (ddp) (i...
void computeAngVelBackward(OneLinkNewtonEuler *prev)
[Forward Newton-Euler] compute angular velocity of the previous link frame
void computeMomentForward(OneLinkNewtonEuler *prev)
[Inverse Newton-Euler] compute moment from the previous link
virtual const yarp::sig::Vector & getAngAccM() const
void computeAngAccM(OneLinkNewtonEuler *prev)
[Forward Newton-Euler] compute angular acceleration of the rotor
virtual const yarp::sig::Vector & getr(bool proj=false)
virtual bool setAsBase(const yarp::sig::Vector &_F, const yarp::sig::Vector &_Mu)
virtual double getFv() const
virtual bool setAngAccM(const yarp::sig::Vector &_dwM)
Set the OneLink angular acceleration of the motor (dwM), ie the corresponding iDynLink angular accele...
void ForwardWrench(OneLinkNewtonEuler *prev)
[Inverse Newton-Euler] Compute F, Mu, Tau
void computeLinAccC()
[Forward Newton-Euler] compute linear acceleration of the center of mass
void computeAngAcc(OneLinkNewtonEuler *prev)
[Forward Newton-Euler] compute angular acceleration of the link
yarp::sig::Vector getZM() const
virtual bool setAngVel(const yarp::sig::Vector &_w)
Set the OneLink angular velocity (w), ie the corresponding iDynLink angular velocity (w) (in the chil...
void ForwardKinematics(OneLinkNewtonEuler *prev)
[Forward Newton-Euler] Compute w, dw, ddp, ddpC, dwM
void computeAngVel(OneLinkNewtonEuler *prev)
[Forward Newton-Euler] compute angular velocity of the link
void computeForceForward(OneLinkNewtonEuler *prev)
[Inverse Newton-Euler] compute force from the previous link
virtual ~OneLinkNewtonEuler()
Destructor.
virtual double getKr() const
void BackwardKinematics(OneLinkNewtonEuler *prev)
[Backward Kinematic computation] Compute w, dw, ddp, ddpC, dwM
yarp::sig::Vector z0
z0=[0 0 1]'
virtual const yarp::sig::Vector & getAngAcc() const
void computeMomentBackward(OneLinkNewtonEuler *next)
[Backward Newton-Euler] compute moment from the following link
yarp::sig::Vector zm
z^{i-1}_{m_{i}} versor rotating solidally with link i, projected in frame i ==>> constant
unsigned int verbose
verbosity flag
virtual void setTorque(const double _Tau)
Set the OneLink torque, ie the corresponding iDynLink joint torque (nothing in the child classes deri...
virtual std::string toString() const
Useful to print some information.
virtual const yarp::sig::Vector & getLinAcc() const
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 ...
virtual double getFs() const
virtual double getMass() const
NewEulMode getMode() const
void computeAngAccBackward(OneLinkNewtonEuler *prev)
[Forward Newton-Euler] compute angular acceleration of the previous link frame
A class for setting a virtual sensor link.
bool setAngAcc(const yarp::sig::Vector &_dw)
Set the OneLink angular acceleration (dw), ie the corresponding iDynLink angular acceleration (dw) (i...
yarp::sig::Matrix H
the roto-translational matrix from the i-th link to the sensor: it's the matrix describing the sensor...
yarp::sig::Matrix I
the semi-link inertia
yarp::sig::Matrix COM
the roto-translational matrix of the COM of the semi-link (bewteen sensor and ith link frame)
bool setAngVel(const yarp::sig::Vector &_w)
Set the OneLink angular velocity (w), ie the corresponding iDynLink angular velocity (w) (in the chil...
bool setMeasuredFMu(const yarp::sig::Vector &_F, const yarp::sig::Vector &_Mu)
Set the sensor measured force/moment - if measured by a FT sensor.
const yarp::sig::Matrix & getRC()
void computeMoment(iDynLink *link)
const yarp::sig::Vector & getrC(bool proj=false)
bool setAngAccM(const yarp::sig::Vector &_dwM)
Set the OneLink angular acceleration of the motor (dwM), ie the corresponding iDynLink angular accele...
const yarp::sig::Vector & getForce() const
const yarp::sig::Vector zeros0
void computeForceToLink(iDynLink *link)
void computeMomentToLink(iDynLink *link)
void BackwardAttachToLink(iDynLink *link)
Compute F,Mu given the reference frame of the link where the sensor is.
void computeAngVel(iDynLink *link)
void ForwardForcesMomentsToLink(iDynLink *link)
Forward the sensor forces and moments, measured by the sensor, to the reference frame of the link whe...
yarp::sig::Vector rc_proj
virtual ~SensorLinkNewtonEuler()
Destructor.
const yarp::sig::Matrix & getR()
yarp::sig::Vector getForceMoment() const
Get the sensor force and moment in a single (6x1) vector.
virtual std::string getType() const
const yarp::sig::Vector & getAngVel() const
const yarp::sig::Matrix & getH() const
SensorLinkNewtonEuler(const yarp::sig::Matrix &_H, const yarp::sig::Matrix &_COM, const double _m, const yarp::sig::Matrix &_I, const NewEulMode _mode, unsigned int verb=iCub::skinDynLib::NO_VERBOSE)
Constructor.
void computeAngAcc(iDynLink *link)
yarp::sig::Vector F
measured or estimated force
bool setForce(const yarp::sig::Vector &_F)
Set the OneLink force: either the corresponding iDynLink force, or the one declared as member in the ...
void ForwardAttachToLink(iDynLink *link)
Compute w,dw,ddp,dppC given the reference frame of the link where the sensor is.
const yarp::sig::Vector & getAngAcc() const
bool setMoment(const yarp::sig::Vector &_Mu)
Set the OneLink moment: either the corresponding iDynLink moment, or the one declared as member in th...
void computeLinAcc(iDynLink *link)
const yarp::sig::Vector & getAngAccM() const
std::string toString() const
Useful to print some information.
yarp::sig::Vector ddpC
linear acceleration of the COM
const yarp::sig::Vector & getr(bool proj=false)
const yarp::sig::Vector & getLinAcc() const
bool setLinAccC(const yarp::sig::Vector &_ddpC)
Set the OneLink linear acceleration of the COM (ddpC), ie the corresponding iDynLink linear accelerat...
yarp::sig::Vector dw
angular acceleration
void computeForce(iDynLink *link)
const yarp::sig::Vector & getMoment(bool isBase=false) const
yarp::sig::Vector ddp
linear acceleration
yarp::sig::Vector Mu
measured or estimated moment
void setTorque(const double _Tau)
Set the OneLink torque, ie the corresponding iDynLink joint torque (nothing in the child classes deri...
SensorLinkNewtonEuler(const NewEulMode _mode, unsigned int verb=iCub::skinDynLib::NO_VERBOSE)
Default constructor.
bool setSensor(const yarp::sig::Matrix &_H, const yarp::sig::Matrix &_HC, const double _m, const yarp::sig::Matrix &_I)
Set a new sensor or new sensor properties.
double m
the semi-link mass (the portion of link defined by the sensor)
yarp::sig::Vector w
angular velocity
const yarp::sig::Matrix & getInertia() const
bool setLinAcc(const yarp::sig::Vector &_ddp)
Set the OneLink linear acceleration (ddp), ie the corresponding iDynLink linear acceleration (ddp) (i...
const yarp::sig::Vector & getLinAccC() const
A class for defining the 7-DOF iCub Arm in the iDyn framework.
A class for defining the 7-DOF iCub Arm in the iDyn framework.
A class for setting a virtual sensor link on the iCub arm, for the arm FT sensor.
virtual ~iCubArmSensorLink()
Destructor.
std::string getType() const
std::string type
the arm type: left/right
iCubArmSensorLink(const std::string &_type, const NewEulMode _mode=DYNAMIC, unsigned int verb=iCub::skinDynLib::NO_VERBOSE)
Constructor: the sensor parameters are automatically set with "right" or "left" choice.
A class for defining the 6-DOF iCub Leg.
A class for setting a virtual sensor link on the iCub leg, for the leg FT sensor.
virtual ~iCubLegSensorLink()
Destructor.
std::string getType() const
iCubLegSensorLink(const std::string _type, const NewEulMode _mode=DYNAMIC, unsigned int verb=iCub::skinDynLib::NO_VERBOSE)
Constructor: the sensor parameters are automatically set with "right" or "left" choice.
std::string type
the leg type: left/right
A Base class for defining a Serial Link Chain, using dynamics and kinematics.
A class for computing force/moment of the FT sensor placed in the middle of the iCub's left or right ...
iDynInvSensorArmNoTorso(iDyn::iCubArmNoTorsoDyn *_c, const NewEulMode _mode=DYNAMIC, unsigned int verb=iCub::skinDynLib::NO_VERBOSE)
Constructor: the sensor is automatically set with "right" or "left" choice.
std::string getType() const
A class for computing force/moment of the FT sensor placed in the middle of the iCub's left or right ...
iDynInvSensorArm(iDyn::iCubArmDyn *_c, const NewEulMode _mode=DYNAMIC, unsigned int verb=iCub::skinDynLib::NO_VERBOSE)
Constructor: the sensor is automatically set with "right" or "left" choice.
std::string getType() const
A class for computing force/moment of the FT sensor placed in the middle of the iCub's left or right ...
std::string getType() const
iDynInvSensorLeg(iDyn::iCubLegDyn *_c, const NewEulMode _mode=DYNAMIC, unsigned int verb=iCub::skinDynLib::NO_VERBOSE)
Constructor: the sensor is automatically set with "right" or "left" choice.
A class for computing force/moment of a sensor placed anywhere in a kinematic chain; its position in ...
yarp::sig::Matrix getCOM() const
Get the sensor roto-traslational matrix of the center of mass of the semi-link defined by the sensor ...
void setSensorInfo(const std::string &_info)
yarp::sig::Matrix getH() const
Get the sensor roto-translational matrix defining its position/orientation wrt the link.
void setMode(const NewEulMode _mode=DYNAMIC)
iDynInvSensor(iDyn::iDynChain *_c, unsigned int i, const yarp::sig::Matrix &_H, const yarp::sig::Matrix &_HC, const double _m, const yarp::sig::Matrix &_I, const std::string &_info, const NewEulMode _mode=DYNAMIC, unsigned int verb=0)
Constructor with FT sensor.
void setInfo(const std::string &_info)
NewEulMode mode
static/dynamic/etc..
void setVerbose(unsigned int verb=iCub::skinDynLib::VERBOSE)
yarp::sig::Matrix getInertia() const
Get the inertia of the portion of link defined between sensor and i-th frame.
std::string info
a string with useful information if needed
yarp::sig::Vector getSensorMoment() const
Returns the sensor estimated moment.
bool setSensor(unsigned int i, const yarp::sig::Matrix &_H, const yarp::sig::Matrix &_HC, const double _m, const yarp::sig::Matrix &_I)
Set a new sensor or new sensor properties.
std::string getSensorInfo() const
std::string getInfo() const
yarp::sig::Vector getSensorForceMoment() const
Get the sensor force and moment in a single (6x1) vector.
bool setDynamicParameters(const double _m, const yarp::sig::Matrix &_HC, const yarp::sig::Matrix &_I)
Set the dynamic parameters of the the portion of link defined between sensor and i-th frame.
yarp::sig::Vector getSensorForce() const
Returns the sensor estimated force.
iDynInvSensor(iDyn::iDynChain *_c, const std::string &_info, const NewEulMode _mode=DYNAMIC, unsigned int verb=iCub::skinDynLib::NO_VERBOSE)
Constructor without FT sensor: the sensor must be set with setSensor()
SensorLinkNewtonEuler * sens
the sensor
double getMass() const
Get the mass of the portion of link defined between sensor and i-th frame.
void computeSensorForceMoment()
Compute forces and moments at the sensor frame; this method calls special Forward and Backward method...
unsigned int getSensorLink() const
unsigned int lSens
the link where the sensor is attached to
unsigned int verbose
verbosity flag
std::string toString() const
Print some information.
yarp::sig::Vector getTorques() const
iDynChain * chain
the iDynChain describing the robotic chain
A base class for defining a Link with standard Denavit-Hartenberg convention, providing kinematic and...
A class for computing joint force/moment/torque of an iCub arm (left/right) given the FT measurements...
std::string getType() const
iDynSensorArmNoTorso(iDyn::iCubArmNoTorsoDyn *_c, const NewEulMode _mode=DYNAMIC, unsigned int verb=iCub::skinDynLib::NO_VERBOSE)
Constructor: the sensor is automatically set with "right" or "left" choice.
A class for computing joint force/moment/torque of an iCub arm (left/right) given the FT measurements...
iDynSensorArm(iDyn::iCubArmDyn *_c, const NewEulMode _mode=DYNAMIC, unsigned int verb=iCub::skinDynLib::NO_VERBOSE)
Constructor: the sensor is automatically set with "right" or "left" choice.
std::string getType() const
A class for computing joint force/moment/torque of an iCub leg (left/right) given the FT measurements...
iDynSensorLeg(iDyn::iCubLegDyn *_c, const NewEulMode _mode=DYNAMIC, unsigned int verb=iCub::skinDynLib::NO_VERBOSE)
Constructor: the sensor is automatically set with "right" or "left" choice.
std::string getType() const
A class for computing forces and torques in a iDynChain, when a force/torque sensor is placed in the ...
bool setSensorMeasures(const yarp::sig::Vector &F, const yarp::sig::Vector &Mu)
Set the sensor measured force and moment.
bool setSensorMeasures(const yarp::sig::Vector &FM)
Set the sensor measured force and moment at once.
virtual void computeFromSensorNewtonEuler()
The main computation method: given the FT sensor measurements, compute forces moments and torques in ...
virtual void computeWrenchFromSensorNewtonEuler()
The main computation method: given the FT sensor measurements, compute forces moments and torques in ...
yarp::sig::Vector getForce(const unsigned int iLink) const
Returns the i-th link force.
yarp::sig::Matrix getMomentsNewtonEuler() const
Returns the links moments as a matrix, where the i-th col is the i-th moment.
double getTorque(const unsigned int iLink) const
Returns the i-th link torque.
yarp::sig::Vector getTorquesNewtonEuler() const
Returns the links torque as a vector.
iDynSensor(iDyn::iDynChain *_c, std::string _info, const NewEulMode _mode=DYNAMIC, unsigned int verb=iCub::skinDynLib::NO_VERBOSE)
Constructor without FT sensor: the sensor must be set with setSensor()
yarp::sig::Matrix getForcesNewtonEuler() const
Returns the links forces as a matrix, where the i-th col is the i-th force.
iDynSensor(iDyn::iDynChain *_c, unsigned int i, const yarp::sig::Matrix &_H, const yarp::sig::Matrix &_HC, const double _m, const yarp::sig::Matrix &_I, std::string _info, const NewEulMode _mode=DYNAMIC, unsigned int verb=iCub::skinDynLib::NO_VERBOSE)
Constructor with FT sensor.
yarp::sig::Vector getMoment(const unsigned int iLink) const
Returns the i-th link moment.
yarp::sig::Matrix getForces() const
Returns the links forces as a matrix, where the i-th col is the i-th force.
virtual bool computeFromSensorNewtonEuler(const yarp::sig::Vector &FMu)
The main computation method: given the FT sensor measurements, compute forces moments and torques in ...
virtual bool computeFromSensorNewtonEuler(const yarp::sig::Vector &F, const yarp::sig::Vector &Mu)
The main computation method: given the FT sensor measurements, compute forces moments and torques in ...
yarp::sig::Matrix getMoments() const
Returns the links moments as a matrix, where the i-th col is the i-th moment.
virtual yarp::sig::Vector getForceMomentEndEff() const
Returns the end-effector force-moment as a single (6x1) vector.
yarp::sig::Vector getTorques() const
Returns the links torque as a vector.
const std::string ChainIterationMode_s[2]
@ DYNAMIC_CORIOLIS_GRAVITY
const std::string NewEulMode_s[4]
const std::string ChainComputationMode_s[4]
This file contains the definition of unique IDs for the body parts and the skin parts of the robot.