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

Interpolator of a sequence of waypoints. More...

#include <Interpolator.h>

Public Member Functions

 Interpolator (const std::map< double, T > &points={})
 Constructor. More...
 
 Interpolator (const Interpolator &inst)
 Copy constructor. More...
 
virtual std::shared_ptr< Interpolator< T, U > > clone () const =0
 Clone this instance and get shared pointer. More...
 
virtual void clearPoints ()
 Clear points. More...
 
virtual void appendPoint (const std::pair< double, T > &point)=0
 Add point. More...
 
virtual void calcCoeff ()=0
 Calculate coefficients. More...
 
virtual T operator() (double t) const =0
 Calculate interpolated value. More...
 
virtual U derivative (double t, int order=1) const =0
 Calculate the derivative of interpolated value. 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 Attributes

std::map< double, T > points_
 Times and values to be interpolated. More...
 

Detailed Description

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

Interpolator of a sequence of waypoints.

Template Parameters
Tvalue type
Uderivative type

The velocity of each waypoint is assumed to be zero.

Definition at line 14 of file Interpolator.h.

Constructor & Destructor Documentation

◆ Interpolator() [1/2]

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

Constructor.

Parameters
pointstimes and values to be interpolated
accelDurationListlist of acceleration/deceleration duration

Definition at line 21 of file Interpolator.h.

◆ Interpolator() [2/2]

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

Copy constructor.

Definition at line 24 of file Interpolator.h.

Member Function Documentation

◆ appendPoint()

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

Add point.

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

Implemented in TrajColl::BangBangInterpolator< T, U >, and TrajColl::CubicInterpolator< T, U >.

◆ calcCoeff()

template<class T , class U = T>
virtual void TrajColl::Interpolator< T, U >::calcCoeff ( )
pure virtual

◆ clearPoints()

template<class T , class U = T>
virtual void TrajColl::Interpolator< T, U >::clearPoints ( )
inlinevirtual

Clear points.

Reimplemented in TrajColl::BangBangInterpolator< T, U >.

Definition at line 33 of file Interpolator.h.

◆ clone()

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

Clone this instance and get shared pointer.

◆ derivative()

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

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.

Implemented in TrajColl::BangBangInterpolator< T, U >, and TrajColl::CubicInterpolator< T, U >.

◆ endTime()

template<class T , class U = T>
double TrajColl::Interpolator< T, U >::endTime ( ) const
inline

Get end time.

Definition at line 68 of file Interpolator.h.

◆ operator()()

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

Calculate interpolated value.

Parameters
ttime

Implemented in TrajColl::BangBangInterpolator< T, U >, and TrajColl::CubicInterpolator< T, U >.

◆ points()

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

Get points.

Definition at line 74 of file Interpolator.h.

◆ startTime()

template<class T , class U = T>
double TrajColl::Interpolator< T, U >::startTime ( ) const
inline

Get start time.

Definition at line 62 of file Interpolator.h.

Member Data Documentation

◆ points_

template<class T , class U = T>
std::map<double, T> TrajColl::Interpolator< T, U >::points_
protected

Times and values to be interpolated.

Definition at line 81 of file Interpolator.h.


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