UniformProlateSpheroidDistribution< RealType > Class Template Reference

Uniform distribution of a prolate hyper spheroid. More...

#include <RobotComponents/components/MotionPlanning/util/Samplers.h>

Public Member Functions

template<class T = std::size_t>
T getDimensionality () const
 Returns the dimensionality of the distribution. More...
 
RealType getDistanceFocalPoints () const
 Returns the distance between the prolate hyper spheroid's focal points. More...
 
RealType getPolarDiameter () const
 Returns the prolate hyper spheroid's polar diameter. More...
 
std::vector< RealType > getRotationMatrix () const
 Returns the rotation matrix stored in a vector. More...
 
RealType getVolume () const
 Returns the prolate hyper spheroid's volume. More...
 
bool isInBounds (RealType *first) const
 Returns whether [first, first + dimensionality) is a point contained by the prolate hyper spheroid. More...
 
template<class Generator >
void operator() (RealType *first, Generator &gen)
 Fills [first, first + dimensionality) with a uniform sample of the prolate hyper spheroid. More...
 
void setPolarDiameter (RealType newPolarDiameter)
 Sets the prolate hyper spheroid's polar diameter. More...
 
template<class ValIter >
 UniformProlateSpheroidDistribution (ValIter focalAFirst, ValIter focalALast, ValIter focalBFirst)
 Constructs a uiform distribution of a prolate hyper spheroid with the focal points [focalAFirst, focalALast) and [focalBFirst, focalBFirst + distance(focalAFirst, focalALast)). More...
 
template<class ValIter >
 UniformProlateSpheroidDistribution (ValIter focalAFirst, ValIter focalALast, ValIter focalBFirst, const std::vector< RealType > &rotationMatrix)
 Constructs a uiform distribution of a prolate hyper spheroid with the focal points [focalAFirst, focalALast) and [focalBFirst, focalBFirst + distance(focalAFirst, focalALast)) and the given rotation matrix. More...
 

Protected Types

using MatType = Eigen::Matrix< RealType, Eigen::Dynamic, Eigen::Dynamic >
 Internal used Eigen matrix type. More...
 
using VecType = Eigen::Matrix< RealType, Eigen::Dynamic, 1 >
 Internal used Eigen vector type. More...
 

Protected Member Functions

void refreshRotationMatrix (const VecType &normalizedFocalPointAToB)
 Calculates the rotation matrix as described in the paper. More...
 
template<class IteratorType >
void setFocalPoints (IteratorType focalAFirst, IteratorType focalBFirst, bool updateRotationMatrix=true)
 Sets the focal points. More...
 

Protected Attributes

VecType centre
 The prolate hyper spheroid's center. More...
 
RealType distanceFocalPoints
 The distance of the focalpoints. More...
 
VecType focalPointA
 The prolate hyper spheroid's first focal point. More...
 
VecType focalPointB
 The prolate hyper spheroid's second focal point. More...
 
RealType polarDiameter
 The prolate hyper spheroid's diameter. More...
 
MatType rotation
 The used rotation matrix. More...
 
MatType scaleThenRotate
 The used transformation matrix to transform uniform points from the volume of a sphere to a uniform sample of the prolate hyper spheroid's volume. More...
 
UniformUnitSphereDistribution< RealType > sphereDistribution
 The internal used sphere volume distribution. More...
 
std::vector< RealType > tmpVal
 Buffer for a temporary sample. More...
 
RealType volumeProlateSpheroid
 The prolate hyper spheroid's volume. More...
 

Detailed Description

template<class RealType = float>
class armarx::UniformProlateSpheroidDistribution< RealType >

Uniform distribution of a prolate hyper spheroid.

Definition at line 321 of file Samplers.h.

Member Typedef Documentation

◆ MatType

using MatType = Eigen::Matrix<RealType, Eigen::Dynamic, Eigen::Dynamic>
protected

Internal used Eigen matrix type.

Definition at line 332 of file Samplers.h.

◆ VecType

using VecType = Eigen::Matrix<RealType, Eigen::Dynamic, 1 >
protected

Internal used Eigen vector type.

Definition at line 328 of file Samplers.h.

Constructor & Destructor Documentation

◆ UniformProlateSpheroidDistribution() [1/2]

UniformProlateSpheroidDistribution ( ValIter  focalAFirst,
ValIter  focalALast,
ValIter  focalBFirst 
)
inline

Constructs a uiform distribution of a prolate hyper spheroid with the focal points [focalAFirst, focalALast) and [focalBFirst, focalBFirst + distance(focalAFirst, focalALast)).

Parameters
focalAFirstThe first value of the first focal point.
focalALastOne past the last value of the first focal point.
focalBFirstThe first value of the second focal point.

Definition at line 342 of file Samplers.h.

◆ UniformProlateSpheroidDistribution() [2/2]

UniformProlateSpheroidDistribution ( ValIter  focalAFirst,
ValIter  focalALast,
ValIter  focalBFirst,
const std::vector< RealType > &  rotationMatrix 
)
inline

Constructs a uiform distribution of a prolate hyper spheroid with the focal points [focalAFirst, focalALast) and [focalBFirst, focalBFirst + distance(focalAFirst, focalALast)) and the given rotation matrix.

Parameters
focalAFirstThe first value of the first focal point.
focalALastOne past the last value of the first focal point.
focalBFirstThe first value of the second focal point.
rotationMatrixThe used rotation matrix (the values should be ordered to be conform with eigens mapping of matrices to vectors. (as defined by Eigen::Map<Eigen::Matrix<RealType, dimensionality, dimensionality>>)

Definition at line 370 of file Samplers.h.

Member Function Documentation

◆ getDimensionality()

T getDimensionality ( ) const
inline

Returns the dimensionality of the distribution.

Returns
The dimensionality of the distribution.

Definition at line 413 of file Samplers.h.

+ Here is the caller graph for this function:

◆ getDistanceFocalPoints()

RealType getDistanceFocalPoints ( ) const
inline

Returns the distance between the prolate hyper spheroid's focal points.

Returns
The distance between the prolate hyper spheroid's focal points.

Definition at line 444 of file Samplers.h.

◆ getPolarDiameter()

RealType getPolarDiameter ( ) const
inline

Returns the prolate hyper spheroid's polar diameter.

Returns
The prolate hyper spheroid's polar diameter.

Definition at line 453 of file Samplers.h.

+ Here is the caller graph for this function:

◆ getRotationMatrix()

std::vector<RealType> getRotationMatrix ( ) const
inline

Returns the rotation matrix stored in a vector.

Returns
The rotation matrix stored in a vector.

Definition at line 487 of file Samplers.h.

+ Here is the caller graph for this function:

◆ getVolume()

RealType getVolume ( ) const
inline

Returns the prolate hyper spheroid's volume.

Returns
The prolate hyper spheroid's volume.

Definition at line 435 of file Samplers.h.

◆ isInBounds()

bool isInBounds ( RealType *  first) const
inline

Returns whether [first, first + dimensionality) is a point contained by the prolate hyper spheroid.

Parameters
firstThe first value of the point to check.
Returns
Whether [first, first + dimensionality) is a point contained by the prolate hyper spheroid.

Definition at line 423 of file Samplers.h.

+ Here is the caller graph for this function:

◆ operator()()

void operator() ( RealType *  first,
Generator &  gen 
)
inline

Fills [first, first + dimensionality) with a uniform sample of the prolate hyper spheroid.

Parameters
firstThe first value to fill.
genThe used generator.

Definition at line 399 of file Samplers.h.

◆ refreshRotationMatrix()

void refreshRotationMatrix ( const VecType normalizedFocalPointAToB)
inlineprotected

Calculates the rotation matrix as described in the paper.

Variable names (mostly) represent the names from the paper

Parameters
normalizedFocalPointAToBcorresponds to a_1 from the paper

Definition at line 535 of file Samplers.h.

+ Here is the caller graph for this function:

◆ setFocalPoints()

void setFocalPoints ( IteratorType  focalAFirst,
IteratorType  focalBFirst,
bool  updateRotationMatrix = true 
)
inlineprotected

Sets the focal points.

Parameters
focalAFirstThe first value of the first focal point.
focalBFirstThe first value of the second focal point.
updateRotationMatrixWhether the rotation matrix should be calculated.

Definition at line 502 of file Samplers.h.

◆ setPolarDiameter()

void setPolarDiameter ( RealType  newPolarDiameter)
inline

Sets the prolate hyper spheroid's polar diameter.

Parameters
Thenew prolate hyper spheroid's polar diameter.

Definition at line 462 of file Samplers.h.

Member Data Documentation

◆ centre

VecType centre
protected

The prolate hyper spheroid's center.

(0.5 * (focalPointA + focalPointB))

Definition at line 608 of file Samplers.h.

◆ distanceFocalPoints

RealType distanceFocalPoints
protected

The distance of the focalpoints.

Definition at line 587 of file Samplers.h.

◆ focalPointA

VecType focalPointA
protected

The prolate hyper spheroid's first focal point.

Definition at line 600 of file Samplers.h.

◆ focalPointB

VecType focalPointB
protected

The prolate hyper spheroid's second focal point.

Definition at line 604 of file Samplers.h.

◆ polarDiameter

RealType polarDiameter
protected

The prolate hyper spheroid's diameter.

Definition at line 591 of file Samplers.h.

◆ rotation

MatType rotation
protected

The used rotation matrix.

Definition at line 612 of file Samplers.h.

◆ scaleThenRotate

MatType scaleThenRotate
protected

The used transformation matrix to transform uniform points from the volume of a sphere to a uniform sample of the prolate hyper spheroid's volume.

Definition at line 617 of file Samplers.h.

◆ sphereDistribution

UniformUnitSphereDistribution<RealType> sphereDistribution
protected

The internal used sphere volume distribution.

(It's results are transformed to the prolate hyper spheroid)

Definition at line 578 of file Samplers.h.

◆ tmpVal

std::vector<RealType> tmpVal
mutableprotected

Buffer for a temporary sample.

Definition at line 583 of file Samplers.h.

◆ volumeProlateSpheroid

RealType volumeProlateSpheroid
protected

The prolate hyper spheroid's volume.

Definition at line 595 of file Samplers.h.


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