humoto
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
humoto::rigidbody::CubicPolynomial1D Class Reference

Detailed Description

Class interpolating simple 1D cubic polynomial between two 1D points. Use this class to build more complex trajectories.

f(t) = a0 + a1 t + a2 t^2 + a3 t^3

Definition at line 41 of file cubic_polynomial.h.

#include <cubic_polynomial.h>

Public Member Functions

 CubicPolynomial1D ()
 Constructor. More...
 
double eval (const double t, const TrajectoryEvaluationType::Type trajectory_type) const
 Evaluate the spline at a point. More...
 
std::vector< doubleeval (const Eigen::VectorXd &time_points, const TrajectoryEvaluationType::Type trajectory_type) const
 Evaluate the polynomial at time_interval points. More...
 
double getAcceleration (const double t) const
 Computes acceleration at the given time point. More...
 
double getJerk () const
 Computes jerk. More...
 
double getPosition (const double t) const
 Computes position at the given time point. More...
 
double getVelocity (const double t) const
 Computes velocity at the given time point. More...
 
void initialize (const double a, const double b)
 Builds cubic polynomial in t = [0, 1] with first derivative equal to 0 at both ends. More...
 
void initialize (const double a, const double adot, const double b, const double bdot)
 Builds cubic polynomial in t = [0, 1] with first derivative not equal to 0 at ends. More...
 

Static Public Member Functions

static Eigen::VectorXd scale (const Eigen::VectorXd &time_points)
 Scale vector. More...
 

Private Attributes

double a0_
 
double a1_
 
double a2_
 
double a3_
 

Constructor & Destructor Documentation

◆ CubicPolynomial1D()

humoto::rigidbody::CubicPolynomial1D::CubicPolynomial1D ( )
inline

Constructor.

Definition at line 47 of file cubic_polynomial.h.

Member Function Documentation

◆ eval() [1/2]

double humoto::rigidbody::CubicPolynomial1D::eval ( const double  t,
const TrajectoryEvaluationType::Type  trajectory_type 
) const
inline

Evaluate the spline at a point.

Parameters
[in]ttime point
[in]trajectory_typetype of trajectory
Returns
evaluated sample

Definition at line 151 of file cubic_polynomial.h.

◆ eval() [2/2]

std::vector<double> humoto::rigidbody::CubicPolynomial1D::eval ( const Eigen::VectorXd &  time_points,
const TrajectoryEvaluationType::Type  trajectory_type 
) const
inline

Evaluate the polynomial at time_interval points.

Parameters
[in]time_pointseigen vector with time instants at which we evaluate
[in]trajectory_typetype of trajectory
Returns
std vector with evaluated samples

Definition at line 176 of file cubic_polynomial.h.

◆ getAcceleration()

double humoto::rigidbody::CubicPolynomial1D::getAcceleration ( const double  t) const
inline

Computes acceleration at the given time point.

Parameters
[in]ttime
Returns
acceleration at the given time point

Definition at line 125 of file cubic_polynomial.h.

◆ getJerk()

double humoto::rigidbody::CubicPolynomial1D::getJerk ( ) const
inline

Computes jerk.

Returns
jerk.

Definition at line 137 of file cubic_polynomial.h.

◆ getPosition()

double humoto::rigidbody::CubicPolynomial1D::getPosition ( const double  t) const
inline

Computes position at the given time point.

Parameters
[in]ttime
Returns
position at the given time point

Definition at line 97 of file cubic_polynomial.h.

◆ getVelocity()

double humoto::rigidbody::CubicPolynomial1D::getVelocity ( const double  t) const
inline

Computes velocity at the given time point.

Parameters
[in]ttime
Returns
velocity at the given time point

Definition at line 111 of file cubic_polynomial.h.

◆ initialize() [1/2]

void humoto::rigidbody::CubicPolynomial1D::initialize ( const double  a,
const double  b 
)
inline

Builds cubic polynomial in t = [0, 1] with first derivative equal to 0 at both ends.

Parameters
[in]ainitial position
[in]bfinal position

Definition at line 60 of file cubic_polynomial.h.

◆ initialize() [2/2]

void humoto::rigidbody::CubicPolynomial1D::initialize ( const double  a,
const double  adot,
const double  b,
const double  bdot 
)
inline

Builds cubic polynomial in t = [0, 1] with first derivative not equal to 0 at ends.

Parameters
[in]ainitial 1D position
[in]adotinitial 1D velocity
[in]bfinal 1D position
[in]bdotfinal 1D velocity

Definition at line 78 of file cubic_polynomial.h.

◆ scale()

static Eigen::VectorXd humoto::rigidbody::CubicPolynomial1D::scale ( const Eigen::VectorXd &  time_points)
inlinestatic

Scale vector.

Parameters
[in]time_pointseigen vector
Returns
eigen vector of scaled values

Definition at line 197 of file cubic_polynomial.h.

Member Data Documentation

◆ a0_

double humoto::rigidbody::CubicPolynomial1D::a0_
private

Definition at line 211 of file cubic_polynomial.h.

◆ a1_

double humoto::rigidbody::CubicPolynomial1D::a1_
private

Definition at line 212 of file cubic_polynomial.h.

◆ a2_

double humoto::rigidbody::CubicPolynomial1D::a2_
private

Definition at line 213 of file cubic_polynomial.h.

◆ a3_

double humoto::rigidbody::CubicPolynomial1D::a3_
private

Definition at line 214 of file cubic_polynomial.h.


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