Skip to content

Commit

Permalink
Merge branch 'orocos:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
sthoduka authored Oct 26, 2023
2 parents dcda098 + 7478f96 commit fa4efee
Show file tree
Hide file tree
Showing 172 changed files with 8,610 additions and 4,529 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
interval: "daily"
106 changes: 106 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: CI

on: [push, pull_request, workflow_dispatch]

env:
CXXFLAGS: "-Wall -Wextra -Wno-unused-parameter"

jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
orocos_build_type: [Debug, Release]
compiler: [gcc, clang]
python_version: ['3.8', '3.10']
exclude:
- os: ubuntu-20.04
python_version: '3.10'
- os: ubuntu-22.04
python_version: '3.8'
include:
- os: ubuntu-20.04
orocos_build_type: Release
compiler: gcc
python_version: '3.9'
- os: ubuntu-20.04
orocos_build_type: Release
compiler: gcc
python_version: '3.10'
- os: ubuntu-20.04
orocos_build_type: Release
compiler: gcc
python_version: '3.11'
- os: ubuntu-22.04
orocos_build_type: Release
compiler: gcc
python_version: '3.11'
env:
CC: ${{ matrix.compiler }}
OROCOS_BUILD_TYPE: ${{ matrix.orocos_build_type }}
ROS_PYTHON_VERSION: ${{ matrix.python_version }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Install
run: |
sudo apt-get install libeigen3-dev libcppunit-dev
pip install psutil future
- name: Build orocos_kdl
run: |
cd orocos_kdl
mkdir build
cd build
cmake -DENABLE_TESTS:BOOL=ON -DCMAKE_BUILD_TYPE=${OROCOS_KDL_BUILD_TYPE} ./..
make
sudo make install
- name: Build PyKDL
run: |
cd python_orocos_kdl
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=${OROCOS_KDL_BUILD_TYPE} ./..
make
sudo make install
- name: ldconfig
run: sudo ldconfig
- name: Test orocos_kdl
run: |
cd orocos_kdl/build
make check
- name: Test PyKDL
run: |
cd python_orocos_kdl
python_version_short=$(python -c "import sys; print('{}.{}'.format(sys.version_info[0], sys.version_info[1]))")
export PYTHONPATH=/usr/local/lib/python${python_version_short}/dist-packages${PYTHONPATH:+:${PYTHONPATH}}
python tests/PyKDLtest.py
industrial_ci:
name: Industrial CI - ${{ matrix.env.ROS_DISTRO }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- env:
ROS_DISTRO: noetic
ROS_REPO: ros
ABICHECK_URL: github:orocos/orocos_kinematics_dynamics#release-1.5
ABICHECK_MERGE: false
branch: release-1.5
env: ${{ matrix.env }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
if: ${{ (github.event_name == 'push' && endsWith(github.ref, matrix.branch)) || (github.event_name == 'pull_request' && endsWith(github.base_ref, matrix.branch)) }}
- uses: ros-industrial/industrial_ci@master
env: ${{ matrix.env }}
if: ${{ (github.event_name == 'push' && endsWith(github.ref, matrix.branch)) || (github.event_name == 'pull_request' && endsWith(github.base_ref, matrix.branch)) }}
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "python_orocos_kdl/pybind11"]
path = python_orocos_kdl/pybind11
url = https://github.com/pybind/pybind11.git
branch = stable
41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Kinematics and Dynamics Library

[![CI](https://github.com/orocos/orocos_kinematics_dynamics/workflows/CI/badge.svg)](https://github.com/orocos/orocos_kinematics_dynamics/actions)

Orocos project to supply RealTime usable kinematics and dynamics code,
it contains code for rigid body kinematics calculations and
representations for kinematic structures and their inverse and forward
kinematic solvers.

The C++ library is located in the `orocos_kdl` folder. The installation instructions can be found in
[INSTALL.md](orocos_kdl/INSTALL.md).

The python bindings, are located in the `python_orocos_kdl` folder. The installation instructions can be found in
[INSTALL.md](python_orocos_kdl/INSTALL.md).

Always use the same version of the C++ library and the python bindings. As a mismatch between these two can cause many issues.

Also when using ROS/catkin, it is preferred to use the catkin installation method over the `cmake/make` method.

There will be no ROS Noetic release.
54 changes: 34 additions & 20 deletions orocos_kdl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#
# Test CMake version
#
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
#MARK_AS_ADVANCED( FORCE CMAKE_BACKWARDS_COMPATIBILITY )
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.2)


###################################################
Expand All @@ -13,7 +12,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

PROJECT(orocos_kdl)

SET( KDL_VERSION 1.4.0)
SET( KDL_VERSION 1.5.1)
STRING( REGEX MATCHALL "[0-9]+" KDL_VERSIONS ${KDL_VERSION} )
LIST( GET KDL_VERSIONS 0 KDL_VERSION_MAJOR)
LIST( GET KDL_VERSIONS 1 KDL_VERSION_MINOR)
Expand All @@ -24,6 +23,14 @@ MESSAGE( STATUS "Orocos KDL version ${VERSION} (${KDL_VERSION_MAJOR}.${KDL_VERSI
SET( PROJ_SOURCE_DIR ${orocos_kdl_SOURCE_DIR} )
SET( PROJ_BINARY_DIR ${orocos_kdl_BINARY_DIR} )

# catkin-specific configuration (optional)
find_package(catkin QUIET)
if(catkin_FOUND)
catkin_package(
SKIP_CMAKE_CONFIG_GENERATION
SKIP_PKG_CONFIG_GENERATION
)
endif()

IF(NOT CMAKE_INSTALL_PREFIX)
SET( CMAKE_INSTALL_PREFIX /usr/local/ CACHE PATH "Installation directory" FORCE)
Expand All @@ -42,38 +49,40 @@ ENDIF ( NOT CMAKE_BUILD_TYPE )

SET( KDL_CFLAGS "")

find_package(Eigen 3 QUIET)
if(NOT Eigen_FOUND)
include(${PROJ_SOURCE_DIR}/config/FindEigen3.cmake)
set(Eigen_INCLUDE_DIR "${EIGEN3_INCLUDE_DIR}")
find_package(Eigen3 QUIET)
if(NOT EIGEN3_FOUND)
include(${PROJ_SOURCE_DIR}/cmake/FindEigen3.cmake)
endif()
include_directories(${Eigen_INCLUDE_DIR})
SET(KDL_CFLAGS "${KDL_CFLAGS} -I${Eigen_INCLUDE_DIR}")
include_directories(${EIGEN3_INCLUDE_DIR})
SET(KDL_CFLAGS "${KDL_CFLAGS} -I\"${EIGEN3_INCLUDE_DIR}\"")

# Check the platform STL containers capabilities
include(config/CheckSTLContainers.cmake)
include(cmake/CheckSTLContainers.cmake)
CHECK_STL_CONTAINERS()

# Set the default option appropriately
if(HAVE_STL_CONTAINER_INCOMPLETE_TYPES)
set(KDL_USE_NEW_TREE_INTERFACE_DEFAULT Off)
set(KDL_USE_NEW_TREE_INTERFACE_DEFAULT OFF)
else(HAVE_STL_CONTAINER_INCOMPLETE_TYPES)
set(KDL_USE_NEW_TREE_INTERFACE_DEFAULT On)
set(KDL_USE_NEW_TREE_INTERFACE_DEFAULT ON)
endif(HAVE_STL_CONTAINER_INCOMPLETE_TYPES)

# Allow the user to select the Tree API version to use
set(KDL_USE_NEW_TREE_INTERFACE ${KDL_USE_NEW_TREE_INTERFACE_DEFAULT} CACHE BOOL "Use the new KDL Tree interface")

#Sanity check, inform the user
if(NOT HAVE_STL_CONTAINER_INCOMPLETE_TYPES AND NOT KDL_USE_NEW_TREE_INTERFACE)
message(WARNING "You have chosen to use the current Tree Interface, but your platform doesn't support containers of "
"incomplete types, this configuration is likely invalid")
endif()

# The new interface requires the use of shared pointers
if(KDL_USE_NEW_TREE_INTERFACE)
# We need shared_ptr from boost since not all compilers are c++11 capable
find_package(Boost REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
set(KDL_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
endif(KDL_USE_NEW_TREE_INTERFACE)

INCLUDE (${PROJ_SOURCE_DIR}/config/DependentOption.cmake)

OPTION(ENABLE_TESTS OFF "Enable building of tests")
IF( ENABLE_TESTS )
# If not in standard paths, set CMAKE_xxx_PATH's in environment, eg.
Expand Down Expand Up @@ -103,15 +112,20 @@ export(TARGETS orocos-kdl

export(PACKAGE orocos_kdl)

set(KDL_INCLUDE_DIRS ${KDL_INCLUDE_DIRS} ${Eigen_INCLUDE_DIR})

CONFIGURE_FILE(KDLConfig.cmake.in
# Generate CMake package configuration
CONFIGURE_FILE(orocos_kdl-config.cmake.in
${PROJECT_BINARY_DIR}/orocos_kdl-config.cmake @ONLY)
CONFIGURE_FILE(KDLConfigVersion.cmake.in
CONFIGURE_FILE(orocos_kdl-config-version.cmake.in
${PROJECT_BINARY_DIR}/orocos_kdl-config-version.cmake @ONLY)

INSTALL(FILES cmake/FindEigen3.cmake DESTINATION share/orocos_kdl/cmake)
INSTALL(FILES ${PROJECT_BINARY_DIR}/orocos_kdl-config.cmake DESTINATION share/orocos_kdl/cmake)
INSTALL(FILES ${PROJECT_BINARY_DIR}/orocos_kdl-config-version.cmake DESTINATION share/orocos_kdl/cmake)
INSTALL(EXPORT OrocosKDLTargets DESTINATION share/orocos_kdl/cmake)

INSTALL(FILES package.xml DESTINATION share/orocos_kdl)
# Generate pkg-config package configuration
CONFIGURE_FILE(orocos_kdl.pc.in ${CMAKE_CURRENT_BINARY_DIR}/orocos-kdl.pc @ONLY)
CONFIGURE_FILE(orocos_kdl.pc.in ${CMAKE_CURRENT_BINARY_DIR}/orocos_kdl.pc @ONLY)

INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/orocos-kdl.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/orocos_kdl.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig)
16 changes: 0 additions & 16 deletions orocos_kdl/INSTALL

This file was deleted.

37 changes: 37 additions & 0 deletions orocos_kdl/INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Install instructions

These install instructions are focused on Debian/Ubuntu systems.

## Shared instructions

1. (Optional) Update apt cache: `sudo apt-get update`
2. Install EIGEN and cppunit: `sudo apt-get install libeigen3-dev libcppunit-dev`
3. (Optional) Install `Doxygen` and `Graphviz` to generate API-documentation: `sudo apt-get install doxygen graphviz`

## Compilation

### With catkin

1. Clone the repository inside the workspace
2. Build with your catkin tool of preference
3. Source the workspace
4. (Optional) To generate the API-documentation use either [rosdoc_lite](http://wiki.ros.org/rosdoc_lite) or
[catkin_tools_document](https://github.com/mikepurvis/catkin_tools_document)

### Without catkin

1. Clone the repository where you want
2. Go to the `orocos_kdl` folder": `cd orocos_kdl`
3. Create a new build folder (it is always better not to build in the source folder): `mkdir build`
4. Go to the build folder `cd build`
5. Execute cmake: `cmake ..`
- (Optional) Adapt `CMAKE_INSTALL_PREFIX` to the desired installation directory
- (Optional) To build the tests, add: `-DENABLE_TESTS:BOOL=ON`
- (Optional) To change the build type, add: `-DCMAKE_BUILD_TYPE=<DESIRED_BUILD_TYPE>`
6. Compile: `make`
7. Install the library: `sudo make install`
8. (Optional) To execute the tests: `make check`
9. (Optional) To create the API-documentation: `make docs`. The API-documentation will be generated at
`<builddir>/doc/api/html`.

To uninstall the library: `sudo make uninstall`
17 changes: 0 additions & 17 deletions orocos_kdl/KDLConfig.cmake.in

This file was deleted.

8 changes: 0 additions & 8 deletions orocos_kdl/README

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit fa4efee

Please sign in to comment.