|
| 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...
|
|
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. More...
|
|
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, const std::size_t order) const |
| Evaluate the derivative of order N of spline at time t. More...
|
|
cubic_hermite_spline_t | compute_derivate (const std::size_t) const |
|
cubic_hermite_spline_t * | compute_derivate_ptr (const std::size_t order) const |
| Compute the derived curve at order N. 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 . More...
|
|
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...
|
|
virtual std::size_t | degree () const |
| Get the degree of the curve. More...
|
|
template<class Archive > |
void | serialize (Archive &ar, const unsigned int version) |
|
| curve_abc () |
| Constructor. More...
|
|
virtual | ~curve_abc () |
| Destructor. More...
|
|
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 treshold. More...
|
|
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 equals given a precision treshold Only two curves of the same class can be approximately equals, for comparison between different type of curves see isEquivalent. More...
|
|
std::pair< time_t, time_t > | timeRange () |
|
void | serialize (Archive &, const unsigned int version) |
|
template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
template<typename In >
Constructor.
- Parameters
-
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_.
template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
Get the degree of the curve.
- Returns
, the degree of the curve.
Implements curves::curve_abc< Time, Numeric, Safe, Point >.
References curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::degree_.
Referenced by curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::isApprox().
template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
static void curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::evalCoeffs |
( |
const Numeric |
t, |
|
|
Numeric & |
h00, |
|
|
Numeric & |
h10, |
|
|
Numeric & |
h01, |
|
|
Numeric & |
h11, |
|
|
std::size_t |
degree_derivative |
|
) |
| |
|
inlinestatic |
Evaluate coefficient for polynom of cubic hermite spline.
Coefficients of polynom :
;
;
;
.
From it, we can calculate their derivate order N :
,
,
,
. - Parameters
-
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().
template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
Point curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::evalCubicHermiteSpline |
( |
const Numeric |
t, |
|
|
std::size_t |
degree_derivative |
|
) |
| const |
|
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
.
- Parameters
-
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) |
- Returns
- point corresponding
on spline at time t or its derivate order N
.
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()().
template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
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
-
other | the other curve to check |
prec | the precision treshold, default Eigen::NumTraits<Numeric>::dummy_precision() |
- Returns
- true is the two curves are approximately equals
References curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::control_points_, curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::degree(), curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::degree_, curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::dim(), 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 >::max(), curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::min(), curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::size(), 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 >::isApprox(), and curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::operator==().
template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
Get the maximum time for which the curve is defined.
- Returns
, upper bound of time range.
Implements curves::curve_abc< Time, Numeric, Safe, Point >.
References curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::time_control_points_.
Referenced by curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::isApprox().
template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
Get the minimum time for which the curve is defined.
- Returns
, lower bound of time range.
Implements curves::curve_abc< Time, Numeric, Safe, Point >.
References curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::time_control_points_.
Referenced by curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::isApprox().
template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
Evaluation of the cubic hermite spline at time t.
- Parameters
-
t | : time when to evaluate the spline. |
- Returns
point corresponding on spline at time t.
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_.
template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
Set time of each control point of cubic hermite spline.
Set duration of each spline, Exemple :
with values corresponding to times for
respectively.
- Parameters
-
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().
template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
Get number of control points contained in the trajectory.
- Returns
- number of control points.
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 >::isApprox(), curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::numIntervals(), and curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::setTime().
template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
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(), and curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::isApprox().
template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
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 >::isApprox(), curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::operator()(), and curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::setTime().
template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
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 >::isApprox(), curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::operator()(), and curves::cubic_hermite_spline< Time, Numeric, Safe, Point >::setTime().
template<typename Time = double, typename Numeric = Time, bool Safe = false, typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>>
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 >::isApprox(), 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().