Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jason Chemin
curves
Commits
3f628465
Commit
3f628465
authored
Aug 22, 2019
by
JasonChmn
Committed by
Pierre Fernbach
Sep 03, 2019
Browse files
[Dynamic dim - hermite] Remove dimension from template
parent
49a95d7f
Changes
4
Hide whitespace changes
Inline
Side-by-side
include/curves/cubic_hermite_spline.h
View file @
3f628465
...
...
@@ -30,7 +30,7 @@ namespace curves
/// - crosses each of the waypoint given in its initialization (\f$P_0\f$, \f$P_1\f$,...,\f$P_N\f$).
/// - has its derivatives on \f$P_i\f$ and \f$P_{i+1}\f$ are \f$p'(t_{P_i}) = m_i\f$ and \f$p'(t_{P_{i+1}}) = m_{i+1}\f$.
///
template
<
typename
Time
=
double
,
typename
Numeric
=
Time
,
std
::
size_t
Dim
=
3
,
bool
Safe
=
false
,
template
<
typename
Time
=
double
,
typename
Numeric
=
Time
,
bool
Safe
=
false
,
typename
Point
=
Eigen
::
Matrix
<
Numeric
,
Eigen
::
Dynamic
,
1
>
>
struct
cubic_hermite_spline
:
public
curve_abc
<
Time
,
Numeric
,
Safe
,
Point
>
{
...
...
python/curves_python.cpp
View file @
3f628465
...
...
@@ -36,7 +36,7 @@ typedef std::vector<pair_point3_tangent_t,Eigen::aligned_allocator<pair_point3_t
typedef
curves
::
bezier_curve
<
real
,
real
,
3
,
true
,
point3_t
>
bezier3_t
;
typedef
curves
::
polynomial
<
real
,
real
,
3
,
true
,
point3_t
,
t_point3_t
>
polynomial3_t
;
typedef
curves
::
exact_cubic
<
real
,
real
,
3
,
true
,
point3_t
,
t_point3_t
>
exact_cubic3_t
;
typedef
curves
::
cubic_hermite_spline
<
real
,
real
,
3
,
true
,
point3_t
>
cubic_hermite_spline3_t
;
typedef
curves
::
cubic_hermite_spline
<
real
,
real
,
true
,
point3_t
>
cubic_hermite_spline3_t
;
typedef
polynomial3_t
::
coeff_t
coeff_t
;
typedef
std
::
pair
<
real
,
point3_t
>
waypoint3_t
;
typedef
std
::
vector
<
waypoint3_t
,
Eigen
::
aligned_allocator
<
point3_t
>
>
t_waypoint3_t
;
...
...
python/test/test.py
View file @
3f628465
...
...
@@ -129,6 +129,22 @@ class TestCurves(unittest.TestCase):
b
.
loadFromText
(
"serialization_curve.test"
)
self
.
assertTrue
((
a
(
0.4
)
==
b
(
0.4
)).
all
())
os
.
remove
(
"serialization_curve.test"
)
# test dim 4
points
=
matrix
([[
1.
,
2.
,
3.
,
4.
],
[
4.
,
5.
,
6.
,
7.
]]).
transpose
()
tangents
=
matrix
([[
1.
,
2.
,
3.
,
4.
],
[
4.
,
5.
,
6.
,
7.
]]).
transpose
()
time_points
=
matrix
([
0.
,
1.
]).
transpose
()
a
=
cubic_hermite_spline3
(
points
,
tangents
,
time_points
)
a
.
min
()
a
.
max
()
a
(
0.4
)
self
.
assertTrue
((
a
.
derivate
(
0.4
,
0
)
==
a
(
0.4
)).
all
())
a
.
derivate
(
0.4
,
2
)
# Test serialization
a
.
saveAsText
(
"serialization_curve.test"
)
b
=
cubic_hermite_spline3
()
b
.
loadFromText
(
"serialization_curve.test"
)
self
.
assertTrue
((
a
(
0.4
)
==
b
(
0.4
)).
all
())
os
.
remove
(
"serialization_curve.test"
)
return
def
test_piecewise_polynomial_curve
(
self
):
...
...
tests/Main.cpp
View file @
3f628465
...
...
@@ -32,7 +32,7 @@ namespace curves
typedef
exact_cubic
<
double
,
double
,
1
,
true
,
point_one
>
exact_cubic_one
;
typedef
std
::
pair
<
double
,
point_one
>
WaypointOne
;
typedef
std
::
vector
<
WaypointOne
>
T_WaypointOne
;
typedef
cubic_hermite_spline
<
double
,
double
,
3
,
true
,
point_t
>
cubic_hermite_spline_t
;
typedef
cubic_hermite_spline
<
double
,
double
,
true
,
point_t
>
cubic_hermite_spline_t
;
typedef
std
::
pair
<
point_t
,
tangent_t
>
pair_point_tangent_t
;
typedef
std
::
vector
<
pair_point_tangent_t
,
Eigen
::
aligned_allocator
<
pair_point_tangent_t
>
>
t_pair_point_tangent_t
;
typedef
piecewise_curve
<
double
,
double
,
3
,
true
,
point_t
,
t_point_t
,
polynomial_t
>
piecewise_polynomial_curve_t
;
...
...
@@ -1245,7 +1245,7 @@ void curveAbcDimDynamicTest(bool& error)
typedef
exact_cubic
<
double
,
double
,
3
,
true
>
exact_cubic_test_t
;
typedef
exact_cubic_test_t
::
spline_constraints
spline_constraints_test_t
;
typedef
bezier_curve
<
double
,
double
,
3
,
true
>
bezier_curve_test_t
;
typedef
cubic_hermite_spline
<
double
,
double
,
3
,
true
>
cubic_hermite_spline_test_t
;
typedef
cubic_hermite_spline
<
double
,
double
,
true
>
cubic_hermite_spline_test_t
;
curve_abc_test_t
*
pt_curve_abc
;
// POLYNOMIAL
point_t
a
(
1
,
1
,
1
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment