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
bf71c76b
Commit
bf71c76b
authored
Jan 04, 2019
by
Guilhem Saurel
Browse files
use standard python bindings name
parent
c8fd823c
Changes
3
Hide whitespace changes
Inline
Side-by-side
python/CMakeLists.txt
View file @
bf71c76b
cmake_minimum_required
(
VERSION 2.8
)
include_directories
(
"
${
EIGEN3_INCLUDE_DIR
}
"
)
STRING
(
REGEX REPLACE
"-"
"_"
PY_NAME
${
PROJECT_NAME
}
)
ADD_REQUIRED_DEPENDENCY
(
"eigenpy"
)
include_directories
(
"
${
PROJECT_SOURCE_DIR
}
/include"
)
FILE
(
GLOB_RECURSE HeaderFiles
"
${
PROJECT_SOURCE_DIR
}
/include/spline/*.h"
)
# Define the wrapper library that wraps our library
add_library
(
spline
SHARED spline_python.cpp
)
add_library
(
${
PY_NAME
}
SHARED spline_python.cpp
)
#~ target_link_libraries( centroidal_dynamics ${Boost_LIBRARIES} ${PROJECT_NAME} )
# don't prepend wrapper library name with lib
set_target_properties
(
spline
PROPERTIES PREFIX
""
)
set_target_properties
(
${
PY_NAME
}
PROPERTIES PREFIX
""
)
IF
(
APPLE
)
# We need to change the extension for python bindings
SET_TARGET_PROPERTIES
(
spline
PROPERTIES SUFFIX
".so"
)
# We need to change the extension for python bindings
SET_TARGET_PROPERTIES
(
${
PY_NAME
}
PROPERTIES SUFFIX
".so"
)
ENDIF
(
APPLE
)
PKG_CONFIG_USE_DEPENDENCY
(
spline
eigenpy
)
PKG_CONFIG_USE_DEPENDENCY
(
${
PY_NAME
}
eigenpy
)
INSTALL
(
TARGETS
spline
DESTINATION
${
PYTHON_SITELIB
}
)
TARGETS
${
PY_NAME
}
DESTINATION
${
PYTHON_SITELIB
}
)
ADD_PYTHON_UNIT_TEST
(
"python-spline"
"python/test/test.py"
"python"
)
python/spline_python.cpp
View file @
bf71c76b
...
...
@@ -205,7 +205,7 @@ void set_end_acc(curve_constraints_t& c, const point_t& val)
BOOST_PYTHON_MODULE
(
spline
)
BOOST_PYTHON_MODULE
(
hpp_
spline
)
{
/** BEGIN eigenpy init**/
eigenpy
::
enableEigenPy
();
...
...
python/test/test.py
View file @
bf71c76b
from
numpy
import
matrix
from
numpy.linalg
import
norm
from
spline
import
bezier
,
bezier6
,
curve_constraints
,
exact_cubic
,
from_bezier
,
polynom
,
spline_deriv_constraint
from
hpp_
spline
import
bezier
,
bezier6
,
curve_constraints
,
exact_cubic
,
from_bezier
,
polynom
,
spline_deriv_constraint
__EPS
=
1e-6
...
...
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