|
TinyRobotics
|
Represents a graph of valid path segments (edges) between coordinates (nodes). More...
#include <PathMap.h>


Public Member Functions | |
| void | addSegment (const CoordinateT &from, const CoordinateT &to, bool directed=false) |
| void | addSegment (PathSegment< CoordinateT > segment) |
| std::vector< PathSegment< CoordinateT > > | getSegments (const CoordinateT &from) const |
| std::vector< CoordinateT > | getNeighbors (CoordinateT from) const override |
| bool | isValid (const Coordinate< float > &coord) const override |
| size_t | size () const |
| PathSegment< CoordinateT > & | operator[] (size_t index) |
| size_t | writeTo (Print &out) |
| size_t | readFrom (Stream &in) |
| void | clear () |
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. | |
Protected Attributes | |
| std::vector< PathSegment< CoordinateT >, AllocatorPSRAM< PathSegment< CoordinateT > > > | segments |
| PathMapSerializer< PathMap< CoordinateT >, CoordinateT > | serializer |
Represents a graph of valid path segments (edges) between coordinates (nodes).
PathMap is used for pathfinding algorithms (A*, Dijkstra, etc.) to find optimal paths between nodes. The map can contain both directed (one-way) and undirected (two-way) segments.
Features:
Typical usage: model a road network, robot navigation graph, or any scenario where movement is constrained to a set of valid connections.
| Coordinate | The coordinate type (e.g., 2D or 3D point). |