Public Member Functions | Private Member Functions | Private Attributes | List of all members
towr::CubicHermitePolynomial Class Reference

Represents a Cubic-Hermite-Polynomial. More...

#include <polynomial.h>

Inheritance diagram for towr::CubicHermitePolynomial:
Inheritance graph
[legend]

Public Member Functions

 CubicHermitePolynomial (int dim)
 
VectorXd GetDerivativeOfPosWrtDuration (double t) const
 How the total duration affect the value ("pos") of the polynomial. More...
 
double GetDerivativeWrtEndNode (Dx dfdt, Dx node_deriv, double t) const
 The derivative of the polynomial when changing the end node. More...
 
double GetDerivativeWrtStartNode (Dx dfdt, Dx node_deriv, double t) const
 The derivative of the polynomial when changing the start node. More...
 
const double GetDuration () const
 
void SetDuration (double duration)
 sets the total duration of the polynomial. More...
 
void SetNodes (const Node &n0, const Node &n1)
 Fully defines the polynomial by the node values using current duration. More...
 
void UpdateCoeff ()
 updates the coefficients using current nodes and durations. More...
 
virtual ~CubicHermitePolynomial ()=default
 
- Public Member Functions inherited from towr::Polynomial
double GetDerivativeWrtCoeff (double t, Dx poly_deriv, Coefficients coeff) const
 The derivative of the polynomial with respect to the coefficients. More...
 
State GetPoint (double t) const
 
 Polynomial (int poly_order, int poly_dim)
 Constructs a polynomial with zero coefficient values. More...
 
virtual ~Polynomial ()=default
 

Private Member Functions

double GetDerivativeOfAccWrtEndNode (Dx node_deriv, double t_local) const
 
double GetDerivativeOfAccWrtStartNode (Dx node_deriv, double t_local) const
 
double GetDerivativeOfPosWrtEndNode (Dx node_deriv, double t_local) const
 
double GetDerivativeOfPosWrtStartNode (Dx node_deriv, double t_local) const
 
double GetDerivativeOfVelWrtEndNode (Dx node_deriv, double t_local) const
 
double GetDerivativeOfVelWrtStartNode (Dx node_deriv, double t_local) const
 

Private Attributes

Node n0_
 
Node n1_
 the start and final node comprising the polynomial. More...
 
double T_
 the total duration of the polynomial. More...
 

Additional Inherited Members

- Public Types inherited from towr::Polynomial
enum  Coefficients {
  A =0, B, C, D,
  E, F, G, H,
  I, J
}
 
using CoeffIDVec = std::vector< Coefficients >
 
using VectorXd = Eigen::VectorXd
 
- Protected Attributes inherited from towr::Polynomial
std::vector< VectorXdcoeff_
 

Detailed Description

Represents a Cubic-Hermite-Polynomial.

This class is a third-order ("cubic") polynomial, so: f(t) = Dt^3 + Ct^2 + Bt + A fd(t) = 3Dt^2 + 2Ct + B fdd(t) = 6Dt + 2C

Instead of setting the polynomial coefficients directly, a third-order polynomial is also fully defined by the value and first-derivative of the start and end of the polynomial as well as the duration. This way of specifying a polynomial is called "Hermite".

Three Cubic-Hermite-Polynomials
nodes.jpg

See also matlab/cubic_hermite_polynomial.m for generation of derivatives.

Definition at line 109 of file polynomial.h.

Constructor & Destructor Documentation

towr::CubicHermitePolynomial::CubicHermitePolynomial ( int  dim)

Definition at line 76 of file polynomial.cc.

virtual towr::CubicHermitePolynomial::~CubicHermitePolynomial ( )
virtualdefault

Member Function Documentation

double towr::CubicHermitePolynomial::GetDerivativeOfAccWrtEndNode ( Dx  node_deriv,
double  t_local 
) const
private

Definition at line 222 of file polynomial.cc.

double towr::CubicHermitePolynomial::GetDerivativeOfAccWrtStartNode ( Dx  node_deriv,
double  t_local 
) const
private

Definition at line 174 of file polynomial.cc.

Eigen::VectorXd towr::CubicHermitePolynomial::GetDerivativeOfPosWrtDuration ( double  t) const

How the total duration affect the value ("pos") of the polynomial.

Parameters
tThe time [0,T] at which the change in value should be observed.

Definition at line 237 of file polynomial.cc.

double towr::CubicHermitePolynomial::GetDerivativeOfPosWrtEndNode ( Dx  node_deriv,
double  t_local 
) const
private

Definition at line 189 of file polynomial.cc.

double towr::CubicHermitePolynomial::GetDerivativeOfPosWrtStartNode ( Dx  node_deriv,
double  t_local 
) const
private

Definition at line 141 of file polynomial.cc.

double towr::CubicHermitePolynomial::GetDerivativeOfVelWrtEndNode ( Dx  node_deriv,
double  t_local 
) const
private

Definition at line 206 of file polynomial.cc.

double towr::CubicHermitePolynomial::GetDerivativeOfVelWrtStartNode ( Dx  node_deriv,
double  t_local 
) const
private

Definition at line 158 of file polynomial.cc.

double towr::CubicHermitePolynomial::GetDerivativeWrtEndNode ( Dx  dfdt,
Dx  node_deriv,
double  t 
) const

The derivative of the polynomial when changing the end node.

Parameters
dxdtWhich polynomial derivative f(t), fd(t) function to use.
node_derivWhether derivative should be w.r.t end-node position or velocity.
tThe time along the polynomial.

Definition at line 124 of file polynomial.cc.

double towr::CubicHermitePolynomial::GetDerivativeWrtStartNode ( Dx  dfdt,
Dx  node_deriv,
double  t 
) const

The derivative of the polynomial when changing the start node.

Parameters
dxdtWhich polynomial derivative f(t), fd(t) function to use.
node_derivWhether derivative should be w.r.t start-node position or velocity.
tThe time along the polynomial.

Definition at line 107 of file polynomial.cc.

const double towr::CubicHermitePolynomial::GetDuration ( ) const
inline
Returns
the total duration of the polynomial.

Definition at line 157 of file polynomial.h.

void towr::CubicHermitePolynomial::SetDuration ( double  duration)

sets the total duration of the polynomial.

Definition at line 92 of file polynomial.cc.

void towr::CubicHermitePolynomial::SetNodes ( const Node n0,
const Node n1 
)

Fully defines the polynomial by the node values using current duration.

Parameters
n0The value and derivative at the start of the polynomial.
n1The value and derivative at the end of the polynomial.

Definition at line 85 of file polynomial.cc.

void towr::CubicHermitePolynomial::UpdateCoeff ( )

updates the coefficients using current nodes and durations.

Definition at line 98 of file polynomial.cc.

Member Data Documentation

Node towr::CubicHermitePolynomial::n0_
private

Definition at line 161 of file polynomial.h.

Node towr::CubicHermitePolynomial::n1_
private

the start and final node comprising the polynomial.

Definition at line 161 of file polynomial.h.

double towr::CubicHermitePolynomial::T_
private

the total duration of the polynomial.

Definition at line 157 of file polynomial.h.


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


towr
Author(s): Alexander W. Winkler
autogenerated on Fri Apr 2 2021 02:14:16