V-ART
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
VART::HermiteInterpolator Class Reference

Hermite Spline interpolation. More...

#include <hermiteinterpolator.h>

Inheritance diagram for VART::HermiteInterpolator:
VART::Interpolator

Public Member Functions

 HermiteInterpolator (float finalTime, float finalPosition)
 
virtual float GetValue (float linearIndex, float initialPos, float range) const
 Evaluates a goal position for DOF interpolation. More...
 
virtual float GetValue (float linearIndex) const
 
virtual TypeID GetID () const
 
void SetInitialPosition (float p)
 Sets initial position for interpolation. More...
 
void AddControlPosition (float pos, float time)
 Adds a control position for interpolation. More...
 
- Public Member Functions inherited from VART::Interpolator
 Interpolator ()
 
virtual ~Interpolator ()
 

Protected Member Functions

int WarpIndex (int i) const
 Warp index around valid vector indices. More...
 

Static Protected Member Functions

static float Interpolate (float p1, float tg1, float p2, float tg2, float t)
 Hermite 1D interpolation. More...
 

Protected Attributes

std::vector< float > positionVec
 A vector of positions to interpolate. More...
 
std::vector< float > timeVec
 A vector of times for each position. More...
 

Additional Inherited Members

- Public Types inherited from VART::Interpolator
enum  TypeID { LINEAR, EASE_IN_EASE_OUT, RANGED, HERMITE }
 

Detailed Description

Hermite Spline interpolation.

Interpolates positions using Hermite Curves. Hermite interpolators have a set of controls points that are use to control the interpolation values, i.e.: the curve passes thru control points. That given, hermite interpolators may not be a good thing to share among dof movers.

Definition at line 19 of file hermiteinterpolator.h.

Constructor & Destructor Documentation

VART::HermiteInterpolator::HermiteInterpolator ( float  finalTime,
float  finalPosition 
)

Definition at line 10 of file hermiteinterpolator.cpp.

Member Function Documentation

void VART::HermiteInterpolator::AddControlPosition ( float  pos,
float  time 
)

Adds a control position for interpolation.

A control position is a value that should be given by interpolation at given time.

Definition at line 54 of file hermiteinterpolator.cpp.

virtual TypeID VART::HermiteInterpolator::GetID ( ) const
inlinevirtual

Implements VART::Interpolator.

Definition at line 26 of file hermiteinterpolator.h.

References VART::Interpolator::HERMITE.

virtual float VART::HermiteInterpolator::GetValue ( float  linearIndex,
float  initialPos,
float  range 
) const
inlinevirtual

Evaluates a goal position for DOF interpolation.

Parameters
linearIndex[in] A number in range [0..1]. Usually related to a linear time function.
initialPos[in] A number in range [0..1]. DOF's initial movement position.
range[in] DOF's position range on movement.
Returns
DOF's current position. An interpolator basically converts a linear interpolation (GetValue input) into other, more sophisticated interpolation (GetValue output). Each derived class implents a specific mapping.

Implements VART::Interpolator.

Definition at line 23 of file hermiteinterpolator.h.

float VART::HermiteInterpolator::GetValue ( float  linearIndex) const
virtual

Definition at line 21 of file hermiteinterpolator.cpp.

float VART::HermiteInterpolator::Interpolate ( float  p1,
float  tg1,
float  p2,
float  tg2,
float  t 
)
staticprotected

Hermite 1D interpolation.

Definition at line 65 of file hermiteinterpolator.cpp.

void VART::HermiteInterpolator::SetInitialPosition ( float  p)
inline

Sets initial position for interpolation.

Definition at line 29 of file hermiteinterpolator.h.

References positionVec.

int VART::HermiteInterpolator::WarpIndex ( int  i) const
protected

Warp index around valid vector indices.

Definition at line 78 of file hermiteinterpolator.cpp.

Member Data Documentation

std::vector<float> VART::HermiteInterpolator::positionVec
protected

A vector of positions to interpolate.

Definition at line 44 of file hermiteinterpolator.h.

Referenced by SetInitialPosition().

std::vector<float> VART::HermiteInterpolator::timeVec
protected

A vector of times for each position.

The times are passed as joint movement normalized times, i.e.: values where 0 means the beginning of joint movement and 1 means end of joint movement. But are stored as dof movement normalized time, i.e.: values where 0 means the beginning of dof movment and 1 menas the end of dof movement.

Definition at line 52 of file hermiteinterpolator.h.


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