Class HashedSetSE3

Nested Relationships

Nested Types

Class Documentation

class HashedSetSE3

HashedSetSE3: a sparse hashed lattice of SE(3) poses

Data structures

using pose_vector_t = std::vector<mrpt::math::TPose3D>
using grids_map_t = std::unordered_map<global_index3d_t, VoxelData, index_se3_t_hash<int32_t>>

Indices and coordinates

inline global_index3d_t coordToGlobalIdx(const mrpt::math::TPose3D &p) const
inline mrpt::math::TPose3D globalIdxToCoord(const global_index3d_t idx) const

returns the coordinate of the voxel “bottom” corner

Basic API for construction and main parameters

HashedSetSE3(double voxel_xyz_size = 1.0, double voxel_yaw_size = mrpt::DEG2RAD(10.0), double voxel_pitch_size = mrpt::DEG2RAD(10.0), double voxel_roll_size = mrpt::DEG2RAD(10.0))

Constructor / default ctor.

Parameters:

voxel_size – Voxel size [meters]

~HashedSetSE3()
void setVoxelProperties(double voxel_xyz_size, double voxel_yaw_size, double voxel_pitch_size, double voxel_roll_size)

Reset the main voxel parameters, and clears all current map contents

Data access API

void clear()
bool empty() const
inline VoxelData *voxelByGlobalIdxs(const global_index3d_t &idx, bool createIfNew)

returns the voxeldata by global index coordinates, creating it or not if not found depending on createIfNew. Returns nullptr if not found and createIfNew is false

Function defined in the header file so compilers can optimize for literals “createIfNew”

inline const VoxelData *voxelByGlobalIdxs(const global_index3d_t &idx) const
inline VoxelData *voxelByCoords(const mrpt::math::TPose3D &pt, bool createIfNew)

Get a voxeldata by (x,y,z) coordinates, creating the voxel if needed.

inline const VoxelData *voxelByCoords(const mrpt::math::TPose3D &pt) const
void insertPose(const mrpt::math::TPose3D &pt)

Insert one pose into the lattice

inline const grids_map_t &voxels() const
void visitAllPoses(const std::function<void(const mrpt::math::TPose3D&)> &f) const
void visitAllVoxels(const std::function<void(const global_index3d_t&, const VoxelData&)> &f) const
bool saveToTextFile(const std::string &file) const

Save to a text file. Each line contains “X Y Z YAW PITCH ROLL”. Returns false if any error occured, true elsewere.

Public Types

using global_index3d_t = index_se3_t<int32_t>
struct VoxelData

Public Functions

VoxelData() = default
inline auto poses() const
inline void insertPose(const mrpt::math::TPose3D &p)