trajectory_collection
Public Member Functions | Protected Types | Protected Attributes | List of all members
TrajColl::CubicInterpolator< T, U > Class Template Reference

Cubic interpolator. More...

#include <CubicInterpolator.h>

Inheritance diagram for TrajColl::CubicInterpolator< T, U >:
Inheritance graph
[legend]
Collaboration diagram for TrajColl::CubicInterpolator< T, U >:
Collaboration graph
[legend]

Public Member Functions

 CubicInterpolator (const std::map< double, T > &points={})
 Constructor. More...
 
 CubicInterpolator (const CubicInterpolator &inst)
 Copy constructor. More...
 
virtual std::shared_ptr< Interpolator< T, U > > clone () const override
 Clone this instance and get shared pointer. More...
 
virtual void appendPoint (const std::pair< double, T > &point) override
 Add point. More...
 
virtual void calcCoeff () override
 Calculate coefficients. More...
 
virtual T operator() (double t) const override
 Calculate interpolated value. More...
 
virtual U derivative (double t, int order=1) const override
 Calculate the derivative of interpolated value. More...
 
- Public Member Functions inherited from TrajColl::Interpolator< T, T >
 Interpolator (const std::map< double, T > &points={})
 Constructor. More...
 
 Interpolator (const Interpolator &inst)
 Copy constructor. More...
 
virtual std::shared_ptr< Interpolator< T, T > > clone () const=0
 Clone this instance and get shared pointer. More...
 
virtual void clearPoints ()
 Clear points. More...
 
double startTime () const
 Get start time. More...
 
double endTime () const
 Get end time. More...
 
const std::map< double, T > & points () const
 Get points. More...
 

Protected Types

using Vector1d = Eigen::Matrix< double, 1, 1 >
 1D vector More...
 

Protected Attributes

std::shared_ptr< CubicHermiteSpline< Vector1d > > func_
 Function to calculate the ratio of interpolation points. More...
 
- Protected Attributes inherited from TrajColl::Interpolator< T, T >
std::map< double, T > points_
 Times and values to be interpolated. More...
 

Detailed Description

template<class T, class U = T>
class TrajColl::CubicInterpolator< T, U >

Cubic interpolator.

Template Parameters
Tvalue type
Uderivative type

The velocity of each waypoint is assumed to be zero.

Definition at line 16 of file CubicInterpolator.h.

Member Typedef Documentation

◆ Vector1d

template<class T , class U = T>
using TrajColl::CubicInterpolator< T, U >::Vector1d = Eigen::Matrix<double, 1, 1>
protected

1D vector

Definition at line 20 of file CubicInterpolator.h.

Constructor & Destructor Documentation

◆ CubicInterpolator() [1/2]

template<class T , class U = T>
TrajColl::CubicInterpolator< T, U >::CubicInterpolator ( const std::map< double, T > &  points = {})
inline

Constructor.

Parameters
pointstimes and values to be interpolated

Definition at line 26 of file CubicInterpolator.h.

◆ CubicInterpolator() [2/2]

template<class T , class U = T>
TrajColl::CubicInterpolator< T, U >::CubicInterpolator ( const CubicInterpolator< T, U > &  inst)
inline

Copy constructor.

Definition at line 37 of file CubicInterpolator.h.

Member Function Documentation

◆ appendPoint()

template<class T , class U = T>
virtual void TrajColl::CubicInterpolator< T, U >::appendPoint ( const std::pair< double, T > &  point)
inlineoverridevirtual

Add point.

Parameters
pointtime and value
Note
CubicInterpolator::calcCoeff should be called before calling CubicInterpolator::operator().

Implements TrajColl::Interpolator< T, T >.

Definition at line 53 of file CubicInterpolator.h.

◆ calcCoeff()

template<class T , class U = T>
virtual void TrajColl::CubicInterpolator< T, U >::calcCoeff ( )
inlineoverridevirtual

Calculate coefficients.

Implements TrajColl::Interpolator< T, T >.

Definition at line 59 of file CubicInterpolator.h.

◆ clone()

template<class T , class U = T>
virtual std::shared_ptr<Interpolator<T, U> > TrajColl::CubicInterpolator< T, U >::clone ( ) const
inlineoverridevirtual

Clone this instance and get shared pointer.

Definition at line 43 of file CubicInterpolator.h.

◆ derivative()

template<class T , class U = T>
virtual U TrajColl::CubicInterpolator< T, U >::derivative ( double  t,
int  order = 1 
) const
inlineoverridevirtual

Calculate the derivative of interpolated value.

Parameters
ttime
orderderivative order

It is assumed that interpolateDerivative() returns zero if derivative order is greater than or equal to 2.

Implements TrajColl::Interpolator< T, T >.

Definition at line 98 of file CubicInterpolator.h.

◆ operator()()

template<class T , class U = T>
virtual T TrajColl::CubicInterpolator< T, U >::operator() ( double  t) const
inlineoverridevirtual

Calculate interpolated value.

Parameters
ttime

Implements TrajColl::Interpolator< T, T >.

Definition at line 84 of file CubicInterpolator.h.

Member Data Documentation

◆ func_

template<class T , class U = T>
std::shared_ptr<CubicHermiteSpline<Vector1d> > TrajColl::CubicInterpolator< T, U >::func_
protected

Function to calculate the ratio of interpolation points.

Definition at line 110 of file CubicInterpolator.h.


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