hpp-rbprm  4.15.1
Implementation of RB-PRM planner using hpp.
hpp::rbprm::sampling Namespace Reference

Classes

struct  AnalysisFactory
 
struct  HeuristicParam
 Defines a parameters set for the ZMP-based heuristic. More...
 
struct  Vec2D
 Data structure to store 2-dimensional informations (2D vectors) More...
 
struct  Plane
 
struct  HeuristicFactory
 
class  OctreeNode
 
struct  OctreeReport
 
struct  sample_compare
 
class  SampleDB
 
class  Sample
 
struct  sample_greater
 

Typedefs

typedef double(* heuristic) (const sampling::Sample &sample, const Eigen::Vector3d &direction, const Eigen::Vector3d &normal, const HeuristicParam &params)
 
typedef shared_ptr< OctreeNodeOctreeNodePtr_t
 
typedef std::multiset< OctreeReport, sample_compareT_OctreeReport
 
typedef std::vector< double > T_Double
 
typedef std::map< std::string, T_DoubleT_Values
 
typedef sampling::SampleVector_t T_Sample
 
typedef boost::function< double(const SampleDB &sampleDB, const sampling::Sample &sample)> evaluate
 
typedef std::map< std::string, evaluateT_evaluate
 
typedef std::pair< std::size_t, std::size_t > VoxelSampleId
 
typedef std::map< long int, VoxelSampleIdT_VoxelSampleId
 
typedef std::pair< double, double > ValueBound
 
typedef std::map< std::string, ValueBoundT_ValueBound
 
typedef shared_ptr< SampleSamplePtr_t
 
typedef std::vector< Sample, Eigen::aligned_allocator< Sample > > SampleVector_t
 

Functions

fcl::Vec3f transform (const fcl::Vec3f &p, const fcl::Vec3f &tr, const fcl::Matrix3f &ro)
 
bool operator== (const Vec2D &v1, const Vec2D &v2)
 
bool operator!= (const Vec2D &v1, const Vec2D &v2)
 
std::ostream & operator<< (std::ostream &out, const Vec2D &v)
 
template<typename T >
bool contains (const std::vector< T > &vect, const T &val)
 Function to verify the existence of an element in a std::vector. More...
 
double computeAngle (const Vec2D &center, const Vec2D &end1, const Vec2D &end2)
 
std::vector< Vec2DcomputeSupportPolygon (const std::map< std::string, fcl::Vec3f > &contactPositions)
 
std::vector< Vec2DconvexHull (std::vector< Vec2D > set)
 
Vec2D weightedCentroidConvex2D (const std::vector< Vec2D > &convexPolygon)
 
void removeNonGroundContacts (std::map< std::string, fcl::Vec3f > &contacts, double groundThreshold)
 
 HPP_PREDEF_CLASS (OctreeNode)
 
 HPP_PREDEF_CLASS (SampleDB)
 
HPP_RBPRM_DLLAPI SampleDBaddValue (SampleDB &database, const std::string &valueName, const evaluate eval, bool isStaticValue=true, bool sortSamples=true)
 
HPP_RBPRM_DLLAPI bool saveLimbDatabase (const SampleDB &database, std::ofstream &dbFile)
 
HPP_RBPRM_DLLAPI T_OctreeReport GetCandidates (const SampleDB &sc, const fcl::Transform3f &treeTrf, const hpp::pinocchio::CollisionObjectPtr_t &o2, const fcl::Vec3f &direction, const HeuristicParam &params, const heuristic evaluate=0)
 
HPP_RBPRM_DLLAPI bool GetCandidates (const SampleDB &sc, const fcl::Transform3f &treeTrf, const hpp::pinocchio::CollisionObjectPtr_t &o2, const fcl::Vec3f &direction, T_OctreeReport &report, const HeuristicParam &params, const heuristic evaluate=0)
 
 HPP_PREDEF_CLASS (Sample)
 
SampleVector_t GenerateSamples (const pinocchio::JointPtr_t limb, const std::string &effector, const std::size_t nbSamples, const fcl::Vec3f &offset=fcl::Vec3f(0, 0, 0), const fcl::Vec3f &limbOffset=fcl::Vec3f(0, 0, 0))
 
void Load (const Sample &sample, pinocchio::ConfigurationOut_t robot)
 

Typedef Documentation

◆ evaluate

typedef boost::function<double(const SampleDB& sampleDB, const sampling::Sample& sample)> hpp::rbprm::sampling::evaluate

Defines an evaluation function for a sample.

Parameters
SampleDBused database with already computed values
samplesample candidate
normalcontact surface normal relatively to the candidate

◆ heuristic

typedef double(* hpp::rbprm::sampling::heuristic) (const sampling::Sample &sample, const Eigen::Vector3d &direction, const Eigen::Vector3d &normal, const HeuristicParam &params)

Defines a heuristic method to sort samples the higher the score, the better the sample in presented joint

Parameters
samplesample candidate
directionoverall direction of motion
normalcontact surface normal relatively to the candidate

◆ OctreeNodePtr_t

◆ SamplePtr_t

◆ SampleVector_t

typedef std::vector<Sample, Eigen::aligned_allocator<Sample> > hpp::rbprm::sampling::SampleVector_t

◆ T_Double

typedef std::vector<double> hpp::rbprm::sampling::T_Double

◆ T_evaluate

typedef std::map<std::string, evaluate> hpp::rbprm::sampling::T_evaluate

◆ T_OctreeReport

◆ T_Sample

◆ T_ValueBound

typedef std::map<std::string, ValueBound> hpp::rbprm::sampling::T_ValueBound

◆ T_Values

typedef std::map<std::string, T_Double> hpp::rbprm::sampling::T_Values

◆ T_VoxelSampleId

◆ ValueBound

typedef std::pair<double, double> hpp::rbprm::sampling::ValueBound

◆ VoxelSampleId

typedef std::pair<std::size_t, std::size_t> hpp::rbprm::sampling::VoxelSampleId

Function Documentation

◆ addValue()

HPP_RBPRM_DLLAPI SampleDB& hpp::rbprm::sampling::addValue ( SampleDB database,
const std::string &  valueName,
const evaluate  eval,
bool  isStaticValue = true,
bool  sortSamples = true 
)

◆ computeAngle()

double hpp::rbprm::sampling::computeAngle ( const Vec2D center,
const Vec2D end1,
const Vec2D end2 
)

Computes the angle between 2 vectors on the same base point

Parameters
centerThe base point of the vectors
end1The end point of the first vector
end2The end point of the second vector
Returns
The angle between the two vectors (non oriented)

◆ computeSupportPolygon()

std::vector<Vec2D> hpp::rbprm::sampling::computeSupportPolygon ( const std::map< std::string, fcl::Vec3f > &  contactPositions)

Computes the support polygon

Parameters
contactPositionsThe map of the contact positions
Returns
The support polygon (orthogonal projection of the contact positions in the ground plane)

◆ contains()

template<typename T >
bool hpp::rbprm::sampling::contains ( const std::vector< T > &  vect,
const T &  val 
)

Function to verify the existence of an element in a std::vector.

◆ convexHull()

std::vector<Vec2D> hpp::rbprm::sampling::convexHull ( std::vector< Vec2D set)

Computes the convex hull of a set

Parameters
setThe set we want to get the convex hull
Returns
The convex hull of the specified set

◆ GenerateSamples()

SampleVector_t hpp::rbprm::sampling::GenerateSamples ( const pinocchio::JointPtr_t  limb,
const std::string &  effector,
const std::size_t  nbSamples,
const fcl::Vec3f &  offset = fcl::Vec3f(0, 0, 0),
const fcl::Vec3f &  limbOffset = fcl::Vec3f(0, 0, 0) 
)

Automatically generates a deque of sample configuration for a given limb of a robot

Parameters
limbroot of the considered limb
effectortag identifying the end effector of the limb
nbSamplesnumber of samples to be generated
offsetlocation of the contact point of the effector relatively to the effector joint origin
limbOffsetoffset betwwen the limb joint position and it's link
Returns
a deque of sample configurations respecting joint limits.

◆ GetCandidates() [1/2]

HPP_RBPRM_DLLAPI T_OctreeReport hpp::rbprm::sampling::GetCandidates ( const SampleDB sc,
const fcl::Transform3f &  treeTrf,
const hpp::pinocchio::CollisionObjectPtr_t &  o2,
const fcl::Vec3f &  direction,
const HeuristicParam params,
const heuristic  evaluate = 0 
)

Given the current position of a robot, returns a set of candidate sample configurations for contact generation. The set is strictly ordered using a heuristic to determine the most relevant contacts.

Parameters
scthe SampleDB containing all the samples for a given limb
treeTrfthe current transformation of the root of the robot
directionthe current direction of motion, used to evaluate the sample heuristically
evaluateheuristic used to sort candidates
Returns
a set of OctreeReport with all the possible candidates for contact

◆ GetCandidates() [2/2]

HPP_RBPRM_DLLAPI bool hpp::rbprm::sampling::GetCandidates ( const SampleDB sc,
const fcl::Transform3f &  treeTrf,
const hpp::pinocchio::CollisionObjectPtr_t &  o2,
const fcl::Vec3f &  direction,
T_OctreeReport report,
const HeuristicParam params,
const heuristic  evaluate = 0 
)

Given the current position of a robot, returns a set of candidate sample configurations for contact generation. The set is strictly ordered using a heuristic to determine the most relevant contacts.

Parameters
scthe SampleDB containing all the samples for a given limb
treeTrfthe current transformation of the root of the robot
directionthe current direction of motion, used to evaluate the sample heuristically
aset of OctreeReport updated as the samples are explored
evaluateheuristic used to sort candidates
Returns
true if at least one candidate was found

◆ HPP_PREDEF_CLASS() [1/3]

hpp::rbprm::sampling::HPP_PREDEF_CLASS ( OctreeNode  )

◆ HPP_PREDEF_CLASS() [2/3]

hpp::rbprm::sampling::HPP_PREDEF_CLASS ( Sample  )

◆ HPP_PREDEF_CLASS() [3/3]

hpp::rbprm::sampling::HPP_PREDEF_CLASS ( SampleDB  )

◆ Load()

void hpp::rbprm::sampling::Load ( const Sample sample,
pinocchio::ConfigurationOut_t  robot 
)

Assigns the limb configuration associated with a sample to a robot configuration

Parameters
sampleThe limb configuration to load
robotthe configuration to be modified

◆ operator!=()

bool hpp::rbprm::sampling::operator!= ( const Vec2D v1,
const Vec2D v2 
)

◆ operator<<()

std::ostream& hpp::rbprm::sampling::operator<< ( std::ostream &  out,
const Vec2D v 
)

◆ operator==()

bool hpp::rbprm::sampling::operator== ( const Vec2D v1,
const Vec2D v2 
)

◆ removeNonGroundContacts()

void hpp::rbprm::sampling::removeNonGroundContacts ( std::map< std::string, fcl::Vec3f > &  contacts,
double  groundThreshold 
)

Remove the contacts that does not belong to the "ground"

Parameters
contactsThe considered contacts map

◆ saveLimbDatabase()

HPP_RBPRM_DLLAPI bool hpp::rbprm::sampling::saveLimbDatabase ( const SampleDB database,
std::ofstream &  dbFile 
)

◆ transform()

fcl::Vec3f hpp::rbprm::sampling::transform ( const fcl::Vec3f &  p,
const fcl::Vec3f &  tr,
const fcl::Matrix3f &  ro 
)

Computes the transform of a point

Parameters
pThe considered point
trThe translation to apply
roThe rotation to apply
Returns
The transformed point

◆ weightedCentroidConvex2D()

Vec2D hpp::rbprm::sampling::weightedCentroidConvex2D ( const std::vector< Vec2D > &  convexPolygon)

Computes the weighted centroid of a convex polygon This is the "real (visual) center" of a polygon (an approximation of it in the worst case)

Parameters
convexPolygonThe convex polygon to whom we want to find the weighted centroid
Returns
The weighted centroid of the specified convex polygon