curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve > Struct Template Reference

#include <curves/piecewise_curve.h>

Inheritance diagram for curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >:
[legend]
Collaboration diagram for curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >:
[legend]

Public Types

typedef Point point_t
 
typedef T_Point t_point_t
 
typedef Time time_t
 
typedef Numeric num_t
 
typedef Curve curve_t
 
typedef std::vector< curve_tt_curve_t
 
typedef std::vector< Time > t_time_t
 
- Public Types inherited from curves::curve_abc< Time, Numeric, Safe, Point >
typedef Point point_t
 
typedef Time time_t
 

Public Member Functions

 piecewise_curve ()
 Empty constructor. More...
 
 piecewise_curve (const curve_t &cf)
 Constructor. More...
 
 piecewise_curve (const t_curve_t list_curves)
 
 piecewise_curve (const piecewise_curve &other)
 
virtual ~piecewise_curve ()
 
virtual Point operator() (const Time t) const
 Evaluation of the cubic spline at time t. More...
 
virtual Point derivate (const Time t, const std::size_t order) const
 Evaluate the derivative of order N of curve at time t. More...
 
piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve > compute_derivate (const std::size_t order) const
 compute_derivate return a piecewise_curve which is the derivative of this at given order More...
 
void add_curve (const curve_t &cf)
 Add a new curve to piecewise curve, which should be defined in $[T_{min},T_{max}]$ where $T_{min}$ is equal to $T_{max}$ of the actual piecewise curve. More...
 
bool is_continuous (const std::size_t order)
 Check if the curve is continuous of order given. More...
 
template<typename Bezier >
piecewise_curve< Time, Numeric, Safe, Point, T_Point, Bezier > convert_piecewise_curve_to_bezier ()
 
template<typename Hermite >
piecewise_curve< Time, Numeric, Safe, Point, T_Point, Hermite > convert_piecewise_curve_to_cubic_hermite ()
 
template<typename Polynomial >
piecewise_curve< Time, Numeric, Safe, Point, T_Point, Polynomial > convert_piecewise_curve_to_polynomial ()
 
virtual std::size_t dim () const
 Get dimension of curve. More...
 
virtual Time min () const
 Get the minimum time for which the curve is defined. More...
 
virtual Time max () const
 Get the maximum time for which the curve is defined. More...
 
std::size_t getNumberCurves ()
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 
- Public Member Functions inherited from curves::curve_abc< Time, Numeric, Safe, Point >
 curve_abc ()
 Constructor. More...
 
virtual ~curve_abc ()
 Destructor. More...
 
std::pair< time_t, time_ttimeRange ()
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Static Public Member Functions

template<typename Polynomial >
static piecewise_curve< Time, Numeric, Safe, Point, T_Point, Polynomial > convert_discrete_points_to_polynomial (T_Point points, t_time_t time_points)
 
template<typename Polynomial >
static piecewise_curve< Time, Numeric, Safe, Point, T_Point, Polynomial > convert_discrete_points_to_polynomial (T_Point points, T_Point points_derivative, t_time_t time_points)
 
template<typename Polynomial >
static piecewise_curve< Time, Numeric, Safe, Point, T_Point, Polynomial > convert_discrete_points_to_polynomial (T_Point points, T_Point points_derivative, T_Point points_second_derivative, t_time_t time_points)
 

Public Attributes

std::size_t dim_
 
t_curve_t curves_
 
t_time_t time_curves_
 
std::size_t size_
 
Time T_min_
 
Time T_max_
 

Static Public Attributes

static const double MARGIN
 

Friends

class boost::serialization::access
 

Member Typedef Documentation

◆ curve_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
typedef Curve curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::curve_t

◆ num_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
typedef Numeric curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::num_t

◆ point_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
typedef Point curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::point_t

◆ t_curve_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
typedef std::vector<curve_t> curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::t_curve_t

◆ t_point_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
typedef T_Point curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::t_point_t

◆ t_time_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
typedef std::vector<Time> curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::t_time_t

◆ time_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
typedef Time curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::time_t

Constructor & Destructor Documentation

◆ piecewise_curve() [1/4]

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::piecewise_curve ( )
inline

Empty constructor.

Add at least one curve to call other class functions.

◆ piecewise_curve() [2/4]

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::piecewise_curve ( const curve_t cf)
inline

Constructor.

Initialize a piecewise curve by giving the first curve.

Parameters
pol: a polynomial curve.

◆ piecewise_curve() [3/4]

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::piecewise_curve ( const t_curve_t  list_curves)
inline

◆ piecewise_curve() [4/4]

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::piecewise_curve ( const piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve > &  other)
inline

◆ ~piecewise_curve()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
virtual curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::~piecewise_curve ( )
inlinevirtual

Member Function Documentation

◆ add_curve()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
void curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::add_curve ( const curve_t cf)
inline

Add a new curve to piecewise curve, which should be defined in $[T_{min},T_{max}]$ where $T_{min}$ is equal to $T_{max}$ of the actual piecewise curve.

The curve added should be of type Curve as defined in the template.

Parameters
cf: curve to add.

Referenced by curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, SplineBase >::compute_derivate(), curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, SplineBase >::convert_discrete_points_to_polynomial(), and curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, SplineBase >::piecewise_curve().

◆ compute_derivate()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
piecewise_curve<Time, Numeric, Safe, Point, T_Point, Curve> curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::compute_derivate ( const std::size_t  order) const
inline

compute_derivate return a piecewise_curve which is the derivative of this at given order

Parameters
orderorder of derivative
Returns

◆ convert_discrete_points_to_polynomial() [1/3]

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
template<typename Polynomial >
static piecewise_curve<Time, Numeric, Safe, Point, T_Point, Polynomial> curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::convert_discrete_points_to_polynomial ( T_Point  points,
t_time_t  time_points 
)
inlinestatic

◆ convert_discrete_points_to_polynomial() [2/3]

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
template<typename Polynomial >
static piecewise_curve<Time, Numeric, Safe, Point, T_Point, Polynomial> curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::convert_discrete_points_to_polynomial ( T_Point  points,
T_Point  points_derivative,
t_time_t  time_points 
)
inlinestatic

◆ convert_discrete_points_to_polynomial() [3/3]

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
template<typename Polynomial >
static piecewise_curve<Time, Numeric, Safe, Point, T_Point, Polynomial> curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::convert_discrete_points_to_polynomial ( T_Point  points,
T_Point  points_derivative,
T_Point  points_second_derivative,
t_time_t  time_points 
)
inlinestatic

◆ convert_piecewise_curve_to_bezier()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
template<typename Bezier >
piecewise_curve<Time, Numeric, Safe, Point, T_Point, Bezier> curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::convert_piecewise_curve_to_bezier ( )
inline

◆ convert_piecewise_curve_to_cubic_hermite()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
template<typename Hermite >
piecewise_curve<Time, Numeric, Safe, Point, T_Point, Hermite> curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::convert_piecewise_curve_to_cubic_hermite ( )
inline

◆ convert_piecewise_curve_to_polynomial()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
template<typename Polynomial >
piecewise_curve<Time, Numeric, Safe, Point, T_Point, Polynomial> curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::convert_piecewise_curve_to_polynomial ( )
inline

◆ derivate()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
virtual Point curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::derivate ( const Time  t,
const std::size_t  order 
) const
inlinevirtual

Evaluate the derivative of order N of curve at time t.

Parameters
t: time when to evaluate the spline.
order: order of derivative.
Returns
$\frac{d^Np(t)}{dt^N}$ point corresponding on derivative spline of order N at time t.

Implements curves::curve_abc< Time, Numeric, Safe, Point >.

Referenced by curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, SplineBase >::derivate().

◆ dim()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
virtual std::size_t curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::dim ( ) const
inlinevirtual

Get dimension of curve.

Returns
dimension of curve.

Implements curves::curve_abc< Time, Numeric, Safe, Point >.

◆ getNumberCurves()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
std::size_t curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::getNumberCurves ( )
inline

◆ is_continuous()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
bool curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::is_continuous ( const std::size_t  order)
inline

Check if the curve is continuous of order given.

Parameters
order: order of continuity we want to check.
Returns
True if the curve is continuous of order given.

◆ max()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
virtual Time curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::max ( ) const
inlinevirtual

Get the maximum time for which the curve is defined.

Returns
$t_{max}$, upper bound of time range.

Implements curves::curve_abc< Time, Numeric, Safe, Point >.

◆ min()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
virtual Time curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::min ( ) const
inlinevirtual

Get the minimum time for which the curve is defined.

Returns
$t_{min}$, lower bound of time range.

Implements curves::curve_abc< Time, Numeric, Safe, Point >.

◆ operator()()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
virtual Point curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::operator() ( const Time  t) const
inlinevirtual

Evaluation of the cubic spline at time t.

Parameters
t: time when to evaluate the spine
Returns
$x(t)$, point corresponding on curve at time t.

Implements curves::curve_abc< Time, Numeric, Safe, Point >.

◆ serialize()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
template<class Archive >
void curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::serialize ( Archive &  ar,
const unsigned int  version 
)
inline

Friends And Related Function Documentation

◆ boost::serialization::access

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
friend class boost::serialization::access
friend

Member Data Documentation

◆ curves_

◆ dim_

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
std::size_t curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::dim_

◆ MARGIN

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
const double curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::MARGIN
static

◆ size_

◆ T_max_

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
Time curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::T_max_

◆ T_min_

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
Time curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::T_min_

◆ time_curves_

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename T_Point = std::vector<Point, Eigen::aligned_allocator<Point> >, typename Curve = curve_abc<Time, Numeric, Safe, Point>>
t_time_t curves::piecewise_curve< Time, Numeric, Safe, Point, T_Point, Curve >::time_curves_