#include <curves/cubic_hermite_spline.h>
Public Types | |
typedef std::pair< Point, Point > | pair_point_tangent_t |
typedef std::vector< pair_point_tangent_t, Eigen::aligned_allocator< Point > > | t_pair_point_tangent_t |
typedef std::vector< Time > | vector_time_t |
typedef Numeric | num_t |
![]() | |
typedef Point | point_t |
typedef Time | time_t |
Public Member Functions | |
cubic_hermite_spline () | |
Empty constructor. More... | |
template<typename In > | |
cubic_hermite_spline (In PairsBegin, In PairsEnd, const vector_time_t &time_control_points) | |
Constructor. More... | |
cubic_hermite_spline (const cubic_hermite_spline &other) | |
virtual | ~cubic_hermite_spline () |
Destructor. More... | |
virtual Point | operator() (const Time t) const |
Evaluation of the cubic hermite spline at time t. More... | |
virtual Point | derivate (const Time t, const std::size_t order) const |
Evaluate the derivative of order N of spline at time t. More... | |
void | setTime (const vector_time_t &time_control_points) |
Set time of each control point of cubic hermite spline. More... | |
t_pair_point_tangent_t | getControlPoints () |
Get vector of pair (positition, derivative) corresponding to control points. More... | |
vector_time_t | getTime () |
Get vector of Time corresponding to Time for each control point. More... | |
std::size_t | size () const |
Get number of control points contained in the trajectory. More... | |
std::size_t | numIntervals () const |
Get number of intervals (subsplines) contained in the trajectory. More... | |
Point | evalCubicHermiteSpline (const Numeric t, std::size_t degree_derivative) const |
Evaluate value of cubic hermite spline or its derivate at specified order at time ![]() | |
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... | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
![]() | |
curve_abc () | |
Constructor. More... | |
virtual | ~curve_abc () |
Destructor. More... | |
std::pair< time_t, time_t > | timeRange () |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Static Public Member Functions | |
static void | evalCoeffs (const Numeric t, Numeric &h00, Numeric &h10, Numeric &h01, Numeric &h11, std::size_t degree_derivative) |
Evaluate coefficient for polynom of cubic hermite spline. More... | |
Public Attributes | |
std::size_t | dim_ |
Dim of curve. More... | |
t_pair_point_tangent_t | control_points_ |
Vector of pair < Point, Tangent >. More... | |
vector_time_t | time_control_points_ |
Vector of Time corresponding to time of each N control points : time at ![]() | |
vector_time_t | duration_splines_ |
Vector of Time corresponding to time duration of each subspline. More... | |
Time | T_min_ |
Starting time of cubic hermite spline : T_min_ is equal to first time of control points. More... | |
Time | T_max_ |
Ending time of cubic hermite spline : T_max_ is equal to last time of control points. More... | |
std::size_t | size_ |
Number of control points (pairs). More... | |
std::size_t | degree_ |
Degree (Cubic so degree 3) More... | |
Friends | |
class | boost::serialization::access |
typedef Numeric curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::num_t |
typedef std::pair<Point, Point> curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::pair_point_tangent_t |
typedef std::vector<pair_point_tangent_t, Eigen::aligned_allocator<Point> > curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::t_pair_point_tangent_t |
typedef std::vector<Time> curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::vector_time_t |
|
inline |
Empty constructor.
Curve obtained this way can not perform other class functions.
|
inline |
Constructor.
wayPointsBegin | : an iterator pointing to the first element of a pair(position, derivative) container. |
wayPointsEns | : an iterator pointing to the last element of a pair(position, derivative) container. |
time_control_points | : vector containing time for each waypoint. |
References curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::control_points_, curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::dim_, curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::setTime(), and curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::size_.
|
inline |
|
inlinevirtual |
Destructor.
|
inlinevirtual |
Evaluate the derivative of order N of spline at time t.
t | : time when to evaluate the spline. |
order | : order of derivative. |
Implements curves::curve_abc< Time, Numeric, Safe, Point >.
References curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::evalCubicHermiteSpline().
|
inlinevirtual |
Get dimension of curve.
Implements curves::curve_abc< Time, Numeric, Safe, Point >.
References curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::dim_.
|
inlinestatic |
Evaluate coefficient for polynom of cubic hermite spline.
Coefficients of polynom :
t | : time to calculate coefficients. |
h00 | : variable to store value of coefficient. |
h10 | : variable to store value of coefficient. |
h01 | : variable to store value of coefficient. |
h11 | : variable to store value of coefficient. |
degree_derivative | : order of derivative. |
References curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::control_points_, curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::dim_, curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::duration_splines_, curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::size(), curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::size_, and curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::time_control_points_.
Referenced by curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::evalCubicHermiteSpline().
|
inline |
Evaluate value of cubic hermite spline or its derivate at specified order at time .
A cubic hermite spline on unit interval and given two control points defined by their position and derivative
and
, is defined by the polynom :
To extend this formula to a cubic hermite spline on any arbitrary interval, we define where
.
Polynom becomes
and
.
t | : time when to evaluate the curve. |
degree_derivative | : Order of derivate of cubic hermite spline (set value to 0 if you do not want derivate) |
References curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::control_points_, curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::evalCoeffs(), curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::size_, and curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::time_control_points_.
Referenced by curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::derivate(), and curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::operator()().
|
inline |
Get vector of pair (positition, derivative) corresponding to control points.
References curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::control_points_.
|
inline |
Get vector of Time corresponding to Time for each control point.
References curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::time_control_points_.
|
inlinevirtual |
Get the maximum time for which the curve is defined.
Implements curves::curve_abc< Time, Numeric, Safe, Point >.
References curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::time_control_points_.
|
inlinevirtual |
Get the minimum time for which the curve is defined.
Implements curves::curve_abc< Time, Numeric, Safe, Point >.
References curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::time_control_points_.
|
inline |
Get number of intervals (subsplines) contained in the trajectory.
References curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::size().
|
inlinevirtual |
Evaluation of the cubic hermite spline at time t.
t | : time when to evaluate the spline. |
Implements curves::curve_abc< Time, Numeric, Safe, Point >.
References curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::control_points_, curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::evalCubicHermiteSpline(), curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::size_, curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::T_max_, and curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::T_min_.
|
inline |
|
inline |
Set time of each control point of cubic hermite spline.
Set duration of each spline, Exemple : with values corresponding to times for
respectively.
time_control_points | : Vector containing time for each control point. |
References curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::size(), curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::T_max_, curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::T_min_, and curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::time_control_points_.
Referenced by curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::cubic_hermite_spline().
|
inline |
Get number of control points contained in the trajectory.
References curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::size_.
Referenced by curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::evalCoeffs(), curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::numIntervals(), and curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::setTime().
|
friend |
t_pair_point_tangent_t curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::control_points_ |
Vector of pair < Point, Tangent >.
Referenced by curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::cubic_hermite_spline(), curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::evalCoeffs(), curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::evalCubicHermiteSpline(), curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::getControlPoints(), and curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::operator()().
std::size_t curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::degree_ |
Degree (Cubic so degree 3)
std::size_t curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::dim_ |
vector_time_t curves::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 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 durations.
Referenced by curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::evalCoeffs().
std::size_t curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::size_ |
Number of control points (pairs).
Referenced by curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::cubic_hermite_spline(), curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::evalCoeffs(), curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::evalCubicHermiteSpline(), curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::operator()(), and curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::size().
Time curves::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.
Referenced by curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::operator()(), and curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::setTime().
Time curves::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.
Referenced by curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::operator()(), and curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::setTime().
vector_time_t curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::time_control_points_ |
Vector of Time corresponding to time of each N control points : time at .
Exemple : with values corresponding to times for
respectively.
Referenced by curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::evalCoeffs(), curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::evalCubicHermiteSpline(), curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::getTime(), curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::max(), curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::min(), and curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::setTime().