MRSL JPS3D Library  1.1
An implementaion of Jump Point Search on 3D voxel map
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DMPlanner< Dim > Class Template Reference

Abstract base for planning. More...

#include <distance_map_planner.h>

Inheritance diagram for DMPlanner< Dim >:
IterativeDMPlanner< Dim >

Public Member Functions

 DMPlanner (bool verbose=false)
 Simple constructor. More...
 
std::vector< bool > setPath (const vec_Vecf< Dim > &path, const Vecf< Dim > &radius, bool dense)
 set a prior path and get region around it More...
 
void setSearchRadius (const Vecf< Dim > &r)
 Set search radius around a prior path.
 
void setPotentialRadius (const Vecf< Dim > &r)
 Set potential radius.
 
void setPotentialMapRange (const Vecf< Dim > &r)
 Set the range of potential map, 0 means the whole map.
 
void setEps (double eps)
 Set heuristic weight.
 
void setCweight (double c)
 Set collision cost weight.
 
void setPow (int pow)
 Set the power of potential function $H_{MAX}(1 - d/d_{max})^{pow}$.
 
int status ()
 Status of the planner. More...
 
vec_Vecf< Dim > getPath ()
 Get the modified path.
 
vec_Vecf< Dim > getRawPath ()
 Get the raw path.
 
vec_Vecf< Dim > getPriorPath ()
 Get the prior path.
 
vec_Vecf< Dim > getOpenSet () const
 Get the nodes in open set.
 
vec_Vecf< Dim > getCloseSet () const
 Get the nodes in close set.
 
vec_Vecf< Dim > getAllSet () const
 Get all the nodes.
 
vec_Vec3f getCloud (double h_max=1)
 Get the potential cloud.
 
vec_Vecf< Dim > getSearchRegion ()
 Get the searching region.
 
std::shared_ptr< JPS::MapUtil< Dim > > getMapUtil ()
 Get the internal map util.
 
void setMap (const std::shared_ptr< JPS::MapUtil< Dim >> &map_util, const Vecf< Dim > &pos)
 Generate distance map. More...
 
bool computePath (const Vecf< Dim > &start, const Vecf< Dim > &goal, const vec_Vecf< Dim > &path)
 Compute the optimal path.
 

Protected Member Functions

vec_E< std::pair< Veci< Dim >, int8_t > > createMask (int pow)
 Create the mask for potential distance field. More...
 
bool plan (const Vecf< Dim > &start, const Vecf< Dim > &goal, decimal_t eps=1, decimal_t cweight=0.1)
 Need to be specified in Child class, main planning function. More...
 
vec_Vecf< Dim > removeLinePts (const vec_Vecf< Dim > &path)
 remove redundant points on the same line
 
vec_Vecf< Dim > removeCornerPts (const vec_Vecf< Dim > &path)
 Remove some corner waypoints.
 
bool checkAvailability (const Veci< Dim > &pn)
 check availability
 

Protected Attributes

std::shared_ptr< JPS::MapUtil< Dim > > map_util_
 Assume using 3D voxel map for all 2d and 3d planning.
 
std::shared_ptr< DMP::GraphSearchgraph_search_
 The planner back-end.
 
std::vector< bool > search_region_
 tunnel for visualization
 
std::vector< int8_t > cmap_
 1-D map array
 
bool planner_verbose_
 Enabled for printing info.
 
double path_cost_
 Path cost (raw)
 
vec_Vecf< Dim > prior_path_
 Prior path from planner.
 
vec_Vecf< Dim > raw_path_
 Raw path from planner.
 
vec_Vecf< Dim > path_
 Modified path for future usage.
 
int status_ = 0
 Flag indicating the success of planning.
 
int8_t H_MAX {100}
 max potential value
 
double eps_ {0.0}
 heuristic weight
 
double cweight_ {0.1}
 potential weight
 
Vecf< Dim > potential_radius_ {Vecf<Dim>::Zero()}
 radius of distance field
 
Vecf< Dim > search_radius_ {Vecf<Dim>::Zero()}
 radius of searching tunnel
 
Vecf< Dim > potential_map_range_ {Vecf<Dim>::Zero()}
 xy range of local distance map
 
int pow_ {1}
 power index for creating mask
 

Detailed Description

template<int Dim>
class DMPlanner< Dim >

Abstract base for planning.

Constructor & Destructor Documentation

◆ DMPlanner()

template<int Dim>
DMPlanner< Dim >::DMPlanner ( bool  verbose = false)

Simple constructor.

Parameters
verboseenable debug mode

Member Function Documentation

◆ createMask()

template<int Dim>
vec_E< std::pair< Veci< Dim >, int8_t > > DMPlanner< Dim >::createMask ( int  pow)
protected

Create the mask for potential distance field.

Mask for generating potential field around obstacle

◆ plan()

template<int Dim>
bool DMPlanner< Dim >::plan ( const Vecf< Dim > &  start,
const Vecf< Dim > &  goal,
decimal_t  eps = 1,
decimal_t  cweight = 0.1 
)
protected

Need to be specified in Child class, main planning function.

check if the map exists

check availability of start

check availability of goal

◆ setMap()

template<int Dim>
void DMPlanner< Dim >::setMap ( const std::shared_ptr< JPS::MapUtil< Dim >> &  map_util,
const Vecf< Dim > &  pos 
)

Generate distance map.

Parameters
map_utilMapUtil that contains the map object
poscenter of the distance map

it copies the map object, thus change the original map_uitl won't affect the internal map.

◆ setPath()

template<int Dim>
std::vector< bool > DMPlanner< Dim >::setPath ( const vec_Vecf< Dim > &  path,
const Vecf< Dim > &  radius,
bool  dense 
)

set a prior path and get region around it

Parameters
pathprior path
rradius in x-y plane
hheight in z axis, if 2d, it's not used
denseif true, dont need to do rayTrace

it returns the inflated region

◆ status()

template<int Dim>
int DMPlanner< Dim >::status ( )

Status of the planner.

0 — exit normally; -1 — no path found; 1, 2 — start or goal is not free.


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