Template Struct CLogOddsGridMapLUT

Inheritance Relationships

Base Type

Struct Documentation

template<typename TCELL>
struct CLogOddsGridMapLUT : public mrpt::maps::detail::logoddscell_traits<TCELL>

One static instance of this struct should exist in any class implementing CLogOddsGridMap2D to hold the Look-up-tables (LUTs) for log-odss Bayesian update. Map cells must be type TCELL, which can be only:

  • int8_t or

  • int16_t

See also

CLogOddsGridMap2D, see derived classes for usage examples.

Public Types

using cell_t = TCELL

The type of

using traits_t = detail::logoddscell_traits<TCELL>

Public Functions

inline CLogOddsGridMapLUT()

Constructor: computes all the required stuff.

inline float l2p(const cell_t l)

Scales an integer representation of the log-odd into a real valued probability in [0,1], using p=exp(l)/(1+exp(l))

inline uint8_t l2p_255(const cell_t l)

Scales an integer representation of the log-odd into a linear scale [0,255], using p=exp(l)/(1+exp(l))

inline cell_t p2l(const float p)

Scales a real valued probability in [0,1] to an integer representation of: log(p)-log(1-p) in the valid range of cell_t.

Public Members

std::vector<float> logoddsTable

A lookup table to compute occupancy probabilities in [0,1] from integer log-odds values in the cells, using \( p(m_{xy}) = \frac{1}{1+exp(-log_odd)} \).

std::vector<uint8_t> logoddsTable_255

A lookup table to compute occupancy probabilities in the range [0,255] from integer log-odds values in the cells, using \( p(m_{xy}) = \frac{1}{1+exp(-log_odd)} \). This is used to speed-up conversions to grayscale images.

std::vector<cell_t> p2lTable

A lookup table for passing from float to log-odds as cell_t.