Represents a polynomial of an arbitrary order defined on the interval . It follows the equation :
where N is the order and .
More...
#include <curves/fwd.h>
Public Types | |
typedef Point | point_t |
typedef T_Point | t_point_t |
typedef Time | time_t |
typedef Numeric | num_t |
typedef curve_abc< Time, Numeric, Safe, Point > | curve_abc_t |
typedef Eigen::MatrixXd | coeff_t |
typedef Eigen::Ref< coeff_t > | coeff_t_ref |
typedef polynomial< Time, Numeric, Safe, Point, T_Point > | polynomial_t |
typedef curve_abc_t::curve_ptr_t | curve_ptr_t |
Public Member Functions | |
polynomial () | |
Empty constructor. Curve obtained this way can not perform other class functions. More... | |
polynomial (const coeff_t &coefficients, const time_t min, const time_t max) | |
Constructor. More... | |
polynomial (const T_Point &coefficients, const time_t min, const time_t max) | |
Constructor. More... | |
template<typename In > | |
polynomial (In zeroOrderCoefficient, In out, const time_t min, const time_t max) | |
Constructor. More... | |
polynomial (const Point &init, const Point &end, const time_t min, const time_t max) | |
Constructor from boundary condition with C0 : create a polynomial that connect exactly init and end (order 1) More... | |
polynomial (const Point &init, const Point &d_init, const Point &end, const Point &d_end, const time_t min, const time_t max) | |
Constructor from boundary condition with C1 : create a polynomial that connect exactly init and end and thier first order derivatives(order 3) More... | |
polynomial (const Point &init, const Point &d_init, const Point &dd_init, const Point &end, const Point &d_end, const Point &dd_end, const time_t min, const time_t max) | |
Constructor from boundary condition with C2 : create a polynomial that connect exactly init and end and thier first and second order derivatives(order 5) More... | |
~polynomial () | |
Destructor. More... | |
polynomial (const polynomial &other) | |
virtual point_t | operator() (const time_t t) const |
Evaluation of the cubic spline at time t using horner's scheme. More... | |
bool | isApprox (const polynomial_t &other, const Numeric prec=Eigen::NumTraits< Numeric >::dummy_precision()) const |
isApprox check if other and *this are approximately equals. Only two curves of the same class can be approximately equals, for comparison between different type of curves see isEquivalent More... | |
virtual bool | isApprox (const curve_abc_t *other, const Numeric prec=Eigen::NumTraits< Numeric >::dummy_precision()) const |
virtual bool | operator== (const polynomial_t &other) const |
virtual bool | operator!= (const polynomial_t &other) const |
virtual point_t | derivate (const time_t t, const std::size_t order) const |
Evaluation of the derivative of order N of spline at time t. More... | |
polynomial_t | compute_derivate (const std::size_t order) const |
polynomial_t * | compute_derivate_ptr (const std::size_t order) const |
Compute the derived curve at order N. More... | |
Eigen::MatrixXd | coeff () const |
point_t | coeffAtDegree (const std::size_t degree) const |
virtual std::size_t | dim () const |
Get dimension of curve. More... | |
virtual num_t | min () const |
Get the minimum time for which the curve is defined. More... | |
virtual num_t | max () const |
Get the maximum time for which the curve is defined. More... | |
virtual std::size_t | degree () const |
Get the degree of the curve. More... | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Static Public Member Functions | |
static polynomial_t | MinimumJerk (const point_t &p_init, const point_t &p_final, const time_t t_min=0., const time_t t_max=1.) |
MinimumJerk Build a polynomial curve connecting p_init to p_final minimizing the time integral of the squared jerk with a zero initial and final velocity and acceleration. More... | |
Public Attributes | |
std::size_t | dim_ |
coeff_t | coefficients_ |
std::size_t | degree_ |
time_t | T_min_ |
time_t | T_max_ |
Friends | |
class | boost::serialization::access |
Represents a polynomial of an arbitrary order defined on the interval . It follows the equation :
where N is the order and .
typedef Eigen::MatrixXd curves::polynomial::coeff_t |
typedef Eigen::Ref<coeff_t> curves::polynomial::coeff_t_ref |
typedef curve_abc<Time, Numeric, Safe, Point> curves::polynomial::curve_abc_t |
typedef Numeric curves::polynomial::num_t |
typedef Point curves::polynomial::point_t |
typedef polynomial<Time, Numeric, Safe, Point, T_Point> curves::polynomial::polynomial_t |
typedef T_Point curves::polynomial::t_point_t |
typedef Time curves::polynomial::time_t |
|
inline |
Empty constructor. Curve obtained this way can not perform other class functions.
|
inline |
Constructor.
coefficients | : a reference to an Eigen matrix where each column is a coefficient, from the zero order coefficient, up to the highest order. Spline order is given by the number of the columns -1. |
min | : LOWER bound on interval definition of the curve. |
max | : UPPER bound on interval definition of the curve. |
|
inline |
Constructor.
coefficients | : a container containing all coefficients of the spline, starting with the zero order coefficient, up to the highest order. Spline order is given by the size of the coefficients. |
min | : LOWER bound on interval definition of the spline. |
max | : UPPER bound on interval definition of the spline. |
|
inline |
Constructor.
zeroOrderCoefficient | : an iterator pointing to the first element of a structure containing the coefficients it corresponds to the zero degree coefficient. |
out | : an iterator pointing to the last element of a structure ofcoefficients. |
min | : LOWER bound on interval definition of the spline. |
max | : UPPER bound on interval definition of the spline. |
|
inline |
Constructor from boundary condition with C0 : create a polynomial that connect exactly init and end (order 1)
init | the initial point of the curve |
end | the final point of the curve |
min | : LOWER bound on interval definition of the spline. |
max | : UPPER bound on interval definition of the spline. |
|
inline |
Constructor from boundary condition with C1 : create a polynomial that connect exactly init and end and thier first order derivatives(order 3)
init | the initial point of the curve |
d_init | the initial value of the derivative of the curve |
end | the final point of the curve |
d_end | the final value of the derivative of the curve |
min | : LOWER bound on interval definition of the spline. |
max | : UPPER bound on interval definition of the spline. |
|
inline |
Constructor from boundary condition with C2 : create a polynomial that connect exactly init and end and thier first and second order derivatives(order 5)
init | the initial point of the curve |
d_init | the initial value of the derivative of the curve |
d_init | the initial value of the second derivative of the curve |
end | the final point of the curve |
d_end | the final value of the derivative of the curve |
d_end | the final value of the second derivative of the curve |
min | : LOWER bound on interval definition of the spline. |
max | : UPPER bound on interval definition of the spline. |
|
inline |
Destructor.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Compute the derived curve at order N.
order | : order of derivative. |
|
inlinevirtual |
Get the degree of the curve.
|
inlinevirtual |
Evaluation of the derivative of order N of spline at time t.
t | : the time when to evaluate the spline. |
order | : order of derivative. |
|
inlinevirtual |
Get dimension of curve.
|
inlinevirtual |
|
inline |
isApprox check if other and *this are approximately equals. Only two curves of the same class can be approximately equals, for comparison between different type of curves see isEquivalent
other | the other curve to check |
prec | the precision treshold, default Eigen::NumTraits<Numeric>::dummy_precision() |
|
inlinevirtual |
Get the maximum time for which the curve is defined.
|
inlinevirtual |
Get the minimum time for which the curve is defined.
|
inlinestatic |
MinimumJerk Build a polynomial curve connecting p_init to p_final minimizing the time integral of the squared jerk with a zero initial and final velocity and acceleration.
p_init | the initial point |
p_final | the final point |
t_min | initial time |
t_max | final time |
|
inlinevirtual |
Evaluation of the cubic spline at time t using horner's scheme.
t | : time when to evaluate the spline. |
|
inlinevirtual |
|
inline |
|
friend |
coeff_t curves::polynomial::coefficients_ |
std::size_t curves::polynomial::degree_ |
std::size_t curves::polynomial::dim_ |
time_t curves::polynomial::T_max_ |
time_t curves::polynomial::T_min_ |