Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • sw/simox/simox
  • uwkce_singer/simox
2 results
Show changes
Commits on Source (319)
Showing
with 85 additions and 3333 deletions
build/
stages:
- build-and-test
- documentation
- deploy
- post-deploy-test
- downstream
......@@ -62,11 +62,7 @@ stages:
# Test.
# ToDo: Add and use `axii ws test -m simox`
- cd "$PROJECT_PATH_IN_WORKSPACE/build"
- ctest . || true
- ctest --rerun-failed --output-on-failure . || true
- cat Testing/Temporary/LastTest.log || true
# Once again to make the job fail if an error occurs.
- ctest .
- ctest --output-on-failure --output-junit "$CI_PROJECT_DIR/report.xml" .
# Generate documentation.
- cd "$PROJECT_PATH_IN_WORKSPACE/build"
......@@ -82,6 +78,9 @@ build-and-test-bionic:
image: git.h2t.iar.kit.edu:5050/sw/armarx/meta/axii:latest-bionic
artifacts:
reports:
junit: report.xml
name: "Simox-Documentation-$CI_COMMIT_REF_NAME"
paths:
- build/doc/html/
......@@ -94,6 +93,78 @@ build-and-test-jammy:
image: git.h2t.iar.kit.edu:5050/sw/armarx/meta/axii:latest-jammy
docker-bionic:
stage: deploy
needs: ["build-and-test-bionic"]
image:
name: gcr.io/kaniko-project/executor:v1.9.0-debug
entrypoint: [""]
script:
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/docker/bionic"
--destination "${CI_REGISTRY_IMAGE}:latest-bionic"
rules:
- if: $CI_COMMIT_BRANCH == "master"
docker-jammy:
stage: deploy
needs: ["build-and-test-jammy"]
image:
name: gcr.io/kaniko-project/executor:v1.9.0-debug
entrypoint: [""]
script:
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/docker/jammy"
--destination "${CI_REGISTRY_IMAGE}:latest-jammy"
rules:
- if: $CI_COMMIT_BRANCH == "master"
.test-docker-image-common:
before_script:
- source /axii/scripts/install_axii.sh
- _axii_auto_env_refresh
script:
- echo "ArmarX Workspace = '$ARMARX_WORKSPACE'"
- printenv
- axii workspace list-modules
- axii workspace list-modules --deps
- axii workspace info
- echo "Simox directory = '$Simox_DIR'"
- which RobotViewer
test-docker-image-bionic:
stage: post-deploy-test
needs: ["docker-bionic"]
extends: .test-docker-image-common
image: git.h2t.iar.kit.edu:5050/sw/simox/simox:latest-bionic
rules:
- if: $CI_COMMIT_BRANCH == "master"
test-docker-image-jammy:
stage: post-deploy-test
needs: ["docker-jammy"]
extends: .test-docker-image-common
image: git.h2t.iar.kit.edu:5050/sw/simox/simox:latest-jammy
rules:
- if: $CI_COMMIT_BRANCH == "master"
armarx-core:
stage: downstream
......@@ -103,7 +174,7 @@ armarx-core:
trigger:
project: sw/armarx/armarx-core
# This is optional, but we could tell ArmarX which Simox branch to use.
branch: master
branch: master
rules:
- if: $CI_COMMIT_BRANCH == "master"
/SimDynamics/ @patrickhegemann @reister
/SimoxUtility/algorithm/get_map_keys_values.h @kartmann
/SimoxUtility/caching/ @kartmann
/SimoxUtility/color/ @kartmann
/SimoxUtility/json/ @kartmann
/SimoxUtility/math/pose/ @kartmann
/SimoxUtility/math/statistics/ @kartmann
/SimoxUtility/math/SoftMinMax.* @kartmann
/SimoxUtility/meta/EnumNames.hpp @kartmann
/SimoxUtility/meta/type_name.* @kartmann
/SimoxUtility/shapes/AxisAlignedBoundingBox.* @kartmann
/SimoxUtility/threads/CountingSemaphore.* @kartmann
/VirtualRobot/IK/platform @reister @dreher
/VirtualRobot/MJCF/ @kartmann
/VirtualRobot/Nodes/HemisphereJoint/ @kartmann
/VirtualRobot/Nodes/RobotNodeHemisphere.* @kartmann
/VirtualRobot/XML/mujoco/ @kartmann
/SimDynamics/ @rietsch @nefzer
/SimoxUtility @meixner @reister
/VirtualRobot @meixner @reister
/GraspPlanning @hyseni
/GeometricPlanning @reister
root = true
[*]
end_of_line = lf
indent_style = space
indent_size = 2
charset = utf-8
[Makefile]
indent_style = tab
repo: d536c26f2a238e943cf08a038d1134c782b1e66c
node: 0879ee8c548a07b8a9e1296bcbb5b006e1a098c7
branch: default
latesttag: v2.6.0
latesttagdistance: 1
changessincelatesttag: 1
syntax: glob
doc/html/*
doc/notes/*.aux
doc/notes/*.pdf
*Debug/*
*Release/*
*RelWithDebInfo/*
*build/*
.*.swp
CMakeFiles/*
cmake_install.cmake
CMakeCache.txt
Makefile
tags
*.log
*.user
src/rbdl_config.h
# autogenerated by python/wrappergen.py
python/rbdl.pyx
examples/simple/CMakeCache.txt
examples/simple/example
examples/simple/librbdl.so
examples/luamodel/example_luamodel
examples/luamodel/CMakeCache.txt
*.vcxproj
*.vcxproj.filters
*.suo
*.db
*.sln
7a77f7a994d813d91742f89563c274d6fd04c061 v1.0.0
e753e34715b107aad90b8aa7dd985cca2ff01d53 v1.1.0
e0f64ac8491140fdc9e4499b55d7eadbc093b229 v2.0.0
7742057b61fb0094c3e437294cd48c596913ad4d v2.0.1
70d7265f4d36fa5aba907879f939ba658fe58bd3 v2.1.0
0f2b7a0fd90a5391d9bb5a2399b1a4fe44893018 v2.2.0
57ec58a73e0948727b96092cb1ea948fdcae4bd0 v2.2.1
39707193a22c11ea671ce1b981b8dc9b4da406b9 v2.2.2
2da137bfd1fd7f2e14294aff6e3feeffebfac952 v2.3.1
8c9139fa7142b8370c0c004abb86ce13d0984aa3 v2.3.2
7cfc6e93e10135c7fe8e89736160f0322932d440 v2.3.3
48c0872b39d6fd9d085c1c5c6ff46f7125a17f9d v2.4.0
9d527cef3bb1dcb8b57b861251fc14ab99a93372 v2.4.1
37918477608938f4c1e90eedf1a525c69533d843 v2.5.0
a6961fd7ef81367ddc3b7bc17ca80543aad2f33d v2.6.0
a6961fd7ef81367ddc3b7bc17ca80543aad2f33d v2.6.0
5ec20951877f17341aba9407e1147220fa2d75f2 v2.6.0
5ec20951877f17341aba9407e1147220fa2d75f2 v2.6.0
c16cbccc273ba7a3512d2b8ad935e84d1216f921 v2.6.0
c16cbccc273ba7a3512d2b8ad935e84d1216f921 v2.6.0
f3e7ec02caf42707c86ecc04c5dfb2d1f2ce4814 v2.6.0
f3e7ec02caf42707c86ecc04c5dfb2d1f2ce4814 v2.6.0
70970b79581f19ffe83e802be10b3a0c90788c93 v2.6.0
# Find the Cython compiler.
#
# This code sets the following variables:
#
# CYTHON_EXECUTABLE
#
# See also UseCython.cmake
#=============================================================================
# Copyright 2011 Kitware, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
# Use the Cython executable that lives next to the Python executable
# if it is a local installation.
find_package( PythonInterp )
if( PYTHONINTERP_FOUND )
get_filename_component( _python_path ${PYTHON_EXECUTABLE} PATH )
find_program( CYTHON_EXECUTABLE
NAMES cython cython.bat cython3
HINTS ${_python_path}
)
else()
find_program( CYTHON_EXECUTABLE
NAMES cython cython.bat cython3
)
endif()
include( FindPackageHandleStandardArgs )
FIND_PACKAGE_HANDLE_STANDARD_ARGS( Cython REQUIRED_VARS CYTHON_EXECUTABLE )
mark_as_advanced( CYTHON_EXECUTABLE )
# - Try to find Eigen3 lib
#
# This module supports requiring a minimum version, e.g. you can do
# find_package(Eigen3 3.1.2)
# to require version 3.1.2 or newer of Eigen3.
#
# Once done this will define
#
# EIGEN3_FOUND - system has eigen lib with correct version
# EIGEN3_INCLUDE_DIR - the eigen include directory
# EIGEN3_VERSION - eigen version
# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
# Copyright (c) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
# Redistribution and use is allowed according to the terms of the 2-clause BSD license.
if(NOT Eigen3_FIND_VERSION)
if(NOT Eigen3_FIND_VERSION_MAJOR)
set(Eigen3_FIND_VERSION_MAJOR 2)
endif(NOT Eigen3_FIND_VERSION_MAJOR)
if(NOT Eigen3_FIND_VERSION_MINOR)
set(Eigen3_FIND_VERSION_MINOR 91)
endif(NOT Eigen3_FIND_VERSION_MINOR)
if(NOT Eigen3_FIND_VERSION_PATCH)
set(Eigen3_FIND_VERSION_PATCH 0)
endif(NOT Eigen3_FIND_VERSION_PATCH)
set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
endif(NOT Eigen3_FIND_VERSION)
macro(_eigen3_check_version)
file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
set(EIGEN3_VERSION_OK FALSE)
else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
set(EIGEN3_VERSION_OK TRUE)
endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
if(NOT EIGEN3_VERSION_OK)
message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
"but at least version ${Eigen3_FIND_VERSION} is required")
endif(NOT EIGEN3_VERSION_OK)
endmacro(_eigen3_check_version)
if (EIGEN3_INCLUDE_DIR)
# in cache already
_eigen3_check_version()
set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})
else (EIGEN3_INCLUDE_DIR)
find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
PATHS
${CMAKE_INSTALL_PREFIX}/include
${KDE4_INCLUDE_DIR}
PATH_SUFFIXES eigen3 eigen
)
if(EIGEN3_INCLUDE_DIR)
_eigen3_check_version()
endif(EIGEN3_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)
mark_as_advanced(EIGEN3_INCLUDE_DIR)
endif(EIGEN3_INCLUDE_DIR)
# - Try to find UnitTest++
#
#
SET (UNITTEST++_FOUND FALSE)
FIND_PATH (UNITTEST++_INCLUDE_DIR UnitTest++.h
/usr/include/unittest++
/usr/include/UnitTest++
/usr/local/include/unittest++
/usr/local/include/UnitTest++
/opt/local/include/unittest++
$ENV{UNITTESTXX_PATH}/src
$ENV{UNITTESTXX_INCLUDE_PATH}
)
FIND_LIBRARY (UNITTEST++_LIBRARY NAMES UnitTest++ PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
$ENV{UNITTESTXX_PATH}
ENV{UNITTESTXX_LIBRARY_PATH}
)
IF (UNITTEST++_INCLUDE_DIR AND UNITTEST++_LIBRARY)
SET (UNITTEST++_FOUND TRUE)
ENDIF (UNITTEST++_INCLUDE_DIR AND UNITTEST++_LIBRARY)
IF (UNITTEST++_FOUND)
IF (NOT UnitTest++_FIND_QUIETLY)
MESSAGE(STATUS "Found UnitTest++: ${UNITTEST++_LIBRARY}")
ENDIF (NOT UnitTest++_FIND_QUIETLY)
ELSE (UNITTEST++_FOUND)
IF (UnitTest++_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find UnitTest++")
ENDIF (UnitTest++_FIND_REQUIRED)
ENDIF (UNITTEST++_FOUND)
MARK_AS_ADVANCED (
UNITTEST++_INCLUDE_DIR
UNITTEST++_LIBRARY
)
# Note: when executed in the build dir, then CMAKE_CURRENT_SOURCE_DIR is the
# build dir.
file( COPY src test bin DESTINATION "${CMAKE_ARGV3}"
FILES_MATCHING PATTERN "*.py" )
# Define a function to create Cython modules.
#
# For more information on the Cython project, see http://cython.org/.
# "Cython is a language that makes writing C extensions for the Python language
# as easy as Python itself."
#
# This file defines a CMake function to build a Cython Python module.
# To use it, first include this file.
#
# include( UseCython )
#
# Then call cython_add_module to create a module.
#
# cython_add_module( <module_name> <src1> <src2> ... <srcN> )
#
# To create a standalone executable, the function
#
# cython_add_standalone_executable( <executable_name> [MAIN_MODULE src1] <src1> <src2> ... <srcN> )
#
# To avoid dependence on Python, set the PYTHON_LIBRARY cache variable to point
# to a static library. If a MAIN_MODULE source is specified,
# the "if __name__ == '__main__':" from that module is used as the C main() method
# for the executable. If MAIN_MODULE, the source with the same basename as
# <executable_name> is assumed to be the MAIN_MODULE.
#
# Where <module_name> is the name of the resulting Python module and
# <src1> <src2> ... are source files to be compiled into the module, e.g. *.pyx,
# *.py, *.c, *.cxx, etc. A CMake target is created with name <module_name>. This can
# be used for target_link_libraries(), etc.
#
# The sample paths set with the CMake include_directories() command will be used
# for include directories to search for *.pxd when running the Cython complire.
#
# Cache variables that effect the behavior include:
#
# CYTHON_ANNOTATE
# CYTHON_NO_DOCSTRINGS
# CYTHON_FLAGS
#
# Source file properties that effect the build process are
#
# CYTHON_IS_CXX
#
# If this is set of a *.pyx file with CMake set_source_files_properties()
# command, the file will be compiled as a C++ file.
#
# See also FindCython.cmake
#=============================================================================
# Copyright 2011 Kitware, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
# Configuration options.
set( CYTHON_ANNOTATE OFF
CACHE BOOL "Create an annotated .html file when compiling *.pyx." )
set( CYTHON_NO_DOCSTRINGS OFF
CACHE BOOL "Strip docstrings from the compiled module." )
set( CYTHON_FLAGS "" CACHE STRING
"Extra flags to the cython compiler." )
mark_as_advanced( CYTHON_ANNOTATE CYTHON_NO_DOCSTRINGS CYTHON_FLAGS )
find_package( Cython REQUIRED )
find_package( PythonLibs REQUIRED )
set( CYTHON_CXX_EXTENSION "cxx" )
set( CYTHON_C_EXTENSION "c" )
# Create a *.c or *.cxx file from a *.pyx file.
# Input the generated file basename. The generate file will put into the variable
# placed in the "generated_file" argument. Finally all the *.py and *.pyx files.
function( compile_pyx _name generated_file )
# Default to assuming all files are C.
set( cxx_arg "" )
set( extension ${CYTHON_C_EXTENSION} )
set( pyx_lang "C" )
set( comment "Compiling Cython C source for ${_name}..." )
set( cython_include_directories "" )
set( pxd_dependencies "" )
set( c_header_dependencies "" )
set( pyx_locations "" )
foreach( pyx_file ${ARGN} )
get_filename_component( pyx_file_basename "${pyx_file}" NAME_WE )
# Determine if it is a C or C++ file.
get_source_file_property( property_is_cxx ${pyx_file} CYTHON_IS_CXX )
if( ${property_is_cxx} STREQUAL "TRUE" )
set( cxx_arg "--cplus" )
set( extension ${CYTHON_CXX_EXTENSION} )
set( pyx_lang "CXX" )
set( comment "Compiling Cython CXX source for ${_name}..." )
endif()
# Get the include directories.
get_source_file_property( pyx_location ${pyx_file} LOCATION )
get_filename_component( pyx_path ${pyx_location} PATH )
get_directory_property( cmake_include_directories DIRECTORY ${pyx_path} INCLUDE_DIRECTORIES )
list( APPEND cython_include_directories ${cmake_include_directories} )
list( APPEND pyx_locations "${pyx_location}" )
# Determine dependencies.
# Add the pxd file will the same name as the given pyx file.
unset( corresponding_pxd_file CACHE )
find_file( corresponding_pxd_file ${pyx_file_basename}.pxd
PATHS "${pyx_path}" ${cmake_include_directories}
NO_DEFAULT_PATH )
if( corresponding_pxd_file )
list( APPEND pxd_dependencies "${corresponding_pxd_file}" )
endif()
# pxd files to check for additional dependencies.
set( pxds_to_check "${pyx_file}" "${pxd_dependencies}" )
set( pxds_checked "" )
set( number_pxds_to_check 1 )
while( ${number_pxds_to_check} GREATER 0 )
foreach( pxd ${pxds_to_check} )
list( APPEND pxds_checked "${pxd}" )
list( REMOVE_ITEM pxds_to_check "${pxd}" )
# check for C header dependencies
file( STRINGS "${pxd}" extern_from_statements
REGEX "cdef[ ]+extern[ ]+from.*$" )
foreach( statement ${extern_from_statements} )
# Had trouble getting the quote in the regex
string( REGEX REPLACE "cdef[ ]+extern[ ]+from[ ]+[\"]([^\"]+)[\"].*" "\\1" header "${statement}" )
unset( header_location CACHE )
find_file( header_location ${header} PATHS ${cmake_include_directories} )
if( header_location )
list( FIND c_header_dependencies "${header_location}" header_idx )
if( ${header_idx} LESS 0 )
list( APPEND c_header_dependencies "${header_location}" )
endif()
endif()
endforeach()
# check for pxd dependencies
# Look for cimport statements.
set( module_dependencies "" )
file( STRINGS "${pxd}" cimport_statements REGEX cimport )
foreach( statement ${cimport_statements} )
if( ${statement} MATCHES from )
string( REGEX REPLACE "from[ ]+([^ ]+).*" "\\1" module "${statement}" )
else()
string( REGEX REPLACE "cimport[ ]+([^ ]+).*" "\\1" module "${statement}" )
endif()
list( APPEND module_dependencies ${module} )
endforeach()
list( REMOVE_DUPLICATES module_dependencies )
# Add the module to the files to check, if appropriate.
foreach( module ${module_dependencies} )
unset( pxd_location CACHE )
find_file( pxd_location ${module}.pxd
PATHS "${pyx_path}" ${cmake_include_directories} NO_DEFAULT_PATH )
if( pxd_location )
list( FIND pxds_checked ${pxd_location} pxd_idx )
if( ${pxd_idx} LESS 0 )
list( FIND pxds_to_check ${pxd_location} pxd_idx )
if( ${pxd_idx} LESS 0 )
list( APPEND pxds_to_check ${pxd_location} )
list( APPEND pxd_dependencies ${pxd_location} )
endif() # if it is not already going to be checked
endif() # if it has not already been checked
endif() # if pxd file can be found
endforeach() # for each module dependency discovered
endforeach() # for each pxd file to check
list( LENGTH pxds_to_check number_pxds_to_check )
endwhile()
endforeach() # pyx_file
# Set additional flags.
if( CYTHON_ANNOTATE )
set( annotate_arg "--annotate" )
endif()
if( CYTHON_NO_DOCSTRINGS )
set( no_docstrings_arg "--no-docstrings" )
endif()
if( "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" OR
"${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo" )
set( cython_debug_arg "--gdb" )
endif()
if( "${PYTHONLIBS_VERSION_STRING}" MATCHES "^2." )
set( version_arg "-2" )
elseif( "${PYTHONLIBS_VERSION_STRING}" MATCHES "^3." )
set( version_arg "-3" )
else()
set( version_arg )
endif()
# Include directory arguments.
list( REMOVE_DUPLICATES cython_include_directories )
set( include_directory_arg "" )
foreach( _include_dir ${cython_include_directories} )
set( include_directory_arg ${include_directory_arg} "-I" "${_include_dir}" )
endforeach()
# Determining generated file name.
set( _generated_file "${CMAKE_CURRENT_BINARY_DIR}/${_name}.${extension}" )
set_source_files_properties( ${_generated_file} PROPERTIES GENERATED TRUE )
set( ${generated_file} ${_generated_file} PARENT_SCOPE )
list( REMOVE_DUPLICATES pxd_dependencies )
list( REMOVE_DUPLICATES c_header_dependencies )
# Add the command to run the compiler.
add_custom_command( OUTPUT ${_generated_file}
COMMAND ${CYTHON_EXECUTABLE}
ARGS ${cxx_arg} ${include_directory_arg} ${version_arg}
${annotate_arg} ${no_docstrings_arg} ${cython_debug_arg} ${CYTHON_FLAGS}
--output-file ${_generated_file} ${pyx_locations}
DEPENDS ${pyx_locations} ${pxd_dependencies}
IMPLICIT_DEPENDS ${pyx_lang} ${c_header_dependencies}
COMMENT ${comment}
)
# Remove their visibility to the user.
set( corresponding_pxd_file "" CACHE INTERNAL "" )
set( header_location "" CACHE INTERNAL "" )
set( pxd_location "" CACHE INTERNAL "" )
endfunction()
# cython_add_module( <name> src1 src2 ... srcN )
# Build the Cython Python module.
function( cython_add_module _name )
set( pyx_module_sources "" )
set( other_module_sources "" )
foreach( _file ${ARGN} )
if( ${_file} MATCHES ".*\\.py[x]?$" )
list( APPEND pyx_module_sources ${_file} )
else()
list( APPEND other_module_sources ${_file} )
endif()
endforeach()
compile_pyx( ${_name} generated_file ${pyx_module_sources} )
include_directories( ${PYTHON_INCLUDE_DIRS} )
python_add_module( ${_name} ${generated_file} ${other_module_sources} )
if( APPLE )
set_target_properties( ${_name} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" )
else()
target_link_libraries( ${_name} ${PYTHON_LIBRARIES} )
endif()
endfunction()
include( CMakeParseArguments )
# cython_add_standalone_executable( _name [MAIN_MODULE src3.py] src1 src2 ... srcN )
# Creates a standalone executable the given sources.
function( cython_add_standalone_executable _name )
set( pyx_module_sources "" )
set( other_module_sources "" )
set( main_module "" )
cmake_parse_arguments( cython_arguments "" "MAIN_MODULE" "" ${ARGN} )
include_directories( ${PYTHON_INCLUDE_DIRS} )
foreach( _file ${cython_arguments_UNPARSED_ARGUMENTS} )
if( ${_file} MATCHES ".*\\.py[x]?$" )
get_filename_component( _file_we ${_file} NAME_WE )
if( "${_file_we}" STREQUAL "${_name}" )
set( main_module "${_file}" )
elseif( NOT "${_file}" STREQUAL "${cython_arguments_MAIN_MODULE}" )
set( PYTHON_MODULE_${_file_we}_static_BUILD_SHARED OFF )
compile_pyx( "${_file_we}_static" generated_file "${_file}" )
list( APPEND pyx_module_sources "${generated_file}" )
endif()
else()
list( APPEND other_module_sources ${_file} )
endif()
endforeach()
if( cython_arguments_MAIN_MODULE )
set( main_module ${cython_arguments_MAIN_MODULE} )
endif()
if( NOT main_module )
message( FATAL_ERROR "main module not found." )
endif()
get_filename_component( main_module_we "${main_module}" NAME_WE )
set( CYTHON_FLAGS ${CYTHON_FLAGS} --embed )
compile_pyx( "${main_module_we}_static" generated_file ${main_module} )
add_executable( ${_name} ${generated_file} ${pyx_module_sources} ${other_module_sources} )
target_link_libraries( ${_name} ${PYTHON_LIBRARIES} ${pyx_module_libs} )
endfunction()
#CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
SET ( RBDL_VERSION_MAJOR 2 )
SET ( RBDL_VERSION_MINOR 6 )
SET ( RBDL_VERSION_PATCH 0 )
SET ( RBDL_VERSION
${RBDL_VERSION_MAJOR}.${RBDL_VERSION_MINOR}.${RBDL_VERSION_PATCH}
)
SET ( RBDL_SO_VERSION
${RBDL_VERSION_MAJOR}.${RBDL_VERSION_MINOR}.${RBDL_VERSION_PATCH}
)
SET (PROJECT_VERSION ${RBDL_VERSION})
PROJECT (rbdl VERSION ${RBDL_VERSION})
LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake )
INCLUDE_DIRECTORIES (
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}/include
)
# SET (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
INCLUDE(GNUInstallDirs)
SET_TARGET_PROPERTIES ( ${PROJECT_EXECUTABLES} PROPERTIES
LINKER_LANGUAGE CXX
)
add_compile_options(-Wno-error=sign-compare)
add_compile_options(-Wno-sign-compare)
add_compile_options(-Wno-unused-parameter)
add_compile_options(-Wno-unused-variable)
add_compile_options(-Wno-maybe-uninitialized)
# Set a default build type to 'Release' if none was specified
IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
MESSAGE(STATUS "Setting build type to 'Release' as none was specified.")
SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
ENDIF()
# Options
SET (RBDL_BUILD_STATIC_DEFAULT OFF)
IF (MSVC)
SET (RBDL_BUILD_STATIC_DEFAULT ON)
ENDIF (MSVC)
OPTION (RBDL_BUILD_STATIC "Build statically linked library (otherwise dynamiclly linked)" ${RBDL_BUILD_STATIC_DEFAULT})
OPTION (RBDL_BUILD_TESTS "Build the test executables" OFF)
OPTION (RBDL_ENABLE_LOGGING "Enable logging (warning: major impact on performance!)" OFF)
OPTION (RBDL_USE_SIMPLE_MATH "Use slow math instead of the fast Eigen3 library (faster compilation)" OFF)
OPTION (RBDL_STORE_VERSION "Enable storing of version information in the library (requires build from valid repository)" OFF)
OPTION (RBDL_BUILD_ADDON_URDFREADER "Build the (experimental) urdf reader" OFF)
OPTION (RBDL_BUILD_ADDON_BENCHMARK "Build the benchmarking tool" OFF)
OPTION (RBDL_BUILD_ADDON_LUAMODEL "Build the lua model reader" OFF)
OPTION (RBDL_BUILD_PYTHON_WRAPPER "Build experimental python wrapper" OFF)
OPTION (RBDL_BUILD_ADDON_GEOMETRY "Build the geometry library" OFF)
OPTION (RBDL_BUILD_ADDON_MUSCLE "Build the muscle library" OFF)
# Addons
IF (RBDL_BUILD_ADDON_URDFREADER)
ADD_SUBDIRECTORY ( addons/urdfreader )
ENDIF (RBDL_BUILD_ADDON_URDFREADER)
IF (RBDL_BUILD_ADDON_BENCHMARK)
ADD_SUBDIRECTORY ( addons/benchmark )
ENDIF (RBDL_BUILD_ADDON_BENCHMARK)
IF (RBDL_BUILD_ADDON_LUAMODEL)
ADD_SUBDIRECTORY ( addons/luamodel )
ENDIF (RBDL_BUILD_ADDON_LUAMODEL)
IF(RBDL_BUILD_ADDON_MUSCLE)
SET(RBDL_BUILD_ADDON_GEOMETRY ON CACHE BOOL "Build the geometry library" FORCE)
ADD_SUBDIRECTORY ( addons/muscle )
IF(RBDL_BUILD_TESTS)
ADD_SUBDIRECTORY ( addons/muscle/tests )
ENDIF(RBDL_BUILD_TESTS)
ENDIF(RBDL_BUILD_ADDON_MUSCLE)
IF(RBDL_BUILD_ADDON_GEOMETRY)
ADD_SUBDIRECTORY ( addons/geometry )
IF(RBDL_BUILD_TESTS)
ADD_SUBDIRECTORY ( addons/geometry/tests )
ENDIF(RBDL_BUILD_TESTS)
ENDIF(RBDL_BUILD_ADDON_GEOMETRY)
IF (RBDL_BUILD_TESTS)
ADD_SUBDIRECTORY ( tests )
ENDIF (RBDL_BUILD_TESTS)
# Source files for RBDL
SET ( RBDL_SOURCES
src/rbdl/rbdl_version.cc
src/rbdl/rbdl_mathutils.cc
src/rbdl/rbdl_utils.cc
src/rbdl/Constraints.cc
src/rbdl/Dynamics.cc
src/rbdl/Logging.cc
src/rbdl/Joint.cc
src/rbdl/Model.cc
src/rbdl/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} )
TARGET_LINK_LIBRARIES(rbdl-static INTERFACE tiff)
IF (NOT WIN32)
SET_TARGET_PROPERTIES ( rbdl-static PROPERTIES PREFIX "lib")
ENDIF (NOT WIN32)
SET_TARGET_PROPERTIES ( rbdl-static PROPERTIES OUTPUT_NAME "rbdl")
IF (RBDL_BUILD_ADDON_LUAMODEL)
TARGET_LINK_LIBRARIES ( rbdl-static
rbdl_luamodel-static
)
ENDIF (RBDL_BUILD_ADDON_LUAMODEL)
INSTALL (TARGETS rbdl-static
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
ELSE (RBDL_BUILD_STATIC)
ADD_LIBRARY ( rbdl SHARED ${RBDL_SOURCES} )
SET_TARGET_PROPERTIES ( rbdl PROPERTIES
VERSION ${RBDL_VERSION}
SOVERSION ${RBDL_SO_VERSION}
)
INSTALL (TARGETS rbdl
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
TARGET_LINK_LIBRARIES(rbdl INTERFACE tiff)
ENDIF (RBDL_BUILD_STATIC)
# Find and use the system's Eigen3 library
FIND_PACKAGE (Eigen3 REQUIRED)
target_link_libraries(rbdl PUBLIC Eigen3::Eigen)
IF (RBDL_STORE_VERSION)
# Set versioning information that can be queried during runtime
EXEC_PROGRAM("hg" ${CMAKE_CURRENT_SOURCE_DIR} ARGS "id -i"
OUTPUT_VARIABLE RBDL_BUILD_REVISION)
EXEC_PROGRAM("hg" ${CMAKE_CURRENT_SOURCE_DIR} ARGS "branch"
OUTPUT_VARIABLE RBDL_BUILD_BRANCH)
SET (RBDL_BUILD_TYPE ${CMAKE_BUILD_TYPE})
ELSE (RBDL_STORE_VERSION)
SET (RBDL_BUILD_REVISION "unknown")
SET (RBDL_BUILD_BRANCH "unknown")
SET (RBDL_BUILD_TYPE "unknown")
ENDIF (RBDL_STORE_VERSION)
CONFIGURE_FILE (
"${CMAKE_CURRENT_SOURCE_DIR}/include/rbdl/rbdl_config.h.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/include/rbdl/rbdl_config.h"
)
target_include_directories(rbdl PUBLIC
$<BUILD_INTERFACE:${Simox_SOURCE_DIR}/3rdParty/rbdl/include>
$<BUILD_INTERFACE:${Simox_BINARY_DIR}/3rdParty/rbdl/include>
$<INSTALL_INTERFACE:include>
)
# Python wrapper
IF (RBDL_BUILD_PYTHON_WRAPPER)
add_subdirectory ( python )
ENDIF (RBDL_BUILD_PYTHON_WRAPPER)
set_target_properties(rbdl PROPERTIES SOURCES "${RBDL_SOURCES}")
# Installation
FILE ( GLOB headers
${CMAKE_CURRENT_SOURCE_DIR}/include/rbdl/*.h
${CMAKE_CURRENT_BINARY_DIR}/include/rbdl/rbdl_config.h
)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/rbdl/rbdl_config.h DESTINATION ${Simox_INSTALL_HEADER_DIR}/rbdl)
INSTALL(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION ${Simox_INSTALL_HEADER_DIR}
COMPONENT Headers
FILES_MATCHING
PATTERN "*.h"
PATTERN "*.hpp"
PATTERN ".svn" EXCLUDE
PATTERN ".git" EXCLUDE
PATTERN "CMakeModules" EXCLUDE
PATTERN "tests" EXCLUDE
PATTERN "build*" EXCLUDE
PATTERN "data" EXCLUDE
PATTERN "examples" EXCLUDE
)
#INSTALL ( FILES ${headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rbdl )
# Setup of SimpleMath install settings
IF (RBDL_USE_SIMPLE_MATH)
INSTALL ( DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/rbdl/SimpleMath"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rbdl
)
ENDIF (RBDL_USE_SIMPLE_MATH)
message("Exporting ${PROJECT_NAME}")
INSTALL(TARGETS ${PROJECT_NAME}
# IMPORTANT: Add the library to the "export-set"
EXPORT SimoxTargets
RUNTIME DESTINATION bin COMPONENT bin
LIBRARY DESTINATION lib COMPONENT shlib
ARCHIVE DESTINATION lib COMPONENT library
COMPONENT dev)
# pkg-config
CONFIGURE_FILE (
${CMAKE_CURRENT_SOURCE_DIR}/rbdl.pc.cmake
${CMAKE_CURRENT_BINARY_DIR}/rbdl.pc @ONLY
)
INSTALL (
FILES ${CMAKE_CURRENT_BINARY_DIR}/rbdl.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
#export(PACKAGE rbdl)
## Packaging
#SET(CPACK_GENERATOR "DEB")
#SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Martin Felis <martin@fysx.org>")
#SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "the Rigid Body Dynamics Library (RBDL)")
#SET(CPACK_PACKAGE_VENDOR "Martin Felis")
#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
#SET(CPACK_PACKAGE_VERSION_MAJOR ${RBDL_VERSION_MAJOR})
#SET(CPACK_PACKAGE_VERSION_MINOR ${RBDL_VERSION_MINOR})
#SET(CPACK_PACKAGE_VERSION_PATCH ${RBDL_VERSION_PATCH})
#SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CPACK_PACKAGE ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
#SET(CPACK_PACKAGE_FILE_NAME "rbdl-${CMAKE_LIBRARY_ARCHITECTURE}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
#SET(CPACK_PACKAGE_EXECUTABLES "rbdl_luamodel_util;RBDL Lua Model Utility")
#INCLUDE(CPack)
# Coding style for RBDL
This documents gives an overview of the coding style used in RBDL and also
the general goals of RBDL.
If you are considering contributing to this library please read the whole
document.
## General Purpose of RBDL
RBDL implements large parts of the algorithms and methods described in
Featherstone's book Rigid Body Dynamics Algorithms. One of the main goals
of this library is to serve as an efficient implementation for the methods
described in Featherstone's book and to a lesser extent general multibody
dynamics and kinematics computations. A person who is familiar with
Featherstone's book should have an easy time to understand the code and
therefore the variable naming conventions used in the book should when
possible used in the code, e.g.:
- the joint space inertia matrix is denoted with H
- the coriolis forces are denoted with C
The algorithmic parts of RBDL's code try to follow the algorithmic or
mathematical notations instead of wrapping algorithms in elegant
programming patterns.
### Aims and Non-Aims of RBDL
This is what RBDL aims to be:
* RBDL aims to be lean
* RBDL aims to be easily integrated into other projects
* RBDL aims to be suitable as a foundation for sophisticated dynamics packages
* RBDL gives you access to its internals and provides only a thin abstraction layer over the actual computation
* RBDL aims to be self-contained and dependant on as few libraries as possible
And this is what RBDL is ***not*** about:
* RBDL is ***not*** a fully fledged simulator with collision detection or fancy graphics
* RBDL does not keep you from screwing up things.
Multibody dynamics is a complicated subject and in this codebase the
preference is mathematical and algorithmic clarity over elegant software
architecture.
## Licensing
RBDL is published under the very permissive zlib license that gives you a
lot of freedom in the use of full library or parts of it. The core part
of the library is solely using this license but addons may use different
licenses.
There is no formal contributor license agreement for this project. Instead
when you submit patches or create a pull request it is assumed that you
have the rights to transfer the corresponding code to the RBDL project and
that you are okay that the code will be published as part of RBDL.
## Data Storage
RBDL tries to avoid dynamic allocations and prefers contiguous memory
storage such as in ```std::vector```s over possibly fragmented memory as in
```std::list``` or heap allocated tree structures.
Where possible we use the Structure-of-Arrays (SOA) approach to store data,
e.g. the velocities v of all bodies is stored in an array (```std::vector```)
of ```SpatialVector```s in the ```Model``` structure.
## Naming Conventions
1. Structs and classes use CamelCase, e.g. ```ConstraintSet```
2. Struct and class members use the lowerCamelCase convention, e.g.
```Model::dofCount```.
Exceptions are:
1. The member variable is a mathematical symbol in an
algorithm reference, E.g. ```S``` is commonly used to denote the joint
motion subspace, then we use the algorithm notation. For mathematical
symbols we also allow the underscore ```_``` to denote a subscript.
2. Specializations of existing variables may be prefixed with an identifier,
followed by a underscore. E.g. ```Model::S``` is the default storage for
joint motion subspaces, however for the specialized 3-DOF joints it uses
the prefix ```multdof3_``` and are therefore stored in
```Model::multdof3_S```.
3. Only the first letter of an acronym is using a capital letter, e.g.
degree of freedom (DOF) would be used as ```jointDofCount```, or
```dofCount```.
4. Variables that are not member variables use the ```snake_case``` convention.
### Examples
struct Model {
std::vector<SpatialVector> v; // ok, v is an
std::vector<SpatialVector> S; // ok, S is commonly used in a reference algorithm
std::vector<double> u; // ok
std::vector<Vector3d> multdof3_u; // ok, 3-dof specialization of Model::u
std::vector<unsigned int> mJointIndex; // NOT OK: invalid prefix
unsigned int DOFCount; // NOT OK: only first letter of abbreviation should be in upper case
double error_tol; // NOT OK: use camelCase instead of snake_case
void CalcPositions(); // NOT OK: camelCase for member variables and function must start with lower-case name
};
## Spacing and Line Width
We use spaces to indent code and use two spaces to indent a block. Do not
use tabs. Namespaces should not be indented.
Lines should not exceed 80 characters in width.
Hint: in the root directory of the RBDL repository you find the file
.editorconfig which uses the correct spacing settings automatically for
many editors (see http://editorconfig.org/ for more details).
## Error Handling
RBDL will fail loudly and abort if an error occurs. This allows you to spot
errors early on. RBDL does not use exceptions.
Code must compile without warnings with all compiler warnings enabled.
Please also consider checking code with static code analyzers such as
clang-analyzer (http://clang-analyzer.llvm.org/).
## Const Correctness
This code uses const correctness, i.e. parameters that are not expected to
change must be specified as const. Use const references whenever possible.
For some optional variables we use pointers, but when possible use
references.
## Braces
Use braces whenever possible. E.g. even there is only a single line of code
after an if-statement wrap it with curly braces. The opening brace starts
in the same line as the ```if``` or the ```else``` statement.
## Documentation
Most importantly the code should be readable to someone who is familiar
with multibody dynamics, especially with Featherstone's notation. The
documentation should mainly serve to clarify the API in terms of doxygen
comments. Within the code itself comments may be used to emphasize on ideas
behind it or to clarify sections. But in general it is best to write
readable code in the first place as comments easily become deprecated.
The doxygen comments should be written in the header files and not in the
```.cc``` files.
## Testing
All code contributions must provide unit tests. RBDL uses UnitTest++
(https://github.com/unittest-cpp/unittest-cpp) as a testing framework. Many
small tests that check single features are preferred over large tests that
test multiple things simultaneously.
Bugfixes ideally come with a test case that reproduce the bug.
## Branching and Bookmarks
RBDL uses Mercurial (https://mercurial-scm.org) as version control system.
The branching concept of mercurial is different than in git. Git's
branching concept is captured in mercurial using bookmarks
(https://www.mercurial-scm.org/wiki/Bookmarks).
The ```default``` branch is reserved for releases. Bugfixes and
contributions happen in the ```dev``` branch but should have a bookmark
assigned to them.
Please do not create new branches, i.e. do not run ```hg branch
<branchname>```.
### Working on a new feature
The following steps are advised when working on a new feature for RBDL:
1. Clone the official repository.
2. Switch to the ```dev``` branch.
3. Create a bookmark that describes that feature preferably in a single
word.
4. Commit all changes to this bookmark in the ```dev``` branch.
5. Publish your work online and notify the RBDL maintainer(s).
Here are the commands to perform steps 1.-4.:
# Step 1: clone official repository
hg clone https://bitbucket.org/rbdl/rbdl <newfeature> && cd <newfeature>
# Step 2: switch to the dev branch
hg update dev
# Step 3: create a bookmark
hg bookmark newfeature
# ...
# Make changes
# ...
# Step 4: commit changes
hg commit
For step 5 the easiest would be to push your changes to a fork of the
official repository on bitbucket and create a pull request.
## Debugging
* Todo: mention logging facility
* Todo: mention SimpleMath as a fast-compiling (but slower runtime) linear
algebra package.
This diff is collapsed.
RBDL - Rigid Body Dynamics Library
Copyright (c) 2011-2016 Martin Felis <martin@fysx.org>
(zlib license)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
RBDL - Rigid Body Dynamics Library
Copyright (c) 2011-2018 Martin Felis <martin@fysx.org>
Introduction
============
RBDL is a highly efficient C++ library that contains some essential rigid
body dynamics algorithms such as the Articulated Body Algorithm (ABA) for
forward dynamics, Recursive Newton-Euler Algorithm (RNEA) for inverse
dynamics and the Composite Rigid Body Algorithm (CRBA) for the efficient
computation of the joint space inertia matrix. It further contains code for
Jacobians, forward and inverse kinematics, handling of external
constraints such as contacts and collisions, and closed-loop models.
The code is developed by Martin Felis <martin@fysx.org>
at the research group [Optimization in Robotics and Biomechanics
(ORB)](http://orb.iwr.uni-heidelberg.de) of the [Interdisciplinary Center
for Scientific Computing (IWR)](http://www.iwr.uni-heidelberg.de) at
[Heidelberg University](http://www.uni-heidelberg.de). The code tightly
follows the notation used in Roy Featherstone''s book "Rigid Body Dynamics
Algorithm".
Recent Changes
==============
* 02 May 2018: New version 2.6.0:
* Added support for closed-loop models by replacing Contacts API by a new
Constraints API. Loop constraints can be stabilized using Baumgarte
stabilization. Special thanks to Davide Corradi for this contribution!
* New constraint type CustomConstraint: a versatile interface to define
more general types of constraints (e.g. time dependent), contributed by
Matthew J. Millard.
* New joint type JointTypeHelical that can be used for screwing motions
(translations and simultaneous rotations), contributed by Stuart Anderson.
* Added support to specify external forces on bodies on constrained forward
dynamics and NonlinearEffects() (contributed by Matthew J. Millard)
* Changed Quaternion multiplication behaviour for a more standard
convention: multiplying q1 (1,0,0,0) with q2 (0,1,0,0) results now in
(0,0,1,0) instead of the previous (0,0,-1,0).
* Removed Model::SetFloatingBaseBody(). Use JointTypeFloatingBase instead.
* LuaModel: extended specification to support ConstraintSets.
* 28 April 2016: New version 2.5.0:
* Added an experimental Cython based Python wrapper of RBDL. The API is
very close to the C++ API. For a brief glimpse of the API see the file
python/test_wrapper.py.
* Matthew Millard added CustomJoints which allow to create different joint
types completely by user code. They are implemented as proxy joints for
which their behaviour is specified using virtual functions.
* Added CalcMInvTimesTau() that evaluates multiplication of the inverse of
the joint space inertia matrix with a vector in O(n) time.
* Added JointTypeFloatingBase which uses TX,TY,TZ and a spherical joint for
the floating base joint.
* Loading of floating base URDF models must now be specified as a third
parameter to URDFReadFromFile() and URDFReadFromString()
* Added the URDF code from Bullet3 which gets used when ROS is not found.
Otherwise use the URDF libraries found via Catkin.
* Added CalcPointVelocity6D, CalcPointAcceleration6D, and CalcPointJacobian6D
that compute both linear and angular quantities
* Removed Model::SetFloatingBase (body). Use a 6-DoF joint or
JointTypeFloatingBase instead.
* Fixed building issues when building DLL with MSVC++.
* 20 April 2016: New version 2.4.1:
* This is a bugfix release that maintains binary compatibility and only fixes
erroneous behaviour.
* critical: fixed termination criterion for InverseKinematics. The termination
criterion would be evaluated too early and thus report convergence too
early. This was reported independently by Kevin Stein, Yun Fei, and Davide
Corradi. Thanks for the reports!
* critical: fixed CompositeRigidBodyAlgorithm when using spherical joints
(thanks to Sébastien Barthélémy for reporting!)
* 23 February 2015: New version 2.4.0:
* Added sparse range-space method ForwardDynamicsContactsRangeSpaceSparse()
and ComputeContactImpulsesRangeSpaceSparse()
* Added null-space method ForwardDynamicsContactsNullSpace()
and ComputeContactImpulsesNullSpace()
* Renamed ForwardDynamicsContactsLagrangian() to
ForwardDynamicsContactsDirect() and
ComputeContactImpulsesLagrangian() to ComputeContactImpulsesDirect()
* Renamed ForwardDynamicsContacts() to ForwardDynamicsContactsKokkevis()
* Removed/Fixed CalcAngularMomentum(). The function produced wrong values. The
functionality has been integrated into CalcCenterOfMass().
* CalcPointJacobian() does not clear the argument of the result anymore.
Caller has to ensure that the matrix was set to zero before using this
function.
* Added optional workspace parameters for ForwardDynamicsLagrangian() to
optionally reduce memory allocations
* Added JointTypeTranslationXYZ, JointTypeEulerXYZ, and JointTypeEulerYXZ
which are equivalent to the emulated multidof joints but faster.
* Added optional parameter to CalcCenterOfMass to compute angular momentum.
* Added CalcBodySpatialJacobian()
* Added CalcContactJacobian()
* Added NonlinearEffects()
* Added solving of linear systems using standard Householder QR
* LuaModel: Added LuaModelReadFromLuaState()
* URDFReader: Fixed various issues and using faster joints for floating
base models
* Various performance improvements
For a complete history see doc/api_changes.txt.
Documentation
=============
The documentation is contained in the code and can be extracted with the
tool [doxygen](http://www.doxygen.org).
To create the documentation simply run
doxygen Doxyfile
which will generate the documentation in the subdirectory ./doc/html. The
main page will then be located in ./doc/html/index.html.
An online version of the generated documentation can be found at
[http://rbdl.bitbucket.org](http://rbdl.bitbucket.org).
Getting RBDL
============
The latest stable code can be obtained from
https://bitbucket.org/rbdl/rbdl/get/default.zip
The official mercurial repository can be cloned from
https://bitbucket.org/rbdl/rbdl
(See [http://mercurial.selenic.com/](http://mercurial.selenic.com) for
mercurial clients.)
Building and Installation
=========================
The RBDL is built using CMake
([http://www.cmake.org](http://www.cmake.org)). To compile the library in
a separate directory in Release mode use:
mkdir build
cd build/
cmake -D CMAKE_BUILD_TYPE=Release ../
make
For optimal performance it is highly recommended to install the Eigen3
linear algebra library from
[http://eigen.tuxfamily.org](http://eigen.tuxfamily.org). RBDL also
comes with a simple, albeit much slower math library (SimpleMath) that can
be used by enabling `RBDL_USE_SIMPLE_MATH`, i.e.:
cmake -D RBDL_USE_SIMPLE_MATH=TRUE ../
Citation
========
An overview of the theoretical and implementation details has been
published in [https://doi.org/10.1007/s10514-016-9574-0](Felis,
M.L. Auton Robot (2017) 41: 495). To cite RBDL in your academic
research you can use the following BibTeX entry:
@Article{Felis2016,
author="Felis, Martin L.",
title="RBDL: an efficient rigid-body dynamics library using recursive algorithms",
journal="Autonomous Robots",
year="2016",
pages="1--17",
issn="1573-7527",
doi="10.1007/s10514-016-9574-0",
url="http://dx.doi.org/10.1007/s10514-016-9574-0"
}
Licensing
=========
The library is published under the very permissive zlib free software
license which should allow you to use the software wherever you need.
This is the full license text (zlib license):
RBDL - Rigid Body Dynamics Library
Copyright (c) 2011-2018 Martin Felis <martin@fysx.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
Acknowledgements
================
Work on this library was originally funded by the [Heidelberg Graduate
School of Mathematical and Computational Methods for the Sciences
(HGS)](http://hgs.iwr.uni-heidelberg.de/hgs.mathcomp/), and the European
FP7 projects [ECHORD](http://echord.eu) (grant number 231143) and
[Koroibot](http://koroibot.eu) (grant number 611909).
CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake )
INCLUDE_DIRECTORIES (
${CMAKE_CURRENT_BINARY_DIR}/include/rbdl
)
SET_TARGET_PROPERTIES ( ${PROJECT_EXECUTABLES} PROPERTIES
LINKER_LANGUAGE CXX
)
# Perform the proper linking
SET (CMAKE_SKIP_BUILD_RPATH FALSE)
SET (CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
SET (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# Options
SET ( BENCHMARK_SOURCES
model_generator.cc
Human36Model.cc
benchmark.cc
)
ADD_EXECUTABLE ( benchmark ${BENCHMARK_SOURCES} )
IF (RBDL_BUILD_STATIC)
SET (LIBRARIES rbdl-static)
IF (RBDL_BUILD_ADDON_LUAMODEL)
SET (LIBRARIES ${LIBRARIES} rbdl_luamodel-static)
ENDIF (RBDL_BUILD_ADDON_LUAMODEL)
IF (RBDL_BUILD_ADDON_URDFREADER)
SET (LIBRARIES ${LIBRARIES} rbdl_urdfreader-static)
ENDIF (RBDL_BUILD_ADDON_URDFREADER)
TARGET_LINK_LIBRARIES ( benchmark
rbdl-static
${LIBRARIES}
)
ELSE (RBDL_BUILD_STATIC)
SET (LIBRARIES rbdl)
IF (RBDL_BUILD_ADDON_LUAMODEL)
SET (LIBRARIES ${LIBRARIES} rbdl_luamodel)
ENDIF (RBDL_BUILD_ADDON_LUAMODEL)
IF (RBDL_BUILD_ADDON_URDFREADER)
SET (LIBRARIES ${LIBRARIES} rbdl_urdfreader)
ENDIF (RBDL_BUILD_ADDON_URDFREADER)
TARGET_LINK_LIBRARIES ( benchmark
rbdl
${LIBRARIES}
)
ENDIF (RBDL_BUILD_STATIC)
#include "Human36Model.h"
#include "rbdl/rbdl.h"
using namespace RigidBodyDynamics;
using namespace RigidBodyDynamics::Math;
enum SegmentName {
SegmentPelvis = 0,
SegmentThigh,
SegmentShank,
SegmentFoot,
SegmentMiddleTrunk,
SegmentUpperTrunk,
SegmentUpperArm,
SegmentLowerArm,
SegmentHand,
SegmentHead,
SegmentNameLast
};
double SegmentLengths[SegmentNameLast] = {
0.1457,
0.4222,
0.4403,
0.1037,
0.2155,
0.2421,
0.2817,
0.2689,
0.0862,
0.2429
};
double SegmentMass[SegmentNameLast] = {
0.8154,
10.3368,
3.1609,
1.001,
16.33,
15.96,
1.9783,
1.1826,
0.4453,
5.0662
};
double SegmentCOM[SegmentNameLast][3] = {
{ 0., 0., 0.0891},
{ 0., 0., -0.1729},
{ 0., 0., -0.1963},
{ 0.1254, 0., -0.0516},
{ 0., 0., 0.1185},
{ 0., 0., 0.1195},
{ 0., 0., -0.1626},
{ 0., 0., -0.1230},
{ 0., 0., -0.0680},
{ 0., 0., 1.1214}
};
double SegmentRadiiOfGyration[SegmentNameLast][3] = {
{ 0.0897, 0.0855, 0.0803},
{ 0.1389, 0.0629, 0.1389},
{ 0.1123, 0.0454, 0.1096},
{ 0.0267, 0.0129, 0.0254},
{ 0.0970, 0.1009, 0.0825},
{ 0.1273, 0.1172, 0.0807},
{ 0.0803, 0.0758, 0.0445},
{ 0.0742, 0.0713, 0.0325},
{ 0.0541, 0.0442, 0.0346},
{ 0.0736, 0.0634, 0.0765}
};
Body create_body (SegmentName segment) {
Matrix3d inertia_C (Matrix3d::Zero());
inertia_C(0,0) = pow(SegmentRadiiOfGyration[segment][0] * SegmentLengths[segment], 2) * SegmentMass[segment];
inertia_C(1,1) = pow(SegmentRadiiOfGyration[segment][1] * SegmentLengths[segment], 2) * SegmentMass[segment];
inertia_C(2,2) = pow(SegmentRadiiOfGyration[segment][2] * SegmentLengths[segment], 2) * SegmentMass[segment];
return RigidBodyDynamics::Body (
SegmentMass[segment],
RigidBodyDynamics::Math::Vector3d (
SegmentCOM[segment][0],
SegmentCOM[segment][1],
SegmentCOM[segment][2]
),
inertia_C);
}
void generate_human36model (RigidBodyDynamics::Model *model) {
Body pelvis_body = create_body (SegmentPelvis);
Body thigh_body = create_body (SegmentThigh);
Body shank_body = create_body (SegmentShank);
Body foot_body = create_body (SegmentFoot);
Body middle_trunk_body = create_body (SegmentMiddleTrunk);
Body upper_trunk_body = create_body (SegmentUpperTrunk);
Body upperarm_body = create_body (SegmentUpperArm);
Body lowerarm_body = create_body (SegmentLowerArm);
Body hand_body = create_body (SegmentHand);
Body head_body = create_body (SegmentHead);
Joint free_flyer (
SpatialVector (0., 0., 0., 1., 0., 0.),
SpatialVector (0., 0., 0., 0., 1., 0.),
SpatialVector (0., 0., 0., 0., 0., 1.),
SpatialVector (0., 1., 0., 0., 0., 0.),
SpatialVector (0., 0., 1., 0., 0., 0.),
SpatialVector (1., 0., 0., 0., 0., 0.)
);
Joint rot_yxz (
SpatialVector (0., 1., 0., 0., 0., 0.),
SpatialVector (1., 0., 0., 0., 0., 0.),
SpatialVector (0., 0., 1., 0., 0., 0.)
);
Joint rot_yz (
SpatialVector (0., 1., 0., 0., 0., 0.),
SpatialVector (0., 0., 1., 0., 0., 0.)
);
Joint rot_y (
SpatialVector (0., 1., 0., 0., 0., 0.)
);
Joint fixed (JointTypeFixed);
model->gravity = Vector3d (0., 0., -9.81);
unsigned int pelvis_id = model->AddBody (0, Xtrans (Vector3d (0., 0., 0.)), free_flyer, pelvis_body, "pelvis");
// right leg
model->AddBody (pelvis_id, Xtrans(Vector3d(0., -0.0872, 0.)), rot_yxz, thigh_body, "thigh_r");
model->AppendBody (Xtrans(Vector3d(0., 0., -SegmentLengths[SegmentThigh])), rot_y, shank_body, "shank_r");
model->AppendBody (Xtrans(Vector3d(0., 0., -SegmentLengths[SegmentShank])), rot_yz, foot_body, "foot_r");
// left leg
model->AddBody (pelvis_id, Xtrans(Vector3d(0., 0.0872, 0.)), rot_yxz, thigh_body, "thigh_l");
model->AppendBody (Xtrans(Vector3d(0., 0., -SegmentLengths[SegmentThigh])), rot_y, shank_body, "shank_l");
model->AppendBody (Xtrans(Vector3d(0., 0., -SegmentLengths[SegmentShank])), rot_yz, foot_body, "foot_l");
// trunk
model->AddBody (pelvis_id, Xtrans(Vector3d(0., 0., SegmentLengths[SegmentPelvis])), rot_yxz, middle_trunk_body, "middletrunk");
unsigned int uppertrunk_id = model->AppendBody (Xtrans(Vector3d(0., 0., SegmentLengths[SegmentMiddleTrunk])), fixed, upper_trunk_body, "uppertrunk");
// right arm
model->AddBody (uppertrunk_id, Xtrans(Vector3d(0., -0.1900, SegmentLengths[SegmentUpperTrunk])), rot_yxz, upperarm_body, "upperarm_r");
model->AppendBody (Xtrans(Vector3d(0., 0., -SegmentLengths[SegmentUpperArm])), rot_y, lowerarm_body, "lowerarm_r");
model->AppendBody (Xtrans(Vector3d(0., 0., -SegmentLengths[SegmentLowerArm])), rot_yz, hand_body, "hand_r");
// left arm
model->AddBody (uppertrunk_id, Xtrans(Vector3d(0., 0.1900, SegmentLengths[SegmentUpperTrunk])), rot_yxz, upperarm_body, "upperarm_l");
model->AppendBody (Xtrans(Vector3d(0., 0., -SegmentLengths[SegmentUpperArm])), rot_y, lowerarm_body, "lowerarm_l");
model->AppendBody (Xtrans(Vector3d(0., 0., -SegmentLengths[SegmentLowerArm])), rot_yz, hand_body, "hand_l");
// head
model->AddBody (uppertrunk_id, Xtrans(Vector3d(0., 0.1900, SegmentLengths[SegmentUpperTrunk])), rot_yxz, upperarm_body, "head");
}
#ifndef _HUMAN36MODEL_H
#define _HUMAN36MODEL_H
namespace RigidBodyDynamics {
class Model;
}
void generate_human36model (RigidBodyDynamics::Model *model);
/* _HUMAN36MODEL_H */
#endif