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

#include <map_util.h>

Public Member Functions

 MapUtil ()
 Simple constructor.
 
Tmap getMap ()
 Get map data.
 
decimal_t getRes ()
 Get resolution.
 
Veci< Dim > getDim ()
 Get dimensions.
 
Vecf< Dim > getOrigin ()
 Get origin.
 
int getIndex (const Veci< Dim > &pn)
 Get index of a cell.
 
bool isOutsideXYZ (const Veci< Dim > &n, int i)
 Check if the given cell is outside of the map in i-the dimension.
 
bool isFree (int idx)
 Check if the cell is free by index.
 
bool isUnknown (int idx)
 Check if the cell is unknown by index.
 
bool isOccupied (int idx)
 Check if the cell is occupied by index.
 
bool isOutside (const Veci< Dim > &pn)
 Check if the cell is outside by coordinate.
 
bool isFree (const Veci< Dim > &pn)
 Check if the given cell is free by coordinate.
 
bool isOccupied (const Veci< Dim > &pn)
 Check if the given cell is occupied by coordinate.
 
bool isUnknown (const Veci< Dim > &pn)
 Check if the given cell is unknown by coordinate.
 
void setMap (const Vecf< Dim > &ori, const Veci< Dim > &dim, const Tmap &map, decimal_t res)
 Set map. More...
 
void info ()
 Print basic information about the util.
 
Veci< Dim > floatToInt (const Vecf< Dim > &pt)
 Float position to discrete cell coordinate.
 
Vecf< Dim > intToFloat (const Veci< Dim > &pn)
 Discrete cell coordinate to float position.
 
vec_Veci< Dim > rayTrace (const Vecf< Dim > &pt1, const Vecf< Dim > &pt2)
 Raytrace from float point pt1 to pt2.
 
bool isBlocked (const Vecf< Dim > &p1, const Vecf< Dim > &p2, int8_t val=100)
 Check if the ray from p1 to p2 is occluded.
 
vec_Vecf< Dim > getCloud ()
 Get occupied voxels.
 
vec_Vecf< Dim > getFreeCloud ()
 Get free voxels.
 
vec_Vecf< Dim > getUnknownCloud ()
 Get unknown voxels.
 
void dilate (const vec_Veci< Dim > &dilate_neighbor)
 Dilate occupied cells.
 
void freeUnknown ()
 Free unknown voxels.
 

Public Attributes

Tmap map_
 Map entity.
 

Protected Attributes

decimal_t res_
 Resolution.
 
Vecf< Dim > origin_d_
 Origin, float type.
 
Veci< Dim > dim_
 Dimension, int type.
 
int8_t val_occ = 100
 Assume occupied cell has value 100.
 
int8_t val_free = 0
 Assume free cell has value 0.
 
int8_t val_unknown = -1
 Assume unknown cell has value -1.
 

Detailed Description

template<int Dim>
class JPS::MapUtil< Dim >

The map util class for collision checking

Parameters
Dimis the dimension of the workspace

Member Function Documentation

◆ setMap()

template<int Dim>
void JPS::MapUtil< Dim >::setMap ( const Vecf< Dim > &  ori,
const Veci< Dim > &  dim,
const Tmap map,
decimal_t  res 
)
inline

Set map.

Parameters
oriorigin position
dimnumber of cells in each dimension
maparray of cell values
resmap resolution

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