WPILibC++ 2023.4.3-108-ge5452e3
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...
 

Protected Member Functions

virtual Matrixd< 6, Degree+1 > Coefficients () const =0
 Returns the coefficients of the 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
protectedpure 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.

◆ 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: