TinyRobotics
Loading...
Searching...
No Matches
src
TinyRobotics
maps
PathSegment.h
1
#
pragma
once
2
3
#
include
"TinyRobotics/coordinates/Coordinate.h"
4
#
include
"TinyRobotics/utils/Common.h"
5
6
namespace
tinyrobotics {
7
8
/**
9
* @class PathSegment
10
* @brief Represents a path segment (edge) between two coordinates in a graph.
11
*
12
* Each segment connects two nodes (coordinates) and can be used to define the
13
* edges in a graph for pathfinding algorithms such as A* or Dijkstra's. The
14
* segment has:
15
* - a start node (from)
16
* - an end node (to)
17
* - a cost (distance, time, or any metric relevant to the problem)
18
* - a directionality flag (directed or undirected)
19
*
20
* This class is a fundamental building block for creating a path map for
21
* navigation, motion planning, and graph-based search.
22
*
23
* @tparam Coordinate The coordinate type (e.g., 2D or 3D point).
24
*/
25
template
<
typename
CoordinateT =
Coordinate
<DistanceM>>
26
class
PathSegment
{
27
public
:
28
CoordinateT from;
29
CoordinateT to;
30
float
cost = 0.0;
// Default cost for traversing this segment
31
bool
directed =
false
;
32
};
33
34
}
// namespace tinyrobotics
tinyrobotics::Coordinate
A generic 3D coordinate class for robotics, navigation, and spatial calculations.
Definition:
Coordinate.h:57
tinyrobotics::PathSegment
Represents a path segment (edge) between two coordinates in a graph.
Definition:
PathSegment.h:26
Generated by
1.9.6