RaidZeroLib
Coroutine robot framework for VEX V5
Loading...
Searching...
No Matches
PiecewiseCubicBezier.hpp
1#pragma once
2#include "RaidZeroLib/api/Pathing/CubicBezier.hpp"
3
4namespace rz {
5
19 public:
32 explicit PiecewiseCubicBezier(std::initializer_list<CubicBezier::Knot> knots);
33
44 Point getPoint(double t) const noexcept override;
45
58 Point getVelocity(double t) const noexcept override;
59
68 Point getAcceleration(double t) const noexcept override;
69
70 private:
80 struct Index {
81 std::size_t segmentIndex;
82 double fractionalIndex;
83 };
84
96 Index getIndex(double t) const noexcept;
97
98 std::vector<CubicBezier> curves;
99};
100
101} // namespace rz
Differentiable 2D path over a unit-interval parameter t ∈ [0, 1].
Definition ParametricPath.hpp:26
Point getVelocity(double t) const noexcept override
First derivative dP/dt at global parameter t (w.r.t. global parameter).
Point getPoint(double t) const noexcept override
Position on the path at global parameter t.
PiecewiseCubicBezier(std::initializer_list< CubicBezier::Knot > knots)
Constructs a piecewise cubic path from consecutive control knots.
Point getAcceleration(double t) const noexcept override
Second derivative d²P/dt² at global parameter t (w.r.t. global parameter).
Immutable 2D point / vector with unit-safe Cartesian coordinates.
Definition Point.hpp:21
Definition DriverControl.hpp:11