iCub-main
|
Class representing an external contact acting on a link of the robot body. More...
#include <dynContact.h>
Public Member Functions | |
dynContact () | |
Default constructor. More... | |
dynContact (const BodyPart &_bodyPart, unsigned int _linkNumber, const yarp::sig::Vector &_CoP) | |
Constructor with unknown moment and force direction. More... | |
dynContact (const BodyPart &_bodyPart, unsigned int _linkNumber, const yarp::sig::Vector &_CoP, const yarp::sig::Vector &_Mu) | |
Constructor with known moment (usually zero) and unknown force direction. More... | |
dynContact (const BodyPart &_bodyPart, unsigned int _linkNumber, const yarp::sig::Vector &_CoP, const yarp::sig::Vector &_Mu, const yarp::sig::Vector &_Fdir) | |
Constructor with known moment (usually zero) and known force direction. More... | |
virtual yarp::sig::Vector | getForceMoment () const |
Get the contact force and moment in a single (6x1) vector. More... | |
virtual const yarp::sig::Vector & | getForce () const |
Get the contact force. More... | |
virtual const yarp::sig::Vector & | getForceDirection () const |
Get the contact force direction. More... | |
virtual double | getForceModule () const |
Get the contact force module. More... | |
virtual const yarp::sig::Vector & | getMoment () const |
Get the contact moment. More... | |
virtual const yarp::sig::Vector & | getCoP () const |
Get the contact center of pressure expressed in the link reference frame. More... | |
virtual unsigned int | getLinkNumber () const |
Get the link number (where 0 is the first link of the chain). More... | |
virtual BodyPart | getBodyPart () const |
Get the body part of the contact. More... | |
virtual std::string | getBodyPartName () const |
Get the name of the contact body part. More... | |
virtual unsigned long | getId () const |
Get the id of this contact. More... | |
virtual bool | isMomentKnown () const |
Get true if the moment applied at this contact is known a-priori. More... | |
virtual bool | isForceDirectionKnown () const |
Get true if the direction of the force applied at this contact is known a-priori. More... | |
virtual bool | setForce (const yarp::sig::Vector &_F) |
Set the contact force. More... | |
virtual bool | setForceModule (double _Fmodule) |
Set the contact force module. More... | |
virtual bool | setForceDirection (const yarp::sig::Vector &_Fdir) |
Set the direction of the contact force. More... | |
virtual bool | setMoment (const yarp::sig::Vector &_Mu) |
Set the contact moment. More... | |
virtual bool | setForceMoment (const yarp::sig::Vector &_F, const yarp::sig::Vector &_Mu) |
Set the contact force and moment. More... | |
virtual bool | setForceMoment (const yarp::sig::Vector &_FMu) |
Set the contact force and moment as a single (6x1) vector. More... | |
virtual bool | setCoP (const yarp::sig::Vector &_CoP) |
Set the contact center of pressure in link reference frame. More... | |
virtual void | setLinkNumber (unsigned int _linkNum) |
Set the contact link number (0 is the first link) More... | |
virtual void | setBodyPart (BodyPart _bodyPart) |
Set the body part of this contact. More... | |
virtual bool | fixForceDirection (const yarp::sig::Vector &_Fdir) |
Fix the direction of the contact force. More... | |
virtual bool | fixMoment () |
Equivalent to calling fixMoment(zeros(3)). More... | |
virtual bool | fixMoment (const yarp::sig::Vector &_Mu) |
Fix the contact moment. More... | |
virtual void | unfixForceDirection () |
Set the flag fDirKnown to false so that when estimating the contact wrenches the solver estimates also the force direction and does not consider it as known a-priori. More... | |
virtual void | unfixMoment () |
Set the flag muKnown to false so that when estimating the contact wrenches the solver estimates also the contact moment and does not consider it as known a-priori. More... | |
virtual bool | read (yarp::os::ConnectionReader &connection) override |
virtual bool | write (yarp::os::ConnectionWriter &connection) const override |
Write dynContact to a connection as a list of 4 elements, that are: More... | |
virtual std::string | toString (int precision=-1) const |
Convert this contact into a string. More... | |
virtual void | setVerbose (unsigned int verb=VERBOSE) |
Set the verbosity level of comments during operations. More... | |
Protected Member Functions | |
void | init (const BodyPart &_bodyPart, unsigned int _linkNumber, const yarp::sig::Vector &_CoP, const yarp::sig::Vector &_Mu=yarp::sig::Vector(0), const yarp::sig::Vector &_Fdir=yarp::sig::Vector(0)) |
bool | checkVectorDim (const yarp::sig::Vector &v, unsigned int dim, const std::string &descr="") |
Protected Attributes | |
unsigned long | contactId |
BodyPart | bodyPart |
part of the body of the robot where the contact is applied More... | |
unsigned int | linkNumber |
number of the link where the contact is applied More... | |
yarp::sig::Vector | CoP |
center of pressure of the contact expressed w.r.t. the reference frame of the link More... | |
yarp::sig::Vector | Fdir |
contact force direction (unit vector) More... | |
yarp::sig::Vector | F |
contact force More... | |
double | Fmodule |
contact force module More... | |
yarp::sig::Vector | Mu |
contact moment More... | |
bool | muKnown |
True if the moment applied at the contact point is known. More... | |
bool | fDirKnown |
True if the direction of the force applied at the contact point is known. More... | |
unsigned int | verbose |
verbosity flag More... | |
Static Protected Attributes | |
static unsigned long | ID = 1 |
Class representing an external contact acting on a link of the robot body.
A contact is identified by a unique id, a robot body part, a link number, the center of pressure (CoP), the contact force and moment. All the vectors (i.e. CoP, force, moment) are expressed w.r.t. the reference frame of the link.
This class is used in the process of estimating the contact wrenches. In the estimation process the link number and the contact position are supposed to be known. The force direction and the moment may be either known or unknown, depending on the sensor data.
Definition at line 51 of file dynContact.h.
dynContact::dynContact | ( | ) |
Default constructor.
Definition at line 33 of file dynContact.cpp.
iCub::skinDynLib::dynContact::dynContact | ( | const BodyPart & | _bodyPart, |
unsigned int | _linkNumber, | ||
const yarp::sig::Vector & | _CoP | ||
) |
Constructor with unknown moment and force direction.
_bodyPart | the body part associated to this contact |
_linkNumber | the number of the link on which this contact is applied |
_CoP | the 3-dim center of pressure of this contact in link reference frame |
iCub::skinDynLib::dynContact::dynContact | ( | const BodyPart & | _bodyPart, |
unsigned int | _linkNumber, | ||
const yarp::sig::Vector & | _CoP, | ||
const yarp::sig::Vector & | _Mu | ||
) |
Constructor with known moment (usually zero) and unknown force direction.
_bodyPart | the body part associated to this contact |
_linkNumber | the number of the link on which this contact is applied |
_CoP | the 3-dim center of pressure of this contact in link reference frame |
_Mu | the moment applied at this contact, expressed in link reference frame |
iCub::skinDynLib::dynContact::dynContact | ( | const BodyPart & | _bodyPart, |
unsigned int | _linkNumber, | ||
const yarp::sig::Vector & | _CoP, | ||
const yarp::sig::Vector & | _Mu, | ||
const yarp::sig::Vector & | _Fdir | ||
) |
Constructor with known moment (usually zero) and known force direction.
_bodyPart | the body part associated to this contact |
_linkNumber | the number of the link on which this contact is applied |
_CoP | the 3-dim center of pressure of this contact in link reference frame |
_Mu | the moment applied at this contact, expressed in link reference frame |
_Fdir | the direction of the contact force, expressed in link reference frame |
|
protected |
Definition at line 274 of file dynContact.cpp.
|
virtual |
Fix the direction of the contact force.
Differently from the method setForceDirection, this method also sets the flag 'fDirKnown' to true, so when estimating the contact wrenches the solver considers the force direction of this contact as known a-priori.
_Fdir | the contact force direction |
Definition at line 167 of file dynContact.cpp.
|
virtual |
Equivalent to calling fixMoment(zeros(3)).
Definition at line 175 of file dynContact.cpp.
|
virtual |
Fix the contact moment.
Differently from the method setMoment, this method also sets the flag 'muKnown' to true, so when estimating the contact wrenches the solver considers the moment of this contact as known a-priori.
_Mu | the contact moment |
|
virtual |
Get the body part of the contact.
Definition at line 86 of file dynContact.cpp.
|
virtual |
Get the name of the contact body part.
Definition at line 88 of file dynContact.cpp.
|
virtual |
Get the contact center of pressure expressed in the link reference frame.
Definition at line 82 of file dynContact.cpp.
|
virtual |
|
virtual |
Get the contact force direction.
Definition at line 76 of file dynContact.cpp.
|
virtual |
Get the contact force module.
Definition at line 78 of file dynContact.cpp.
|
virtual |
Get the contact force and moment in a single (6x1) vector.
Definition at line 72 of file dynContact.cpp.
|
virtual |
|
virtual |
Get the link number (where 0 is the first link of the chain).
Definition at line 84 of file dynContact.cpp.
|
virtual |
|
protected |
Definition at line 49 of file dynContact.cpp.
|
virtual |
Get true if the direction of the force applied at this contact is known a-priori.
Definition at line 97 of file dynContact.cpp.
|
virtual |
Get true if the moment applied at this contact is known a-priori.
Definition at line 95 of file dynContact.cpp.
|
overridevirtual |
Reimplemented in iCub::skinDynLib::skinContact.
Definition at line 229 of file dynContact.cpp.
|
virtual |
Set the body part of this contact.
_bodyPart | the contact body part |
Definition at line 161 of file dynContact.cpp.
|
virtual |
Set the contact center of pressure in link reference frame.
_CoP | a 3x1 vector |
Definition at line 150 of file dynContact.cpp.
|
virtual |
Set the contact force.
_F | a 3-dim vector containing the contact force |
Definition at line 101 of file dynContact.cpp.
|
virtual |
Set the direction of the contact force.
_Fdir | a 3-dim vector containing the direction of the contact force |
Definition at line 122 of file dynContact.cpp.
|
virtual |
Set the contact force module.
_Fmodule | the module of the contact force |
Definition at line 111 of file dynContact.cpp.
|
virtual |
Set the contact force and moment.
_F | a 3-dim vector containing the contact force |
_Mu | a 3-dim vector containing the contact moment |
Definition at line 139 of file dynContact.cpp.
|
virtual |
Set the contact force and moment as a single (6x1) vector.
_FMu | a 6x1 vector where 0:2=force 3:5=moment |
Definition at line 143 of file dynContact.cpp.
|
virtual |
Set the contact link number (0 is the first link)
_linkNum | the link number |
Definition at line 157 of file dynContact.cpp.
|
virtual |
Set the contact moment.
_Mu | a 3-dim vector containing the contact moment |
Definition at line 132 of file dynContact.cpp.
|
virtual |
Set the verbosity level of comments during operations.
verb | level of verbosity |
Definition at line 270 of file dynContact.cpp.
|
virtual |
Convert this contact into a string.
Useful to print some information.
precision | number of decimal digits to use in the string representation |
Reimplemented in iCub::skinDynLib::skinContact.
Definition at line 263 of file dynContact.cpp.
|
virtual |
Set the flag fDirKnown to false so that when estimating the contact wrenches the solver estimates also the force direction and does not consider it as known a-priori.
Definition at line 187 of file dynContact.cpp.
|
virtual |
Set the flag muKnown to false so that when estimating the contact wrenches the solver estimates also the contact moment and does not consider it as known a-priori.
Definition at line 189 of file dynContact.cpp.
|
overridevirtual |
Write dynContact to a connection as a list of 4 elements, that are:
connection | the connection to write to |
Reimplemented in iCub::skinDynLib::skinContact.
Definition at line 194 of file dynContact.cpp.
|
protected |
part of the body of the robot where the contact is applied
Definition at line 60 of file dynContact.h.
|
protected |
Definition at line 57 of file dynContact.h.
|
protected |
center of pressure of the contact expressed w.r.t. the reference frame of the link
Definition at line 64 of file dynContact.h.
|
protected |
contact force
Definition at line 68 of file dynContact.h.
|
protected |
contact force direction (unit vector)
Definition at line 66 of file dynContact.h.
|
protected |
True if the direction of the force applied at the contact point is known.
Definition at line 77 of file dynContact.h.
|
protected |
contact force module
Definition at line 70 of file dynContact.h.
|
staticprotected |
Definition at line 55 of file dynContact.h.
|
protected |
number of the link where the contact is applied
Definition at line 62 of file dynContact.h.
|
protected |
contact moment
Definition at line 72 of file dynContact.h.
|
protected |
True if the moment applied at the contact point is known.
Definition at line 75 of file dynContact.h.
|
protected |
verbosity flag
Definition at line 80 of file dynContact.h.