Represents a Cubic-Hermite-Polynomial. More...
#include <polynomial.h>
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< VectorXd > | coeff_ |
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".
See also matlab/cubic_hermite_polynomial.m for generation of derivatives.
Definition at line 105 of file polynomial.h.
towr::CubicHermitePolynomial::CubicHermitePolynomial | ( | int | dim | ) |
Definition at line 76 of file polynomial.cc.
|
virtualdefault |
|
private |
Definition at line 222 of file polynomial.cc.
|
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.
t | The time [0,T] at which the change in value should be observed. |
Definition at line 237 of file polynomial.cc.
|
private |
Definition at line 189 of file polynomial.cc.
|
private |
Definition at line 141 of file polynomial.cc.
|
private |
Definition at line 206 of file polynomial.cc.
|
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.
dxdt | Which polynomial derivative f(t), fd(t) function to use. |
node_deriv | Whether derivative should be w.r.t end-node position or velocity. |
t | The 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.
dxdt | Which polynomial derivative f(t), fd(t) function to use. |
node_deriv | Whether derivative should be w.r.t start-node position or velocity. |
t | The time along the polynomial. |
Definition at line 107 of file polynomial.cc.
|
inline |
Definition at line 153 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.
Fully defines the polynomial by the node values using current duration.
n0 | The value and derivative at the start of the polynomial. |
n1 | The 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.
|
private |
Definition at line 157 of file polynomial.h.
|
private |
the start and final node comprising the polynomial.
Definition at line 157 of file polynomial.h.
|
private |
the total duration of the polynomial.
Definition at line 153 of file polynomial.h.