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

#include <ndcurves/cubic_hermite_spline.h>

Inheritance diagram for ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >:
Collaboration diagram for ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >:

Public Types

typedef Point point_t
 
typedef std::pair< Point, Point > pair_point_tangent_t
 
typedef std::vector< pair_point_tangent_t, Eigen::aligned_allocator< pair_point_tangent_t > > t_pair_point_tangent_t
 
typedef std::vector< Time > vector_time_t
 
typedef Time time_t
 
typedef Numeric num_t
 
typedef curve_abc< Time, Numeric, Safe, point_tcurve_abc_t
 
typedef cubic_hermite_spline< Time, Numeric, Safe, point_tcubic_hermite_spline_t
 
typedef bezier_curve< Time, Numeric, Safe, point_tbezier_t
 
typedef bezier_t::t_point_t t_point_t
 
typedef piecewise_curve< Time, Numeric, Safe, point_t, point_t, bezier_tpiecewise_bezier_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

 cubic_hermite_spline ()
 Empty constructor. Curve obtained this way can not perform other class functions.
 
template<typename In >
 cubic_hermite_spline (In PairsBegin, In PairsEnd, const vector_time_t &time_control_points)
 Constructor.
 
 cubic_hermite_spline (const cubic_hermite_spline &other)
 
virtual ~cubic_hermite_spline ()
 Destructor.
 
virtual Point operator() (const time_t t) const
 Evaluation of the cubic hermite spline at time t.
 
bool isApprox (const cubic_hermite_spline_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 cubic_hermite_spline_t &other) const
 
virtual bool operator!= (const cubic_hermite_spline_t &other) const
 
virtual Point derivate (const time_t t, const std::size_t order) const
 Evaluate the derivative of order N of spline at time t.
 
piecewise_bezier_t compute_derivate (const std::size_t order) const
 
piecewise_bezier_tcompute_derivate_ptr (const std::size_t order) const
 Compute the derived curve at order N.
 
void setTime (const vector_time_t &time_control_points)
 Set time of each control point of cubic hermite spline. Set duration of each spline, Exemple : \(( 0., 0.5, 0.9, ..., 4.5 )\) with values corresponding to times for \(P_0, P_1, P_2, ..., P_N\) respectively.

 
t_pair_point_tangent_t getControlPoints ()
 Get vector of pair (positition, derivative) corresponding to control points.
 
vector_time_t getTime ()
 Get vector of Time corresponding to Time for each control point.
 
std::size_t size () const
 Get number of control points contained in the trajectory.
 
std::size_t numIntervals () const
 Get number of intervals (subsplines) contained in the trajectory.
 
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.
 
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.
 
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.
 
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.
 

Public Attributes

std::size_t dim_
 Dim of curve.
 
t_pair_point_tangent_t control_points_
 Vector of pair < Point, Tangent >.
 
vector_time_t time_control_points_
 
vector_time_t duration_splines_
 
Time T_min_
 
Time T_max_
 
std::size_t size_
 Number of control points (pairs).
 
std::size_t degree_
 Degree (Cubic so degree 3)
 

Friends

class boost::serialization::access
 

Member Typedef Documentation

◆ bezier_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
typedef bezier_curve<Time, Numeric, Safe, point_t> ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::bezier_t

◆ cubic_hermite_spline_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
typedef cubic_hermite_spline<Time, Numeric, Safe, point_t> ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::cubic_hermite_spline_t

◆ curve_abc_t

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

◆ num_t

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

◆ pair_point_tangent_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
typedef std::pair<Point, Point> ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::pair_point_tangent_t

◆ piecewise_bezier_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
typedef piecewise_curve<Time, Numeric, Safe, point_t, point_t, bezier_t> ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::piecewise_bezier_t

◆ point_t

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

◆ t_pair_point_tangent_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
typedef std::vector<pair_point_tangent_t, Eigen::aligned_allocator<pair_point_tangent_t> > ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::t_pair_point_tangent_t

◆ t_point_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
typedef bezier_t::t_point_t ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::t_point_t

◆ time_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
typedef Time ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::time_t

◆ vector_time_t

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
typedef std::vector<Time> ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::vector_time_t

Constructor & Destructor Documentation

◆ cubic_hermite_spline() [1/3]

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::cubic_hermite_spline ( )
inline

Empty constructor. Curve obtained this way can not perform other class functions.

◆ cubic_hermite_spline() [2/3]

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
template<typename In >
ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::cubic_hermite_spline ( In  PairsBegin,
In  PairsEnd,
const vector_time_t time_control_points 
)
inline

Constructor.

Parameters
PairsBegin: an iterator pointing to the first element of a pair(position, derivative) container.
PairsEnd: an iterator pointing to the last element of a pair(position, derivative) container.
time_control_points: vector containing time for each waypoint.

◆ cubic_hermite_spline() [3/3]

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

◆ ~cubic_hermite_spline()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
virtual ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::~cubic_hermite_spline ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ compute_derivate()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
piecewise_bezier_t ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::compute_derivate ( const std::size_t  order) const
inline

◆ compute_derivate_ptr()

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

Compute the derived curve at order N.

Parameters
order: order of derivative.
Returns
A pointer to \(\frac{d^Nx(t)}{dt^N}\) derivative order N of the curve.

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

◆ degree()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
virtual std::size_t ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::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>>
virtual Point ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::derivate ( const time_t  t,
const std::size_t  order 
) const
inlinevirtual

Evaluate the derivative of order N of spline 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>>
virtual std::size_t ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::dim ( ) const
inlinevirtual

Get dimension of curve.

Returns
dimension of curve.

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

◆ getControlPoints()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
t_pair_point_tangent_t ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::getControlPoints ( )
inline

Get vector of pair (positition, derivative) corresponding to control points.

Returns
vector containing control points.

◆ getTime()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
vector_time_t ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::getTime ( )
inline

Get vector of Time corresponding to Time for each control point.

Returns
vector containing time of each control point.

◆ isApprox() [1/2]

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
bool ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::isApprox ( const cubic_hermite_spline_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

◆ isApprox() [2/2]

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

◆ max()

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

◆ numIntervals()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
std::size_t ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::numIntervals ( ) const
inline

Get number of intervals (subsplines) contained in the trajectory.

Returns
number of intervals (subsplines).

◆ operator!=()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
virtual bool ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::operator!= ( const cubic_hermite_spline_t other) const
inlinevirtual

◆ operator()()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
virtual Point ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::operator() ( const time_t  t) const
inlinevirtual

Evaluation of the cubic hermite spline at time t.

Parameters
t: time when to evaluate the spline.
Returns
\(p(t)\) point corresponding on spline 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>>
virtual bool ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::operator== ( const cubic_hermite_spline_t other) const
inlinevirtual

◆ serialize()

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

◆ setTime()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
void ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::setTime ( const vector_time_t time_control_points)
inline

Set time of each control point of cubic hermite spline. Set duration of each spline, Exemple : \(( 0., 0.5, 0.9, ..., 4.5 )\) with values corresponding to times for \(P_0, P_1, P_2, ..., P_N\) respectively.

Parameters
time_control_points: Vector containing time for each control point.

◆ size()

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
std::size_t ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::size ( ) const
inline

Get number of control points contained in the trajectory.

Returns
number of control points.

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>>
friend class boost::serialization::access
friend

Member Data Documentation

◆ control_points_

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
t_pair_point_tangent_t ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::control_points_

Vector of pair < Point, Tangent >.

◆ degree_

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
std::size_t ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::degree_

Degree (Cubic so degree 3)

◆ dim_

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

Dim of curve.

◆ duration_splines_

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
vector_time_t ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::duration_splines_

Vector of Time corresponding to time duration of each subspline.
For N control points with time \(T_{P_0}, T_{P_1}, T_{P_2}, ..., T_{P_N}\) respectively, duration of each subspline is : ( T_{P_1}-T_{P_0}, T_{P_2}-T_{P_1}, ..., T_{P_N}-T_{P_{N-1} )
It contains \(N-1\) durations.

◆ size_

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

Number of control points (pairs).

◆ T_max_

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

Ending time of cubic hermite spline : T_max_ is equal to last time of control points.

◆ T_min_

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

Starting time of cubic hermite spline : T_min_ is equal to first time of control points.

◆ time_control_points_

template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
vector_time_t ndcurves::cubic_hermite_spline< Time, Numeric, Safe, Point >::time_control_points_

Vector of Time corresponding to time of each N control points : time at \(P_0, P_1, P_2, ..., P_N\). Exemple : \(( 0., 0.5, 0.9, ..., 4.5 )\) with values corresponding to times for \(P_0, P_1, P_2, ..., P_N\) respectively.


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