All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
Affordance

Classes

class  hpp::affordance::Affordance
 Class that saves a reference collision object and indices to those of its mesh triangles that form one affordance object. More...
 
class  hpp::affordance::SemanticsData
 Class containing a vector of vectors of Affordance objects. More...
 
class  hpp::affordance::OperationBase
 Base class for the data needed to determine affordances of different types. More...
 
class  hpp::affordance::SupportOperation
 Class that contains the information needed to create affordance objects of type Support. More...
 
class  hpp::affordance::LeanOperation
 Class that contains the information needed to create affordance objects of type Lean. More...
 
class  hpp::affordance::Support45Operation
 Class that contains the information needed to create affordance. More...
 

Functions

void hpp::affordance::searchLinkedTriangles (std::vector< unsigned int > &listPotential, const OperationBasePtr_t &refOp, const std::vector< Triangle > &allTris, std::vector< unsigned int > &searchableTris, const unsigned int &refTriIdx, double &area)
 Free function that searches through a vector of mesh triangles and saves the triangle indices that form a potential affordance object. More...
 
SemanticsDataPtr_t hpp::affordance::affordanceAnalysis (FclConstCollisionObjectPtr_t colObj, const OperationBases_t &opVec)
 Free function that extracts all affordances (of all types) from a given fcl::collisionObject. More...
 
std::vector< CollisionObjects_t > hpp::affordance::getAffordanceObjects (const SemanticsDataPtr_t &sData)
 Free function that, given a semanticsData pointer, creates one fcl::collisionObject for every Affordance object. More...
 
std::vector< CollisionObjects_t > hpp::affordance::getReducedAffordanceObjects (const SemanticsDataPtr_t &sData, std::vector< double > reduceSizes)
 Free function that, given a semanticsData pointer, creates one fcl::collisionObject for every Affordance object. More...
 

Detailed Description

Function Documentation

SemanticsDataPtr_t hpp::affordance::affordanceAnalysis ( FclConstCollisionObjectPtr_t  colObj,
const OperationBases_t &  opVec 
)

Free function that extracts all affordances (of all types) from a given fcl::collisionObject.

Parameters
colObjreference to a fcl::collisionObject pointer the triangles of which will be searched for affordance objects.
opVecvector of operation objects that determine which requirements are set for which affordance type. The length of this vector corresponds to the amount of different affordance types considered.
std::vector<CollisionObjects_t> hpp::affordance::getAffordanceObjects ( const SemanticsDataPtr_t &  sData)

Free function that, given a semanticsData pointer, creates one fcl::collisionObject for every Affordance object.

Parameters
sDatareference to all found Affordance objects.
std::vector<CollisionObjects_t> hpp::affordance::getReducedAffordanceObjects ( const SemanticsDataPtr_t &  sData,
std::vector< double >  reduceSizes 
)

Free function that, given a semanticsData pointer, creates one fcl::collisionObject for every Affordance object.

The object are reduced of

Parameters
reduceSize: each vertice are moved toward the center of this value
sDatareference to all found Affordance objects. NOTE : if there is changes in affordance.impl:: Afford::createOperations (), you should be carefull to the index of the affordance type. The order of the values in reduceSizes correspond to the order of the affordance type in affordance.impl:: Afford::createOperations () FIXME : not working with plane that contain the z axis
void hpp::affordance::searchLinkedTriangles ( std::vector< unsigned int > &  listPotential,
const OperationBasePtr_t &  refOp,
const std::vector< Triangle > &  allTris,
std::vector< unsigned int > &  searchableTris,
const unsigned int &  refTriIdx,
double &  area 
)

Free function that searches through a vector of mesh triangles and saves the triangle indices that form a potential affordance object.

Given a reference triangle index that fullfils the affordance requirements of a given affordance type, the function recursively goes all triangles that ara linked to the the reference. Also saves the through total area of found potential affordance.

Parameters
listPotentialreference to the vector of triangle indices that form one potential affordance object. At every recursive step maximum one triangle is added to the vector.
refOpoperation that determines which affordance type the triangles will be tested for.
allTrisall triangles of a given fcl::collisionObject mesh. This parameter is only used as to verify global (affordance type) and local (neighbouring triangles) requirements, and is not modified within the function.
searchableTrisvector of triangle indices that should be tested in the search for more triangles. Whenever a triangle is found, it is deleted from the vector and will not be tested again. Similarly, if a triangle is tested once and does not fullfil the global requirement set by the affordance type, it is deleted and will not be tested again in subsequent recursive steps.
refTriIdxindex corresponding to the last found triangle that fullfils both the local and the global requirement. It is then used as reference in the following recursive step.
areatotal area of all triangles that are part of the potential affordance object. Every time a triangle fulfilling all set requirements is found, its are is added to the previous total before going to the next recursive step.