PPL API Reference
Overview Core Algorithm Abstractions Utilities Parallel Methods
Modules Class Hierarchy Classes Functions
Todo List Bug List Dead Code
List of all members | Protected Member Functions | Protected Attributes
MinkowskiDistance< MPTraits > Class Template Reference

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 CfgType &_c1, const CfgType &_c2) override
 
virtual void ScaleCfg (double _length, CfgType &_c, const CfgType &_o) override
 
Distance Interface
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
 
Configuration Scaling

These functions rescale a configuration vector based on this distance metric.

void ScaleCfg (double _length, CfgType &_c)
 
virtual void ScaleCfg (double _length, GroupCfgType &_c, const GroupCfgType &_o)
 
void ScaleCfg (double _length, GroupCfgType &_c)
 
Initialization
virtual void Initialize ()
 
Name and Label Accessors
const std::string & GetName () const
 Get the class name for this object.
 
const std::string & GetLabel () const
 Get the unique label for this object.
 
std::string GetNameAndLabel () const
 Get the unique string identifier for this object "m_name::m_label".
 
void SetLabel (const std::string &)
 Set the unique label for this object.
 
MPLibrary Accessors
void SetMPLibrary (MPLibrary *) noexcept
 Set the owning MPLibrary.
 
MPLibraryGetMPLibrary () const noexcept
 Get the owning MPLibrary.
 
bool IsRunning () const noexcept
 Check the library's running flag.
 
DistanceMetricPointer GetDistanceMetric (const std::string &) const noexcept
 Get a distance metric by label from the owning MPLibrary.
 
ValidityCheckerPointer GetValidityChecker (const std::string &) const noexcept
 Get a validity checker by label from the owning MPLibrary.
 
NeighborhoodFinderPointer GetNeighborhoodFinder (const std::string &) const noexcept
 Get a neighborhood finder by label from the owning MPLibrary.
 
SamplerPointer GetSampler (const std::string &) const noexcept
 Get a sampler by label from the owning MPLibrary.
 
LocalPlannerPointer GetLocalPlanner (const std::string &) const noexcept
 Get a local planner by label from the owning MPLibrary.
 
ExtenderPointer GetExtender (const std::string &) const noexcept
 Get an extender by label from the owning MPLibrary.
 
PathModifierPointer GetPathModifier (const std::string &) const noexcept
 Get a path modifier by label from the owning MPLibrary.
 
ConnectorPointer GetConnector (const std::string &) const noexcept
 Get a connector by label from the owning MPLibrary.
 
MetricPointer GetMetric (const std::string &) const noexcept
 Get a metric by label from the owning MPLibrary.
 
MapEvaluatorPointer GetMapEvaluator (const std::string &) const noexcept
 Get a map evaluator by label from the owning MPLibrary.
 
MPStrategyPointer GetMPStrategy (const std::string &) const noexcept
 Get a strategy by label from the owning MPLibrary.
 
MPTraits::MPToolsGetMPTools () const noexcept
 Get the MPTools container from the owning MPLibrary.
 
Problem Accessors
MPProblemGetMPProblem () const noexcept
 Get the library's current MPProblem.
 
EnvironmentGetEnvironment () const noexcept
 Get the current environment.
 
MPTaskGetTask () const noexcept
 Get the current task.
 
GroupTaskGetGroupTask () const noexcept
 Get the current group task.
 
Solution Accessors
MPSolutionGetMPSolution () const noexcept
 
RoadmapTypeGetRoadmap (Robot *const _r=nullptr) const noexcept
 Get the current free-space roadmap.
 
GroupRoadmapTypeGetGroupRoadmap (RobotGroup *const _g=nullptr) const noexcept
 Get the current free-space group roadmap.
 
RoadmapTypeGetBlockRoadmap (Robot *const _r=nullptr) const noexcept
 Get the current obstacle-space roadmap.
 
PathGetPath (Robot *const _r=nullptr) const noexcept
 Get the current best path.
 
GroupPathGetGroupPath (RobotGroup *const _g=nullptr) const noexcept
 Get the current best group path.
 
StatClassGetStatClass () const noexcept
 Get the current StatClass.
 
LocalObstacleMapGetLocalObstacleMap () const noexcept
 Get the local obstacle map.
 
GoalTrackerGetGoalTracker () const noexcept
 Get the goal tracker.
 

Public Types

Local Types
typedef MPTraits::CfgType CfgType
 
typedef MPTraits::GroupCfgType GroupCfgType
 
Motion Planning Types
typedef MPTraits::RoadmapType RoadmapType
 
typedef RoadmapType::VID VID
 
typedef GroupCfgType::Formation Formation
 
Local Types
typedef MPTraits::GroupRoadmapType GroupRoadmapType
 
typedef MPTraits::LocalObstacleMap LocalObstacleMap
 
typedef MPTraits::Path Path
 
typedef MPTraits::GroupPathType GroupPath
 
typedef MPTraits::MPLibrary MPLibrary
 
typedef MPTraits::MPSolution MPSolution
 
typedef MPTraits::GoalTracker GoalTracker
 
typedef MPLibrary::SamplerPointer SamplerPointer
 
typedef MPLibrary::LocalPlannerPointer LocalPlannerPointer
 
typedef MPLibrary::ExtenderPointer ExtenderPointer
 
typedef MPLibrary::PathModifierPointer PathModifierPointer
 
typedef MPLibrary::ConnectorPointer ConnectorPointer
 
typedef MPLibrary::MetricPointer MetricPointer
 
typedef MPLibrary::MapEvaluatorPointer MapEvaluatorPointer
 
typedef MPLibrary::MPStrategyPointer MPStrategyPointer
 
typedef MPLibrary::DistanceMetricPointer DistanceMetricPointer
 
typedef MPLibrary::ValidityCheckerPointer ValidityCheckerPointer
 
typedef MPLibrary::NeighborhoodFinderPointer NeighborhoodFinderPointer
 

Protected Member Functions

void SetName (const std::string &_s)
 
const std::string & GetBaseFilename () const
 
Helpers
double PositionDistance (const CfgType &_c)
 
double OrientationDistance (const CfgType &_c)
 

Protected Attributes

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

Detailed Description

template<typename MPTraits>
class MinkowskiDistance< MPTraits >

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 Function Documentation

◆ Print()

template<typename MPTraits >
void MinkowskiDistance< MPTraits >::Print ( std::ostream &  _os) const
virtual

Print internal state of this object.

Parameters
_osThe std::ostream to print to.

Reimplemented from MPBaseObject< MPTraits >.

◆ Distance() [1/2]

template<typename MPTraits >
double MinkowskiDistance< MPTraits >::Distance ( const CfgType &  _c1,
const CfgType &  _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< MPTraits >.

◆ ScaleCfg() [1/4]

template<typename MPTraits >
void MinkowskiDistance< MPTraits >::ScaleCfg ( double  _length,
CfgType &  _c,
const CfgType &  _o 
)
overridevirtual

Scale a directional configuration to a certain magnitude.

Parameters
_lengthDesired magnitude.
_cConfiguration to be scaled.
_oOrigin of scaling.

Reimplemented from DistanceMetricMethod< MPTraits >.

◆ Distance() [2/2]

template<typename MPTraits >
double DistanceMetricMethod< MPTraits >::Distance ( const GroupCfgType _c1,
const GroupCfgType _c2 
)
virtualinherited

This version is for group configurations. The default implementation returns the summed individual distances. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ EdgeWeight() [1/2]

template<typename MPTraits >
double DistanceMetricMethod< MPTraits >::EdgeWeight ( const RoadmapType *const  _r,
const typename RoadmapType::CEI &  _edge 
)
noexceptinherited

Compute the weight of an existing roadmap edge according to this metric.

Parameters
_rThe containing roadmap.
_edgeThe edge iterator.
Returns
The total edge weight computed through each intermediate of the edge.
Todo:
We need to make this work for group roadmaps. Probably it needs to take the roadmap as a templated parameter and not be virtual (there is really only one way to do this).

◆ EdgeWeight() [2/2]

template<typename MPTraits >
double DistanceMetricMethod< MPTraits >::EdgeWeight ( const RoadmapType *const  _r,
const VID  _source,
const VID  _target 
)
noexceptinherited

Compute the weight of an existing roadmap edge according to this metric.

Parameters
_rThe containing roadmap.
_sourceThe source vertex descriptor.
_targetThe target vertex descriptor.
Returns
The total edge weight computed through each intermediate of the edge (_source, _target) in _r.
Exceptions
Ifthe edge (_source, _target) does not exist in _r.

◆ ScaleCfg() [2/4]

template<typename MPTraits >
void DistanceMetricMethod< MPTraits >::ScaleCfg ( double  _length,
CfgType &  _c 
)
inherited

This version uses the default origin. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ ScaleCfg() [3/4]

template<typename MPTraits >
void DistanceMetricMethod< MPTraits >::ScaleCfg ( double  _length,
GroupCfgType _c,
const GroupCfgType _o 
)
virtualinherited

This version is for group configurations. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ ScaleCfg() [4/4]

template<typename MPTraits >
void DistanceMetricMethod< MPTraits >::ScaleCfg ( double  _length,
GroupCfgType _c 
)
inherited

This version is for group configurations with default origin. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ Initialize()

template<typename MPTraits >
virtual void MPBaseObject< MPTraits >::Initialize ( )
virtualinherited

Initialize this object for the current MPProblem. This should reset any internal state of the algorithms so that they are ready for execution. It is also the place to initialize any state that depends on the current problem.

Warning
This member will be called for every compiled algorithm in the planning library - even those that will not be used. If an algorithm needs to do expenisve setup, then this method should only set a flag that tells it to do so on first use. The only exceptions are the MPStrategies, which will only have their initialize called on first use.

Reimplemented in ConnectorMethod< MPTraits >, CBSQuery< MPTraits >, ComposeEvaluator< MPTraits >, LazyQuery< MPTraits >, QueryMethod< MPTraits >, SIPPMethod< MPTraits >, TimeEvaluator< MPTraits >, TimeMetric< MPTraits >, AdaptiveRRT< MPTraits >, BasicPRM< MPTraits >, BasicRRTStrategy< MPTraits >, TogglePRMStrategy< MPTraits >, ValidationStrategy< MPTraits >, LKHSearch< MPTraits >, ClearanceUtility< MPTraits >, ReachabilityUtil< MPTraits >, SafeIntervalTool< MPTraits >, and TopologicalMap< MPTraits >.

◆ SetName()

template<typename MPTraits >
void MPBaseObject< MPTraits >::SetName ( const std::string &  _s)
protectedinherited
Parameters
_sClass name

◆ GetBaseFilename()

template<typename MPTraits >
const std::string & MPBaseObject< MPTraits >::GetBaseFilename ( ) const
protectedinherited
Returns
base file name from MPProblem

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