-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from ju6ge/casadi
RBDL version 3.1.2 with Casadi \o/
- Loading branch information
Showing
50 changed files
with
3,272 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,135 @@ | ||
debug | ||
build | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# dotenv | ||
.env | ||
|
||
# virtualenv | ||
.venv | ||
venv/ | ||
ENV/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
Pipfile.lock | ||
.idea | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
|
||
# Visual code | ||
.vscode | ||
|
||
# Visual studio | ||
.vs | ||
|
||
# CMake | ||
CMakeCache.txt | ||
CMakeFiles | ||
CMakeScripts | ||
Testing | ||
Makefile | ||
cmake_install.cmake | ||
install_manifest.txt | ||
compile_commands.json | ||
CTestTestfile.cmake | ||
CMakeLists.txt.user | ||
|
||
# Specific project files and folders | ||
build* | ||
debug* | ||
install* | ||
*.user* | ||
includes/numpy | ||
S2MSource | ||
pyomeca | ||
release* | ||
*.DS_Store | ||
|
||
doc/html | ||
**/build | ||
CMakeLists.txt.user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# - Find Casadi | ||
# Find the native Casadi includes and libraries | ||
# | ||
# Casadi_INCLUDE_DIR - where to find casadi.hpp, etc. | ||
# Casadi_LIBRARIES - List of libraries when using Casadi. | ||
# Casadi_FOUND - True if Casadi is found. | ||
|
||
if (Casadi_INCLUDE_DIR) | ||
# Already in cache, be silent | ||
set (Casadi_FIND_QUIETLY TRUE) | ||
endif (Casadi_INCLUDE_DIR) | ||
|
||
find_path (Casadi_INCLUDE_DIR "casadi.hpp" | ||
PATHS ${CMAKE_INSTALL_PREFIX}/include/casadi ${CMAKE_INSTALL_PREFIX}/Library/include/casadi | ||
) | ||
find_library (Casadi_LIBRARY NAMES casadi | ||
PATHS ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/Library/lib | ||
) | ||
|
||
# handle the QUIETLY and REQUIRED arguments and set Casadi_FOUND to TRUE if | ||
# all listed variables are TRUE | ||
include (FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args (Casadi DEFAULT_MSG | ||
Casadi_LIBRARY | ||
Casadi_INCLUDE_DIR | ||
) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
CMAKE_MINIMUM_REQUIRED(VERSION 3.10) | ||
|
||
SET ( RBDL_VERSION_MAJOR 3 ) | ||
SET ( RBDL_VERSION_MINOR 0 ) | ||
SET ( RBDL_VERSION_PATCH 0 ) | ||
SET ( RBDL_VERSION_MINOR 1 ) | ||
SET ( RBDL_VERSION_PATCH 2 ) | ||
SET ( RBDL_VERSION | ||
${RBDL_VERSION_MAJOR}.${RBDL_VERSION_MINOR}.${RBDL_VERSION_PATCH} | ||
) | ||
|
@@ -16,7 +16,6 @@ LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake ) | |
|
||
INCLUDE_DIRECTORIES ( | ||
${CMAKE_CURRENT_SOURCE_DIR}/include | ||
${CMAKE_CURRENT_BINARY_DIR}/include | ||
) | ||
|
||
|
||
|
@@ -36,15 +35,6 @@ IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) | |
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") | ||
ENDIF() | ||
|
||
# Find and use the system's Eigen3 library | ||
FIND_PACKAGE (Eigen3 3.0.0) | ||
|
||
IF (NOT EIGEN3_FOUND) | ||
MESSAGE (WARNING "Could not find Eigen3 on your system. Please install it!") | ||
ENDIF (NOT EIGEN3_FOUND) | ||
|
||
INCLUDE_DIRECTORIES (${EIGEN3_INCLUDE_DIR}) | ||
|
||
IF (MSVC) | ||
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj /permissive- /std:c++17") | ||
ENDIF (MSVC) | ||
|
@@ -61,6 +51,9 @@ ELSE( ${CMAKE_VERSION} VERSION_LESS 3.12.0 ) | |
ENDIF( ${CMAKE_VERSION} VERSION_LESS 3.12.0 ) | ||
|
||
|
||
SET (RBDL_BUILD_COMPILER_ID ${CMAKE_CXX_COMPILER_ID}) | ||
SET (RBDL_BUILD_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION}) | ||
|
||
# Options | ||
SET (RBDL_BUILD_STATIC_DEFAULT OFF) | ||
OPTION (RBDL_BUILD_STATIC "Build statically linked library (otherwise dynamiclly linked)" ${RBDL_BUILD_STATIC_DEFAULT}) | ||
|
@@ -76,10 +69,17 @@ OPTION (RBDL_BUILD_ADDON_MUSCLE "Build the muscle library" OFF) | |
OPTION (RBDL_BUILD_ADDON_MUSCLE_FITTING "Build muscle library fitting functions (requires Ipopt)" OFF) | ||
OPTION (RBDL_BUILD_EXECUTABLES "Build addon executables, disable this if you only want to build the libraries." ON) | ||
OPTION (RBDL_USE_PYTHON_2 "Use python 2 instead of python 3" OFF) | ||
OPTION (RBDL_USE_CASADI_MATH "Use the CasADi backend" OFF) | ||
|
||
SET (RBDL_BUILD_COMPILER_ID ${CMAKE_CXX_COMPILER_ID}) | ||
SET (RBDL_BUILD_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION}) | ||
|
||
# Find and use the system's Eigen3 library | ||
FIND_PACKAGE (Eigen3 3.0.0) | ||
|
||
IF (NOT EIGEN3_FOUND) | ||
MESSAGE (WARNING "Could not find Eigen3 on your system. Please install it!") | ||
ENDIF (NOT EIGEN3_FOUND) | ||
|
||
INCLUDE_DIRECTORIES (${EIGEN3_INCLUDE_DIR}) | ||
|
||
# Addons | ||
IF (RBDL_BUILD_ADDON_URDFREADER) | ||
|
@@ -90,7 +90,9 @@ IF (RBDL_BUILD_ADDON_BENCHMARK) | |
ADD_SUBDIRECTORY ( addons/benchmark ) | ||
ENDIF (RBDL_BUILD_ADDON_BENCHMARK) | ||
|
||
|
||
IF (RBDL_USE_CASADI_MATH) | ||
ADD_SUBDIRECTORY( casadi ) | ||
ENDIF (RBDL_USE_CASADI_MATH) | ||
|
||
IF(RBDL_BUILD_ADDON_MUSCLE) | ||
SET(RBDL_BUILD_ADDON_GEOMETRY ON CACHE BOOL "Build the geometry library" FORCE) | ||
|
@@ -138,16 +140,13 @@ SET ( RBDL_SOURCES | |
src/Kinematics.cc | ||
) | ||
|
||
#IF (MSVC AND NOT RBDL_BUILD_STATIC) | ||
# MESSAGE (FATAL_ERROR, "Compiling RBDL as a DLL currently not supported. Please enable RBDL_BUILD_STATIC.") | ||
#ENDIF (MSVC AND NOT RBDL_BUILD_STATIC) | ||
|
||
# Static / dynamic builds | ||
IF (RBDL_BUILD_STATIC) | ||
ADD_LIBRARY ( rbdl-static STATIC ${RBDL_SOURCES} ) | ||
IF (NOT WIN32) | ||
TARGET_INCLUDE_DIRECTORIES(rbdl-static PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/include) | ||
IF (NOT MSVC) | ||
SET_TARGET_PROPERTIES ( rbdl-static PROPERTIES PREFIX "lib") | ||
ENDIF (NOT WIN32) | ||
ENDIF (NOT MSVC) | ||
SET_TARGET_PROPERTIES ( rbdl-static PROPERTIES OUTPUT_NAME "rbdl") | ||
|
||
IF (RBDL_BUILD_ADDON_LUAMODEL) | ||
|
@@ -160,6 +159,11 @@ IF (RBDL_BUILD_STATIC) | |
rbdl_urdfreader-static | ||
) | ||
ENDIF (RBDL_BUILD_ADDON_URDFREADER) | ||
IF (RBDL_USE_CASADI_MATH) | ||
TARGET_LINK_LIBRARIES ( rbdl-static | ||
${Casadi_LIBRARY} | ||
) | ||
ENDIF (RBDL_USE_CASADI_MATH) | ||
|
||
INSTALL (TARGETS rbdl-static | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
|
@@ -168,11 +172,18 @@ IF (RBDL_BUILD_STATIC) | |
) | ||
ELSE (RBDL_BUILD_STATIC) | ||
ADD_LIBRARY ( rbdl SHARED ${RBDL_SOURCES} ) | ||
TARGET_INCLUDE_DIRECTORIES(rbdl PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/include) | ||
SET_TARGET_PROPERTIES ( rbdl PROPERTIES | ||
VERSION ${RBDL_VERSION} | ||
SOVERSION ${RBDL_SO_VERSION} | ||
) | ||
|
||
IF (RBDL_USE_CASADI_MATH) | ||
TARGET_LINK_LIBRARIES ( rbdl | ||
${Casadi_LIBRARY} | ||
) | ||
ENDIF (RBDL_USE_CASADI_MATH) | ||
|
||
INSTALL (TARGETS rbdl | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
|
@@ -217,14 +228,31 @@ INSTALL ( FILES ${headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rbdl ) | |
|
||
# pkg-config | ||
CONFIGURE_FILE ( | ||
${CMAKE_CURRENT_SOURCE_DIR}/rbdl.pc.cmake | ||
${CMAKE_CURRENT_SOURCE_DIR}/share/rbdl.pc.cmake | ||
${CMAKE_CURRENT_BINARY_DIR}/rbdl.pc @ONLY | ||
) | ||
INSTALL ( | ||
FILES ${CMAKE_CURRENT_BINARY_DIR}/rbdl.pc | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig | ||
) | ||
|
||
# Prepare share | ||
if(WIN32 AND NOT CYGWIN) | ||
set(CMAKE_SHARE_DIR cmake) | ||
else() | ||
set(CMAKE_SHARE_DIR lib/cmake/RBDL) | ||
endif() | ||
include(CMakePackageConfigHelpers) | ||
configure_package_config_file( | ||
share/RBDLConfig.cmake.in | ||
${CMAKE_CURRENT_BINARY_DIR}/RBDLConfig.cmake | ||
INSTALL_DESTINATION ${CMAKE_SHARE_DIR} | ||
) | ||
INSTALL ( | ||
FILES ${CMAKE_CURRENT_BINARY_DIR}/RBDLConfig.cmake | ||
DESTINATION ${CMAKE_SHARE_DIR} | ||
) | ||
|
||
# Packaging | ||
SET(CPACK_GENERATOR "DEB") | ||
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Martin Felis <[email protected]>") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.