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.
 
RealType getDistanceFocalPoints () const
 Returns the distance between the prolate hyper spheroid's focal points.
 
RealType getPolarDiameter () const
 Returns the prolate hyper spheroid's polar diameter.
 
std::vector< RealType > getRotationMatrix () const
 Returns the rotation matrix stored in a vector.
 
RealType getVolume () const
 Returns the prolate hyper spheroid's volume.
 
bool isInBounds (RealType *first) const
 Returns whether [first, first + dimensionality) is a point contained by the prolate hyper spheroid.
 
template<class Generator>
void operator() (RealType *first, Generator &gen)
 Fills [first, first + dimensionality) with a uniform sample of the prolate hyper spheroid.
 
void setPolarDiameter (RealType newPolarDiameter)
 Sets the prolate hyper spheroid's polar diameter.
 
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)).
 
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.
 

Protected Types

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

Protected Member Functions

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

Protected Attributes

VecType centre
 The prolate hyper spheroid's center.
 
RealType distanceFocalPoints
 The distance of the focalpoints.
 
VecType focalPointA
 The prolate hyper spheroid's first focal point.
 
VecType focalPointB
 The prolate hyper spheroid's second focal point.
 
RealType polarDiameter
 The prolate hyper spheroid's diameter.
 
MatType rotation
 The used rotation matrix.
 
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.
 
UniformUnitSphereDistribution< RealType > sphereDistribution
 The internal used sphere volume distribution.
 
std::vector< RealType > tmpVal
 Buffer for a temporary sample.
 
RealType volumeProlateSpheroid
 The prolate hyper spheroid's volume.
 

Detailed Description

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

Uniform distribution of a prolate hyper spheroid.

Member Typedef Documentation

◆ MatType

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

Internal used Eigen matrix type.

◆ VecType

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

Internal used Eigen vector type.

Constructor & Destructor Documentation

◆ UniformProlateSpheroidDistribution() [1/2]

template<class RealType = float>
template<class ValIter>
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.

◆ UniformProlateSpheroidDistribution() [2/2]

template<class RealType = float>
template<class ValIter>
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>>)

Member Function Documentation

◆ getDimensionality()

template<class RealType = float>
template<class T = std::size_t>
T getDimensionality ( ) const
inline

Returns the dimensionality of the distribution.

Returns
The dimensionality of the distribution.

◆ getDistanceFocalPoints()

template<class RealType = float>
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.

◆ getPolarDiameter()

template<class RealType = float>
RealType getPolarDiameter ( ) const
inline

Returns the prolate hyper spheroid's polar diameter.

Returns
The prolate hyper spheroid's polar diameter.

◆ getRotationMatrix()

template<class RealType = float>
std::vector< RealType > getRotationMatrix ( ) const
inline

Returns the rotation matrix stored in a vector.

Returns
The rotation matrix stored in a vector.

◆ getVolume()

template<class RealType = float>
RealType getVolume ( ) const
inline

Returns the prolate hyper spheroid's volume.

Returns
The prolate hyper spheroid's volume.

◆ isInBounds()

template<class RealType = float>
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.

◆ operator()()

template<class RealType = float>
template<class Generator>
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.

◆ refreshRotationMatrix()

template<class RealType = float>
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

◆ setFocalPoints()

template<class RealType = float>
template<class IteratorType>
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.

◆ setPolarDiameter()

template<class RealType = float>
void setPolarDiameter ( RealType newPolarDiameter)
inline

Sets the prolate hyper spheroid's polar diameter.

Parameters
Thenew prolate hyper spheroid's polar diameter.

Member Data Documentation

◆ centre

template<class RealType = float>
VecType centre
protected

The prolate hyper spheroid's center.

(0.5 * (focalPointA + focalPointB))

◆ distanceFocalPoints

template<class RealType = float>
RealType distanceFocalPoints
protected

The distance of the focalpoints.

◆ focalPointA

template<class RealType = float>
VecType focalPointA
protected

The prolate hyper spheroid's first focal point.

◆ focalPointB

template<class RealType = float>
VecType focalPointB
protected

The prolate hyper spheroid's second focal point.

◆ polarDiameter

template<class RealType = float>
RealType polarDiameter
protected

The prolate hyper spheroid's diameter.

◆ rotation

template<class RealType = float>
MatType rotation
protected

The used rotation matrix.

◆ scaleThenRotate

template<class RealType = float>
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.

◆ sphereDistribution

template<class RealType = float>
UniformUnitSphereDistribution<RealType> sphereDistribution
protected

The internal used sphere volume distribution.

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

◆ tmpVal

template<class RealType = float>
std::vector<RealType> tmpVal
mutableprotected

Buffer for a temporary sample.

◆ volumeProlateSpheroid

template<class RealType = float>
RealType volumeProlateSpheroid
protected

The prolate hyper spheroid's volume.


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