LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
light::Spline Class Reference

Concatenated quintic Hermite spline with arc-length parameterization. More...

#include <spline.hpp>

Public Member Functions

 Spline ()=default
 
 Spline (const std::vector< Waypoint > &wps)
 Build a spline from waypoints.
 
bool valid () const
 
float totalArcLen () const
 
size_t segmentCount () const
 
SplineSample sampleAt (float s) const
 Sample pose / derivatives at arc length s.
 
float headingAt (float s) const
 Heading at arc length s, in radians.
 
float curvatureAt (float s) const
 Signed curvature at arc length s.
 

Detailed Description

Concatenated quintic Hermite spline with arc-length parameterization.

Construct from a list of Waypoints; the resulting spline can then be sampled by global arc length s ∈ [0, totalArcLen()].

Definition at line 60 of file spline.hpp.

Constructor & Destructor Documentation

◆ Spline() [1/2]

light::Spline::Spline ( )
default

◆ Spline() [2/2]

light::Spline::Spline ( const std::vector< Waypoint > &  wps)
explicit

Build a spline from waypoints.

Parameters
wpsordered list of waypoints; must have at least 2 entries

Member Function Documentation

◆ curvatureAt()

float light::Spline::curvatureAt ( float  s) const

Signed curvature at arc length s.

Parameters
sarc length from start
Returns
curvature in 1/in; positive = CW (matches theta sign)

◆ headingAt()

float light::Spline::headingAt ( float  s) const

Heading at arc length s, in radians.

Parameters
sarc length from start
Returns
atan2(dx, dy) — LightLib convention (+Y forward)

◆ sampleAt()

SplineSample light::Spline::sampleAt ( float  s) const

Sample pose / derivatives at arc length s.

Parameters
sarc length from start; clamped to [0, totalArcLen()]

◆ segmentCount()

size_t light::Spline::segmentCount ( ) const
inline
Returns
Number of internal Hermite segments.

Definition at line 79 of file spline.hpp.

◆ totalArcLen()

float light::Spline::totalArcLen ( ) const
inline
Returns
Total arc length of the spline, inches.

Definition at line 76 of file spline.hpp.

◆ valid()

bool light::Spline::valid ( ) const
inline
Returns
true if the spline has at least one segment.

Definition at line 73 of file spline.hpp.


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