hpp-spline  4.10.0
template based classes for creating and manipulating spline and bezier curves. Comes with extra options specific to end-effector trajectories in robotics.
spline::bezier_curve< Time, Numeric, Dim, Safe, Point > Struct Template Reference

#include <hpp/spline/bezier_curve.h>

Inheritance diagram for spline::bezier_curve< Time, Numeric, Dim, Safe, Point >:
Collaboration diagram for spline::bezier_curve< Time, Numeric, Dim, Safe, Point >:

Public Types

typedef Point point_t
 
typedef Time time_t
 
typedef Numeric num_t
 
typedef curve_constraints< point_tcurve_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 spline::curve_abc< double, double, 3, false, Eigen::Matrix< double, 3, 1 > >
typedef Eigen::Matrix< double, 3, 1 > point_t
 
typedef double 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. If the derivative is to be evaluated several times, it is rather recommended to compute the derivative curve using compute_derivate. 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. This method will probably be removed in the future. 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_tsplit (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
 
virtual time_t max () const
 
- Public Member Functions inherited from spline::curve_abc< double, double, 3, false, Eigen::Matrix< double, 3, 1 > >
 curve_abc ()
 Constructor. More...
 
virtual ~curve_abc ()
 Destructor. More...
 
virtual point_t operator() (const time_t t) const=0
 Evaluation of the cubic spline at time t. More...
 
virtual point_t derivate (const time_t t, const std::size_t order) const=0
 Evaluation of the derivative spline at time t. More...
 
virtual time_t min () const=0
 Returns the minimum time for wich curve is defined. More...
 
virtual time_t max () const=0
 Returns the maximum time for wich curve is defined. 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

◆ 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 bezier_curve<Time, Numeric, Dim, Safe, Point> spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::bezier_curve_t

◆ 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 t_point_t::const_iterator spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::cit_point_t

◆ 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 curve_constraints<point_t> spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::curve_constraints_t

◆ 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 Numeric spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::num_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 Point spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::point_t

◆ 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 std::vector<point_t, Eigen::aligned_allocator<point_t> > spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::t_point_t

◆ time_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 spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::time_t

Constructor & Destructor Documentation

◆ bezier_curve() [1/4]

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 >
spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::bezier_curve ( In  PointsBegin,
In  PointsEnd 
)
inline

Constructor.

Parameters
PointsBegin,PointsEnd: the points parametering the Bezier curve

◆ bezier_curve() [2/4]

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 >
spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::bezier_curve ( In  PointsBegin,
In  PointsEnd,
const time_t  T 
)
inline

Constructor.

Parameters
PointsBegin,PointsEnd: the points parametering the Bezier curve

◆ bezier_curve() [3/4]

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 >
spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::bezier_curve ( In  PointsBegin,
In  PointsEnd,
const time_t  T,
const time_t  mult_T 
)
inline

Constructor.

Parameters
PointsBegin,PointsEnd: the points parametering the Bezier curve

◆ bezier_curve() [4/4]

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 >
spline::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

◆ ~bezier_curve()

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

Destructor.

Member Function Documentation

◆ compute_derivate()

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 spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::compute_derivate ( const std::size_t  order) const
inline

Computes the derivative curve at order N.

Parameters
order: order of the derivative
return: the value x(t)

◆ compute_primitive()

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 spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::compute_primitive ( const std::size_t  order) const
inline

Computes the primitive of the curve at order N.

Parameters
constant: value of the primitive at t = 0
return: the curve x_1(t) such that d/dt(x_1(t)) = x_1(t)

◆ deCasteljauReduction() [1/2]

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 spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::deCasteljauReduction ( const Numeric  t) const
inline

◆ deCasteljauReduction() [2/2]

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 spline::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)

◆ derivate()

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 spline::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)

◆ evalBernstein()

template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
point_t spline::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.

◆ evalDeCasteljau()

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

evalDeCasteljau evaluate the curve value at time t using deCasteljau algorithm

Parameters
tunNormalized time
Returns
the point at time t

◆ evalHorner()

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

Evaluates all Bernstein polynomes for a certain degree using horner's scheme.

◆ extract()

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 spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::extract ( const Numeric  t1,
const Numeric  t2 
)
inline

◆ max()

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 spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::max ( ) const
inlinevirtual

◆ min()

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 spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::min ( ) const
inlinevirtual

◆ operator()()

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 spline::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)

◆ split()

template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
std::pair<bezier_curve_t, bezier_curve_t> spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::split ( const Numeric  t)
inline

split split the curve in 2 at time t

Parameters
t
Returns

◆ waypoints()

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& spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::waypoints ( ) const
inline

◆ zero()

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 spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::zero ( const time_t  T = 1.)
inlinestatic

Member Data Documentation

◆ bernstein_

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> > spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::bernstein_

◆ 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 spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::degree_

◆ mult_T_

template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
time_t spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::mult_T_

◆ size_

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 spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::size_

◆ T_

template<typename Time = double, typename Numeric = Time, std::size_t Dim = 3, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Dim, 1>>
time_t spline::bezier_curve< Time, Numeric, Dim, Safe, Point >::T_

The documentation for this struct was generated from the following file: