|
|
| GridBitMap (int xCount, int yCount, float resolutionM) |
| |
|
| GridBitMap (int xCount, int yCount, Distance resolution) |
| |
|
void | resize (int newXCount, int newYCount) |
| |
| int | getXCount () const |
| | Get the number of cells in the X direction.
|
| |
| int | getYCount () const |
| | Get the number of cells in the Y direction.
|
| |
| float | getResolution () const |
| | Get the map resolution (cell size in meters).
|
| |
|
bool | worldToCell (float wx, float wy, Cell &cell) const |
| |
|
void | cellToWorld (int cx, int cy, float &wx, float &wy) const |
| |
| bool | getCell (int cx, int cy, CellState &result) const |
| | Get the state of a cell by integer indices.
|
| |
|
void | setCell (int cx, int cy, CellState value) |
| |
|
bool | getCell (const Coordinate< T > &coord, CellState &result) const |
| |
|
void | setCell (const Coordinate< T > &coord, CellState value) |
| |
| bool | isValid (const Coordinate< T > &coord) const |
| | Check if a coordinate is within the map bounds.
|
| |
| std::vector< Coordinate<> > | getNeighbors (Coordinate< T > from) const |
| | Get world coordinates of neighboring cells (for pathfinding or navigation)
|
| |
| Coordinate< T > | toWorld (int cx, int cy) const override |
| | Convert cell indices to world coordinates (returns Coordinate<T>)
|
| |
|
size_t | writeTo (Print &out) |
| | Write map to output.
|
| |
|
size_t | readFrom (Stream &in) |
| | Read map from input.
|
| |
| 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.
|
| |
| 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.
|
| |
template<typename T = DistanceM>
class tinyrobotics::GridBitMap< T >
A grid map using two bit vectors to represent CellState efficiently.
The GridMapBitVector class models the environment as a regular grid of cells, each storing a state (FREE, OCCUPIED, UNKNOWN) using two std::vector<bool> for memory efficiency. So each cell occupies only 2 buts!
CellState encoding:
- 00: FREE
- 01: OCCUPIED
- 10: UNKNOWN
- Template Parameters
-
| T | Numeric type for coordinates (default: float) |