RaidZeroLib
Coroutine robot framework for VEX V5
Toggle main menu visibility
Loading...
Searching...
No Matches
CubicBezier.hpp
1
#pragma once
2
#include "RaidZeroLib/api/Geometry/Point.hpp"
3
#include "RaidZeroLib/api/Pathing/ParametricPath.hpp"
4
5
namespace
rz
{
6
26
class
CubicBezier
:
public
ParametricPath
{
27
public
:
41
class
Knot
{
42
public
:
53
Knot
(
Length
x,
Length
y,
Angle
theta,
Length
magnitude)
noexcept
;
54
56
Point
getPoint
() const noexcept;
57
59
Point
getForwardControl
() const noexcept;
60
62
Point
getBackwardControl
() const noexcept;
63
64
private:
65
Length
x;
66
Length
y;
67
Angle
theta;
68
Length
magnitude;
69
};
70
86
CubicBezier
(const
Knot
&
start
, const
Knot
& end) noexcept;
87
94
Point
getPoint
(
double
t) const noexcept override;
95
104
Point
getVelocity
(
double
t) const noexcept override;
105
114
Point
getAcceleration
(
double
t) const noexcept override;
115
116
private:
117
Point
c0;
118
Point
c1;
119
Point
c2;
120
Point
c3;
121
};
122
123
}
// namespace rz
rz::CubicBezier::Knot
Control knot defining both position and tangent handle geometry.
Definition
CubicBezier.hpp:41
rz::CubicBezier::Knot::getPoint
Point getPoint() const noexcept
Returns the anchor position (x, y) of the control knot.
rz::CubicBezier::Knot::getForwardControl
Point getForwardControl() const noexcept
Returns the forward (outgoing) control handle in world coordinates.
rz::CubicBezier::Knot::getBackwardControl
Point getBackwardControl() const noexcept
Returns the backward (incoming) control handle in world coordinates.
rz::CubicBezier::Knot::Knot
Knot(Length x, Length y, Angle theta, Length magnitude) noexcept
Constructs a control knot with position, tangent angle, and handle length.
rz::CubicBezier::CubicBezier
CubicBezier(const Knot &start, const Knot &end) noexcept
Constructs a cubic Bézier segment between two control knots.
rz::CubicBezier::getPoint
Point getPoint(double t) const noexcept override
Computes the position P(t) along the cubic Bézier.
rz::CubicBezier::getVelocity
Point getVelocity(double t) const noexcept override
Computes the first derivative dP/dt at parameter t.
rz::CubicBezier::getAcceleration
Point getAcceleration(double t) const noexcept override
Computes the second derivative d²P/dt² at parameter t.
rz::ParametricPath
Differentiable 2D path over a unit-interval parameter t ∈ [0, 1].
Definition
ParametricPath.hpp:26
rz::Point
Immutable 2D point / vector with unit-safe Cartesian coordinates.
Definition
Point.hpp:21
rz::start
void start(RobotConfig config)
Starts RaidZeroLib on the brain. Call once from initialize().
rz::Angle
au::QuantityD< au::Radians > Angle
Definition
Units.hpp:13
rz::Length
au::QuantityD< au::Meters > Length
Definition
Units.hpp:9
rz
Definition
DriverControl.hpp:11
RaidZeroLib
api
Pathing
CubicBezier.hpp
Generated by
1.18.0