Parasol Planning Library (PPL)
DefaultWeight< CfgType > Class Template Reference

#include <Weight.h>

Collaboration diagram for DefaultWeight< CfgType >:
Collaboration graph
[legend]

Public Member Functions

Construction
 DefaultWeight (const std::string &_label="", const double _w=0, const std::vector< CfgType > &_intermediates=std::vector< CfgType >())
 
virtual ~DefaultWeight ()=default
 
Assignment
virtual const DefaultWeightoperator= (const DefaultWeight &_w)
 
Ordering and Equality
virtual bool operator== (const DefaultWeight &_w) const noexcept
 
virtual bool operator!= (const DefaultWeight &_w) const noexcept
 
virtual bool operator< (const DefaultWeight &_other) const noexcept
 
Properties
const std::string & GetLPLabel () const noexcept
 Get the string label value. More...
 
void SetLPLabel (const std::string &_lpLabel) noexcept
 Set the string label value. More...
 
std::vector< CfgType > & GetIntermediates () noexcept
 
const std::vector< CfgType > & GetIntermediates () const noexcept
 
void SetIntermediates (const std::vector< CfgType > &_intermediates) noexcept
 Set the intermediate configurations corresponding to the current weight. More...
 
void SetIntermediates (std::vector< CfgType > &&_intermediates) noexcept
 Set the intermediate configurations corresponding to the current weight. More...
 
double GetWeight () const noexcept
 Get the numerical weight value. More...
 
void SetWeight (const double _w) noexcept
 Set the numerical weight value. More...
 
void SetControl (const Control &_c) noexcept
 Set a singular control corresponding to the path given by the weight. More...
 
const ControlSetGetControlSet () const noexcept
 Get a vector of controls corresponding to the path given by the weight. More...
 
ControlSetGetControlSet () noexcept
 Get a vector of controls corresponding to the path given by the weight. More...
 
void SetControlSet (const ControlSet &_c) noexcept
 Set a vector of controls corresponding to the path given by the weight. More...
 
bool IsChecked (const int _mult) const noexcept
 Is the checked resolution multiple at most _mult? More...
 
void SetChecked (const int _mult) noexcept
 
bool HasClearance () const noexcept
 
double GetClearance () const noexcept
 Get the clearance value of the current weight. More...
 
void SetClearance (const double _c) noexcept
 
size_t GetTimeSteps () const noexcept
 
void SetTimeSteps (std::size_t _steps) noexcept
 

Protected Attributes

Internal State
std::string m_lpLabel
 Label of local planner that built this edge. More...
 
double m_weight {0.}
 The edge length. More...
 
std::vector< CfgType > m_intermediates
 Intermediate configurations. More...
 
int m_checkedMult {std::numeric_limits<int>::max()}
 The checked resolution multiple (for lazy query), or max if none. More...
 
double m_clearance {std::numeric_limits<double>::infinity()}
 The clearance value, or inf if not evaluated. More...
 
ControlSet m_controls
 The controls used. More...
 
size_t m_timeSteps {0}
 The number of timesteps to apply the controls. More...
 

I/O

static RobotinputRobot = nullptr
 
virtual void Read (std::istream &_is)
 
virtual void Write (std::ostream &_os) const
 
void Clear ()
 Clear all of the contents of the object to a reinitialized state. More...
 

Stuff for stapl graph interface

virtual DefaultWeight operator+ (const DefaultWeight &_other) const
 This only adds weights, it doesn't take intermediates into account. More...
 
double Weight () const noexcept
 
static DefaultWeight MaxWeight () noexcept
 

Detailed Description

template<class CfgType>
class DefaultWeight< CfgType >

Default weight class for roadmap edges. Defined as a value and a set of intermediate configurations.

Weight is the concept for what is stored on the graph edges. Essentially, edges are defined as polygonal chains I = {q_1, q_2, ..., q_n} through @cspace. They have two essential properties: a weight value representing some idea of distance between the two end points of the edge and a set of intermediate configurations defining the polygonal chain (not including the start and goal configurations).

Constructor & Destructor Documentation

◆ DefaultWeight()

template<typename CfgType >
DefaultWeight< CfgType >::DefaultWeight ( const std::string &  _label = "",
const double  _w = 0,
const std::vector< CfgType > &  _intermediates = std::vector<CfgType>() 
)

Construct a weight.

Parameters
_labelAn initial string label for identification.
_wAn initial weight value.
_intermediatesA vector of intermediate configurations.

◆ ~DefaultWeight()

template<class CfgType >
virtual DefaultWeight< CfgType >::~DefaultWeight ( )
virtualdefault

Member Function Documentation

◆ Clear()

template<typename CfgType >
void DefaultWeight< CfgType >::Clear

Clear all of the contents of the object to a reinitialized state.

Clears out the contents of all vectors and zeros out all member values. Intended to reinitialize an object to its default-constructed state. This was found to be required by Read(), due to stapl's reuse of a temp obj.

◆ GetClearance()

template<typename CfgType >
double DefaultWeight< CfgType >::GetClearance
noexcept

Get the clearance value of the current weight.

◆ GetControlSet() [1/2]

template<typename CfgType >
const ControlSet & DefaultWeight< CfgType >::GetControlSet
noexcept

Get a vector of controls corresponding to the path given by the weight.

◆ GetControlSet() [2/2]

template<typename CfgType >
ControlSet & DefaultWeight< CfgType >::GetControlSet
noexcept

Get a vector of controls corresponding to the path given by the weight.

◆ GetIntermediates() [1/2]

template<typename CfgType >
const std::vector< CfgType > & DefaultWeight< CfgType >::GetIntermediates
noexcept

Get a vector of intermediate configurations corresponding to the current weight.

◆ GetIntermediates() [2/2]

template<typename CfgType >
std::vector< CfgType > & DefaultWeight< CfgType >::GetIntermediates
noexcept

Get a vector of intermediate configurations corresponding to the current weight.

◆ GetLPLabel()

template<typename CfgType >
const std::string & DefaultWeight< CfgType >::GetLPLabel
noexcept

Get the string label value.

◆ GetTimeSteps()

template<typename CfgType >
std::size_t DefaultWeight< CfgType >::GetTimeSteps
noexcept

Get the number of timesteps of the local plan corresponding to the weight's intermediates' path.

◆ GetWeight()

template<typename CfgType >
double DefaultWeight< CfgType >::GetWeight
noexcept

Get the numerical weight value.

◆ HasClearance()

template<class CfgType >
bool DefaultWeight< CfgType >::HasClearance ( ) const
noexcept

◆ IsChecked()

template<typename CfgType >
bool DefaultWeight< CfgType >::IsChecked ( const int  _mult) const
noexcept

Is the checked resolution multiple at most _mult?

◆ MaxWeight()

template<typename CfgType >
DefaultWeight< CfgType > DefaultWeight< CfgType >::MaxWeight
staticnoexcept

◆ operator!=()

template<typename CfgType >
bool DefaultWeight< CfgType >::operator!= ( const DefaultWeight< CfgType > &  _w) const
virtualnoexcept

Check if the current and given weights are unequal.

Parameters
_wThe given weight.
Returns
True is unequal, false otherwise.

◆ operator+()

template<typename CfgType >
DefaultWeight< CfgType > DefaultWeight< CfgType >::operator+ ( const DefaultWeight< CfgType > &  _other) const
virtual

This only adds weights, it doesn't take intermediates into account.

◆ operator<()

template<typename CfgType >
bool DefaultWeight< CfgType >::operator< ( const DefaultWeight< CfgType > &  _other) const
virtualnoexcept

Check if the current weight is less than a given weight by numerical weight value.

Parameters
_wThe given weight.
Returns
True is current weight value is less, false otherwise.

◆ operator=()

template<typename CfgType >
const DefaultWeight< CfgType > & DefaultWeight< CfgType >::operator= ( const DefaultWeight< CfgType > &  _w)
virtual

Set the current weight to a copy of a given weight.

Parameters
_wThe given weight.

◆ operator==()

template<typename CfgType >
bool DefaultWeight< CfgType >::operator== ( const DefaultWeight< CfgType > &  _w) const
virtualnoexcept

Check if the current and given weights are equal.

Parameters
_wThe given weight.
Returns
True is equal, false otherwise.

◆ Read()

template<typename CfgType >
void DefaultWeight< CfgType >::Read ( std::istream &  _is)
virtual

Read an edge in from an input stream.

Parameters
_isThe input stream to read from.

@TODO an easy optimization would be to make coast controls not print the 0's signal, it could reduce some roadmaps significantly, I'd bet

◆ SetChecked()

template<typename CfgType >
void DefaultWeight< CfgType >::SetChecked ( const int  _mult)
noexcept

Set the checked resolution multiple to a lesser value than current.

Parameters
_multThe new desired value.

◆ SetClearance()

template<typename CfgType >
void DefaultWeight< CfgType >::SetClearance ( const double  _c)
noexcept

Set the clearance value of the current weight.

Parameters
Thedesired new clearance value.

◆ SetControl()

template<typename CfgType >
void DefaultWeight< CfgType >::SetControl ( const Control _c)
noexcept

Set a singular control corresponding to the path given by the weight.

◆ SetControlSet()

template<typename CfgType >
void DefaultWeight< CfgType >::SetControlSet ( const ControlSet _c)
noexcept

Set a vector of controls corresponding to the path given by the weight.

◆ SetIntermediates() [1/2]

template<typename CfgType >
void DefaultWeight< CfgType >::SetIntermediates ( const std::vector< CfgType > &  _intermediates)
noexcept

Set the intermediate configurations corresponding to the current weight.

◆ SetIntermediates() [2/2]

template<typename CfgType >
void DefaultWeight< CfgType >::SetIntermediates ( std::vector< CfgType > &&  _intermediates)
noexcept

Set the intermediate configurations corresponding to the current weight.

◆ SetLPLabel()

template<typename CfgType >
void DefaultWeight< CfgType >::SetLPLabel ( const std::string &  _lpLabel)
noexcept

Set the string label value.

◆ SetTimeSteps()

template<typename CfgType >
void DefaultWeight< CfgType >::SetTimeSteps ( std::size_t  _steps)
noexcept

Set the number of timesteps of the local plan corresponding to the weight's intermediates' path.

◆ SetWeight()

template<typename CfgType >
void DefaultWeight< CfgType >::SetWeight ( const double  _w)
noexcept

Set the numerical weight value.

◆ Weight()

template<typename CfgType >
double DefaultWeight< CfgType >::Weight
noexcept

◆ Write()

template<typename CfgType >
void DefaultWeight< CfgType >::Write ( std::ostream &  _os) const
virtual

Write an edge to an output stream.

Parameters
_osThe output stream to write to.

@TODO Now that we read/write the control signals for nonholonomic, we should remove the writing of intermediates for conciseness.

@TODO an easy optimization would be to make coast controls not print the 0 signal, it could reduce some roadmaps significantly, I'd bet.

Field Documentation

◆ inputRobot

template<typename CfgType >
Robot * DefaultWeight< CfgType >::inputRobot = nullptr
static

A static pointer to the current robot, which is needed to parse any intermediate configurations in the edge.

◆ m_checkedMult

template<class CfgType >
int DefaultWeight< CfgType >::m_checkedMult {std::numeric_limits<int>::max()}
protected

The checked resolution multiple (for lazy query), or max if none.

◆ m_clearance

template<class CfgType >
double DefaultWeight< CfgType >::m_clearance {std::numeric_limits<double>::infinity()}
protected

The clearance value, or inf if not evaluated.

◆ m_controls

template<class CfgType >
ControlSet DefaultWeight< CfgType >::m_controls
protected

The controls used.

◆ m_intermediates

template<class CfgType >
std::vector<CfgType> DefaultWeight< CfgType >::m_intermediates
protected

Intermediate configurations.

◆ m_lpLabel

template<class CfgType >
std::string DefaultWeight< CfgType >::m_lpLabel
protected

Label of local planner that built this edge.

◆ m_timeSteps

template<class CfgType >
size_t DefaultWeight< CfgType >::m_timeSteps {0}
protected

The number of timesteps to apply the controls.

◆ m_weight

template<class CfgType >
double DefaultWeight< CfgType >::m_weight {0.}
protected

The edge length.


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