diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..a919358407497bbdc27de02031eb38df418b7ae8 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,53 @@ +variables: + GIT_SUBMODULE_STRATEGY: "recursive" + GIT_DEPTH: "3" + CCACHE_BASEDIR: "${CI_PROJECT_DIR}" + CCACHE_DIR: "${CI_PROJECT_DIR}/ccache" + +cache: + paths: + - ccache + +.robotpkg-sot-dynamic-pinocchio-v3: &robotpkg-sot-dynamic-pinocchio-v3 + except: + - gh-pages + script: + - mkdir -p ccache + - cd /root/robotpkg/wip/sot-dynamic-pinocchio-v3 + - git pull + - make checkout MASTER_REPOSITORY="dir ${CI_PROJECT_DIR}" + - make install + - cd work.$(hostname)/$(make show-var VARNAME=DISTNAME) + - make test + +robotpkg-sot-dynamic-pinocchio-v3-14.04-release: + <<: *robotpkg-sot-dynamic-pinocchio-v3 + image: eur0c.laas.fr:5000/stack-of-tasks/sot-dynamic-pinocchio/sot-dynamic-pinocchio-v3:14.04 + +robotpkg-sot-dynamic-pinocchio-v3-16.04-release: + <<: *robotpkg-sot-dynamic-pinocchio-v3 + image: eur0c.laas.fr:5000/stack-of-tasks/sot-dynamic-pinocchio/sot-dynamic-pinocchio-v3:16.04 + +robotpkg-sot-dynamic-pinocchio-v3-18.04-release: + <<: *robotpkg-sot-dynamic-pinocchio-v3 + image: eur0c.laas.fr:5000/stack-of-tasks/sot-dynamic-pinocchio/sot-dynamic-pinocchio-v3:18.04 + +doc-coverage: + <<: *robotpkg-sot-dynamic-pinocchio-v3 + image: eur0c.laas.fr:5000/stack-of-tasks/sot-dynamic-pinocchio/sot-dynamic-pinocchio-v3:16.04 + before_script: + - echo -e 'CXXFLAGS+= --coverage\nLDFLAGS+= --coverage\nPKG_DEFAULT_OPTIONS= debug' >> /opt/openrobots/etc/robotpkg.conf + after_script: + - cd /root/robotpkg/wip/sot-dynamic-pinocchio-v3 + - cd work.$(hostname)/$(make show-var VARNAME=DISTNAME) + - make doc + - mv doc/doxygen-html ${CI_PROJECT_DIR} + - mkdir -p ${CI_PROJECT_DIR}/coverage/ + - gcovr -r . + - gcovr -r . --html --html-details -o ${CI_PROJECT_DIR}/coverage/index.html + artifacts: + expire_in: 1 day + paths: + - doxygen-html/ + - coverage/ + diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a2d47a84ccebbede75086477dd1fcb48519dfe0..6e064e681060c1a50133f1294a5ef9187d5c59ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,7 @@ INCLUDE(cmake/boost.cmake) INCLUDE(cmake/eigen.cmake) INCLUDE(cmake/lapack.cmake) INCLUDE(cmake/cpack.cmake) +INCLUDE(cmake/python.cmake) SET(PROJECT_NAME sot-dynamic-pinocchio) @@ -27,6 +28,7 @@ SET(PROJECT_DESCRIPTION "pinocchio bindings for dynamic-graph.") SET(PROJECT_URL "https://github.com/stack-of-tasks/sot-dynamic-pinocchio/") SET(CUSTOM_HEADER_DIR "${PROJECT_NAME}") +SET(DOXYGEN_USE_MATHJAX YES) # Disable -Werror on Unix for now. SET(CXX_DISABLE_WERROR True) @@ -62,15 +64,13 @@ SET(plugins SET(LIBRARY_NAME ${PROJECT_NAME}) LIST(APPEND plugins dynamic) - -LIST(APPEND LOGGING_WATCHED_TARGETS ${plugins}) - # Add dependency toward sot-dynamic-pinocchio library in pkg-config file. PKG_CONFIG_APPEND_LIBS(${LIBRARY_NAME}) # Search for dependencies. # Boost SET(BOOST_COMPONENTS filesystem system unit_test_framework python) +FINDPYTHON() SEARCH_FOR_BOOST() SEARCH_FOR_EIGEN() diff --git a/README.md b/README.md index a86320d428f0d6f6d71e626d943b42c84b228c91..ec1d552c46fa5918f697121fc23788431ca28940 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,10 @@ sot-dynamic-pinocchio Encapsulate Pinocchio in SoT =========== -[](https://travis-ci.org/stack-of-tasks/sot-dynamic-pinocchio) -[](https://coveralls.io/r/stack-of-tasks/sot-dynamic-pinocchio) +[](https://travis-ci.org/stack-of-tasks/sot-dynamic-pinocchio) +[](https://gepgitlab.laas.fr/stack-of-tasks/sot-dynamic-pinocchio/commits/master) +[](http://projects.laas.fr/gepetto/doc/stack-of-tasks/sot-dynamic-pinocchio/master/coverage/) + This software provides robot dynamic computation for dynamic-graph by using pinocchio. @@ -41,4 +43,3 @@ have to be available on your machine. [dynamic-graph]: http://github.com/stack-of-tasks/dynamic-graph [pinocchio]: http://github.com/stack-of-tasks/pinocchio [sot-core]: http://github.com/stack-of-tasks/sot-core ->>>>>>> devel diff --git a/cmake b/cmake index 212cba414aac3cd18037d4102788b23f3df501f8..8e7bedfcbd8524c0401a58fd74edc07c3d4308d0 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 212cba414aac3cd18037d4102788b23f3df501f8 +Subproject commit 8e7bedfcbd8524c0401a58fd74edc07c3d4308d0 diff --git a/custom_cmake/python.cmake b/custom_cmake/python.cmake deleted file mode 100644 index 2c6ed4f12b0d7e44c08fd63ae31379b05d39bbfd..0000000000000000000000000000000000000000 --- a/custom_cmake/python.cmake +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright (C) 2008-2016 LAAS-CNRS, JRL AIST-CNRS. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - - -# -# SOT_DYNAMIC_PYTHON_MODULE SUBMODULENAME LIBRARYNAME TARGETNAME -# --------------------------- -# -# Add a python submodule to dynamic_graph -# -# SUBMODULENAME : the name of the submodule (can be foo/bar), -# -# LIBRARYNAME : library to link the submodule with. -# -# TARGETNAME : name of the target: should be different for several -# calls to the macro. -# -# NOTICE : Before calling this macro, set variable NEW_ENTITY_CLASS as -# the list of new Entity types that you want to be bound. -# Entity class name should match the name referencing the type -# in the factory. -# -MACRO(SOT_DYNAMIC_PYTHON_MODULE SUBMODULENAME LIBRARYNAME TARGETNAME) - FINDPYTHON() - - SET(PYTHON_MODULE ${TARGETNAME}) - - ADD_LIBRARY(${PYTHON_MODULE} - MODULE - ${PROJECT_SOURCE_DIR}/src/python-module-py.cpp) - #${PROJECT_SOURCE_DIR}/src/sot-dynamic-py.cpp) - - FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/src/dynamic_graph/${SUBMODULENAME}) - SET_TARGET_PROPERTIES(${PYTHON_MODULE} - PROPERTIES PREFIX "" - OUTPUT_NAME dynamic_graph/${SUBMODULENAME}/wrap - ) - - TARGET_LINK_LIBRARIES(${PYTHON_MODULE} "-Wl,--no-as-needed") - TARGET_LINK_LIBRARIES(${PYTHON_MODULE} ${LIBRARYNAME} ${PYTHON_LIBRARY}) - TARGET_LINK_LIBRARIES(${PYTHON_MODULE} ${Boost_LIBRARIES}) - TARGET_LINK_LIBRARIES(${PYTHON_MODULE} pinocchio) - TARGET_LINK_LIBRARIES(${PYTHON_MODULE} eigenpy) - - PKG_CONFIG_USE_DEPENDENCY(${PYTHON_MODULE} dynamic-graph) - PKG_CONFIG_USE_DEPENDENCY(${PYTHON_MODULE} pinocchio) - PKG_CONFIG_USE_DEPENDENCY(${PYTHON_MODULE} eigenpy) - - INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) - - # - # Installation - # - SET(PYTHON_INSTALL_DIR ${PYTHON_SITELIB}/dynamic_graph/${SUBMODULENAME}) - - INSTALL(TARGETS ${PYTHON_MODULE} - DESTINATION - ${PYTHON_INSTALL_DIR}) - - SET(ENTITY_CLASS_LIST "") - FOREACH (ENTITY ${NEW_ENTITY_CLASS}) - SET(ENTITY_CLASS_LIST "${ENTITY_CLASS_LIST}${ENTITY}('')\n") - ENDFOREACH(ENTITY ${NEW_ENTITY_CLASS}) - - CONFIGURE_FILE( - ${PROJECT_SOURCE_DIR}/cmake/dynamic_graph/submodule/__init__.py.cmake - ${PROJECT_BINARY_DIR}/src/dynamic_graph/${SUBMODULENAME}/__init__.py - ) - - INSTALL( - FILES ${PROJECT_BINARY_DIR}/src/dynamic_graph/${SUBMODULENAME}/__init__.py - DESTINATION ${PYTHON_INSTALL_DIR} - ) - -ENDMACRO(DYNAMIC_GRAPH_PYTHON_MODULE SUBMODULENAME) \ No newline at end of file diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index b865ecfc1554c85b3e9193c87ac5d22d6cbc895c..d0d241b0449dc8726b4ebda2b91c2e6f5f8fd3b3 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -1,6 +1,3 @@ -INCLUDE(../cmake/python.cmake) -FINDPYTHON() - INSTALL( FILES kine_romeo.py kine_romeo_small.py DESTINATION ${PYTHON_SITELIB}/dynamic_graph/tutorial diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c93eaf63876380623703ab6887b76378751eafe7..3c29c101d38575ef00917e83d843919ed369efc8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,8 +14,6 @@ # received a copy of the GNU Lesser General Public License along with # sot-dynamic-pinocchio. If not, see <http://www.gnu.org/licenses/>. -INCLUDE(../custom_cmake/python.cmake) -INCLUDE(../cmake/python.cmake) LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) # Verbosity level @@ -54,7 +52,7 @@ FOREACH(lib ${plugins}) # build python submodule STRING(REPLACE - _ PYTHON_LIBRARY_NAME ${lib}) - SOT_DYNAMIC_PYTHON_MODULE("sot/dynamics_pinocchio/${PYTHON_LIBRARY_NAME}" + DYNAMIC_GRAPH_PYTHON_MODULE("sot/dynamics_pinocchio/${PYTHON_LIBRARY_NAME}" ${libname} sot-dynamic-pinocchio-${PYTHON_LIBRARY_NAME}-wrap ) @@ -81,4 +79,4 @@ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/dynamic_graph/sot/dynamics_pinocchio/tools.py ${CMAKE_CURRENT_SOURCE_DIR}/dynamic_graph/sot/dynamics_pinocchio/parser.py DESTINATION ${PYTHON_SITELIB}/dynamic_graph/sot/dynamics_pinocchio - ) \ No newline at end of file + ) diff --git a/unitTesting/CMakeLists.txt b/unitTesting/CMakeLists.txt index 132599bce0254631551100bae2f5987709d398ae..3247e7fb1617a7abdfff27135d3c36511b4c264c 100644 --- a/unitTesting/CMakeLists.txt +++ b/unitTesting/CMakeLists.txt @@ -12,7 +12,6 @@ # General Lesser Public License for more details. You should have # received a copy of the GNU Lesser General Public License along with # sot-dynamic-pinocchio. If not, see <http://www.gnu.org/licenses/>. -INCLUDE(../cmake/python.cmake) ADD_DEFINITIONS(-DDEBUG=2) @@ -30,9 +29,6 @@ test_constructor # Install procedure for the urdf files #---------------------------------------------------- -FILE(COPY ${CMAKE_CURRENT_SOURCE_DIR}/two_link.urdf - DESTINATION urdf) - SET(test_dyn_plugins_dependencies dynamic) # Make Boost.Test generates the main function in test cases. @@ -50,8 +46,6 @@ ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN) #SET(sampleinitconfig # ${JRL_DYNAMICS_PKGDATAROOTDIR}/jrl-dynamics/examples/data/sampleInitConfig.dat) -FINDPYTHON() - LIST(APPEND LOGGING_WATCHED_VARIABLES samplespec sampleljr) FOREACH(test ${tests}) @@ -60,7 +54,7 @@ FOREACH(test ${tests}) ${test}.cpp) MESSAGE("PYTHON_INCLUDE_PATH: ${PYTHON_INCLUDE_PATH}") INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) - + TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} dp-zmpreffromcom dp-force-compensation @@ -77,7 +71,7 @@ FOREACH(test ${tests}) PKG_CONFIG_USE_DEPENDENCY(${EXECUTABLE_NAME} sot-core) PKG_CONFIG_USE_DEPENDENCY(${EXECUTABLE_NAME} dynamic-graph) PKG_CONFIG_USE_DEPENDENCY(${EXECUTABLE_NAME} dynamic-graph-python) - + IF(${test}_plugins_dependencies) ADD_DEPENDENCIES(${EXECUTABLE_NAME} "${${test}_plugins_dependencies}") TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} "${${test}_plugins_dependencies}") @@ -89,7 +83,7 @@ FOREACH(test ${tests}) IF (UNIX) SET(EXTRA_LD_LIBRARY_PATH $ENV{LD_LIBRARY_PATH}) - SET_PROPERTY(TEST ${test} PROPERTY + SET_PROPERTY(TEST ${test} PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}:${CMAKE_BINARY_DIR}/src:${BOOST_ROOT}/lib:${EXTRA_LD_LIBRARY_PATH}") ENDIF(UNIX) diff --git a/unitTesting/two_link.urdf b/unitTesting/two_link.urdf deleted file mode 100644 index 570717dac88d37291e2703b0d607848a3d1699fa..0000000000000000000000000000000000000000 --- a/unitTesting/two_link.urdf +++ /dev/null @@ -1,45 +0,0 @@ -<?xml version="1.0"?> -<!-- - simple_humanoid URDF model - - FIXME: fill missing data: sole, gripper and sensors - --> -<robot xmlns:xacro="http://ros.org/wiki/xacro" name="test_two_link"> - - <link name="base_link"/> - <joint name="JOINT1" type="revolute"> - <axis xyz="0 0 1"/> - <parent link="base_link"/> - <child link="CHILD1"/> - <origin xyz="1 0 0"/> - <limit effort="12" lower="0" upper="3.14" velocity="10"/> - </joint> - <link name="CHILD1"> - <inertial> - <origin xyz="0.5 0 0" rpy="0 0 0"/> - <mass value="10"/> - <inertia ixx="1" ixy="0" ixz="0" iyy="1" iyz="0" izz="1" /> - </inertial> - </link> - <joint name="JOINT2" type="revolute"> - <axis xyz="0 0 1"/> - <parent link="CHILD1"/> - <child link="CHILD2"/> - <origin xyz="1 0 0"/> - <limit effort="12" lower="0" upper="3.14" velocity="10"/> - </joint> - <link name="CHILD2"> - <inertial> - <origin xyz="0.5 0 0" rpy="0 0 0"/> - <mass value="20"/> - <inertia ixx="1" ixy="0" ixz="0" iyy="1" iyz="0" izz="1" /> - </inertial> - </link> - <joint name="FRAMEJOINT1" type="fixed"> - <parent link="CHILD2"/> - <child link="CHILD3"/> - <origin rpy="0 0 0" xyz="0 0 -0.16"/> - </joint> - <link name="CHILD3"/> - -</robot>