Template Class BaseLinearGrid2

Inheritance Relationships

Base Type

Derived Types

Class Documentation

template<typename Derived>
class BaseLinearGrid2 : public beluga::BaseDenseGrid2<Derived>

Linear 2D grid base type.

When instantiated, it satisfies Beluga named requirements: LinearGrid2.

Template Parameters:

Derived – Concrete linear grid type. It must define Derived::width(), Derived::height(), Derived::resolution(), Derived::data_at(std::size_t), Derived::index_at(int, int), and Derived::data() as described in Beluga named requirements: LinearGrid2.

Subclassed by beluga::ValueGrid2< float >, beluga::BaseOccupancyGrid2< Derived >

Public Functions

inline std::size_t index_at(int xi, int yi) const

Computes index for given grid cell coordinates.

inline std::size_t index_at(const Eigen::Vector2i &pi) const

Computes index for given grid cell coordinates.

Parameters:

pi – Grid cell coordinates.

inline Eigen::Vector2d coordinates_at(std::size_t index) const

Compute plane coordinates given a grid cell index.

Parameters:

index – Grid cell index.

Returns:

Plane coordinates of the cell centroid.

inline auto data_at(std::size_t index) const

Gets cell data, if included.

Parameters:

index – Grid cell index.

Returns:

Cell data if included, std::nullopt otherwise.

inline auto neighborhood4(std::size_t index) const

Computes 4-connected neighborhood for cell.

Parameters:

index – Grid cell index.

Returns:

range of neighbor cells’ indices.