curve_constraint.h
Go to the documentation of this file.
1 
11 #ifndef _CLASS_CURVE_CONSTRAINT
12 #define _CLASS_CURVE_CONSTRAINT
13 
14 #include "MathDefs.h"
15 #include "serialization/archive.hpp"
16 #include "serialization/eigen-matrix.hpp"
17 #include <functional>
18 #include <vector>
19 
20 namespace ndcurves {
21 template <typename Point>
22 struct curve_constraints : serialization::Serializable {
23  typedef Point point_t;
24  curve_constraints(const size_t dim = 3)
25  : init_vel(point_t::Zero(dim)),
26  init_acc(point_t::Zero(dim)),
27  init_jerk(point_t::Zero(dim)),
28  end_vel(point_t::Zero(dim)),
29  end_acc(point_t::Zero(dim)),
30  end_jerk(point_t::Zero(dim)),
31  dim_(dim) {}
32 
34  : init_vel(other.init_vel),
35  init_acc(other.init_acc),
36  init_jerk(other.init_jerk),
37  end_vel(other.end_vel),
38  end_acc(other.end_acc),
39  end_jerk(other.end_jerk),
40  dim_(other.dim_) {}
41 
45  virtual bool operator==(const curve_constraints& other) const {
46  return dim_ == other.dim_ &&
47  init_vel == other.init_vel &&
48  init_acc == other.init_acc &&
49  init_jerk == other.init_jerk &&
50  end_vel == other.end_vel &&
51  end_acc == other.end_acc &&
52  end_jerk == other.end_jerk;
53  }
54 
58  virtual bool operator!=(const curve_constraints& other) const { return !(*this == other); }
59 
60 
61  virtual ~curve_constraints() {}
68  size_t dim_;
69 
70  // Serialization of the class
72  template <class Archive>
73  void serialize(Archive& ar, const unsigned int version) {
74  if (version) {
75  // Do something depending on version ?
76  }
77  ar& boost::serialization::make_nvp("init_vel", init_vel);
78  ar& boost::serialization::make_nvp("init_acc", init_acc);
79  ar& boost::serialization::make_nvp("init_jerk", init_jerk);
80  ar& boost::serialization::make_nvp("end_vel", end_vel);
81  ar& boost::serialization::make_nvp("end_acc", end_acc);
82  ar& boost::serialization::make_nvp("end_jerk", end_jerk);
83  ar& boost::serialization::make_nvp("dim", dim_);
84  }
85 };
86 } // namespace ndcurves
87 #endif //_CLASS_CUBICZEROVELACC
ndcurves::curve_constraints::curve_constraints
curve_constraints(const curve_constraints &other)
Definition: curve_constraint.h:33
ndcurves::curve_constraints::end_vel
point_t end_vel
Definition: curve_constraint.h:65
ndcurves::curve_constraints
Definition: curve_constraint.h:22
ndcurves::curve_constraints::init_vel
point_t init_vel
Definition: curve_constraint.h:62
ndcurves::curve_constraints::operator!=
virtual bool operator!=(const curve_constraints &other) const
Check if actual curve_constraint and other are different.
Definition: curve_constraint.h:58
ndcurves::curve_constraints::curve_constraints
curve_constraints(const size_t dim=3)
Definition: curve_constraint.h:24
ndcurves::curve_constraints::point_t
Point point_t
Definition: curve_constraint.h:23
ndcurves::curve_constraints::serialize
void serialize(Archive &ar, const unsigned int version)
Definition: curve_constraint.h:73
ndcurves::curve_constraints::end_jerk
point_t end_jerk
Definition: curve_constraint.h:67
ndcurves::curve_constraints::~curve_constraints
virtual ~curve_constraints()
Definition: curve_constraint.h:61
ndcurves
Definition: bernstein.h:20
ndcurves::curve_constraints::init_acc
point_t init_acc
Definition: curve_constraint.h:63
ndcurves::curve_constraints::operator==
virtual bool operator==(const curve_constraints &other) const
Check if actual curve_constraints and other are equal.
Definition: curve_constraint.h:45
MathDefs.h
ndcurves::curve_constraints::end_acc
point_t end_acc
Definition: curve_constraint.h:66
ndcurves::helpers::Point
Eigen::Matrix< Numeric, Eigen::Dynamic, 1 > Point
Definition: effector_spline.h:28
ndcurves::curve_constraints::access
friend class boost::serialization::access
Definition: curve_constraint.h:71
ndcurves::curve_constraints::dim_
size_t dim_
Definition: curve_constraint.h:68
ndcurves::curve_constraints::init_jerk
point_t init_jerk
Definition: curve_constraint.h:64