hpp-affordance  4.9.0
Implementation to Extract Whole-Body Affordances for Mutli-Contact Planning.
Affordance

Classes

class  hpp::affordance::Affordance
 
class  hpp::affordance::SemanticsData
 
class  hpp::affordance::OperationBase
 
class  hpp::affordance::SupportOperation
 
class  hpp::affordance::LeanOperation
 objects of type Lean. Inherits the OperationBase class. More...
 
class  hpp::affordance::Support45Operation
 objects of type Lean. Inherits the OperationBase class. 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)
 
SemanticsDataPtr_t hpp::affordance::affordanceAnalysis (FclConstCollisionObjectPtr_t colObj, const OperationBases_t &opVec)
 
std::vector< CollisionObjects_thpp::affordance::getAffordanceObjects (const SemanticsDataPtr_t &sData)
 
std::vector< CollisionObjects_thpp::affordance::getReducedAffordanceObjects (const SemanticsDataPtr_t &sData, std::vector< double > reduceSizes)
 

Detailed Description

Function Documentation

◆ affordanceAnalysis()

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.

◆ getAffordanceObjects()

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.

◆ getReducedAffordanceObjects()

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

◆ searchLinkedTriangles()

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.