WPILibC++ 2024.3.2
frc::Spline< Degree > Class Template Referenceabstract

Represents a two-dimensional parametric spline that interpolates between two points. More...

#include <frc/spline/Spline.h>

Classes

struct  ControlVector
 Represents a control vector for a spline. More...
 

Public Types

using PoseWithCurvature = std::pair< Pose2d, units::curvature_t >
 

Public Member Functions

 Spline ()=default
 
 Spline (const Spline &)=default
 
Splineoperator= (const Spline &)=default
 
 Spline (Spline &&)=default
 
Splineoperator= (Spline &&)=default
 
virtual ~Spline ()=default
 
PoseWithCurvature GetPoint (double t) const
 Gets the pose and curvature at some point t on the spline. More...
 
virtual Matrixd< 6, Degree+1 > Coefficients () const =0
 Returns the coefficients of the spline. More...
 
virtual const ControlVectorGetInitialControlVector () const =0
 Returns the initial control vector that created this spline. More...
 
virtual const ControlVectorGetFinalControlVector () const =0
 Returns the final control vector that created this spline. More...
 

Static Protected Member Functions

static Eigen::Vector2d ToVector (const Translation2d &translation)
 Converts a Translation2d into a vector that is compatible with Eigen. More...
 
static Translation2d FromVector (const Eigen::Vector2d &vector)
 Converts an Eigen vector into a Translation2d. More...
 

Detailed Description

template<int Degree>
class frc::Spline< Degree >

Represents a two-dimensional parametric spline that interpolates between two points.

Template Parameters
DegreeThe degree of the spline.

Member Typedef Documentation

◆ PoseWithCurvature

template<int Degree>
using frc::Spline< Degree >::PoseWithCurvature = std::pair<Pose2d, units::curvature_t>

Constructor & Destructor Documentation

◆ Spline() [1/3]

template<int Degree>
frc::Spline< Degree >::Spline ( )
default

◆ Spline() [2/3]

template<int Degree>
frc::Spline< Degree >::Spline ( const Spline< Degree > &  )
default

◆ Spline() [3/3]

template<int Degree>
frc::Spline< Degree >::Spline ( Spline< Degree > &&  )
default

◆ ~Spline()

template<int Degree>
virtual frc::Spline< Degree >::~Spline ( )
virtualdefault

Member Function Documentation

◆ Coefficients()

template<int Degree>
virtual Matrixd< 6, Degree+1 > frc::Spline< Degree >::Coefficients ( ) const
pure virtual

Returns the coefficients of the spline.

Returns
The coefficients of the spline.

Implemented in frc::CubicHermiteSpline, and frc::QuinticHermiteSpline.

◆ FromVector()

template<int Degree>
static Translation2d frc::Spline< Degree >::FromVector ( const Eigen::Vector2d &  vector)
inlinestaticprotected

Converts an Eigen vector into a Translation2d.

Parameters
vectorThe vector to convert.
Returns
The Translation2d.

◆ GetFinalControlVector()

template<int Degree>
virtual const ControlVector & frc::Spline< Degree >::GetFinalControlVector ( ) const
pure virtual

Returns the final control vector that created this spline.

Returns
The final control vector that created this spline.

Implemented in frc::CubicHermiteSpline, and frc::QuinticHermiteSpline.

◆ GetInitialControlVector()

template<int Degree>
virtual const ControlVector & frc::Spline< Degree >::GetInitialControlVector ( ) const
pure virtual

Returns the initial control vector that created this spline.

Returns
The initial control vector that created this spline.

Implemented in frc::CubicHermiteSpline, and frc::QuinticHermiteSpline.

◆ GetPoint()

template<int Degree>
PoseWithCurvature frc::Spline< Degree >::GetPoint ( double  t) const
inline

Gets the pose and curvature at some point t on the spline.

Parameters
tThe point t
Returns
The pose and curvature at that point.

◆ operator=() [1/2]

template<int Degree>
Spline & frc::Spline< Degree >::operator= ( const Spline< Degree > &  )
default

◆ operator=() [2/2]

template<int Degree>
Spline & frc::Spline< Degree >::operator= ( Spline< Degree > &&  )
default

◆ ToVector()

template<int Degree>
static Eigen::Vector2d frc::Spline< Degree >::ToVector ( const Translation2d translation)
inlinestaticprotected

Converts a Translation2d into a vector that is compatible with Eigen.

Parameters
translationThe Translation2d to convert.
Returns
The vector.

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