class mola::OccGrid

Overview

Extends MRPT’s occupancy grid with super-resolution likelihood field.

#include <OccGrid.h>

class OccGrid: public mrpt::serialization::CSerializable
{
public:
    // structs

    struct InsertionParameters;
    struct LikelihoodParameters;

    // fields

    InsertionParameters insertionParameters_;
    LikelihoodParameters likelihoodParameters_;
    static constexpr float CACHE_MISS_VALUE = std::numeric_limits<float>::min();

    // methods

    void insertObservation(
        const mrpt::obs::CObservation2DRangeScan& obs,
        const mrpt::math::TPose2D& robotPose
        );

    const mrpt::maps::COccupancyGridMap2D& grid() const;
    void resetLikelihoodCache();

    void setSize(
        const mrpt::math::TPoint2Df& minCorner,
        const mrpt::math::TPoint2Df& maxCorner,
        float resolution,
        float occupancyValue = 0.5f
        );

    void resizeGrid(
        const mrpt::math::TPoint2Df& minCorner,
        const mrpt::math::TPoint2Df& maxCorner,
        float newCellsOccupancy = 0.5f
        );
};

Fields

static constexpr float CACHE_MISS_VALUE = std::numeric_limits<float>::min()

For use in likelihoodCacheGrid_

Methods

void resetLikelihoodCache()

Invalidates all cached likelihood values (normally users do not need to call this)

void setSize(
    const mrpt::math::TPoint2Df& minCorner,
    const mrpt::math::TPoint2Df& maxCorner,
    float resolution,
    float occupancyValue = 0.5f
    )

Change the size of gridmap, erasing all its previous contents.

Parameters:

minCorner

The (x,y) coordinates of left-bottom grid corner.

maxCorner

The (x,y) coordinates of right-top grid corner.

resolution

The new size of square cells [meters]

occupancyValue

The occupancy value of cells, tipically 0.5.

void resizeGrid(
    const mrpt::math::TPoint2Df& minCorner,
    const mrpt::math::TPoint2Df& maxCorner,
    float newCellsOccupancy = 0.5f
    )

Change the size of gridmap, maintaining previous contents.

Parameters:

minCorner

The (x,y) coordinates of left-bottom grid corner.

maxCorner

The (x,y) coordinates of right-top grid corner.

newCellsOccupancyValue

Occupancy of new cells, tipically 0.5.

See also:

setSize