ReTo  0.3.7
reto::Spline Class Reference

Class to manage spline structs. More...

#include <Spline.h>

+ Collaboration diagram for reto::Spline:

Public Member Functions

 Spline (const std::vector< Eigen::Vector3f > &points)
 Create a new Spline object. More...
 
Eigen::Vector3f evaluate (float dt)
 Evaluate the spline in a specific time. More...
 
Eigen::Vector3f getTangent (void)
 Returns tangent vector in last time evaluate called. More...
 
Eigen::Vector3f getTangent (float dt0, float dt1)
 Returns tangent vector between between two times given. More...
 
float angleBetweenPoints (void)
 Returns interpolated angle between last and current time. More...
 
float angleBetweenPoints (float dt0, float dt1)
 Returns interpolated angle between last and current time. More...
 

Protected Member Functions

float _catmullRom (float p0, float p1, float p2, float p3, float t)
 Evaluate catmull rom spline with 4 given values and time. More...
 

Protected Attributes

std::vector< Eigen::Vector3f > _points
 List of points who defineds the spline.
 
float _currentdt
 Current time used (default = 0.0f)
 
float _olddt
 Last time used (default = 0.0f)
 

Detailed Description

Class to manage spline structs.

Definition at line 36 of file Spline.h.

Constructor & Destructor Documentation

reto::Spline::Spline ( const std::vector< Eigen::Vector3f > &  points)

Create a new Spline object.

Parameters
pointsPoint list who define the spline.

Member Function Documentation

float reto::Spline::_catmullRom ( float  p0,
float  p1,
float  p2,
float  p3,
float  t 
)
protected

Evaluate catmull rom spline with 4 given values and time.

Parameters
p0First value
p1Second value
p2Third value
p3Fourth value
tTime to evaluate
Returns
Interpolated value
float reto::Spline::angleBetweenPoints ( void  )

Returns interpolated angle between last and current time.

Returns
angle (in radians).
float reto::Spline::angleBetweenPoints ( float  dt0,
float  dt1 
)

Returns interpolated angle between last and current time.

Parameters
dt0Last time
dt1Current time
Returns
angle (in radians).
Eigen::Vector3f reto::Spline::evaluate ( float  dt)

Evaluate the spline in a specific time.

Parameters
dtTime to evaluate. Must be in [0, 1] interval.
Returns
Interpolated position in dt time.
Eigen::Vector3f reto::Spline::getTangent ( void  )

Returns tangent vector in last time evaluate called.

Returns
Intepolated tangent in dt time.
Eigen::Vector3f reto::Spline::getTangent ( float  dt0,
float  dt1 
)

Returns tangent vector between between two times given.

Parameters
dt0Last time
dt1Current time
Returns
Interpolated tangent in position.

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