Parasol Planning Library (PPL)
Path Class Referencefinal

#include <Path.h>

Public Types

Motion Planning Types
typedef GenericStateGraph< Cfg, DefaultWeight< Cfg > > RoadmapType
 
typedef RoadmapType::VID VID
 

Public Member Functions

Construction
 Path (RoadmapType *const _r=nullptr)
 
Path Interface
RobotGetRobot () const noexcept
 Get the robot which travels this path. More...
 
RoadmapTypeGetRoadmap () const noexcept
 Get the roadmap used by this path. More...
 
size_t Size () const noexcept
 Get the number of cfgs in the path. More...
 
bool Empty () const noexcept
 Check if the path is empty. More...
 
double Length () const
 Get the total edge weight. More...
 
const std::vector< VID > & VIDs () const noexcept
 Get the VIDs in the path. More...
 
const std::pair< std::vector< VID >, std::vector< size_t > > VIDsWaiting () const noexcept
 Get the VIDs and timesteps waiting in the path. More...
 
const std::vector< Cfg > & Cfgs () const
 
const std::vector< CfgFullCfgs (MPLibrary *const _lib) const
 
const std::vector< CfgFullCfgsWithWait (MPLibrary *const _lib) const
 
size_t TimeSteps () const
 
void SetTimeSteps (size_t _timesteps)
 Hardcode number of timesteps in the path. More...
 
void ResetTimeSteps ()
 Reset the number of timesteps to 0. More...
 
Pathoperator+= (const Path &_p)
 
Path operator+ (const Path &_p) const
 
Pathoperator+= (const std::vector< VID > &_vids)
 
Path operator+ (const std::vector< VID > &_vids) const
 
Pathoperator= (const Path &_p)
 Copy assignment operator. More...
 
void Clear ()
 Clear all data in the path. More...
 
void FlushCache ()
 Clear cached data, but leave the VIDs. More...
 
void SetFinalWaitTimeSteps (const size_t &_timeSteps)
 
const size_t GetFinalWaitTimeSteps () const
 Get the number of timesteps to wait after traversal of the path. More...
 
void SetWaitTimes (std::vector< size_t > _waitTimes)
 
std::vector< size_t > GetWaitTimes ()
 Get the wait time at each vertex index in the path. More...
 
std::pair< std::pair< size_t, size_t >, std::pair< size_t, size_t > > GetEdgeAtTimestep (size_t _timestep)
 

Detailed Description

A path of connected configurations from a given roadmap.

The implementation uses a vector of VID's as the primary representation. The corresponding configurations are computed lazily upon request.

Examples
PathModifiers_UseCase.cpp.

Member Typedef Documentation

◆ RoadmapType

◆ VID

Constructor & Destructor Documentation

◆ Path()

Path::Path ( RoadmapType *const  _r = nullptr)

Construct an empty path.

Parameters
_rThe roadmap used by this path.

Member Function Documentation

◆ Cfgs()

const std::vector< Cfg > & Path::Cfgs ( ) const

Get a copy of the Cfgs in the path.

Warning
If the cfgs in the roadmap are later altered (i.e., if the DOF values or labels are edited), this copy will be out-of-date.

◆ Clear()

void Path::Clear ( )

Clear all data in the path.

◆ Empty()

bool Path::Empty ( ) const
noexcept

Check if the path is empty.

◆ FlushCache()

void Path::FlushCache ( )

Clear cached data, but leave the VIDs.

◆ FullCfgs()

const std::vector< Cfg > Path::FullCfgs ( MPLibrary *const  _lib) const

Get the current full Cfg path with steps spaced one environment resolution apart. This is not cached due to its size and infrequent usage.

Parameters
_libThe planning library to use.
Returns
The full path of configurations, including local-plan intermediates between the roadmap nodes.

◆ FullCfgsWithWait()

const std::vector< Cfg > Path::FullCfgsWithWait ( MPLibrary *const  _lib) const

Get the current full Cfg path with wait times. Steps are spaced one environment resolution apart. This is not cached due to its size and infrequent usage.

Parameters
_libThe planning library to use.
Returns
The full path of configurations, including local-plan intermediates between the roadmap nodes and waiting.

◆ GetEdgeAtTimestep()

std::pair< std::pair< size_t, size_t >, std::pair< size_t, size_t > > Path::GetEdgeAtTimestep ( size_t  _timestep)

Get the (source,target) of the path at the input timestep.

Parameters
_timestepThe timestep to find the corresponding edge.
Returns
The source and target of the corresponding edge.

◆ GetFinalWaitTimeSteps()

const size_t Path::GetFinalWaitTimeSteps ( ) const

Get the number of timesteps to wait after traversal of the path.

◆ GetRoadmap()

Path::RoadmapType * Path::GetRoadmap ( ) const
noexcept

Get the roadmap used by this path.

◆ GetRobot()

Robot * Path::GetRobot ( ) const
noexcept

Get the robot which travels this path.

◆ GetWaitTimes()

std::vector< size_t > Path::GetWaitTimes ( )

Get the wait time at each vertex index in the path.

◆ Length()

double Path::Length ( ) const

Get the total edge weight.

Todo:
This will be an error if we allow self-edges.

◆ operator+() [1/2]

Path Path::operator+ ( const Path _p) const

Add another path to the end of this one and return the result.

Parameters
_pThe path to add.

◆ operator+() [2/2]

Path Path::operator+ ( const std::vector< VID > &  _vids) const

Add a new set of VIDs to the end of this path and return the result.

Parameters
_vidsThe VIDs to add.

◆ operator+=() [1/2]

Path & Path::operator+= ( const Path _p)

Append another path to the end of this one.

Parameters
_pThe path to append.

◆ operator+=() [2/2]

Path & Path::operator+= ( const std::vector< VID > &  _vids)

Append a new set of VIDs to the end of this path.

Parameters
_vidsThe VIDs to append.

◆ operator=()

Path & Path::operator= ( const Path _p)

Copy assignment operator.

◆ ResetTimeSteps()

void Path::ResetTimeSteps ( )

Reset the number of timesteps to 0.

◆ SetFinalWaitTimeSteps()

void Path::SetFinalWaitTimeSteps ( const size_t &  _timeSteps)

Set the number of timesteps to wait after traversal of the path.

Parameters
_timeStepsThe number of desired timesteps.

◆ SetTimeSteps()

void Path::SetTimeSteps ( size_t  _timesteps)

Hardcode number of timesteps in the path.

◆ SetWaitTimes()

void Path::SetWaitTimes ( std::vector< size_t >  _waitTimes)

Set the wait times at each vertex in path Used in Safe Interval Path Planning

◆ Size()

size_t Path::Size ( ) const
noexcept

Get the number of cfgs in the path.

◆ TimeSteps()

size_t Path::TimeSteps ( ) const

Get the number of timesteps calculated to traverse the path, including waiting times.

◆ VIDs()

const std::vector< typename Path::VID > & Path::VIDs ( ) const
noexcept

Get the VIDs in the path.

◆ VIDsWaiting()

const std::pair< std::vector< typename Path::VID >, std::vector< size_t > > Path::VIDsWaiting ( ) const
noexcept

Get the VIDs and timesteps waiting in the path.


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