MRSL Motion Primitive Library  1.2
A motion primitive library for generating trajectory for mobile robots
Public Member Functions | Protected Attributes | List of all members
MPL::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.
 
template<int U = Dim>
std::enable_if< U==2, int >::type getIndex (const Veci< Dim > &pn)
 Get index of a cell for 2D.
 
template<int U = Dim>
std::enable_if< U==3, int >::type getIndex (const Veci< Dim > &pn)
 Get index of a cell for 3D.
 
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.
 
template<int U = Dim>
std::enable_if< U==3, vec_Vec3f >::type getCloud ()
 Get occupied voxels for 3D.
 
template<int U = Dim>
std::enable_if< U==2, vec_Vec2f >::type getCloud ()
 Get occupied voxels for 2D.
 
template<int U = Dim>
std::enable_if< U==3, vec_Vec3f >::type getFreeCloud ()
 Get free voxels for 3D.
 
template<int U = Dim>
std::enable_if< U==2, vec_Vec2f >::type getFreeCloud ()
 Get free voxels for 2D.
 
template<int U = Dim>
std::enable_if< U==3, vec_Vec3f >::type getUnknownCloud ()
 Get unknown voxels for 3D.
 
template<int U = Dim>
std::enable_if< U==2, vec_Vec2f >::type getUnknownCloud ()
 Get unknown voxels for 2D.
 
template<int U = Dim>
std::enable_if< U==3 >::type dilate (const vec_Veci< Dim > &dilate_neighbor)
 Dilate occupied cells.
 
template<int U = Dim>
std::enable_if< U==2 >::type dilate (const vec_Veci< Dim > &dilate_neighbor)
 
void freeUnknown ()
 Free unknown voxels.
 
void freeAll ()
 Free all voxels.
 

Protected Attributes

decimal_t res_
 Map resolution.
 
Vecf< Dim > origin_d_
 Origin, float type.
 
Veci< Dim > dim_
 Dimension, int type.
 
Tmap map_
 Map entity.
 
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 MPL::MapUtil< Dim >

The map util class for collision checking

Parameters
Dimis the dimension of the workspace

Member Function Documentation

◆ setMap()

template<int Dim>
void MPL::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: