template class mrpt::maps::CVoxelMapOccupancyBase

Base class for log-odds sparse voxel map for cells containing occupancy, and possibly other information, for each voxel.

See also:

Use derived classes CVoxelMap, CVoxelMapRGB

#include <mrpt/maps/CVoxelMapOccupancyBase.h>

template <typename voxel_node_t, typename occupancy_t = int8_t>
class CVoxelMapOccupancyBase:
    public mrpt::maps::CVoxelMapBase,
    public mrpt::maps::detail::logoddscell_traits<int8_t>,
    public mrpt::maps::NearestNeighborsCapable
{
public:
    // construction

    CVoxelMapOccupancyBase(
        double resolution = 0.05,
        uint8_t inner_bits = 2,
        uint8_t leaf_bits = 3
        );
};

// direct descendants

class CVoxelMap;
class CVoxelMapRGB;

Inherited Members

public:
    // structs

    struct Impl;

    //
fields

    static constexpr int8_t CELLTYPE_MIN = -127;
    static constexpr int8_t CELLTYPE_MAX = 127;
    static constexpr int8_t P2LTABLE_SIZE = CELLTYPE_MAX;
    static constexpr std::size_t LOGODDS_LUT_ENTRIES = 1<<8;

    //
methods

    virtual bool isEmpty() const = 0;
    virtual void saveMetricMapRepresentationToFile(const std::string& filNamePrefix) const = 0;
    virtual std::string asString() const = 0;
    virtual void getVisualizationInto(mrpt::opengl::CSetOfObjects& o) const = 0;
    CVoxelMapBase& operator = (const CVoxelMapBase& o);
    CVoxelMapBase& operator = (CVoxelMapBase&& o);
    virtual void getAsOctoMapVoxels(mrpt::opengl::COctoMapVoxels& gl_obj) const = 0;
    virtual bool nn_has_indices_or_ids() const = 0;
    virtual size_t nn_index_count() const = 0;

    virtual bool nn_single_search(
        const mrpt::math::TPoint3Df& query,
        mrpt::math::TPoint3Df& result,
        float& out_dist_sqr,
        uint64_t& resultIndexOrIDOrID
        ) const = 0;

    virtual bool nn_single_search(
        const mrpt::math::TPoint2Df& query,
        mrpt::math::TPoint2Df& result,
        float& out_dist_sqr,
        uint64_t& resultIndexOrIDOrID
        ) const = 0;

    virtual void nn_multiple_search(
        const mrpt::math::TPoint3Df& query,
        const size_t N,
        std::vector<mrpt::math::TPoint3Df>& results,
        std::vector<float>& out_dists_sqr,
        std::vector<uint64_t>& resultIndicesOrIDs
        ) const = 0;

    virtual void nn_multiple_search(
        const mrpt::math::TPoint2Df& query,
        const size_t N,
        std::vector<mrpt::math::TPoint2Df>& results,
        std::vector<float>& out_dists_sqr,
        std::vector<uint64_t>& resultIndicesOrIDs
        ) const = 0;

    virtual void nn_radius_search(
        const mrpt::math::TPoint3Df& query,
        const float search_radius_sqr,
        std::vector<mrpt::math::TPoint3Df>& results,
        std::vector<float>& out_dists_sqr,
        std::vector<uint64_t>& resultIndicesOrIDs,
        size_t maxPoints = 0
        ) const = 0;

    virtual void nn_radius_search(
        const mrpt::math::TPoint2Df& query,
        const float search_radius_sqr,
        std::vector<mrpt::math::TPoint2Df>& results,
        std::vector<float>& out_dists_sqr,
        std::vector<uint64_t>& resultIndicesOrIDs,
        size_t maxPoints = 0
        ) const = 0;