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
Guilhem Saurel
ndcurves
Commits
296d4ac4
Commit
296d4ac4
authored
Apr 12, 2019
by
JasonChmn
Browse files
change namespace in all folder of curves, make test 100% OK
parent
7d23ecc7
Changes
3
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
296d4ac4
cmake_minimum_required
(
VERSION 2.6
)
project
(
splin
e
)
project
(
curv
e
)
INCLUDE
(
cmake/base.cmake
)
INCLUDE
(
cmake/test.cmake
)
INCLUDE
(
cmake/python.cmake
)
...
...
python/spline_python.cpp
View file @
296d4ac4
#include
"hpp/
splin
e/bezier_curve.h"
#include
"hpp/
splin
e/polynom.h"
#include
"hpp/
splin
e/exact_cubic.h"
#include
"hpp/
splin
e/spline_deriv_constraint.h"
#include
"hpp/
splin
e/curve_constraint.h"
#include
"hpp/
splin
e/bezier_polynom_conversion.h"
#include
"hpp/
splin
e/bernstein.h"
#include
"hpp/
curv
e/bezier_curve.h"
#include
"hpp/
curv
e/polynom.h"
#include
"hpp/
curv
e/exact_cubic.h"
#include
"hpp/
curv
e/spline_deriv_constraint.h"
#include
"hpp/
curv
e/curve_constraint.h"
#include
"hpp/
curv
e/bezier_polynom_conversion.h"
#include
"hpp/
curv
e/bernstein.h"
#include
<vector>
...
...
@@ -30,20 +30,20 @@ typedef std::vector<Waypoint> T_Waypoint;
typedef
std
::
pair
<
real
,
point6_t
>
Waypoint6
;
typedef
std
::
vector
<
Waypoint6
>
T_Waypoint6
;
typedef
splin
e
::
bezier_curve
<
real
,
real
,
3
,
true
,
point_t
>
bezier_t
;
typedef
splin
e
::
bezier_curve
<
real
,
real
,
6
,
true
,
point6_t
>
bezier6_t
;
typedef
splin
e
::
polynom
<
real
,
real
,
3
,
true
,
point_t
,
t_point_t
>
polynom_t
;
typedef
splin
e
::
exact_cubic
<
real
,
real
,
3
,
true
,
point_t
,
t_point_t
>
exact_cubic_t
;
typedef
curv
e
::
bezier_curve
<
real
,
real
,
3
,
true
,
point_t
>
bezier_t
;
typedef
curv
e
::
bezier_curve
<
real
,
real
,
6
,
true
,
point6_t
>
bezier6_t
;
typedef
curv
e
::
polynom
<
real
,
real
,
3
,
true
,
point_t
,
t_point_t
>
polynom_t
;
typedef
curv
e
::
exact_cubic
<
real
,
real
,
3
,
true
,
point_t
,
t_point_t
>
exact_cubic_t
;
typedef
polynom_t
::
coeff_t
coeff_t
;
typedef
std
::
pair
<
real
,
point_t
>
waypoint_t
;
typedef
std
::
vector
<
waypoint_t
,
Eigen
::
aligned_allocator
<
point_t
>
>
t_waypoint_t
;
typedef
splin
e
::
Bern
<
double
>
bernstein_t
;
typedef
curv
e
::
Bern
<
double
>
bernstein_t
;
typedef
splin
e
::
spline_deriv_constraint
<
real
,
real
,
3
,
true
,
point_t
,
t_point_t
>
spline_deriv_constraint_t
;
typedef
splin
e
::
curve_constraints
<
point_t
>
curve_constraints_t
;
typedef
splin
e
::
curve_constraints
<
point6_t
>
curve_constraints6_t
;
typedef
curv
e
::
spline_deriv_constraint
<
real
,
real
,
3
,
true
,
point_t
,
t_point_t
>
spline_deriv_constraint_t
;
typedef
curv
e
::
curve_constraints
<
point_t
>
curve_constraints_t
;
typedef
curv
e
::
curve_constraints
<
point6_t
>
curve_constraints6_t
;
/*** TEMPLATE SPECIALIZATION FOR PYTHON ****/
EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION
(
bernstein_t
)
...
...
@@ -54,7 +54,7 @@ EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION(exact_cubic_t)
EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION
(
curve_constraints_t
)
EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION
(
spline_deriv_constraint_t
)
namespace
splin
e
namespace
curv
e
{
using
namespace
boost
::
python
;
template
<
typename
PointList
,
typename
T_Point
>
...
...
tests/Main.cpp
View file @
296d4ac4
#include
"hpp/
splin
e/exact_cubic.h"
#include
"hpp/
splin
e/bezier_curve.h"
#include
"hpp/
splin
e/polynom.h"
#include
"hpp/
splin
e/spline_deriv_constraint.h"
#include
"hpp/
splin
e/helpers/effector_spline.h"
#include
"hpp/
splin
e/helpers/effector_spline_rotation.h"
#include
"hpp/
splin
e/bezier_polynom_conversion.h"
#include
"hpp/
curv
e/exact_cubic.h"
#include
"hpp/
curv
e/bezier_curve.h"
#include
"hpp/
curv
e/polynom.h"
#include
"hpp/
curv
e/spline_deriv_constraint.h"
#include
"hpp/
curv
e/helpers/effector_spline.h"
#include
"hpp/
curv
e/helpers/effector_spline_rotation.h"
#include
"hpp/
curv
e/bezier_polynom_conversion.h"
#include
<string>
#include
<iostream>
...
...
@@ -13,7 +13,7 @@
using
namespace
std
;
namespace
splin
e
namespace
curv
e
{
typedef
Eigen
::
Vector3d
point_t
;
typedef
std
::
vector
<
point_t
,
Eigen
::
aligned_allocator
<
point_t
>
>
t_point_t
;
...
...
@@ -46,9 +46,9 @@ bool QuasiEqual(const double a, const double b, const float margin)
const
double
margin
=
0.001
;
}
// namespace
splin
e
}
// namespace
curv
e
using
namespace
splin
e
;
using
namespace
curv
e
;
ostream
&
operator
<<
(
ostream
&
os
,
const
point_t
&
pt
)
{
...
...
@@ -456,7 +456,7 @@ void BezierToPolynomConversionTest(bool& error)
/*Exact Cubic Function tests*/
void
ExactCubicNoErrorTest
(
bool
&
error
)
{
splin
e
::
T_Waypoint
waypoints
;
curv
e
::
T_Waypoint
waypoints
;
for
(
double
i
=
0
;
i
<=
1
;
i
=
i
+
0.2
)
{
waypoints
.
push_back
(
std
::
make_pair
(
i
,
point_t
(
i
,
i
,
i
)));
...
...
@@ -502,7 +502,7 @@ void ExactCubicNoErrorTest(bool& error)
/*Exact Cubic Function tests*/
void
ExactCubicTwoPointsTest
(
bool
&
error
)
{
splin
e
::
T_Waypoint
waypoints
;
curv
e
::
T_Waypoint
waypoints
;
for
(
double
i
=
0
;
i
<
2
;
++
i
)
{
waypoints
.
push_back
(
std
::
make_pair
(
i
,
point_t
(
i
,
i
,
i
)));
...
...
@@ -519,7 +519,7 @@ void ExactCubicTwoPointsTest(bool& error)
void
ExactCubicOneDimTest
(
bool
&
error
)
{
splin
e
::
T_WaypointOne
waypoints
;
curv
e
::
T_WaypointOne
waypoints
;
point_one
zero
;
zero
(
0
,
0
)
=
9
;
point_one
one
;
one
(
0
,
0
)
=
14
;
point_one
two
;
two
(
0
,
0
)
=
25
;
...
...
@@ -536,7 +536,7 @@ void ExactCubicOneDimTest(bool& error)
ComparePoints
(
one
,
res1
,
errmsg
,
error
);
}
void
CheckWayPointConstraint
(
const
std
::
string
&
errmsg
,
const
double
step
,
const
splin
e
::
T_Waypoint
&
/*wayPoints*/
,
const
exact_cubic_t
*
curve
,
bool
&
error
)
void
CheckWayPointConstraint
(
const
std
::
string
&
errmsg
,
const
double
step
,
const
curv
e
::
T_Waypoint
&
/*wayPoints*/
,
const
exact_cubic_t
*
curve
,
bool
&
error
)
{
point_t
res1
;
for
(
double
i
=
0
;
i
<=
1
;
i
=
i
+
step
)
...
...
@@ -555,7 +555,7 @@ void CheckDerivative(const std::string& errmsg, const double eval_point, const s
void
ExactCubicPointsCrossedTest
(
bool
&
error
)
{
splin
e
::
T_Waypoint
waypoints
;
curv
e
::
T_Waypoint
waypoints
;
for
(
double
i
=
0
;
i
<=
1
;
i
=
i
+
0.2
)
{
waypoints
.
push_back
(
std
::
make_pair
(
i
,
point_t
(
i
,
i
,
i
)));
...
...
@@ -568,7 +568,7 @@ void ExactCubicPointsCrossedTest(bool& error)
void
ExactCubicVelocityConstraintsTest
(
bool
&
error
)
{
splin
e
::
T_Waypoint
waypoints
;
curv
e
::
T_Waypoint
waypoints
;
for
(
double
i
=
0
;
i
<=
1
;
i
=
i
+
0.2
)
{
waypoints
.
push_back
(
std
::
make_pair
(
i
,
point_t
(
i
,
i
,
i
)));
...
...
@@ -617,7 +617,7 @@ void CheckPointOnline(const std::string& errmsg, const point_t& A, const point_t
void
EffectorTrajectoryTest
(
bool
&
error
)
{
// create arbitrary trajectory
splin
e
::
T_Waypoint
waypoints
;
curv
e
::
T_Waypoint
waypoints
;
for
(
double
i
=
0
;
i
<=
10
;
i
=
i
+
2
)
{
waypoints
.
push_back
(
std
::
make_pair
(
i
,
point_t
(
i
,
i
,
i
)));
...
...
@@ -674,7 +674,7 @@ double GetXRotFromQuat(helpers::quat_ref_const_t q)
void
EffectorSplineRotationNoRotationTest
(
bool
&
error
)
{
// create arbitrary trajectory
splin
e
::
T_Waypoint
waypoints
;
curv
e
::
T_Waypoint
waypoints
;
for
(
double
i
=
0
;
i
<=
10
;
i
=
i
+
2
)
{
waypoints
.
push_back
(
std
::
make_pair
(
i
,
point_t
(
i
,
i
,
i
)));
...
...
@@ -696,7 +696,7 @@ void EffectorSplineRotationNoRotationTest(bool& error)
void
EffectorSplineRotationRotationTest
(
bool
&
error
)
{
// create arbitrary trajectory
splin
e
::
T_Waypoint
waypoints
;
curv
e
::
T_Waypoint
waypoints
;
for
(
double
i
=
0
;
i
<=
10
;
i
=
i
+
2
)
{
waypoints
.
push_back
(
std
::
make_pair
(
i
,
point_t
(
i
,
i
,
i
)));
...
...
@@ -719,7 +719,7 @@ void EffectorSplineRotationRotationTest(bool& error)
void
EffectorSplineRotationWayPointRotationTest
(
bool
&
error
)
{
// create arbitrary trajectory
splin
e
::
T_Waypoint
waypoints
;
curv
e
::
T_Waypoint
waypoints
;
for
(
double
i
=
0
;
i
<=
10
;
i
=
i
+
2
)
{
waypoints
.
push_back
(
std
::
make_pair
(
i
,
point_t
(
i
,
i
,
i
)));
...
...
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