A map-like utility for generating and validating neighbor coordinates in a configurable pattern.
More...
|
|
| CallbackMap ()=default |
| | Default constructor.
|
| |
| | CallbackMap (float distanceX, float distanceY, float resolutionM, int neighborCount) |
| | Construct a CallbackMap with extents, resolution, and neighbor count.
|
| |
| int | getXCount () const override |
| | Get the number of cells in the X direction.
|
| |
| int | getYCount () const override |
| | Get the number of cells in the Y direction.
|
| |
| float | getResolution () const override |
| | Get the map resolution in meters.
|
| |
| std::vector< Coordinate< T > > | getNeighbors (Coordinate< T > from) const override |
| | Generate valid neighbor coordinates around a given point.
|
| |
| bool | isValid (const Coordinate< T > &coord) const override |
| | Check if a coordinate is valid (not occupied).
|
| |
| bool | getCell (int x, int y, CellState &state) const override |
| | Get the cell state at grid coordinates (x, y).
|
| |
| Coordinate< T > | toWorld (int x, int y) const override |
| | Convert grid indices to world coordinates.
|
| |
| void | setIsValidCallback (CellState(*callback)(Coordinate< T >)) |
| | Set the callback for cell validity checking.
|
| |
| void | setResolution (float resolutionM) |
| | Set the map resolution in meters.
|
| |
| void | setNeighborCount (int neighborCount) |
| | Set the number of neighbors to generate.
|
| |
| void | setDistanceX (float dx) |
| | Set the map extent in X direction.
|
| |
| void | setDistanceY (float dy) |
| | Set the map extent in Y direction.
|
| |
| 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::CallbackMap< T >
A map-like utility for generating and validating neighbor coordinates in a configurable pattern.
CallbackMap generates neighbor coordinates around a given point at a specified distance and angular resolution. It supports a user-provided callback to determine if a coordinate is valid (e.g., obstacle-free).
Typical use: pathfinding, navigation, or virtual occupancy grids where neighbors are not stored but computed on demand.
- Template Parameters
-
| T | Numeric type for coordinates (default: DistanceM) |
Example usage:
A map-like utility for generating and validating neighbor coordinates in a configurable pattern.
Definition: CallbackMap.h:34
A generic 3D coordinate class for robotics, navigation, and spatial calculations.
Definition: Coordinate.h:57
T x
X coordinate (meters)
Definition: Coordinate.h:71