integral_cost.h
Go to the documentation of this file.
1 
9 #ifndef _CLASS_QUADRATIC_COST
10 #define _CLASS_QUADRATIC_COST
11 
14 
15 #include <Eigen/Core>
16 
17 namespace ndcurves {
18 namespace optimization {
19 
21  DISTANCE = 0x000,
22  VELOCITY = 0x001,
23  ACCELERATION = 0x002,
24  JERK = 0x003,
25  FOURTH = 0x004,
26  FIFTH = 0x005
27 };
28 
29 template <typename Point, typename Numeric>
31  const std::size_t num_derivate) {
33  typedef typename bezier_t::t_point_t t_point_t;
34  typedef typename t_point_t::const_iterator cit_point_t;
35  bezier_t acc = pData.bezier->compute_derivate(num_derivate);
36  const t_point_t& wps = acc.waypoints();
38  bezier_product<Point, Numeric, cit_point_t>(wps.begin(), wps.end(), wps.begin(), wps.end(), pData.dim_));
39  return res;
40 }
41 
42 template <typename Point, typename Numeric>
44  const integral_cost_flag flag) {
45  std::size_t size = (std::size_t)(flag);
46  return compute_integral_cost_internal<Point, Numeric>(pData, size);
47 }
48 
49 } // namespace optimization
50 } // namespace ndcurves
51 #endif //_CLASS_QUADRATIC_COST
Definition: bernstein.h:20
Definition: integral_cost.h:26
Definition: integral_cost.h:21
quadratic_variable< Numeric > compute_integral_cost_internal(const problem_data< Point, Numeric > &pData, const std::size_t num_derivate)
Definition: integral_cost.h:30
bezier_curve< double, double, true, pointX_t > bezier_t
Definition: fwd.h:89
quadratic_variable< Numeric > compute_integral_cost(const problem_data< Point, Numeric > &pData, const integral_cost_flag flag)
Definition: integral_cost.h:43
Definition: integral_cost.h:24
integral_cost_flag
Definition: integral_cost.h:20
Definition: integral_cost.h:22
Definition: integral_cost.h:25
Definition: integral_cost.h:23
std::vector< point_t, Eigen::aligned_allocator< point_t > > t_point_t
Definition: bezier_curve.h:40
utils for defining optimization problems
Definition: bezier_curve.h:33
Definition: details.h:21
Definition: fwd.h:58
bezier_t * bezier
Definition: details.h:36
const std::size_t dim_
Definition: details.h:37