Parasol Planning Library (PPL)
MinkowskiDistance Class Reference

#include <MinkowskiDistance.h>

Inheritance diagram for MinkowskiDistance:
Inheritance graph
[legend]
Collaboration diagram for MinkowskiDistance:
Collaboration graph
[legend]

Public Types

Local Types
typedef MPBaseObject::GroupCfgType GroupCfgType
 
- Public Types inherited from DistanceMetricMethod
typedef MPBaseObject::RoadmapType RoadmapType
 
typedef RoadmapType::VID VID
 
typedef MPBaseObject::GroupCfgType GroupCfgType
 
typedef GroupCfgType::Formation Formation
 
- Public Types inherited from MPBaseObject
typedef DefaultWeight< CfgWeightType
 
typedef GenericStateGraph< Cfg, WeightTypeRoadmapType
 
typedef GroupCfg< RoadmapTypeGroupCfgType
 
typedef GroupLocalPlan< RoadmapTypeGroupWeightType
 
typedef GroupRoadmap< GroupCfgType, GroupWeightTypeGroupRoadmapType
 

Public Member Functions

Construction
 MinkowskiDistance (double _r1=3, double _r2=3, double _r3=1./3, bool _normalize=false)
 
 MinkowskiDistance (XMLNode &_node)
 
virtual ~MinkowskiDistance ()=default
 
MPBaseObject Overrides
virtual void Print (std::ostream &_os) const
 
DistanceMetricMethod Overrides
virtual double Distance (const Cfg &_c1, const Cfg &_c2) override
 
virtual void ScaleCfg (double _length, Cfg &_c, const Cfg &_o) override
 
- Public Member Functions inherited from DistanceMetricMethod
 DistanceMetricMethod ()=default
 
 DistanceMetricMethod (XMLNode &_node)
 
virtual ~DistanceMetricMethod ()=default
 
virtual double Distance (const GroupCfgType &_c1, const GroupCfgType &_c2)
 
double EdgeWeight (const RoadmapType *const _r, const typename RoadmapType::CEI &_edge) noexcept
 
double EdgeWeight (const RoadmapType *const _r, const VID _source, const VID _target) noexcept
 
void ScaleCfg (double _length, Cfg &_c)
 
virtual void ScaleCfg (double _length, GroupCfgType &_c, const GroupCfgType &_o)
 
void ScaleCfg (double _length, GroupCfgType &_c)
 
- Public Member Functions inherited from MPBaseObject
 MPBaseObject (const std::string &_label="", const std::string &_name="", bool _debug=false)
 
 MPBaseObject (XMLNode &_node)
 
virtual ~MPBaseObject ()
 
virtual void Initialize ()
 
const std::string & GetName () const
 Get the class name for this object. More...
 
const std::string & GetLabel () const
 Get the unique label for this object. More...
 
std::string GetNameAndLabel () const
 Get the unique string identifier for this object "m_name::m_label". More...
 
void SetLabel (const std::string &)
 Set the unique label for this object. More...
 
void SetMPLibrary (MPLibrary *) noexcept
 Set the owning MPLibrary. More...
 
MPLibraryGetMPLibrary () const noexcept
 Get the owning MPLibrary. More...
 
bool IsRunning () const noexcept
 Check the library's running flag. More...
 
MPProblemGetMPProblem () const noexcept
 Get the library's current MPProblem. More...
 
EnvironmentGetEnvironment () const noexcept
 Get the current environment. More...
 
MPTaskGetTask () const noexcept
 Get the current task. More...
 
GroupTaskGetGroupTask () const noexcept
 Get the current group task. More...
 
MPSolutionTypeGetMPSolution () const noexcept
 
RoadmapTypeGetRoadmap (Robot *const _r=nullptr) const noexcept
 Get the current free-space roadmap. More...
 
GroupRoadmapTypeGetGroupRoadmap (RobotGroup *const _g=nullptr) const noexcept
 Get the current free-space group roadmap. More...
 
RoadmapTypeGetBlockRoadmap (Robot *const _r=nullptr) const noexcept
 Get the current obstacle-space roadmap. More...
 
PathGetPath (Robot *const _r=nullptr) const noexcept
 
GroupPathGetGroupPath (RobotGroup *const _g=nullptr) const noexcept
 Get the current best group path. More...
 
StatClassGetStatClass () const noexcept
 Get the current StatClass. More...
 
LocalObstacleMapGetLocalObstacleMap () const noexcept
 Get the local obstacle map. More...
 

Protected Member Functions

Helpers
double PositionDistance (const Cfg &_c)
 
double OrientationDistance (const Cfg &_c)
 
- Protected Member Functions inherited from MPBaseObject
void SetName (const std::string &_s)
 
const std::string & GetBaseFilename () const
 

Protected Attributes

Internal State
double m_r1 {3}
 For position part. More...
 
double m_r2 {3}
 For rotation part. More...
 
double m_r3 {1. / 3.}
 For calculating root. More...
 
bool m_normalize {false}
 Normalize distance w.r.t. environment? More...
 
- Protected Attributes inherited from MPBaseObject
bool m_debug
 Print debug info? More...
 

Detailed Description

Minkowski distance is a generalized L-p norm where the exponents p and 1/p each have separate values.

Todo:
Remove m_r2, which isn't part of the Minkowski difference and doesn't have any valid use.
Todo:
Move the normalization option up to the base class.
Todo:
Separate the computation of orientation and joint distances.

Member Typedef Documentation

◆ GroupCfgType

Constructor & Destructor Documentation

◆ MinkowskiDistance() [1/2]

MinkowskiDistance::MinkowskiDistance ( double  _r1 = 3,
double  _r2 = 3,
double  _r3 = 1. / 3,
bool  _normalize = false 
)

◆ MinkowskiDistance() [2/2]

MinkowskiDistance::MinkowskiDistance ( XMLNode _node)

◆ ~MinkowskiDistance()

virtual MinkowskiDistance::~MinkowskiDistance ( )
virtualdefault

Member Function Documentation

◆ Distance()

double MinkowskiDistance::Distance ( const Cfg _c1,
const Cfg _c2 
)
overridevirtual

Compute a distance between two configurations.

Parameters
_c1The first configuration.
_c2The second configuration.
Returns
The computed distance between _c1 and _c2.

Implements DistanceMetricMethod.

Reimplemented in ScaledEuclideanDistance.

◆ OrientationDistance()

double MinkowskiDistance::OrientationDistance ( const Cfg _c)
protected

◆ PositionDistance()

double MinkowskiDistance::PositionDistance ( const Cfg _c)
protected

◆ Print()

void MinkowskiDistance::Print ( std::ostream &  _os) const
virtual

Print internal state of this object.

Parameters
_osThe std::ostream to print to.

Reimplemented from MPBaseObject.

Reimplemented in ScaledEuclideanDistance.

◆ ScaleCfg()

void MinkowskiDistance::ScaleCfg ( double  _length,
Cfg _c,
const Cfg _o 
)
overridevirtual

Scale a directional configuration to a certain magnitude.

Parameters
_lengthDesired magnitude.
_cConfiguration to be scaled.
_oOrigin of scaling.
Todo:
This implementation is very poor. Scaling should be a constant-time operation - complexity should not depend on the length of the input vector.
Todo:
This is a very expensive way to scale a configuration. We should probably remove it and require derived classes to implement a more efficient function (this is the best we can do for a base class that does not know anything about the properties of the metric space).

Reimplemented from DistanceMetricMethod.

Field Documentation

◆ m_normalize

bool MinkowskiDistance::m_normalize {false}
protected

Normalize distance w.r.t. environment?

◆ m_r1

double MinkowskiDistance::m_r1 {3}
protected

For position part.

◆ m_r2

double MinkowskiDistance::m_r2 {3}
protected

For rotation part.

◆ m_r3

double MinkowskiDistance::m_r3 {1. / 3.}
protected

For calculating root.


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