ndcurves
2.3.0
create and manipulate spline and bezier curves.
Toggle main menu visibility
Loading...
Searching...
No Matches
curve_constraint.h
Go to the documentation of this file.
1
7
8
#ifndef _CLASS_CURVE_CONSTRAINT
9
#define _CLASS_CURVE_CONSTRAINT
10
11
#include <functional>
12
#include <vector>
13
14
#include "
MathDefs.h
"
15
#include "
serialization/archive.hpp
"
16
#include "
serialization/eigen-matrix.hpp
"
17
18
namespace
ndcurves
{
19
template
<
typename
Po
int
>
20
struct
curve_constraints
:
serialization::Serializable
{
21
typedef
Point
point_t
;
22
curve_constraints
(
const
size_t
dim
= 3)
23
:
init_vel
(
point_t
::Zero(
dim
)),
24
init_acc
(
point_t
::Zero(
dim
)),
25
init_jerk
(
point_t
::Zero(
dim
)),
26
end_vel
(
point_t
::Zero(
dim
)),
27
end_acc
(
point_t
::Zero(
dim
)),
28
end_jerk
(
point_t
::Zero(
dim
)),
29
dim_
(
dim
) {}
30
31
curve_constraints
(
const
curve_constraints
& other)
32
:
init_vel
(other.
init_vel
),
33
init_acc
(other.
init_acc
),
34
init_jerk
(other.
init_jerk
),
35
end_vel
(other.
end_vel
),
36
end_acc
(other.
end_acc
),
37
end_jerk
(other.
end_jerk
),
38
dim_
(other.
dim_
) {}
39
43
virtual
bool
operator==
(
const
curve_constraints
& other)
const
{
44
return
dim_
== other.
dim_
&&
init_vel
== other.
init_vel
&&
45
init_acc
== other.
init_acc
&&
init_jerk
== other.
init_jerk
&&
46
end_vel
== other.
end_vel
&&
end_acc
== other.
end_acc
&&
47
end_jerk
== other.
end_jerk
;
48
}
49
53
virtual
bool
operator!=
(
const
curve_constraints
& other)
const
{
54
return
!(*
this
== other);
55
}
56
57
virtual
~curve_constraints
() {}
58
point_t
init_vel
;
59
point_t
init_acc
;
60
point_t
init_jerk
;
61
point_t
end_vel
;
62
point_t
end_acc
;
63
point_t
end_jerk
;
64
size_t
dim_
;
65
66
// Serialization of the class
67
friend
class
boost::serialization::access;
68
template
<
class
Archive>
69
void
serialize
(Archive& ar,
const
unsigned
int
version) {
70
if
(version) {
71
// Do something depending on version ?
72
}
73
ar& boost::serialization::make_nvp(
"init_vel"
,
init_vel
);
74
ar& boost::serialization::make_nvp(
"init_acc"
,
init_acc
);
75
ar& boost::serialization::make_nvp(
"init_jerk"
,
init_jerk
);
76
ar& boost::serialization::make_nvp(
"end_vel"
,
end_vel
);
77
ar& boost::serialization::make_nvp(
"end_acc"
,
end_acc
);
78
ar& boost::serialization::make_nvp(
"end_jerk"
,
end_jerk
);
79
ar& boost::serialization::make_nvp(
"dim"
,
dim_
);
80
}
81
};
82
}
// namespace ndcurves
83
#endif
//_CLASS_CUBICZEROVELACC
MathDefs.h
archive.hpp
eigen-matrix.hpp
ndcurves
Definition
bernstein.h:20
ndcurves::dim
virtual std::size_t dim() const
Get dimension of curve.
Definition
bezier_curve.h:693
ndcurves::curve_constraints::curve_constraints
curve_constraints(const size_t dim=3)
Definition
curve_constraint.h:22
ndcurves::curve_constraints< point_t >::init_acc
point_t init_acc
Definition
curve_constraint.h:59
ndcurves::curve_constraints< point_t >::end_acc
point_t end_acc
Definition
curve_constraint.h:62
ndcurves::curve_constraints::serialize
void serialize(Archive &ar, const unsigned int version)
Definition
curve_constraint.h:69
ndcurves::curve_constraints< point_t >::init_jerk
point_t init_jerk
Definition
curve_constraint.h:60
ndcurves::curve_constraints::curve_constraints
curve_constraints(const curve_constraints &other)
Definition
curve_constraint.h:31
ndcurves::curve_constraints< point_t >::end_jerk
point_t end_jerk
Definition
curve_constraint.h:63
ndcurves::curve_constraints< point_t >::init_vel
point_t init_vel
Definition
curve_constraint.h:58
ndcurves::curve_constraints< point_t >::end_vel
point_t end_vel
Definition
curve_constraint.h:61
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:43
ndcurves::curve_constraints< point_t >::dim_
size_t dim_
Definition
curve_constraint.h:64
ndcurves::curve_constraints::~curve_constraints
virtual ~curve_constraints()
Definition
curve_constraint.h:57
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:53
ndcurves::curve_constraints< point_t >::point_t
point_t point_t
Definition
curve_constraint.h:21
ndcurves::serialization::Serializable
Definition
archive.hpp:41
include
ndcurves
curve_constraint.h
Generated by
1.17.0