class mrpt::maps::CVoxelMapRGB

Overview

Log-odds sparse voxel map for cells containing the occupancy and an RGB color for each voxel.

#include <mrpt/maps/CVoxelMapRGB.h>

class CVoxelMapRGB: public mrpt::maps::CVoxelMapOccupancyBase
{
public:
    // typedefs

    typedef std::shared_ptr<mrpt::maps ::CVoxelMapRGB> Ptr;
    typedef std::shared_ptr<const mrpt::maps ::CVoxelMapRGB> ConstPtr;
    typedef std::unique_ptr<mrpt::maps ::CVoxelMapRGB> UniquePtr;
    typedef std::unique_ptr<const mrpt::maps ::CVoxelMapRGB> ConstUniquePtr;
    typedef CVoxelMapBase<node_t> myself_t;
    typedef node_t voxel_node_t;

    // structs

    struct TMapDefinition;
    struct TMapDefinitionBase;

    // fields

    static constexpr const char* className = "mrpt::maps" "::" "CVoxelMapRGB";
    static const size_t m_private_map_register_id =   mrpt::maps::internal::TMetricMapTypesRegistry::Instance().doRegister("mrpt::maps::CVoxelMapRGB,voxelMapRGB" ,& mrpt::maps::CVoxelMapRGB ::MapDefinition,& mrpt::maps::CVoxelMapRGB ::internal_CreateFromMapDefinition);
    TVoxelMap_LikelihoodOptions likelihoodOptions;
    TVoxelMap_RenderingOptions renderingOptions;

    // construction

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

    // methods

    static constexpr auto getClassName();
    static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic();
    static std::shared_ptr<CObject> CreateObject();

    template <typename... Args>
    static Ptr Create(Args&&... args);

    template <typename Alloc, typename... Args>
    static Ptr CreateAlloc(
        const Alloc& alloc,
        Args&&... args
        );

    template <typename... Args>
    static UniquePtr CreateUnique(Args&&... args);

    virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const;
    virtual mrpt::rtti::CObject* clone() const;
    static std::shared_ptr<mrpt::maps::TMetricMapInitializer> MapDefinition();
    static std::shared_ptr<CVoxelMapRGB> CreateFromMapDefinition(const mrpt::maps::TMetricMapInitializer& def);
    static std::shared_ptr<mrpt::maps::CMetricMap> internal_CreateFromMapDefinition(const mrpt::maps::TMetricMapInitializer& def);

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

    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;

    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
        ) const;

    void insertPointCloudAsRays(
        const mrpt::maps::CPointsMap& pts,
        const mrpt::math::TPoint3D& sensorPt,
        const std::optional<const mrpt::poses::CPose3D>& sensorPose = std::nullopt
        );

    void insertPointCloudAsEndPoints(
        const mrpt::maps::CPointsMap& pts,
        const mrpt::math::TPoint3D& sensorPt,
        const std::optional<const mrpt::poses::CPose3D>& sensorPose = std::nullopt
        );

    mrpt::maps::CSimplePointsMap::Ptr getOccupiedVoxels();
    const Bonxai::VoxelGrid<node_t>& grid() const;
};

Inherited Members

public:
    // typedefs

    typedef std::shared_ptr<CObject> Ptr;
    typedef std::shared_ptr<const CObject> ConstPtr;
    typedef std::shared_ptr<CSerializable> Ptr;
    typedef std::shared_ptr<const CSerializable> ConstPtr;
    typedef std::shared_ptr<CMetricMap> Ptr;
    typedef std::shared_ptr<const CMetricMap> ConstPtr;

    // 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

    static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic();
    virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const;
    virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const;
    static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic();
    Visualizable& operator = (const Visualizable&);
    Visualizable& operator = (Visualizable&&);
    virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const;
    virtual bool isEmpty() const = 0;
    virtual void saveMetricMapRepresentationToFile(const std::string& filNamePrefix) const = 0;
    virtual std::string asString() const = 0;
    virtual void getVisualizationInto(mrpt::viz::CSetOfObjects& o) const = 0;
    CVoxelMapBase& operator = (const CVoxelMapBase&);
    CVoxelMapBase& operator = (CVoxelMapBase&& o);
    virtual void getAsOctoMapVoxels(mrpt::viz::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,
        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,
        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,
        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,
        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;

    NearestNeighborsCapable& operator = (const NearestNeighborsCapable&);
    NearestNeighborsCapable& operator = (NearestNeighborsCapable&&);
    static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic();

Typedefs

typedef std::shared_ptr<mrpt::maps ::CVoxelMapRGB> Ptr

A type for the associated smart pointer.

Fields

static const size_t m_private_map_register_id =   mrpt::maps::internal::TMetricMapTypesRegistry::Instance().doRegister("mrpt::maps::CVoxelMapRGB,voxelMapRGB" ,& mrpt::maps::CVoxelMapRGB ::MapDefinition,& mrpt::maps::CVoxelMapRGB ::internal_CreateFromMapDefinition)

ID used to initialize class registration (just ignore it)

Methods

virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const

Returns information about the class of an object in runtime.

virtual mrpt::rtti::CObject* clone() const

Returns a deep copy (clone) of the object, indepently of its class.

static std::shared_ptr<mrpt::maps::TMetricMapInitializer> MapDefinition()

Returns default map definition initializer.

See * mrpt::maps::TMetricMapInitializer

static std::shared_ptr<CVoxelMapRGB> CreateFromMapDefinition(const mrpt::maps::TMetricMapInitializer& def)

Constructor from a map definition structure: initializes the map and * its parameters accordingly.