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 Impl;
    struct IndicesHash;
    struct Parameters;
    struct indices_t;
    struct voxel_t;

    // fields

    Parameters params_;

    // methods

    void setResolution(const float voxel_size);
    void processPointCloud(const mrpt::maps::CPointsMap& p);
    void clear();
    int32_t coord2idx(float xyz) const;
    void visit_voxels(const std::function<void(const indices_t idx, const voxel_t&vxl)>& userCode) const;
    size_t size() const;
};

Methods

void setResolution(const float voxel_size)

Changes the voxel resolution, clearing past contents

void clear()

Remove all points and internal data.

size_t size() const

Returns the number of occupied voxels.