#include <ndcurves/bezier_curve.h>
Public Member Functions | |
bezier_curve () | |
Empty constructor. Curve obtained this way can not perform other class functions. | |
template<typename In > | |
bezier_curve (In PointsBegin, In PointsEnd, const time_t T_min=0., const time_t T_max=1., const time_t mult_T=1.) | |
Constructor. Given the first and last point of a control points set, create the bezier curve. | |
template<typename In > | |
bezier_curve (In PointsBegin, In PointsEnd, const curve_constraints_t &constraints, const time_t T_min=0., const time_t T_max=1., const time_t mult_T=1.) | |
Constructor with constraints. This constructor will add 4 points (2 after the first one, 2 before the last one) to ensure that velocity and acceleration constraints are respected. | |
bezier_curve (const bezier_curve &other) | |
virtual | ~bezier_curve () |
Destructor. | |
virtual point_t | operator() (const time_t t) const |
Evaluation of the bezier curve at time t. | |
bool | isApprox (const bezier_curve_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 | |
virtual bool | isApprox (const curve_abc_t *other, const Numeric prec=Eigen::NumTraits< Numeric >::dummy_precision()) const |
virtual bool | operator== (const bezier_curve_t &other) const |
virtual bool | operator!= (const bezier_curve_t &other) const |
bezier_curve_t | compute_derivate (const std::size_t order) const |
Compute the derived curve at order N. Computes the derivative order N, \(\frac{d^Nx(t)}{dt^N}\) of bezier curve of parametric equation x(t). | |
bezier_curve_t * | compute_derivate_ptr (const std::size_t order) const |
Compute the derived curve at order N. | |
bezier_curve_t | compute_primitive (const std::size_t order, const point_t &init) const |
Compute the primitive of the curve at order N. Computes the primitive at order N of bezier curve of parametric equation \(x(t)\). At order \(N=1\), the primitve \(X(t)\) of \(x(t)\) is such as \(\frac{dX(t)}{dt} = x(t)\). | |
bezier_curve_t | compute_primitive (const std::size_t order) const |
bezier_curve_t * | compute_primitive_ptr (const std::size_t order, const point_t &init) const |
bezier_curve_t | elevate (const std::size_t order) const |
Computes a Bezier curve of order degrees higher than the current curve, but strictly equivalent. Order elevation is required for addition / substraction and other comparison operations. | |
void | elevate_self (const std::size_t order) |
Elevate the Bezier curve of order degrees higher than the current curve, but strictly equivalent. Order elevation is required for addition / substraction and other comparison operations. | |
virtual point_t | derivate (const time_t t, const std::size_t order) const |
Evaluate the derivative order N of curve at time t. If derivative is to be evaluated several times, it is rather recommended to compute derived curve using compute_derivate. | |
point_t | evalBernstein (const Numeric t) const |
Evaluate all Bernstein polynomes for a certain degree. A bezier curve with N control points is represented by : \(x(t) =
\sum_{i=0}^{N} B_i^N(t) P_i\) with \( B_i^N(t) = \binom{N}{i}t^i
(1-t)^{N-i} \). Warning: the horner scheme is about 100 times faster than this method. This method will probably be removed in the future as the computation of bernstein polynomial is very costly. | |
![]() | |
curve_abc () | |
Constructor. | |
virtual | ~curve_abc () |
Destructor. | |
bool | isEquivalent (const curve_t *other, const Numeric prec=Eigen::NumTraits< Numeric >::dummy_precision(), const size_t order=5) const |
isEquivalent check if other and *this are approximately equal by values, given a precision threshold. This test is done by discretizing both curves and evaluating them and their derivatives. | |
virtual bool | isApprox (const curve_t *other, const Numeric prec=Eigen::NumTraits< Numeric >::dummy_precision()) const =0 |
isApprox check if other and *this are approximately equal given a precision threshold Only two curves of the same class can be approximately equal, for comparison between different type of curves see isEquivalent. | |
virtual std::size_t | dim () const =0 |
Get dimension of curve. | |
virtual time_t | min () const =0 |
Get the minimum time for which the curve is defined. | |
virtual time_t | max () const =0 |
Get the maximum time for which the curve is defined. | |
virtual std::size_t | degree () const =0 |
Get the degree of the curve. | |
std::pair< time_t, time_t > | timeRange () |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
![]() | |
template<class Derived > | |
void | loadFromText (const std::string &filename) |
Loads a Derived object from a text file. | |
template<class Derived > | |
void | saveAsText (const std::string &filename) const |
Saved a Derived object as a text file. | |
template<class Derived > | |
void | loadFromXML (const std::string &filename, const std::string &tag_name) |
Loads a Derived object from an XML file. | |
template<class Derived > | |
void | saveAsXML (const std::string &filename, const std::string &tag_name) const |
Saved a Derived object as an XML file. | |
template<class Derived > | |
void | loadFromBinary (const std::string &filename) |
Loads a Derived object from an binary file. | |
template<class Derived > | |
void | saveAsBinary (const std::string &filename) const |
Saved a Derived object as an binary file. | |
typedef std::shared_ptr<bezier_curve_t> ndcurves::bezier_curve< Time, Numeric, Safe, Point >::bezier_curve_ptr_t |
typedef bezier_curve<Time, Numeric, Safe, Point> ndcurves::bezier_curve< Time, Numeric, Safe, Point >::bezier_curve_t |
typedef t_point_t::const_iterator ndcurves::bezier_curve< Time, Numeric, Safe, Point >::cit_point_t |
typedef curve_abc<Time, Numeric, Safe, point_t> ndcurves::bezier_curve< Time, Numeric, Safe, Point >::curve_abc_t |
typedef curve_constraints<point_t> ndcurves::bezier_curve< Time, Numeric, Safe, Point >::curve_constraints_t |
typedef curve_abc_t::curve_ptr_t ndcurves::bezier_curve< Time, Numeric, Safe, Point >::curve_ptr_t |
typedef Numeric ndcurves::bezier_curve< Time, Numeric, Safe, Point >::num_t |
typedef piecewise_curve<Time, Numeric, Safe, point_t, point_t, bezier_curve_t> ndcurves::bezier_curve< Time, Numeric, Safe, Point >::piecewise_curve_t |
typedef Point ndcurves::bezier_curve< Time, Numeric, Safe, Point >::point_t |
typedef std::vector<point_t, Eigen::aligned_allocator<point_t> > ndcurves::bezier_curve< Time, Numeric, Safe, Point >::t_point_t |
typedef Time ndcurves::bezier_curve< Time, Numeric, Safe, Point >::time_t |
typedef Eigen::Ref<const vector_x_t> ndcurves::bezier_curve< Time, Numeric, Safe, Point >::vector_x_ref_t |
typedef Eigen::Matrix<Numeric, Eigen::Dynamic, 1> ndcurves::bezier_curve< Time, Numeric, Safe, Point >::vector_x_t |
|
inline |
Empty constructor. Curve obtained this way can not perform other class functions.
|
inline |
Constructor. Given the first and last point of a control points set, create the bezier curve.
PointsBegin | : an iterator pointing to the first element of a control point container. |
PointsEnd | : an iterator pointing to the last element of a control point container. |
T_min | : lower bound of time, curve will be defined for time in [T_min, T_max]. |
T_max | : upper bound of time, curve will be defined for time in [T_min, T_max]. |
mult_T | : ... (default value is 1.0). |
|
inline |
Constructor with constraints. This constructor will add 4 points (2 after the first one, 2 before the last one) to ensure that velocity and acceleration constraints are respected.
PointsBegin | : an iterator pointing to the first element of a control point container. |
PointsEnd | : an iterator pointing to the last element of a control point container. |
constraints | : constraints applying on start / end velocities and acceleration. |
T_min | : lower bound of time, curve will be defined for time in [T_min, T_max]. |
T_max | : upper bound of time, curve will be defined for time in [T_min, T_max]. |
mult_T | : ... (default value is 1.0). |
|
inline |
|
inlinevirtual |
Destructor.
|
inline |
Compute the derived curve at order N. Computes the derivative order N, \(\frac{d^Nx(t)}{dt^N}\) of bezier curve of parametric equation x(t).
order | : order of derivative. |
|
inlinevirtual |
Compute the derived curve at order N.
order | : order of derivative. |
Implements ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.
|
inline |
|
inline |
Compute the primitive of the curve at order N. Computes the primitive at order N of bezier curve of parametric equation \(x(t)\).
At order \(N=1\), the primitve \(X(t)\) of \(x(t)\) is such as \(\frac{dX(t)}{dt} = x(t)\).
order | : order of the primitive. |
init | : constant valuefor the first point of the primitive (can tipycally be zero) |
|
inline |
|
inlinevirtual |
Evaluate the derivative order N of curve at time t. If derivative is to be evaluated several times, it is rather recommended to compute derived curve using compute_derivate.
order | : order of derivative. |
t | : time when to evaluate the curve. |
Implements ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.
|
inline |
Computes a Bezier curve of order degrees higher than the current curve, but strictly equivalent. Order elevation is required for addition / substraction and other comparison operations.
order | : number of order the curve must be updated |
|
inline |
Elevate the Bezier curve of order degrees higher than the current curve, but strictly equivalent. Order elevation is required for addition / substraction and other comparison operations.
order | : number of order the curve must be updated |
|
inline |
Evaluate all Bernstein polynomes for a certain degree. A bezier curve with N control points is represented by : \(x(t) =
\sum_{i=0}^{N} B_i^N(t) P_i\) with \( B_i^N(t) = \binom{N}{i}t^i
(1-t)^{N-i} \).
Warning: the horner scheme is about 100 times faster than this method.
This method will probably be removed in the future as the computation of bernstein polynomial is very costly.
t | : time when to evaluate the curve. |
|
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 threshold, default Eigen::NumTraits<Numeric>::dummy_precision() |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Evaluation of the bezier curve at time t.
t | : time when to evaluate the curve. |
Implements ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.
|
inlinevirtual |