class mp2p_icp_filters::PointCloudToVoxelGrid

Overview

Auxiliary data structure: an index of points in a point cloud, organized by their 3D position according to a predefined regular-sized voxel grid.

#include <PointCloudToVoxelGrid.h>

class PointCloudToVoxelGrid
{
public:
    // structs

    struct IndicesHash;
    struct Parameters;
    struct indices_t;
    struct voxel_t;

    // fields

    Parameters params_;
    tsl::robin_map<indices_t, voxel_t, IndicesHash> pts_voxels;

    // methods

    void setResolution(const float voxel_size);
    void processPointCloud(const mrpt::maps::CPointsMap& p);
    void clear();
    int32_t coord2idx(float xyz) const;
};

Fields

tsl::robin_map<indices_t, voxel_t, IndicesHash> pts_voxels

The point indices in each voxel. Directly access to each desired cell, use its iterator, etc.

Methods

void setResolution(const float voxel_size)

Changes the voxel resolution, clearing past contents

void clear()

Remove all points and internal data.