Commit 96101e97 authored by Pierre Fernbach's avatar Pierre Fernbach
Browse files

Add serialization to curve_constraints

parent 90b35dbe
......@@ -12,13 +12,14 @@
#include "MathDefs.h"
#include "serialization/archive.hpp"
#include "serialization/eigen-matrix.hpp"
#include <functional>
#include <vector>
namespace curves {
template <typename Point>
struct curve_constraints {
struct curve_constraints : serialization::Serializable {
typedef Point point_t;
curve_constraints(const size_t dim = 3)
: init_vel(point_t::Zero(dim)),
......@@ -46,6 +47,22 @@ struct curve_constraints {
point_t end_acc;
point_t end_jerk;
size_t dim_;
// Serialization of the class
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive& ar, const unsigned int version) {
if (version) {
// Do something depending on version ?
ar& boost::serialization::make_nvp("init_vel", init_vel);
ar& boost::serialization::make_nvp("init_acc", init_acc);
ar& boost::serialization::make_nvp("init_jerk", init_jerk);
ar& boost::serialization::make_nvp("end_vel", end_vel);
ar& boost::serialization::make_nvp("end_acc", end_acc);
ar& boost::serialization::make_nvp("end_jerk", end_jerk);
ar& boost::serialization::make_nvp("dim", dim_);
} // namespace curves
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment