iCub-main
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
iCub::skinDynLib::skinPart Class Reference

Class that encloses everything relate to a skinPart. More...

#include <skinPart.h>

+ Inheritance diagram for iCub::skinDynLib::skinPart:

Public Member Functions

 skinPart ()
 Constructor. More...
 
 skinPart (const std::string &_filePath)
 Constructor with the configuration file to load from. More...
 
 skinPart (const skinPart &_sp)
 Copy constructor. More...
 
skinPartoperator= (const skinPart &_sp)
 Copy Operator. More...
 
bool setTaxelPosesFromFile (const std::string &_filePath, const std::string &_spatial_sampling="default")
 Populates the skinPart by reading from a file. More...
 
bool initRepresentativeTaxels ()
 Initializes the mapping between the taxels and their representatives (i.e. More...
 
int getTaxelsSize ()
 gets the size of the taxel vector (it differs from skinPartBase::getSize()) More...
 
void clearTaxels ()
 Clears the vector of taxels properly and gracefully. More...
 
void print (int verbosity=0)
 Print Method. More...
 
std::string toString (int precision=0)
 toString Method More...
 
 ~skinPart ()
 Destructor. More...
 
- Public Member Functions inherited from iCub::skinDynLib::skinPartBase
 skinPartBase ()
 Constructor. More...
 
 skinPartBase (const skinPartBase &_spb)
 Copy constructor. More...
 
virtual skinPartBaseoperator= (const skinPartBase &_sp)
 Copy Operator. More...
 
void setName (const std::string &_name)
 Sets the name of the class. More...
 
std::string getName ()
 Gets the name of the class. More...
 
void setSize (int _size)
 Sets the size of the class. More...
 
int getSize ()
 Gets the size of the class. More...
 
void setVersion (const std::string &_version)
 Sets the version ("V1" / "V2" / "V2.1") More...
 
std::string getVersion ()
 Gets the version. More...
 

Public Attributes

std::vector< Taxel * > taxels
 List of taxels that belong to the skinPart. More...
 
std::string spatial_sampling
 Spatial_sampling used in building up the skinPart class. More...
 
std::vector< int > taxel2Repr
 Indexing variable used in the case of reducing the resolution - e.g. More...
 
std::map< int, std::list< unsigned int > > repr2TaxelList
 Mapping in the opposite direction Indexed by representative taxel IDs, it stores lists of the taxels being represented - e.g. More...
 
- Public Attributes inherited from iCub::skinDynLib::skinPartBase
std::string name
 
int size
 
std::string version
 
std::recursive_mutex recursive_mtx
 

Protected Member Functions

bool setTaxelPosesFromFileOld (const std::string &_filePath)
 Populates the skinPart by reading from a file - old convention. More...
 
bool mapTaxelsOntoThemselves ()
 Maps the taxels onto themselves, performing a 1:1 mapping. More...
 

Detailed Description

Class that encloses everything relate to a skinPart.

It consists of a std::vector of Taxel(s), and a number of methods for loading and populating these taxels from files.

Definition at line 145 of file skinPart.h.

Constructor & Destructor Documentation

◆ skinPart() [1/3]

skinPart::skinPart ( )

Constructor.

Definition at line 79 of file skinPart.cpp.

◆ skinPart() [2/3]

skinPart::skinPart ( const std::string &  _filePath)

Constructor with the configuration file to load from.

Parameters
_filePathis the absolute path of the file to read

Definition at line 84 of file skinPart.cpp.

◆ skinPart() [3/3]

skinPart::skinPart ( const skinPart _sp)

Copy constructor.

Parameters
_spis the skinPart to copy from

Definition at line 89 of file skinPart.cpp.

◆ ~skinPart()

skinPart::~skinPart ( )

Destructor.

Definition at line 395 of file skinPart.cpp.

Member Function Documentation

◆ clearTaxels()

void skinPart::clearTaxels ( )

Clears the vector of taxels properly and gracefully.

WARNING: it deletes the pointed objects as well!

Definition at line 335 of file skinPart.cpp.

◆ getTaxelsSize()

int skinPart::getTaxelsSize ( )

gets the size of the taxel vector (it differs from skinPartBase::getSize())

Returns
the size of the taxel vector

Definition at line 330 of file skinPart.cpp.

◆ initRepresentativeTaxels()

bool skinPart::initRepresentativeTaxels ( )

Initializes the mapping between the taxels and their representatives (i.e.

the centers of the triangles)

Returns
true/false in case of success/failure

Definition at line 313 of file skinPart.cpp.

◆ mapTaxelsOntoThemselves()

bool skinPart::mapTaxelsOntoThemselves ( )
protected

Maps the taxels onto themselves, performing a 1:1 mapping.

This has been made in order for the "taxel" spatial_sampling modality to be consistent with the "triangle" sampling, thus maintaining integrity into taxel2Repr and repr2TaxelList

Returns
true/false in case of success/failure

Definition at line 285 of file skinPart.cpp.

◆ operator=()

skinPart & skinPart::operator= ( const skinPart _sp)

Copy Operator.

Parameters
_spis the skinPart to copy from

Definition at line 94 of file skinPart.cpp.

◆ print()

void skinPart::print ( int  verbosity = 0)
virtual

Print Method.

Parameters
verbosityis the verbosity level

Reimplemented from iCub::skinDynLib::skinPartBase.

Definition at line 349 of file skinPart.cpp.

◆ setTaxelPosesFromFile()

bool skinPart::setTaxelPosesFromFile ( const std::string &  _filePath,
const std::string &  _spatial_sampling = "default" 
)
virtual

Populates the skinPart by reading from a file.

Parameters
_filePathis the full absolute path of the file
_spatial_samplingis the type of spatial sampling to perform (default "default") if "default", the spatial_sampling will be read from file if "taxel" or "triangle", this will be the spatial_sampling performed
Returns
true/false in case of success/failure

Reimplemented from iCub::skinDynLib::skinPartBase.

Definition at line 118 of file skinPart.cpp.

◆ setTaxelPosesFromFileOld()

bool skinPart::setTaxelPosesFromFileOld ( const std::string &  _filePath)
protected

Populates the skinPart by reading from a file - old convention.

Spatial Sampling will be forced to "taxel"

Parameters
_filePathis the full absolute path of the file
Returns
true/false in case of success/failure

Definition at line 234 of file skinPart.cpp.

◆ toString()

std::string skinPart::toString ( int  precision = 0)
virtual

toString Method

Parameters
verbosityis the verbosity level

Reimplemented from iCub::skinDynLib::skinPartBase.

Definition at line 386 of file skinPart.cpp.

Member Data Documentation

◆ repr2TaxelList

std::map<int, std::list<unsigned int> > iCub::skinDynLib::skinPart::repr2TaxelList

Mapping in the opposite direction Indexed by representative taxel IDs, it stores lists of the taxels being represented - e.g.

all taxels of a triangle

Definition at line 170 of file skinPart.h.

◆ spatial_sampling

std::string iCub::skinDynLib::skinPart::spatial_sampling

Spatial_sampling used in building up the skinPart class.

It can be either full, i.e. "taxel", or "triangle", where the latter remaps the individual taxels onto the center taxels of their respective triangular module (composed of 10 taxels, but 12 values on the port - 2 are thermal pads)

Definition at line 158 of file skinPart.h.

◆ taxel2Repr

std::vector<int> iCub::skinDynLib::skinPart::taxel2Repr

Indexing variable used in the case of reducing the resolution - e.g.

taking only triangle centers The index into the vector is the taxel ID, the value stored is its representative

Definition at line 164 of file skinPart.h.

◆ taxels

std::vector<Taxel*> iCub::skinDynLib::skinPart::taxels

List of taxels that belong to the skinPart.

Definition at line 151 of file skinPart.h.


The documentation for this class was generated from the following files: