Commit 6400ecc5 authored by Guilhem Saurel's avatar Guilhem Saurel

fix python tests

parent 368a0135
......@@ -20,7 +20,7 @@ include_directories(${EIGEN3_INCLUDE_DIR})
SETUP_PROJECT()
OPTION (BUILD_PYTHON_INTERFACE "Build the python binding" OFF)
OPTION (BUILD_PYTHON_INTERFACE "Build the python binding" ON)
IF(BUILD_PYTHON_INTERFACE)
# search for python
FINDPYTHON(2.7 REQUIRED)
......
......@@ -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")
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment