utils::PolynomialBase< T > Struct Template Referenceabstract

Polynomial function. More...

#include <lipm_walking/utils/polynomials.h>

Inheritance diagram for utils::PolynomialBase< T >:
utils::CubicPolynomialBase< T > utils::QuinticPolynomialBase< T > utils::CubicPolynomial< T > utils::QuinticPolynomial< T > utils::CubicHermitePolynomial< T > utils::QuinticHermitePolynomial< T > utils::HoubaPolynomial< T >

Public Member Functions

virtual EIGEN_MAKE_ALIGNED_OPERATOR_NEW T pos (double t) const =0
 Get the value of the polynomial at time t. More...
 
virtual T vel (double t) const =0
 Get the value of the first-order derivative (velocity) at time t. More...
 
virtual T accel (double t) const =0
 Get the value of the second-order derivative (acceleration) at time t. More...
 
tangent (double t) const
 Get the value of the tangent vector at time t. More...
 
double arcLength (double t_start, double t_end) const
 Compute the arc length between two points of the polynomial curve. More...
 
double arcLengthInverse (double t_start, double length, double t_guess=-1.) const
 Inverse of the arc length function. More...
 

Detailed Description

template<typename T>
struct utils::PolynomialBase< T >

Polynomial function.

Definition at line 39 of file polynomials.h.

Member Function Documentation

template<typename T>
virtual T utils::PolynomialBase< T >::accel ( double  t) const
pure virtual
template<typename T>
double utils::PolynomialBase< T >::arcLength ( double  t_start,
double  t_end 
) const
inline

Compute the arc length between two points of the polynomial curve.

Parameters
t_startIndex of start point.
t_endIndex of end point.
Returns
length Arc length of the curve between P(t_start) and P(t_end).
Note
This function uses 5-point Gauss-Legendre quadrature [1]. It is adapted from the Unreal Engine's GetSplineLength [2] pointed out in jj's post on Medium [3].

[1] https://en.wikipedia.org/wiki/Gaussian_quadrature [2] https://api.unrealengine.com/INT/BlueprintAPI/Spline/GetSplineLength/ [3] https://medium.com/@all2one/how-to-compute-the-length-of-a-spline-e44f5f04c40

< value of polynomial variable

< corresponding Gauss-Legendre weight

Definition at line 93 of file polynomials.h.

template<typename T>
double utils::PolynomialBase< T >::arcLengthInverse ( double  t_start,
double  length,
double  t_guess = -1. 
) const
inline

Inverse of the arc length function.

Parameters
t_startStart index on polynomial curve.
lengthDesired arc length.
t_guessInitial guess for the value of the desired output (optional).
Returns
t Value of the polynomial argument such that arcLength(t_start, t) == length.

Definition at line 128 of file polynomials.h.

template<typename T>
virtual EIGEN_MAKE_ALIGNED_OPERATOR_NEW T utils::PolynomialBase< T >::pos ( double  t) const
pure virtual
template<typename T>
T utils::PolynomialBase< T >::tangent ( double  t) const
inline

Get the value of the tangent vector at time t.

Parameters
tValue of the polynomial argument.

Definition at line 69 of file polynomials.h.

template<typename T>
virtual T utils::PolynomialBase< T >::vel ( double  t) const
pure virtual