hpp-spline  4.10.0
template based classes for creating and manipulating spline and bezier curves. Comes with extra options specific to end-effector trajectories in robotics.
cubic_spline.h
Go to the documentation of this file.
1 
13 #ifndef _STRUCT_CUBICSPLINE
14 #define _STRUCT_CUBICSPLINE
15 
16 #include "MathDefs.h"
17 
18 #include "polynom.h"
19 
20 #include <stdexcept>
21 
22 namespace spline {
27 template <typename Point, typename T_Point>
28 T_Point make_cubic_vector(Point const& a, Point const& b, Point const& c, Point const& d) {
29  T_Point res;
30  res.push_back(a);
31  res.push_back(b);
32  res.push_back(c);
33  res.push_back(d);
34  return res;
35 }
36 
37 template <typename Time, typename Numeric, std::size_t Dim, bool Safe, typename Point, typename T_Point>
39  Point const& d, const Time min, const Time max) {
40  T_Point coeffs = make_cubic_vector<Point, T_Point>(a, b, c, d);
41  return polynom<Time, Numeric, Dim, Safe, Point, T_Point>(coeffs.begin(), coeffs.end(), min, max);
42 }
43 } // namespace spline
44 #endif //_STRUCT_CUBICSPLINE
polynom.h
Definition of a cubic spline.
spline::helpers::Time
double Time
Definition: effector_spline.h:27
spline::make_cubic_vector
T_Point make_cubic_vector(Point const &a, Point const &b, Point const &c, Point const &d)
Creates coefficient vector of a cubic spline defined on the interval [tBegin, tEnd]....
Definition: cubic_spline.h:28
spline::helpers::Point
Eigen::Matrix< Numeric, 3, 1 > Point
Definition: effector_spline.h:28
spline::polynom
Represents a polynomf arbitrary order defined on the interval [tBegin, tEnd]. It follows the equation...
Definition: polynom.h:34
MathDefs.h
spline::create_cubic
polynom< Time, Numeric, Dim, Safe, Point, T_Point > create_cubic(Point const &a, Point const &b, Point const &c, Point const &d, const Time min, const Time max)
Definition: cubic_spline.h:38
spline
Definition: bernstein.h:20
spline::helpers::T_Point
std::vector< Point, Eigen::aligned_allocator< Point > > T_Point
Definition: effector_spline.h:29