RaidZeroLib
Coroutine robot framework for VEX V5
Loading...
Searching...
No Matches
rz::PiecewiseCubicBezier Class Reference

Piecewise cubic Bézier path over t ∈ [0, 1] with segment-uniform parameterization. More...

#include <PiecewiseCubicBezier.hpp>

Inheritance diagram for rz::PiecewiseCubicBezier:
rz::ParametricPath

Public Member Functions

 PiecewiseCubicBezier (std::initializer_list< CubicBezier::Knot > knots)
 Constructs a piecewise cubic path from consecutive control knots.
Point getPoint (double t) const noexcept override
 Position on the path at global parameter t.
Point getVelocity (double t) const noexcept override
 First derivative dP/dt at global parameter t (w.r.t. global parameter).
Point getAcceleration (double t) const noexcept override
 Second derivative d²P/dt² at global parameter t (w.r.t. global parameter).
Public Member Functions inherited from rz::ParametricPath
virtual ~ParametricPath ()=default
 Virtual destructor.
virtual Angle getTheta (double t) const noexcept
 Path heading: orientation of the tangent dP/dt.
virtual Curvature getCurvature (double t) const noexcept
 Signed curvature κ(t) = wedge(dP/dt, d²P/dt²) / |dP/dt|³.
virtual Length getLength (double tStart=0, double tEnd=1) const noexcept
 Arclength along the path between parameters tStart and tEnd.
virtual double stepT (double t, Length distance) const noexcept
 Advance the parameter by a target arclength measured along the path.
virtual DiscretePath toDiscrete (Length distance, bool includeEnd=true) const

Detailed Description

Piecewise cubic Bézier path over t ∈ [0, 1] with segment-uniform parameterization.

Builds a chain of cubic Bézier segments from consecutive control “knots.” The global parameter t is mapped uniformly by segment: if there are N segments, segment k occupies t ∈ [k/N, (k+1)/N], and the segment-local parameter is fractionalIndex = N * t − k in [0, 1].

Continuity: The curve is C¹ guaranteed continuous, C² is up to the user's choice of control points

See also
CubicBezier

Constructor & Destructor Documentation

◆ PiecewiseCubicBezier()

rz::PiecewiseCubicBezier::PiecewiseCubicBezier ( std::initializer_list< CubicBezier::Knot > knots)
explicit

Constructs a piecewise cubic path from consecutive control knots.

For a list of M control points, creates M-1 cubic segments: segment i uses knots knots[i] (start) and knots[i+1] (end).

Parameters
knotsNon-empty initializer list of control knots (size ≥ 2).
Precondition
knots.size() >= 2 to form at least one segment.
Note
Parameterization is uniform per segment, not by arclength. For arclength-uniform sampling, use ParametricPath::toDiscrete or ParametricPath::stepT.

Member Function Documentation

◆ getAcceleration()

Point rz::PiecewiseCubicBezier::getAcceleration ( double t) const
overridevirtualnoexcept

Second derivative d²P/dt² at global parameter t (w.r.t. global parameter).

Parameters
tDimensionless global parameter.
Returns
Second derivative vector (meters).
Precondition
0 ≤ t ≤ 1.

Implements rz::ParametricPath.

◆ getPoint()

Point rz::PiecewiseCubicBezier::getPoint ( double t) const
overridevirtualnoexcept

Position on the path at global parameter t.

Maps t to the owning segment and evaluates that cubic at its local parameter.

Parameters
tDimensionless global parameter (clamped conceptually to [0, 1]).
Returns
2D point in meters.
Precondition
0 ≤ t ≤ 1.

Implements rz::ParametricPath.

◆ getVelocity()

Point rz::PiecewiseCubicBezier::getVelocity ( double t) const
overridevirtualnoexcept

First derivative dP/dt at global parameter t (w.r.t. global parameter).

Internally computes the segment index and local parameter, and returns the cubic’s derivative with respect to its local parameter, scaled by the segment mapping (here, uniform per segment).

Parameters
tDimensionless global parameter.
Returns
Tangent vector (meters).
Precondition
0 ≤ t ≤ 1.

Implements rz::ParametricPath.


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