iCub-main
|
Class representing an external contact acting on the iCub' skin. More...
#include <skinContact.h>
Public Member Functions | |
skinContact () | |
Empty contructor. More... | |
skinContact (const dynContact &c) | |
Create a skinContact starting from a dynContact. More... | |
skinContact (const BodyPart &_bodyPart, const SkinPart &_skinPart, unsigned int _linkNumber, const yarp::sig::Vector &_CoP, const yarp::sig::Vector &_geoCenter, unsigned int _activeTaxels, double _pressure) | |
Constructor. More... | |
skinContact (const BodyPart &_bodyPart, const SkinPart &_skinPart, unsigned int _linkNumber, const yarp::sig::Vector &_CoP, const yarp::sig::Vector &_geoCenter, std::vector< unsigned int > _taxelList, double _pressure) | |
Constructor with list of active taxels. More... | |
skinContact (const BodyPart &_bodyPart, const SkinPart &_skinPart, unsigned int _linkNumber, const yarp::sig::Vector &_CoP, const yarp::sig::Vector &_geoCenter, unsigned int _activeTaxels, double _pressure, const yarp::sig::Vector &_normalDir) | |
Constructor with contact surface normal. More... | |
skinContact (const BodyPart &_bodyPart, const SkinPart &_skinPart, unsigned int _linkNumber, const yarp::sig::Vector &_CoP, const yarp::sig::Vector &_geoCenter, std::vector< unsigned int > _taxelList, double _pressure, const yarp::sig::Vector &_normalDir) | |
Constructor with contact surface normal and list of active taxels. More... | |
skinContact (const BodyPart &_bodyPart, const SkinPart &_skinPart, unsigned int _linkNumber, const yarp::sig::Vector &_CoP, const yarp::sig::Vector &_geoCenter, std::vector< unsigned int > _taxelList, double _pressure, const yarp::sig::Vector &_normalDir, const yarp::sig::Vector &_F, const yarp::sig::Vector &_Mu) | |
Constructor with contact surface normal, list of active taxels, direction of contact force, and moment applied at this contact. More... | |
const yarp::sig::Vector & | getGeoCenter () const |
Get the contact geometric center, expressed in the link reference frame. More... | |
const yarp::sig::Vector & | getNormalDir () const |
Get the direction normal to the contact area, expressed in the link reference frame. More... | |
double | getPressure () const |
Get the average pressure measured at this contact. More... | |
unsigned int | getActiveTaxels () const |
Get the number of active taxels. More... | |
SkinPart | getSkinPart () const |
Get the skin part on which this contact is applied. More... | |
std::string | getSkinPartName () const |
Get the name of the skin part on which this contact is applied. More... | |
std::vector< unsigned int > | getTaxelList () const |
Get the list of id's of the taxels activated by this contact. More... | |
bool | setGeoCenter (const yarp::sig::Vector &_geoCenter) |
Set the geometric center of the contact area (link reference frame). More... | |
bool | setNormalDir (const yarp::sig::Vector &_normalDir) |
Set the normal direction of the contact area, expressed in link reference frame. More... | |
bool | setPressure (double _pressure) |
Set the average contact pressure. More... | |
void | setActiveTaxels (unsigned int _activeTaxels) |
Set the number of active taxels. More... | |
void | setSkinPart (SkinPart _skinPart) |
Set the skin part on which this contact is applied. More... | |
void | setTaxelList (const std::vector< unsigned int > &list) |
Set the list of taxels that are activated by this contact. More... | |
virtual bool | read (yarp::os::ConnectionReader &connection) override |
virtual bool | write (yarp::os::ConnectionWriter &connection) const override |
Write this skinContact to a connection. More... | |
virtual yarp::sig::Vector | toVector () const |
Convert this skinContact to a vector. More... | |
virtual bool | fromVector (const yarp::sig::Vector &v) |
Convert the specified vector into a skinContact. More... | |
virtual std::string | toString (int precision=-1) const override |
Convert this skinContact into a string. More... | |
Public Member Functions inherited from iCub::skinDynLib::dynContact | |
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 void | setVerbose (unsigned int verb=VERBOSE) |
Set the verbosity level of comments during operations. More... | |
Protected Attributes | |
SkinPart | skinPart |
double | pressure |
yarp::sig::Vector | geoCenter |
yarp::sig::Vector | normalDir |
unsigned int | activeTaxels |
std::vector< unsigned int > | taxelList |
Protected Attributes inherited from iCub::skinDynLib::dynContact | |
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... | |
Additional Inherited Members | |
Protected Member Functions inherited from iCub::skinDynLib::dynContact | |
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="") |
Static Protected Attributes inherited from iCub::skinDynLib::dynContact | |
static unsigned long | ID = 1 |
Class representing an external contact acting on the iCub' skin.
Definition at line 49 of file skinContact.h.
skinContact::skinContact | ( | ) |
Empty contructor.
Definition at line 57 of file skinContact.cpp.
skinContact::skinContact | ( | const dynContact & | c | ) |
Create a skinContact starting from a dynContact.
Definition at line 25 of file skinContact.cpp.
skinContact::skinContact | ( | const BodyPart & | _bodyPart, |
const SkinPart & | _skinPart, | ||
unsigned int | _linkNumber, | ||
const yarp::sig::Vector & | _CoP, | ||
const yarp::sig::Vector & | _geoCenter, | ||
unsigned int | _activeTaxels, | ||
double | _pressure | ||
) |
Constructor.
_bodyPart | the part of the body |
_skinPart | the part of the skin |
_linkNumber | the link number relative to the specified body part |
_CoP | the center of pressure (link reference frame) |
_geoCenter | the geometric center of the contact area (link reference frame) |
_activeTaxels | number of taxels activated |
_pressure | average pressure applied on the contact area |
Definition at line 28 of file skinContact.cpp.
skinContact::skinContact | ( | const BodyPart & | _bodyPart, |
const SkinPart & | _skinPart, | ||
unsigned int | _linkNumber, | ||
const yarp::sig::Vector & | _CoP, | ||
const yarp::sig::Vector & | _geoCenter, | ||
std::vector< unsigned int > | _taxelList, | ||
double | _pressure | ||
) |
Constructor with list of active taxels.
_bodyPart | the part of the body |
_skinPart | the part of the skin |
_linkNumber | the link number relative to the specified body part |
_CoP | the center of pressure (link reference frame) |
_geoCenter | the geometric center of the contact area (link reference frame) |
_taxelList | list of activated taxels |
_pressure | average pressure applied on the contact area |
Definition at line 38 of file skinContact.cpp.
iCub::skinDynLib::skinContact::skinContact | ( | const BodyPart & | _bodyPart, |
const SkinPart & | _skinPart, | ||
unsigned int | _linkNumber, | ||
const yarp::sig::Vector & | _CoP, | ||
const yarp::sig::Vector & | _geoCenter, | ||
unsigned int | _activeTaxels, | ||
double | _pressure, | ||
const yarp::sig::Vector & | _normalDir | ||
) |
Constructor with contact surface normal.
_bodyPart | the part of the body |
_skinPart | the part of the skin |
_linkNumber | the link number relative to the specified body part |
_CoP | the center of pressure (link reference frame) |
_geoCenter | the geometric center of the contact area (link reference frame) |
_activeTaxels | number of taxels activated |
_pressure | average pressure applied on the contact area |
_normalDir | contact area normal direction (link reference frame) |
iCub::skinDynLib::skinContact::skinContact | ( | const BodyPart & | _bodyPart, |
const SkinPart & | _skinPart, | ||
unsigned int | _linkNumber, | ||
const yarp::sig::Vector & | _CoP, | ||
const yarp::sig::Vector & | _geoCenter, | ||
std::vector< unsigned int > | _taxelList, | ||
double | _pressure, | ||
const yarp::sig::Vector & | _normalDir | ||
) |
Constructor with contact surface normal and list of active taxels.
_bodyPart | the part of the body |
_skinPart | the part of the skin |
_linkNumber | the link number relative to the specified body part |
_CoP | the center of pressure (link reference frame) |
_geoCenter | the geometric center of the contact area (link reference frame) |
_taxelList | list of activated taxels |
_pressure | average pressure applied on the contact area |
_normalDir | contact area normal direction (link reference frame) |
skinContact::skinContact | ( | const BodyPart & | _bodyPart, |
const SkinPart & | _skinPart, | ||
unsigned int | _linkNumber, | ||
const yarp::sig::Vector & | _CoP, | ||
const yarp::sig::Vector & | _geoCenter, | ||
std::vector< unsigned int > | _taxelList, | ||
double | _pressure, | ||
const yarp::sig::Vector & | _normalDir, | ||
const yarp::sig::Vector & | _F, | ||
const yarp::sig::Vector & | _Mu | ||
) |
Constructor with contact surface normal, list of active taxels, direction of contact force, and moment applied at this contact.
_bodyPart | the part of the body |
_skinPart | the part of the skin |
_linkNumber | the link number relative to the specified body part |
_CoP | the center of pressure (link reference frame) |
_geoCenter | the geometric center of the contact area (link reference frame) |
_taxelList | list of activated taxels |
_pressure | average pressure applied on the contact area |
_normalDir | contact area normal direction (link reference frame) |
_F | force applied at contact, expressed in link reference frame |
_Mu | the moment applied at this contact, expressed in link reference frame |
Definition at line 48 of file skinContact.cpp.
|
virtual |
Convert the specified vector into a skinContact.
The vector has to contain the following data, in this specific order: 0: contactId; 1: body part id; 2: link number; 3: skin part; 4-6: center of pressure; 7-9: force; 10-12: moment; 13-15: geometric center; 16-18: surface normal direction; 19: number of active taxels; 20-?: list of the id's of the activated taxels; ?: pressure;
v | the vector to convert into a skinContact |
Definition at line 240 of file skinContact.cpp.
|
inline |
Get the number of active taxels.
Definition at line 174 of file skinContact.h.
|
inline |
Get the contact geometric center, expressed in the link reference frame.
Definition at line 159 of file skinContact.h.
|
inline |
Get the direction normal to the contact area, expressed in the link reference frame.
Definition at line 164 of file skinContact.h.
|
inline |
Get the average pressure measured at this contact.
Definition at line 169 of file skinContact.h.
|
inline |
Get the skin part on which this contact is applied.
Definition at line 179 of file skinContact.h.
|
inline |
Get the name of the skin part on which this contact is applied.
Definition at line 184 of file skinContact.h.
|
inline |
Get the list of id's of the taxels activated by this contact.
Definition at line 189 of file skinContact.h.
|
overridevirtual |
Reimplemented from iCub::skinDynLib::dynContact.
Definition at line 155 of file skinContact.cpp.
void skinContact::setActiveTaxels | ( | unsigned int | _activeTaxels | ) |
Set the number of active taxels.
_activeTaxels | the number of taxels activated by this contact |
Definition at line 83 of file skinContact.cpp.
bool skinContact::setGeoCenter | ( | const yarp::sig::Vector & | _geoCenter | ) |
Set the geometric center of the contact area (link reference frame).
_geoCenter | a 3-dim vector containing the geometric center of this contact area |
Definition at line 62 of file skinContact.cpp.
bool skinContact::setNormalDir | ( | const yarp::sig::Vector & | _normalDir | ) |
Set the normal direction of the contact area, expressed in link reference frame.
_normalDir | a 3-dim vector containing the normal to the contact area |
Definition at line 69 of file skinContact.cpp.
bool skinContact::setPressure | ( | double | _pressure | ) |
Set the average contact pressure.
_pressure | the mean contact pressure |
Definition at line 76 of file skinContact.cpp.
void skinContact::setSkinPart | ( | SkinPart | _skinPart | ) |
Set the skin part on which this contact is applied.
_skinPart | the skin part |
Definition at line 88 of file skinContact.cpp.
void skinContact::setTaxelList | ( | const std::vector< unsigned int > & | list | ) |
Set the list of taxels that are activated by this contact.
list | list of id's of the active taxels associated to this contact |
Definition at line 92 of file skinContact.cpp.
|
overridevirtual |
Convert this skinContact into a string.
Useful to print some information.
precision | number of decimal digits to use in the string representation |
Reimplemented from iCub::skinDynLib::dynContact.
Definition at line 264 of file skinContact.cpp.
|
virtual |
Convert this skinContact to a vector.
The size of the vector is 21 plus the number of active taxels. The vector contains this data, in this order: 0: contactId; 1: body part id; 2: link number; 3: skin part; 4-6: center of pressure; 7-9: force; 10-12: moment; 13-15: geometric center; 16-18: surface normal direction; 19: number of active taxels; 20-?: list of the id's of the activated taxels; ?: pressure;
Definition at line 220 of file skinContact.cpp.
|
overridevirtual |
Write this skinContact to a connection.
The skinContact is represented as a list of 8 elements that are:
connection | connection to write to |
Reimplemented from iCub::skinDynLib::dynContact.
Definition at line 99 of file skinContact.cpp.
|
protected |
Definition at line 62 of file skinContact.h.
|
protected |
Definition at line 58 of file skinContact.h.
|
protected |
Definition at line 60 of file skinContact.h.
|
protected |
Definition at line 56 of file skinContact.h.
|
protected |
Definition at line 53 of file skinContact.h.
|
protected |
Definition at line 64 of file skinContact.h.