All Classes Namespaces Files Functions Variables Typedefs
curve::bezier_curve< Time, Numeric, Dim, Safe, Point > Struct Template Reference

#include <curve/bezier_curve.h>

Inheritance diagram for curve::bezier_curve< Time, Numeric, Dim, Safe, Point >:
[legend]
Collaboration diagram for curve::bezier_curve< Time, Numeric, Dim, Safe, Point >:
[legend]

Public Types

typedef Point point_t
 
typedef Time time_t
 
typedef Numeric num_t
 
typedef curve_constraints
< point_t
curve_constraints_t
 
typedef std::vector< point_t,
Eigen::aligned_allocator
< point_t > > 
t_point_t
 
typedef t_point_t::const_iterator cit_point_t
 
typedef bezier_curve< Time,
Numeric, Dim, Safe, Point > 
bezier_curve_t
 
- Public Types inherited from curve::curve_abc< Time, Numeric, Dim, Safe, Point >
typedef Point point_t
 
typedef Time time_t
 

Public Member Functions

template<typename In >
 bezier_curve (In PointsBegin, In PointsEnd)
 Constructor. More...
 
template<typename In >
 bezier_curve (In PointsBegin, In PointsEnd, const time_t T)
 Constructor. More...
 
template<typename In >
 bezier_curve (In PointsBegin, In PointsEnd, const time_t T, const time_t mult_T)
 Constructor. More...
 
template<typename In >
 bezier_curve (In PointsBegin, In PointsEnd, const curve_constraints_t &constraints, const time_t T=1.)
 Constructor 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. More...
 
 ~bezier_curve ()
 Destructor. More...
 
virtual point_t operator() (const time_t t) const
 Evaluation of the cubic spline at time t. More...
 
bezier_curve_t compute_derivate (const std::size_t order) const
 Computes the derivative curve at order N. More...
 
bezier_curve_t compute_primitive (const std::size_t order) const
 Computes the primitive of the curve at order N. More...
 
virtual point_t derivate (const time_t t, const std::size_t order) const
 Evaluates the derivative at order N of the curve. More...
 
point_t evalBernstein (const Numeric t) const
 Evaluates all Bernstein polynomes for a certain degree Warning: the horner scheme is about 100 times faster than this method. More...
 
point_t evalHorner (const Numeric t) const
 Evaluates all Bernstein polynomes for a certain degree using horner's scheme. More...
 
const t_point_twaypoints () const
 
point_t evalDeCasteljau (const Numeric t) const
 evalDeCasteljau evaluate the curve value at time t using deCasteljau algorithm More...
 
t_point_t deCasteljauReduction (const Numeric t) const
 
t_point_t deCasteljauReduction (const t_point_t &pts, const Numeric u) const
 deCasteljauReduction compute the de Casteljau's reduction of the given list of points at time t More...
 
std::pair< bezier_curve_t,
bezier_curve_t
split (const Numeric t)
 split split the curve in 2 at time t More...
 
bezier_curve_t extract (const Numeric t1, const Numeric t2)
 
virtual time_t min () const
 Returns the minimum time for wich curve is defined. More...
 
virtual time_t max () const
 Returns the maximum time for wich curve is defined. More...
 
- Public Member Functions inherited from curve::curve_abc< Time, Numeric, Dim, Safe, Point >
 curve_abc ()
 Constructor. More...
 
virtual ~curve_abc ()
 Destructor. More...
 
std::pair< time_t, time_ttimeRange ()
 

Static Public Member Functions

static bezier_curve_t zero (const time_t T=1.)
 

Public Attributes

time_t T_
 
time_t mult_T_
 
std::size_t size_
 
std::size_t degree_
 
std::vector< Bern< Numeric > > bernstein_
 

Member Typedef Documentation

template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
typedef bezier_curve<Time, Numeric, Dim, Safe, Point > curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::bezier_curve_t
template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
typedef t_point_t::const_iterator curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::cit_point_t
template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
typedef curve_constraints<point_t> curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::curve_constraints_t
template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
typedef Numeric curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::num_t
template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
typedef Point curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::point_t
template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
typedef std::vector<point_t,Eigen::aligned_allocator<point_t> > curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::t_point_t
template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
typedef Time curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::time_t

Constructor & Destructor Documentation

template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
template<typename In >
curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::bezier_curve ( In  PointsBegin,
In  PointsEnd 
)
inline
template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
template<typename In >
curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::bezier_curve ( In  PointsBegin,
In  PointsEnd,
const time_t  T 
)
inline
template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
template<typename In >
curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::bezier_curve ( In  PointsBegin,
In  PointsEnd,
const time_t  T,
const time_t  mult_T 
)
inline
template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
template<typename In >
curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::bezier_curve ( In  PointsBegin,
In  PointsEnd,
const curve_constraints_t constraints,
const time_t  T = 1. 
)
inline

Constructor 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.

Parameters
PointsBegin,PointsEnd: the points parametering the Bezier curve
constraints: constraints applying on start / end velocities and acceleration

References curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::size_, and curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::T_.

template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::~bezier_curve ( )
inline

Destructor.

Member Function Documentation

template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
bezier_curve_t curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::compute_derivate ( const std::size_t  order) const
inline
template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
bezier_curve_t curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::compute_primitive ( const std::size_t  order) const
inline
template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
t_point_t curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::deCasteljauReduction ( const Numeric  t) const
inline
template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
t_point_t curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::deCasteljauReduction ( const t_point_t pts,
const Numeric  u 
) const
inline

deCasteljauReduction compute the de Casteljau's reduction of the given list of points at time t

Parameters
ptsthe original list of points
uthe NORMALIZED time
Returns
the reduced list of point (size of pts - 1)
template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
virtual point_t curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::derivate ( const time_t  t,
const std::size_t  order 
) const
inlinevirtual

Evaluates the derivative at order N of the curve.

If the derivative is to be evaluated several times, it is rather recommended to compute the derivative curve using compute_derivate

Parameters
order: order of the derivative
t: the time when to evaluate the spine
return: the value x(t)

Implements curve::curve_abc< Time, Numeric, Dim, Safe, Point >.

References curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::compute_derivate().

template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
point_t curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::evalBernstein ( const Numeric  t) const
inline

Evaluates all Bernstein polynomes for a certain degree Warning: the horner scheme is about 100 times faster than this method.

This method will probably be removed in the future

References curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::bernstein_, curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::mult_T_, and curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::T_.

template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
point_t curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::evalDeCasteljau ( const Numeric  t) const
inline
template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
point_t curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::evalHorner ( const Numeric  t) const
inline
template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
bezier_curve_t curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::extract ( const Numeric  t1,
const Numeric  t2 
)
inline
template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
virtual time_t curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::max ( ) const
inlinevirtual

Returns the maximum time for wich curve is defined.

Implements curve::curve_abc< Time, Numeric, Dim, Safe, Point >.

References curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::T_.

template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
virtual time_t curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::min ( ) const
inlinevirtual

Returns the minimum time for wich curve is defined.

Implements curve::curve_abc< Time, Numeric, Dim, Safe, Point >.

template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
virtual point_t curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::operator() ( const time_t  t) const
inlinevirtual

Evaluation of the cubic spline at time t.

Parameters
t: the time when to evaluate the spine
return: the value x(t)

Implements curve::curve_abc< Time, Numeric, Dim, Safe, Point >.

References curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::evalHorner(), and curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::T_.

template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
const t_point_t& curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::waypoints ( ) const
inline
template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
static bezier_curve_t curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::zero ( const time_t  T = 1.)
inlinestatic

Member Data Documentation

template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
std::vector<Bern<Numeric> > curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::bernstein_
template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
std::size_t curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::degree_
template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
std::size_t curve::bezier_curve< Time, Numeric, Dim, Safe, Point >::size_