Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
towr::Spline Class Reference

A spline built from a sequence of cubic polynomials. More...

#include <spline.h>

Inheritance diagram for towr::Spline:
Inheritance graph
[legend]

Public Types

using VecPoly = std::vector< CubicHermitePolynomial >
 
using VecTimes = std::vector< double >
 

Public Member Functions

const State GetPoint (double t) const
 
const State GetPoint (int poly_id, double t_local) const
 
VecTimes GetPolyDurations () const
 
int GetPolynomialCount () const
 
double GetTotalTime () const
 
 Spline (const VecTimes &poly_durations, int n_dim)
 
virtual ~Spline ()=default
 

Static Public Member Functions

static int GetSegmentID (double t_global, const VecTimes &durations)
 

Protected Member Functions

std::pair< int, double > GetLocalTime (double t_global, const VecTimes &d) const
 How much time of the current segment has passed at t_global. More...
 
void UpdatePolynomialCoeff ()
 Updates the cubic-Hermite polynomial coefficients using the currently set nodes values and durations. More...
 

Protected Attributes

VecPoly cubic_polys_
 the sequence of polynomials making up the spline. More...
 

Detailed Description

A spline built from a sequence of cubic polynomials.

This class is responsible for stitching together multiple individual polynomials into one spline.

Definition at line 45 of file spline.h.

Member Typedef Documentation

◆ VecPoly

Definition at line 48 of file spline.h.

◆ VecTimes

using towr::Spline::VecTimes = std::vector<double>

Definition at line 47 of file spline.h.

Constructor & Destructor Documentation

◆ Spline()

towr::Spline::Spline ( const VecTimes poly_durations,
int  n_dim 
)

Definition at line 36 of file spline.cc.

◆ ~Spline()

virtual towr::Spline::~Spline ( )
virtualdefault

Member Function Documentation

◆ GetLocalTime()

std::pair< int, double > towr::Spline::GetLocalTime ( double  t_global,
const VecTimes d 
) const
protected

How much time of the current segment has passed at t_global.

Parameters
t_globalThe global time [s] along the spline.
dThe durations of each segment.
Returns
The segment id and the time passed in this segment.

Definition at line 69 of file spline.cc.

◆ GetPoint() [1/2]

const State towr::Spline::GetPoint ( double  t) const
Returns
The state of the spline at time t.
Parameters
tThe time at which the state of the spline is desired.

Definition at line 81 of file spline.cc.

◆ GetPoint() [2/2]

const State towr::Spline::GetPoint ( int  poly_id,
double  t_local 
) const
Parameters
poly_idPolynomial id, 0 is first polynomial.
t_localTime along the current polynomial.
Returns
The position, velocity and acceleration of spline.

Definition at line 90 of file spline.cc.

◆ GetPolyDurations()

Spline::VecTimes towr::Spline::GetPolyDurations ( ) const
Returns
the durations of each polynomial.

Definition at line 109 of file spline.cc.

◆ GetPolynomialCount()

int towr::Spline::GetPolynomialCount ( ) const
Returns
the number of polynomials making up this spline.

Definition at line 103 of file spline.cc.

◆ GetSegmentID()

int towr::Spline::GetSegmentID ( double  t_global,
const VecTimes durations 
)
static
Returns
The segment (e.g. phase, polynomial) at time t_global.
Parameters
t_globalThe global time in the spline.
durationsThe durations [s] of each segment.

Definition at line 49 of file spline.cc.

◆ GetTotalTime()

double towr::Spline::GetTotalTime ( ) const
Returns
The total time of the spline.

Definition at line 119 of file spline.cc.

◆ UpdatePolynomialCoeff()

void towr::Spline::UpdatePolynomialCoeff ( )
protected

Updates the cubic-Hermite polynomial coefficients using the currently set nodes values and durations.

Definition at line 96 of file spline.cc.

Member Data Documentation

◆ cubic_polys_

VecPoly towr::Spline::cubic_polys_
protected

the sequence of polynomials making up the spline.

Definition at line 89 of file spline.h.


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


towr
Author(s): Alexander W. Winkler
autogenerated on Mon Feb 28 2022 23:54:22