iCub-main
|
Class representing an external contact acting on the iCub' skin. More...
#include <skinContact.h>
Public Member Functions | |
skinContact () | |
Empty contructor. | |
skinContact (const dynContact &c) | |
Create a skinContact starting from a dynContact. | |
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. | |
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. | |
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. | |
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. | |
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. | |
const yarp::sig::Vector & | getGeoCenter () const |
Get the contact geometric center, expressed in the link reference frame. | |
const yarp::sig::Vector & | getNormalDir () const |
Get the direction normal to the contact area, expressed in the link reference frame. | |
double | getPressure () const |
Get the average pressure measured at this contact. | |
unsigned int | getActiveTaxels () const |
Get the number of active taxels. | |
SkinPart | getSkinPart () const |
Get the skin part on which this contact is applied. | |
std::string | getSkinPartName () const |
Get the name of the skin part on which this contact is applied. | |
std::vector< unsigned int > | getTaxelList () const |
Get the list of id's of the taxels activated by this contact. | |
bool | setGeoCenter (const yarp::sig::Vector &_geoCenter) |
Set the geometric center of the contact area (link reference frame). | |
bool | setNormalDir (const yarp::sig::Vector &_normalDir) |
Set the normal direction of the contact area, expressed in link reference frame. | |
bool | setPressure (double _pressure) |
Set the average contact pressure. | |
void | setActiveTaxels (unsigned int _activeTaxels) |
Set the number of active taxels. | |
void | setSkinPart (SkinPart _skinPart) |
Set the skin part on which this contact is applied. | |
void | setTaxelList (const std::vector< unsigned int > &list) |
Set the list of taxels that are activated by this contact. | |
virtual bool | read (yarp::os::ConnectionReader &connection) override |
virtual bool | write (yarp::os::ConnectionWriter &connection) const override |
Write this skinContact to a connection. | |
virtual yarp::sig::Vector | toVector () const |
Convert this skinContact to a vector. | |
virtual bool | fromVector (const yarp::sig::Vector &v) |
Convert the specified vector into a skinContact. | |
virtual std::string | toString (int precision=-1) const override |
Convert this skinContact into a string. | |
Public Member Functions inherited from iCub::skinDynLib::dynContact | |
dynContact () | |
Default constructor. | |
dynContact (const BodyPart &_bodyPart, unsigned int _linkNumber, const yarp::sig::Vector &_CoP) | |
Constructor with unknown moment and force direction. | |
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. | |
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. | |
virtual yarp::sig::Vector | getForceMoment () const |
Get the contact force and moment in a single (6x1) vector. | |
virtual const yarp::sig::Vector & | getForce () const |
Get the contact force. | |
virtual const yarp::sig::Vector & | getForceDirection () const |
Get the contact force direction. | |
virtual double | getForceModule () const |
Get the contact force module. | |
virtual const yarp::sig::Vector & | getMoment () const |
Get the contact moment. | |
virtual const yarp::sig::Vector & | getCoP () const |
Get the contact center of pressure expressed in the link reference frame. | |
virtual unsigned int | getLinkNumber () const |
Get the link number (where 0 is the first link of the chain). | |
virtual BodyPart | getBodyPart () const |
Get the body part of the contact. | |
virtual std::string | getBodyPartName () const |
Get the name of the contact body part. | |
virtual unsigned long | getId () const |
Get the id of this contact. | |
virtual bool | isMomentKnown () const |
Get true if the moment applied at this contact is known a-priori. | |
virtual bool | isForceDirectionKnown () const |
Get true if the direction of the force applied at this contact is known a-priori. | |
virtual bool | setForce (const yarp::sig::Vector &_F) |
Set the contact force. | |
virtual bool | setForceModule (double _Fmodule) |
Set the contact force module. | |
virtual bool | setForceDirection (const yarp::sig::Vector &_Fdir) |
Set the direction of the contact force. | |
virtual bool | setMoment (const yarp::sig::Vector &_Mu) |
Set the contact moment. | |
virtual bool | setForceMoment (const yarp::sig::Vector &_F, const yarp::sig::Vector &_Mu) |
Set the contact force and moment. | |
virtual bool | setForceMoment (const yarp::sig::Vector &_FMu) |
Set the contact force and moment as a single (6x1) vector. | |
virtual bool | setCoP (const yarp::sig::Vector &_CoP) |
Set the contact center of pressure in link reference frame. | |
virtual void | setLinkNumber (unsigned int _linkNum) |
Set the contact link number (0 is the first link) | |
virtual void | setBodyPart (BodyPart _bodyPart) |
Set the body part of this contact. | |
virtual bool | fixForceDirection (const yarp::sig::Vector &_Fdir) |
Fix the direction of the contact force. | |
virtual bool | fixMoment () |
Equivalent to calling fixMoment(zeros(3)). | |
virtual bool | fixMoment (const yarp::sig::Vector &_Mu) |
Fix the contact moment. | |
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. | |
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. | |
virtual void | setVerbose (unsigned int verb=VERBOSE) |
Set the verbosity level of comments during operations. | |
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 | |
unsigned int | linkNumber |
number of the link where the contact is applied | |
yarp::sig::Vector | CoP |
center of pressure of the contact expressed w.r.t. the reference frame of the link | |
yarp::sig::Vector | Fdir |
contact force direction (unit vector) | |
yarp::sig::Vector | F |
contact force | |
double | Fmodule |
contact force module | |
yarp::sig::Vector | Mu |
contact moment | |
bool | muKnown |
True if the moment applied at the contact point is known. | |
bool | fDirKnown |
True if the direction of the force applied at the contact point is known. | |
unsigned int | verbose |
verbosity flag | |
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.