7#include "RaidZeroLib/api/Geometry/Point.hpp"
54 template <std::ranges::input_range Range>
55 requires(!std::same_as<std::remove_cvref_t<Range>,
DiscretePath> &&
56 std::convertible_to<std::ranges::range_reference_t<Range>,
Point>)
57 explicit DiscretePath(Range&& range) : path(std::ranges::begin(range), std::ranges::end(range)) {
58 assert(!path.empty() &&
"DiscretePath cannot be empty");
119 std::vector<
Point> path;
Immutable sequence of 2D waypoints with unit-safe geometry.
Definition DiscretePath.hpp:25
DiscretePath(Range &&range)
Constructs a path from any C++20 input range of points.
Definition DiscretePath.hpp:57
Curvature getCurvature(std::size_t index) const noexcept
Signed curvature at vertex index using the circumcircle of three consecutive points.
size_type size() const noexcept
Number of waypoints.
const_reverse_iterator rend() const noexcept
Reverse end iterator (one before the first).
const Point & const_reference
Definition DiscretePath.hpp:28
Point value_type
Definition DiscretePath.hpp:27
const_iterator end() const noexcept
Forward end iterator (one past the last).
std::vector< Point > container_type
Definition DiscretePath.hpp:29
std::vector< Point >::const_iterator const_iterator
Definition DiscretePath.hpp:31
std::vector< Point >::const_reverse_iterator const_reverse_iterator
Definition DiscretePath.hpp:32
DiscretePath operator+(const DiscretePath &rhs) const
Concatenates two paths (this followed by rhs).
const_reference back() const noexcept
Last waypoint.
DiscretePath(std::initializer_list< Point > waypoints)
Constructs a path from a brace-initialized list of points.
DiscretePath operator+(const Point &rhs) const
Appends a single waypoint to the end of the path.
std::size_t size_type
Definition DiscretePath.hpp:30
const_reverse_iterator rbegin() const noexcept
Reverse begin iterator (last element).
const_reference front() const noexcept
First waypoint.
const_iterator begin() const noexcept
Forward begin iterator.
Immutable 2D point / vector with unit-safe Cartesian coordinates.
Definition Point.hpp:21
DiscretePath::const_iterator closestPoint(DiscretePath::const_iterator begin, DiscretePath::const_iterator end, const Point &point)
Iterator-based closest-point search by Euclidean distance.
au::QuantityD< au::Inverse< au::Meters > > Curvature
Definition Units.hpp:11
Definition DriverControl.hpp:11