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
BruteForceNF< MPTraits > Class Template Reference

Public Member Functions

Construction
 BruteForceNF ()
 
 BruteForceNF (XMLNode &_node)
 
virtual ~BruteForceNF ()=default
 
MPBaseObject Overrides
virtual void Print (std::ostream &_os) const override
 
NeighborhoodFinderMethod Overrides
virtual void FindNeighbors (RoadmapType *const _r, const CfgType &_cfg, const VertexSet &_candidates, OutputIterator _out) override
 
virtual void FindNeighbors (GroupRoadmapType *const _r, const GroupCfgType &_cfg, const VertexSet &_candidates, OutputIterator _out) override
 
Accessors
Type GetType () const noexcept
 
virtual size_t & GetK () noexcept
 
virtual double & GetRadius () noexcept
 
virtual void SetDMLabel (const std::string &_label) noexcept
 
virtual const std::string & GetDMLabel () const noexcept
 
Nearest-Neighbor Queries
template<typename AbstractRoadmapType >
void FindNeighbors (AbstractRoadmapType *const _r, const typename AbstractRoadmapType::CfgType &_cfg, OutputIterator _out)
 
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

Motion Planning Types
typedef MPTraits::RoadmapType RoadmapType
 
typedef MPTraits::CfgType CfgType
 
typedef RoadmapType::VID VID
 
typedef RoadmapType::VertexSet VertexSet
 
typedef MPTraits::GroupRoadmapType GroupRoadmapType
 
typedef MPTraits::GroupCfgType GroupCfgType
 
Local Types
enum class  Type { K , RADIUS , APPROX , OTHER }
 The type of neighbors found. More...
 
typedef std::back_insert_iterator< std::vector< Neighbor > > OutputIterator
 Output iterator for writing discovered neighbors to a container.
 
Local Types
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
template<typename AbstractRoadmapType >
void FindNeighborsImpl (AbstractRoadmapType *const _r, const typename AbstractRoadmapType::CfgType &_cfg, const VertexSet &_candidates, OutputIterator _out)
 Templated implementation for both individual and group versions.
 
Helpers
template<typename AbstractRoadmapType >
bool DirectEdge (const AbstractRoadmapType *_g, const typename AbstractRoadmapType::CfgType &_c, const typename AbstractRoadmapType::VID _v) const noexcept
 

Protected Attributes

bool m_debug
 Print debug info?
 
Internal State
Todo:
Remove m_k and m_radius - these don't apply to all NFs so it doesn't make sense to have them here. Fix design errors in SRT method which require this.
Type m_nfType {Type::OTHER}
 Type of neighborhood finder.
 
size_t m_k {0}
 How many closest neighbors to find?
 
double m_radius {0}
 Maximum distance of closest neighbors.
 
std::string m_dmLabel
 The distance metric to use.
 
bool m_unconnected {false}
 Require neighbors with no direct edge.
 

Detailed Description

template<typename MPTraits>
class BruteForceNF< MPTraits >

Determine the nearest neighbors with a brute force search.

This method does a direct distance check between the query configuration and each input candidate.

Member Enumeration Documentation

◆ Type

template<typename MPTraits >
enum class NeighborhoodFinderMethod::Type
stronginherited

The type of neighbors found.

Enumerator

k-closest neighbors

RADIUS 

All neighbors within a radius.

APPROX 

Approximate nearest neighbors.

OTHER 

Something else.

Member Function Documentation

◆ Print()

template<typename MPTraits >
void BruteForceNF< MPTraits >::Print ( std::ostream &  _os) const
overridevirtual

Print internal state of this object.

Parameters
_osThe std::ostream to print to.

Reimplemented from NeighborhoodFinderMethod< MPTraits >.

◆ FindNeighbors() [1/3]

template<typename MPTraits >
void BruteForceNF< MPTraits >::FindNeighbors ( RoadmapType *const  _r,
const CfgType &  _cfg,
const VertexSet &  _candidates,
OutputIterator  _out 
)
overridevirtual

Some methods can be implemented more efficiently if the candidates are provided in a hash set. This function is to support that; the default implementation forwards to the iterator version.

Parameters
_rThe roadmap.
_cfgThe query configuration.
_candidatesThe set of candidate VIDs.
_outOutput iterator.

Implements NeighborhoodFinderMethod< MPTraits >.

◆ FindNeighbors() [2/3]

template<typename MPTraits >
void BruteForceNF< MPTraits >::FindNeighbors ( GroupRoadmapType *const  _r,
const GroupCfgType _cfg,
const VertexSet &  _candidates,
OutputIterator  _out 
)
overridevirtual

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

Implements NeighborhoodFinderMethod< MPTraits >.

◆ GetType()

template<typename MPTraits >
NeighborhoodFinderMethod< MPTraits >::Type NeighborhoodFinderMethod< MPTraits >::GetType
noexceptinherited
Returns
Type of neighborhood finder

◆ GetK()

template<typename MPTraits >
size_t & NeighborhoodFinderMethod< MPTraits >::GetK
virtualnoexceptinherited
Returns
Number of closest neighbors to find

◆ GetRadius()

template<typename MPTraits >
double & NeighborhoodFinderMethod< MPTraits >::GetRadius
virtualnoexceptinherited
Returns
Distance of farthest potential neighbor

◆ SetDMLabel()

template<typename MPTraits >
void NeighborhoodFinderMethod< MPTraits >::SetDMLabel ( const std::string &  _label)
virtualnoexceptinherited

Set the distance metric label.

Parameters
_labelThe new DM label to use.

◆ GetDMLabel()

template<typename MPTraits >
const std::string & NeighborhoodFinderMethod< MPTraits >::GetDMLabel
virtualnoexceptinherited

Get the distance metric label.

Returns
The label for the current DM.

◆ FindNeighbors() [3/3]

template<typename MPTraits >
template<typename AbstractRoadmapType >
void NeighborhoodFinderMethod< MPTraits >::FindNeighbors ( AbstractRoadmapType *const  _r,
const typename AbstractRoadmapType::CfgType &  _cfg,
OutputIterator  _out 
)
inherited

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

◆ DirectEdge()

template<typename MPTraits >
template<typename AbstractRoadmapType >
bool NeighborhoodFinderMethod< MPTraits >::DirectEdge ( const AbstractRoadmapType *  _g,
const typename AbstractRoadmapType::CfgType &  _c,
const typename AbstractRoadmapType::VID  _v 
) const
protectednoexceptinherited

Checks if there is a direct edge to potential neighbor.

Parameters
_gThe roadmap graph we are searching.
_cThe query configuration.
_vA potential neighbor for _c.
Returns
True if there is already a direct edge from _c to _v.
Note
Takes linear time in |g|.

◆ 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: