Skip to content
GitLab
Menu
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
9ae40c19
Commit
9ae40c19
authored
Apr 12, 2019
by
JasonChmn
Browse files
change name of hpp-spline for curves, make test 100% OK
parent
296d4ac4
Changes
3
Show whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
9ae40c19
...
...
@@ -5,7 +5,7 @@ INCLUDE(cmake/test.cmake)
INCLUDE
(
cmake/python.cmake
)
INCLUDE
(
cmake/hpp.cmake
)
SET
(
PROJECT_NAME
hpp-spline
)
SET
(
PROJECT_NAME
curves
)
SET
(
PROJECT_DESCRIPTION
"template based classes for creating and manipulating spline and bezier curves. Comes with extra options specific to end-effector trajectories in robotics."
)
...
...
python/spline_python.cpp
View file @
9ae40c19
...
...
@@ -30,7 +30,7 @@ typedef std::vector<Waypoint> T_Waypoint;
typedef
std
::
pair
<
real
,
point6_t
>
Waypoint6
;
typedef
std
::
vector
<
Waypoint6
>
T_Waypoint6
;
typedef
curve
::
bezier_curve
<
real
,
real
,
3
,
true
,
point_t
>
bezier_t
;
typedef
curve
::
bezier_curve
<
real
,
real
,
3
,
true
,
point_t
>
bezier
3
_t
;
typedef
curve
::
bezier_curve
<
real
,
real
,
6
,
true
,
point6_t
>
bezier6_t
;
typedef
curve
::
polynom
<
real
,
real
,
3
,
true
,
point_t
,
t_point_t
>
polynom_t
;
typedef
curve
::
exact_cubic
<
real
,
real
,
3
,
true
,
point_t
,
t_point_t
>
exact_cubic_t
;
...
...
@@ -47,7 +47,7 @@ typedef curve::curve_constraints<point6_t> curve_constraints6_t;
/*** TEMPLATE SPECIALIZATION FOR PYTHON ****/
EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION
(
bernstein_t
)
EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION
(
bezier_t
)
EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION
(
bezier
3
_t
)
EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION
(
bezier6_t
)
EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION
(
polynom_t
)
EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION
(
exact_cubic_t
)
...
...
@@ -81,21 +81,21 @@ Bezier* wrapBezierConstructorConstraintsTemplate(const PointList& array, const C
}
/*3D constructors */
bezier_t
*
wrapBezierConstructor
(
const
point_list_t
&
array
)
bezier
3
_t
*
wrapBezierConstructor
(
const
point_list_t
&
array
)
{
return
wrapBezierConstructorTemplate
<
bezier_t
,
point_list_t
,
t_point_t
>
(
array
)
;
return
wrapBezierConstructorTemplate
<
bezier
3
_t
,
point_list_t
,
t_point_t
>
(
array
)
;
}
bezier_t
*
wrapBezierConstructorBounds
(
const
point_list_t
&
array
,
const
real
ub
)
bezier
3
_t
*
wrapBezierConstructorBounds
(
const
point_list_t
&
array
,
const
real
ub
)
{
return
wrapBezierConstructorTemplate
<
bezier_t
,
point_list_t
,
t_point_t
>
(
array
,
ub
)
;
return
wrapBezierConstructorTemplate
<
bezier
3
_t
,
point_list_t
,
t_point_t
>
(
array
,
ub
)
;
}
bezier_t
*
wrapBezierConstructorConstraints
(
const
point_list_t
&
array
,
const
curve_constraints_t
&
constraints
)
bezier
3
_t
*
wrapBezierConstructorConstraints
(
const
point_list_t
&
array
,
const
curve_constraints_t
&
constraints
)
{
return
wrapBezierConstructorConstraintsTemplate
<
bezier_t
,
point_list_t
,
t_point_t
,
curve_constraints_t
>
(
array
,
constraints
)
;
return
wrapBezierConstructorConstraintsTemplate
<
bezier
3
_t
,
point_list_t
,
t_point_t
,
curve_constraints_t
>
(
array
,
constraints
)
;
}
bezier_t
*
wrapBezierConstructorBoundsConstraints
(
const
point_list_t
&
array
,
const
curve_constraints_t
&
constraints
,
const
real
ub
)
bezier
3
_t
*
wrapBezierConstructorBoundsConstraints
(
const
point_list_t
&
array
,
const
curve_constraints_t
&
constraints
,
const
real
ub
)
{
return
wrapBezierConstructorConstraintsTemplate
<
bezier_t
,
point_list_t
,
t_point_t
,
curve_constraints_t
>
(
array
,
constraints
,
ub
)
;
return
wrapBezierConstructorConstraintsTemplate
<
bezier
3
_t
,
point_list_t
,
t_point_t
,
curve_constraints_t
>
(
array
,
constraints
,
ub
)
;
}
/*END 3D constructors */
/*6D constructors */
...
...
@@ -205,7 +205,7 @@ void set_end_acc(curve_constraints_t& c, const point_t& val)
BOOST_PYTHON_MODULE
(
hpp_spline
)
BOOST_PYTHON_MODULE
(
curves
)
{
/** BEGIN eigenpy init**/
eigenpy
::
enableEigenPy
();
...
...
@@ -241,21 +241,21 @@ BOOST_PYTHON_MODULE(hpp_spline)
/** END bezier curve**/
/** BEGIN bezier curve**/
class_
<
bezier_t
>
class_
<
bezier
3
_t
>
(
"bezier"
,
no_init
)
.
def
(
"__init__"
,
make_constructor
(
&
wrapBezierConstructor
))
.
def
(
"__init__"
,
make_constructor
(
&
wrapBezierConstructorBounds
))
.
def
(
"__init__"
,
make_constructor
(
&
wrapBezierConstructorConstraints
))
.
def
(
"__init__"
,
make_constructor
(
&
wrapBezierConstructorBoundsConstraints
))
.
def
(
"min"
,
&
bezier_t
::
min
)
.
def
(
"max"
,
&
bezier_t
::
max
)
.
def
(
"__call__"
,
&
bezier_t
::
operator
())
.
def
(
"derivate"
,
&
bezier_t
::
derivate
)
.
def
(
"compute_derivate"
,
&
bezier_t
::
compute_derivate
)
.
def
(
"compute_primitive"
,
&
bezier_t
::
compute_primitive
)
.
def
(
"waypoints"
,
&
wayPointsToList
<
bezier_t
,
3
>
)
.
def_readonly
(
"degree"
,
&
bezier_t
::
degree_
)
.
def_readonly
(
"nbWaypoints"
,
&
bezier_t
::
size_
)
.
def
(
"min"
,
&
bezier
3
_t
::
min
)
.
def
(
"max"
,
&
bezier
3
_t
::
max
)
.
def
(
"__call__"
,
&
bezier
3
_t
::
operator
())
.
def
(
"derivate"
,
&
bezier
3
_t
::
derivate
)
.
def
(
"compute_derivate"
,
&
bezier
3
_t
::
compute_derivate
)
.
def
(
"compute_primitive"
,
&
bezier
3
_t
::
compute_primitive
)
.
def
(
"waypoints"
,
&
wayPointsToList
<
bezier
3
_t
,
3
>
)
.
def_readonly
(
"degree"
,
&
bezier
3
_t
::
degree_
)
.
def_readonly
(
"nbWaypoints"
,
&
bezier
3
_t
::
size_
)
;
/** END bezier curve**/
...
...
@@ -314,7 +314,7 @@ BOOST_PYTHON_MODULE(hpp_spline)
/** END bernstein polynom**/
/** BEGIN Bezier to polynom conversion**/
def
(
"from_bezier"
,
from_bezier
<
bezier_t
,
polynom_t
>
);
def
(
"from_bezier"
,
from_bezier
<
bezier
3
_t
,
polynom_t
>
);
/** END Bezier to polynom conversion**/
...
...
python/test/test.py
View file @
9ae40c19
...
...
@@ -6,7 +6,7 @@ from numpy import matrix
from
numpy.linalg
import
norm
from
numpy.testing
import
assert_allclose
from
hpp_spline
import
bezier
,
bezier6
,
curve_constraints
,
exact_cubic
,
from_bezier
,
polynom
,
spline_deriv_constraint
from
curves
import
bezier
,
bezier6
,
curve_constraints
,
exact_cubic
,
from_bezier
,
polynom
,
spline_deriv_constraint
class
TestSpline
(
unittest
.
TestCase
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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