TinyRobotics
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
PathMap< CoordinateT > Class Template Reference

Represents a graph of valid path segments (edges) between coordinates (nodes). More...

#include <PathMap.h>

Inheritance diagram for PathMap< CoordinateT >:
Inheritance graph
[legend]
Collaboration diagram for PathMap< CoordinateT >:
Collaboration graph
[legend]

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
 

Detailed Description

template<typename CoordinateT = Coordinate<float>>
class tinyrobotics::PathMap< CoordinateT >

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.

Template Parameters
CoordinateThe coordinate type (e.g., 2D or 3D point).

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