Loading...
Searching...
No Matches
ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType > Struct Template Reference

#include <ndcurves/piecewise_curve.h>

Inheritance diagram for ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >:
Collaboration diagram for ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >:

Public Types

typedef Point point_t
 
typedef Point_derivate point_derivate_t
 
typedef std::vector< point_t, Eigen::aligned_allocator< point_t > > t_point_t
 
typedef std::vector< point_derivate_t, Eigen::aligned_allocator< point_derivate_t > > t_point_derivate_t
 
typedef Time time_t
 
typedef Numeric num_t
 
typedef curve_abc< Time, Numeric, Safe, point_t, point_derivate_tbase_curve_t
 
typedef CurveType curve_t
 
typedef std::shared_ptr< curve_tcurve_ptr_t
 
typedef std::vector< curve_ptr_tt_curve_ptr_t
 
typedef std::vector< Time > t_time_t
 
typedef piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveTypepiecewise_curve_t
 
typedef piecewise_curve< Time, Numeric, Safe, Point_derivate, Point_derivate, typename CurveType::curve_derivate_t > piecewise_curve_derivate_t
 
typedef std::shared_ptr< typename piecewise_curve_derivate_t::curve_tcurve_derivate_ptr_t
 
- Public Types inherited from ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >
typedef Point point_t
 
typedef Point_derivate point_derivate_t
 
typedef Time time_t
 
typedef Numeric num_t
 
typedef curve_abc< Time, Numeric, Safe, point_t, point_derivate_tcurve_t
 
typedef curve_abc< Time, Numeric, Safe, point_derivate_tcurve_derivate_t
 
typedef std::shared_ptr< curve_tcurve_ptr_t
 

Public Member Functions

 piecewise_curve ()
 Empty constructor. Add at least one curve to call other class functions.
 
 piecewise_curve (const curve_ptr_t &cf)
 Constructor. Initialize a piecewise curve by giving the first curve.
 
 piecewise_curve (const t_curve_ptr_t &curves_list)
 
 piecewise_curve (const piecewise_curve &other)
 
virtual ~piecewise_curve ()
 
virtual point_t operator() (const Time t) const
 Evaluation of the cubic spline at time t.
 
bool isApprox (const piecewise_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 base_curve_t *other, const Numeric prec=Eigen::NumTraits< Numeric >::dummy_precision()) const
 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 bool operator== (const piecewise_curve_t &other) const
 
virtual bool operator!= (const piecewise_curve_t &other) const
 
virtual point_derivate_t derivate (const Time t, const std::size_t order) const
 Evaluate the derivative of order N of curve at time t.
 
piecewise_curve_derivate_tcompute_derivate_ptr (const std::size_t order) const
 compute_derivate return a piecewise_curve which is the derivative of this at given order
 
template<typename Curve >
void add_curve (const Curve &curve)
 
void add_curve_ptr (const curve_ptr_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. The curve added should be of type Curve as defined in the template.
 
bool is_continuous (const std::size_t order)
 Check if the curve is continuous of order given.
 
std::size_t num_curves () const
 Get number of curves in piecewise curve.
 
curve_ptr_t curve_at_time (const time_t t) const
 Get curve corresponding to time t in piecewise curve. Example : A piecewise curve PC made of two curves : c1 for t in [0,1] and c2 for t in ]1,2]. PC.curve_at_time(0.5) will return c1.
 
curve_ptr_t curve_at_index (const std::size_t idx) const
 Get curve at specified index in piecewise curve.
 
template<typename Bezier >
piecewise_curve_t convert_piecewise_curve_to_bezier ()
 Convert all curves in piecewise curve into bezier curves.
 
template<typename Hermite >
piecewise_curve_t convert_piecewise_curve_to_cubic_hermite ()
 Convert all curves in piecewise curve into cubic hermite curves. Curves need to be of degree inferior or equal to three.
 
template<typename Polynomial >
piecewise_curve_t convert_piecewise_curve_to_polynomial ()
 Convert all curves in piecewise curve into polynomial curves.
 
virtual std::size_t dim () const
 Get dimension of curve.
 
virtual Time min () const
 Get the minimum time for which the curve is defined.
 
virtual Time max () const
 Get the maximum time for which the curve is defined.
 
virtual std::size_t degree () const
 Get the degree of the curve.
 
std::size_t getNumberCurves ()
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 
- Public Member Functions inherited from ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >
 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.
 
std::pair< time_t, time_ttimeRange ()
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 
- Public Member Functions inherited from ndcurves::serialization::Serializable
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.
 

Static Public Member Functions

template<typename Polynomial >
static piecewise_curve_t convert_discrete_points_to_polynomial (t_point_t points, t_time_t time_points)
 Convert discrete points into piecewise polynomial curve with C0 continuity.
 
template<typename Polynomial >
static piecewise_curve_t convert_discrete_points_to_polynomial (t_point_t points, t_point_derivate_t points_derivative, t_time_t time_points)
 Convert discrete points into piecewise polynomial curve with C1 continuity.
 
template<typename Polynomial >
static piecewise_curve_t convert_discrete_points_to_polynomial (t_point_t points, t_point_derivate_t points_derivative, t_point_derivate_t points_second_derivative, t_time_t time_points)
 Convert discrete points into piecewise polynomial curve with C2 continuity.
 
template<typename Polynomial >
static piecewise_curve_t load_piecewise_from_text_file (const std::string &filename, const time_t dt, const size_t dim)
 load_piecewise_from_text_file build a piecewise polynomial from a list of discrete points read from a file. The file should contains one points per line, optionally with it's derivative and second derivatives. Each lines should then contains dim, 2*dim or 3*dim values
 

Public Attributes

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

Friends

class boost::serialization::access
 

Member Typedef Documentation

◆ base_curve_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
typedef curve_abc<Time, Numeric, Safe, point_t, point_derivate_t> ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::base_curve_t

◆ curve_derivate_ptr_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
typedef std::shared_ptr<typename piecewise_curve_derivate_t::curve_t> ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::curve_derivate_ptr_t

◆ curve_ptr_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
typedef std::shared_ptr<curve_t> ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::curve_ptr_t

◆ curve_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
typedef CurveType ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::curve_t

◆ num_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
typedef Numeric ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::num_t

◆ piecewise_curve_derivate_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
typedef piecewise_curve<Time, Numeric, Safe, Point_derivate, Point_derivate, typename CurveType::curve_derivate_t> ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::piecewise_curve_derivate_t

◆ piecewise_curve_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
typedef piecewise_curve<Time, Numeric, Safe, Point, Point_derivate, CurveType> ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::piecewise_curve_t

◆ point_derivate_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
typedef Point_derivate ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::point_derivate_t

◆ point_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
typedef Point ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::point_t

◆ t_curve_ptr_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
typedef std::vector<curve_ptr_t> ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::t_curve_ptr_t

◆ t_point_derivate_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
typedef std::vector<point_derivate_t, Eigen::aligned_allocator<point_derivate_t> > ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::t_point_derivate_t

◆ t_point_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
typedef std::vector<point_t, Eigen::aligned_allocator<point_t> > ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::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 Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
typedef std::vector<Time> ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::t_time_t

◆ time_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
typedef Time ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::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 Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::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 Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::piecewise_curve ( const curve_ptr_t cf)
inline

Constructor. Initialize a piecewise curve by giving the first curve.

Parameters
cf: a curve.

◆ piecewise_curve() [3/4]

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::piecewise_curve ( const t_curve_ptr_t curves_list)
inline

◆ piecewise_curve() [4/4]

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::piecewise_curve ( const piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType > &  other)
inline

◆ ~piecewise_curve()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
virtual ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::~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 Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
template<typename Curve >
void ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::add_curve ( const Curve curve)
inline

◆ add_curve_ptr()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
void ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::add_curve_ptr ( const curve_ptr_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.

◆ compute_derivate_ptr()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
piecewise_curve_derivate_t * ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::compute_derivate_ptr ( const std::size_t  order) const
inlinevirtual

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

Parameters
orderorder of derivative
Returns

Implements ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ 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 Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
template<typename Polynomial >
static piecewise_curve_t ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::convert_discrete_points_to_polynomial ( t_point_t  points,
t_point_derivate_t  points_derivative,
t_point_derivate_t  points_second_derivative,
t_time_t  time_points 
)
inlinestatic

Convert discrete points into piecewise polynomial curve with C2 continuity.

Parameters
points: discrete points to convert.
points_derivative: derivative of order 1 corresponding to each point in piecewise curve.
points_second_derivative: derivative of order 2 corresponding to each point in piecewise curve.
time_points: time corresponding to each point in piecewise curve.
Returns
piecewise polynomial curve of C2 continuity.

◆ 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 Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
template<typename Polynomial >
static piecewise_curve_t ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::convert_discrete_points_to_polynomial ( t_point_t  points,
t_point_derivate_t  points_derivative,
t_time_t  time_points 
)
inlinestatic

Convert discrete points into piecewise polynomial curve with C1 continuity.

Parameters
points: discrete points to convert.
points_derivative: derivative of order 1 corresponding to each point in piecewise curve.
time_points: time corresponding to each point in piecewise curve.
Returns
piecewise polynomial curve of C1 continuity.

◆ 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 Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
template<typename Polynomial >
static piecewise_curve_t ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::convert_discrete_points_to_polynomial ( t_point_t  points,
t_time_t  time_points 
)
inlinestatic

Convert discrete points into piecewise polynomial curve with C0 continuity.

Parameters
points: discrete points to convert.
time_points: time corresponding to each point in piecewise curve.
Returns
piecewise polynomial curve of C0 continuity.

◆ convert_piecewise_curve_to_bezier()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
template<typename Bezier >
piecewise_curve_t ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::convert_piecewise_curve_to_bezier ( )
inline

Convert all curves in piecewise curve into bezier curves.

Returns
piecewise bezier curve.

◆ 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 Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
template<typename Hermite >
piecewise_curve_t ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::convert_piecewise_curve_to_cubic_hermite ( )
inline

Convert all curves in piecewise curve into cubic hermite curves. Curves need to be of degree inferior or equal to three.

Returns
piecewise cubic hermite curve.

◆ convert_piecewise_curve_to_polynomial()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
template<typename Polynomial >
piecewise_curve_t ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::convert_piecewise_curve_to_polynomial ( )
inline

Convert all curves in piecewise curve into polynomial curves.

Returns
piecewise polynomial curve.

◆ curve_at_index()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
curve_ptr_t ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::curve_at_index ( const std::size_t  idx) const
inline

Get curve at specified index in piecewise curve.

Parameters
idx: Index of curve to return, from 0 to num_curves-1.
Returns
curve corresonding to index in piecewise curve.

◆ curve_at_time()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
curve_ptr_t ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::curve_at_time ( const time_t  t) const
inline

Get curve corresponding to time t in piecewise curve. Example : A piecewise curve PC made of two curves : c1 for t in [0,1] and c2 for t in ]1,2]. PC.curve_at_time(0.5) will return c1.

Parameters
t: time to select curve.
Returns
Curve corresponding to time t in piecewise curve.

◆ degree()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
virtual std::size_t ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::degree ( ) const
inlinevirtual

Get the degree of the curve.

Returns
\(degree\), the degree of the curve.

Implements ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ derivate()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
virtual point_derivate_t ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::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 ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ dim()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
virtual std::size_t ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::dim ( ) const
inlinevirtual

Get dimension of curve.

Returns
dimension of curve.

Implements ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ getNumberCurves()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
std::size_t ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::getNumberCurves ( )
inline

◆ is_continuous()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
bool ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::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.

◆ isApprox() [1/2]

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
virtual bool ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::isApprox ( const base_curve_t other,
const Numeric  prec = Eigen::NumTraits< Numeric >::dummy_precision() 
) const
inlinevirtual

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.

Parameters
otherthe other curve to check
precthe precision threshold, default Eigen::NumTraits<Numeric>::dummy_precision()
Returns
true if the two curves are approximately equal

Implements ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ isApprox() [2/2]

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
bool ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::isApprox ( const piecewise_curve_t other,
const Numeric  prec = Eigen::NumTraits<Numeric>::dummy_precision() 
) const
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

Parameters
otherthe other curve to check
precthe precision threshold, default Eigen::NumTraits<Numeric>::dummy_precision()
Returns
true is the two curves are approximately equals

◆ load_piecewise_from_text_file()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
template<typename Polynomial >
static piecewise_curve_t ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::load_piecewise_from_text_file ( const std::string &  filename,
const time_t  dt,
const size_t  dim 
)
inlinestatic

load_piecewise_from_text_file build a piecewise polynomial from a list of discrete points read from a file. The file should contains one points per line, optionally with it's derivative and second derivatives. Each lines should then contains dim, 2*dim or 3*dim values

Parameters
filenamethe (absolute) name of the file to load
dtthe time step between each points in the file
dimthe dimension of the curve
Returns
a piecewise curves containing polynomial connectiong all the points in the file

◆ max()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
virtual Time ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::max ( ) const
inlinevirtual

Get the maximum time for which the curve is defined.

Returns
\(t_{max}\), upper bound of time range.

Implements ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ min()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
virtual Time ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::min ( ) const
inlinevirtual

Get the minimum time for which the curve is defined.

Returns
\(t_{min}\), lower bound of time range.

Implements ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ num_curves()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
std::size_t ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::num_curves ( ) const
inline

Get number of curves in piecewise curve.

Returns
Number of curves in piecewise curve.

◆ operator!=()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
virtual bool ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::operator!= ( const piecewise_curve_t other) const
inlinevirtual

◆ operator()()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
virtual point_t ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::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 ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ operator==()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
virtual bool ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::operator== ( const piecewise_curve_t other) const
inlinevirtual

◆ serialize()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
template<class Archive >
void ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::serialize ( Archive ar,
const unsigned int  version 
)
inline

Friends And Related Symbol Documentation

◆ boost::serialization::access

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
friend class boost::serialization::access
friend

Member Data Documentation

◆ curves_

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
t_curve_ptr_t ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::curves_

◆ dim_

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
std::size_t ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::dim_

◆ size_

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
std::size_t ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::size_

◆ T_max_

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
Time ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::T_max_

◆ T_min_

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
Time ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::T_min_

◆ time_curves_

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>, typename Point_derivate = Point, typename CurveType = curve_abc<Time, Numeric, Safe, Point, Point_derivate>>
t_time_t ndcurves::piecewise_curve< Time, Numeric, Safe, Point, Point_derivate, CurveType >::time_curves_

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