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. | |
double | GetDerivativeWrtEndNode (Dx dfdt, Dx node_deriv, double t) const |
The derivative of the polynomial when changing the end node. | |
double | GetDerivativeWrtStartNode (Dx dfdt, Dx node_deriv, double t) const |
The derivative of the polynomial when changing the start node. | |
const double | GetDuration () const |
void | SetDuration (double duration) |
sets the total duration of the polynomial. | |
void | SetNodes (const Node &n0, const Node &n1) |
Fully defines the polynomial by the node values using current duration. | |
void | UpdateCoeff () |
updates the coefficients using current nodes and durations. | |
virtual | ~CubicHermitePolynomial () |
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. | |
double | T_ |
the total duration of the polynomial. |
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 | | | -------|------ | |
See also matlab/cubic_hermite_polynomial.m for generation of derivatives.
Definition at line 109 of file polynomial.h.
Definition at line 76 of file polynomial.cc.
virtual towr::CubicHermitePolynomial::~CubicHermitePolynomial | ( | ) | [virtual] |
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.
t | The 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.
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.
const double towr::CubicHermitePolynomial::GetDuration | ( | ) | const [inline] |
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.
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.
updates the coefficients using current nodes and durations.
Definition at line 98 of file polynomial.cc.
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.