TinyRobotics
Loading...
Searching...
No Matches
Public Member Functions | List of all members
IMap< T > Class Template Referenceabstract

Abstract interface for 2D grid maps and occupancy maps in TinyRobotics. More...

#include <IMap.h>

Inheritance diagram for IMap< T >:
Inheritance graph
[legend]
Collaboration diagram for IMap< T >:
Collaboration graph
[legend]

Public Member Functions

virtual int getXCount () const =0
 Get the number of cells in the X direction.
 
virtual int getYCount () const =0
 Get the number of cells in the Y direction.
 
virtual float getResolution () const =0
 Get the map resolution (cell size in meters).
 
virtual bool getCell (int x, int y, CellState &state) const =0
 Get the state of a cell by integer indices.
 
virtual Coordinate< T > toWorld (int x, int y) const =0
 Convert cell indices to world coordinates.
 
- Public Member Functions inherited from IMapNeighbors< T >
virtual std::vector< Coordinate< T > > getNeighbors (Coordinate< T > from) const =0
 Get world coordinates of neighboring cells (for pathfinding or navigation).
 
virtual bool isValid (const Coordinate< T > &coord) const =0
 Check if a coordinate is inside the map bounds.
 

Detailed Description

template<typename T = DistanceM>
class tinyrobotics::IMap< T >

Abstract interface for 2D grid maps and occupancy maps in TinyRobotics.

IMap extends IMapNeighbors and provides a comprehensive interface for grid-based or cell-based maps for frontier exploring. It supports cell access, coordinate transforms, and neighbor queries, making it suitable for pathfinding, navigation, and mapping algorithms. All grid or occupancy map implementations (e.g., GridMap, GridBitMap) should inherit from this interface and implement all pure virtual methods.

Features:

Template Parameters
TScalar type for coordinates and math (default: DistanceM)

Required Methods

Member Function Documentation

◆ getCell()

virtual bool getCell ( int  x,
int  y,
CellState state 
) const
pure virtual

Get the state of a cell by integer indices.

Parameters
xCell X index
yCell Y index
stateOutput: Cell state (FREE, OCCUPIED, UNKNOWN)
Returns
True if cell is valid, false otherwise.

Implemented in GridBitMap< T >, GridMap< StateT, T >, and CallbackMap< T >.

◆ getResolution()

virtual float getResolution ( ) const
pure virtual

Get the map resolution (cell size in meters).

Implemented in GridBitMap< T >, GridMap< StateT, T >, and CallbackMap< T >.

◆ getXCount()

virtual int getXCount ( ) const
pure virtual

Get the number of cells in the X direction.

Implemented in GridBitMap< T >, GridMap< StateT, T >, and CallbackMap< T >.

◆ getYCount()

virtual int getYCount ( ) const
pure virtual

Get the number of cells in the Y direction.

Implemented in GridBitMap< T >, GridMap< StateT, T >, and CallbackMap< T >.

◆ toWorld()

virtual Coordinate< T > toWorld ( int  x,
int  y 
) const
pure virtual

Convert cell indices to world coordinates.

Parameters
xCell X index
yCell Y index
Returns
World coordinate of the cell center.

Implemented in GridMap< StateT, T >, GridBitMap< T >, and CallbackMap< T >.


The documentation for this class was generated from the following file: