humoto
|
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< double > | eval (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_ |
|
inline |
Constructor.
Definition at line 47 of file cubic_polynomial.h.
|
inline |
Evaluate the spline at a point.
[in] | t | time point |
[in] | trajectory_type | type of trajectory |
Definition at line 151 of file cubic_polynomial.h.
|
inline |
Evaluate the polynomial at time_interval points.
[in] | time_points | eigen vector with time instants at which we evaluate |
[in] | trajectory_type | type of trajectory |
Definition at line 176 of file cubic_polynomial.h.
Computes acceleration at the given time point.
[in] | t | time |
Definition at line 125 of file cubic_polynomial.h.
|
inline |
Computes position at the given time point.
[in] | t | time |
Definition at line 97 of file cubic_polynomial.h.
Computes velocity at the given time point.
[in] | t | time |
Definition at line 111 of file cubic_polynomial.h.
Builds cubic polynomial in t = [0, 1] with first derivative equal to 0 at both ends.
[in] | a | initial position |
[in] | b | final position |
Definition at line 60 of file cubic_polynomial.h.
|
inline |
Builds cubic polynomial in t = [0, 1] with first derivative not equal to 0 at ends.
[in] | a | initial 1D position |
[in] | adot | initial 1D velocity |
[in] | b | final 1D position |
[in] | bdot | final 1D velocity |
Definition at line 78 of file cubic_polynomial.h.
|
inlinestatic |
Scale vector.
[in] | time_points | eigen vector |
Definition at line 197 of file cubic_polynomial.h.
|
private |
Definition at line 211 of file cubic_polynomial.h.
|
private |
Definition at line 212 of file cubic_polynomial.h.
|
private |
Definition at line 213 of file cubic_polynomial.h.
|
private |
Definition at line 214 of file cubic_polynomial.h.