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
6400ecc5
Commit
6400ecc5
authored
Jan 03, 2019
by
Guilhem Saurel
Browse files
fix python tests
parent
368a0135
Changes
3
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
6400ecc5
...
...
@@ -20,7 +20,7 @@ include_directories(${EIGEN3_INCLUDE_DIR})
SETUP_PROJECT
()
OPTION
(
BUILD_PYTHON_INTERFACE
"Build the python binding"
O
FF
)
OPTION
(
BUILD_PYTHON_INTERFACE
"Build the python binding"
O
N
)
IF
(
BUILD_PYTHON_INTERFACE
)
# search for python
FINDPYTHON
(
2.7 REQUIRED
)
...
...
python/CMakeLists.txt
View file @
6400ecc5
...
...
@@ -22,3 +22,5 @@ PKG_CONFIG_USE_DEPENDENCY(spline eigenpy)
INSTALL
(
FILES
${
LIBRARY_OUTPUT_PATH
}
spline.so DESTINATION
${
PYTHON_SITELIB
}
)
ADD_PYTHON_UNIT_TEST
(
"python-spline"
"python/test/test.py"
"python"
)
python/test/test.py
View file @
6400ecc5
...
...
@@ -7,7 +7,7 @@ __EPS = 1e-6
waypoints
=
matrix
([[
1.
,
2.
,
3.
],
[
4.
,
5.
,
6.
]]).
transpose
()
waypoints6
=
matrix
([[
1.
,
2.
,
3.
,
7.
,
5.
,
5.
],
[
4.
,
5.
,
6.
,
4.
,
5.
,
6.
]]).
transpose
()
time_waypoints
=
matrix
([
0.
,
1.
])
time_waypoints
=
matrix
([
0.
,
1.
])
.
transpose
()
# testing bezier curve
a
=
bezier6
(
waypoints6
)
...
...
@@ -50,10 +50,10 @@ assert (prim(0) == matrix([0., 0., 0.])).all()
# testing bezier with constraints
c
=
curve_constraints
()
c
.
init_vel
=
matrix
([
0.
,
1.
,
1.
])
c
.
end_vel
=
matrix
([
0.
,
1.
,
1.
])
c
.
init_acc
=
matrix
([
0.
,
1.
,
-
1.
])
c
.
end_acc
=
matrix
([
0.
,
100.
,
1.
])
c
.
init_vel
=
matrix
([
0.
,
1.
,
1.
])
.
transpose
()
c
.
end_vel
=
matrix
([
0.
,
1.
,
1.
])
.
transpose
()
c
.
init_acc
=
matrix
([
0.
,
1.
,
-
1.
])
.
transpose
()
c
.
end_acc
=
matrix
([
0.
,
100.
,
1.
])
.
transpose
()
waypoints
=
matrix
([[
1.
,
2.
,
3.
],
[
4.
,
5.
,
6.
]]).
transpose
()
a
=
bezier
(
waypoints
,
c
)
...
...
@@ -84,10 +84,10 @@ c.end_vel
c
.
init_acc
c
.
end_acc
c
.
init_vel
=
matrix
([
0.
,
1.
,
1.
])
c
.
end_vel
=
matrix
([
0.
,
1.
,
1.
])
c
.
init_acc
=
matrix
([
0.
,
1.
,
1.
])
c
.
end_acc
=
matrix
([
0.
,
1.
,
1.
])
c
.
init_vel
=
matrix
([
0.
,
1.
,
1.
])
.
transpose
()
c
.
end_vel
=
matrix
([
0.
,
1.
,
1.
])
.
transpose
()
c
.
init_acc
=
matrix
([
0.
,
1.
,
1.
])
.
transpose
()
c
.
end_acc
=
matrix
([
0.
,
1.
,
1.
])
.
transpose
()
a
=
spline_deriv_constraint
(
waypoints
,
time_waypoints
)
a
=
spline_deriv_constraint
(
waypoints
,
time_waypoints
,
c
)
...
...
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