Skip to content

Commit 5f8d500

Browse files
authored
Merge pull request #96 from gergondet/topic/MeshScaleVector
2 parents 4cd3e19 + 112b6f6 commit 5f8d500

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2714
-4692
lines changed

.clang-format

-1
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,3 @@ Standard: Cpp11
103103
TabWidth: 2
104104
UseTab: Never
105105
...
106-

.clang-format-check.sh

-18
This file was deleted.

.clang-format-common.sh

-15
This file was deleted.

.clang-format-fix.sh

-7
This file was deleted.

.github/workflows/build.yml

+5-15
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,11 @@ on:
99
- '**'
1010

1111
jobs:
12-
13-
clang-format:
14-
runs-on: ubuntu-20.04
15-
steps:
16-
- uses: actions/checkout@v2
17-
- name: Install clang-format-10
18-
run: |
19-
sudo apt-get -qq update
20-
sudo apt-get -qq install clang-format-10
21-
- name: Run clang-format-check
22-
run: |
23-
./.clang-format-check.sh
24-
2512
build:
26-
needs: clang-format
2713
strategy:
2814
fail-fast: false
2915
matrix:
30-
os: [ubuntu-18.04, ubuntu-20.04, macos-latest, windows-latest]
16+
os: [ubuntu-20.04, macos-latest, windows-latest]
3117
build-type: [Debug, RelWithDebInfo]
3218
compiler: [gcc, clang]
3319
exclude:
@@ -68,6 +54,8 @@ jobs:
6854
ref: 7.1.0
6955
- path: jbeder/yaml-cpp
7056
ref: 29dcf92f870ee51cce8d68f8fcfe228942e8dfe1
57+
macos-options: -DPYTHON_BINDING:BOOL=OFF
58+
windows-options: -DPYTHON_BINDING:BOOL=OFF
7159
github: |
7260
- path: jrl-umi3218/Eigen3ToPython
7361
- path: jrl-umi3218/SpaceVecAlg
@@ -76,6 +64,8 @@ jobs:
7664
with:
7765
compiler: ${{ matrix.compiler }}
7866
build-type: ${{ matrix.build-type }}
67+
macos-options: -DPYTHON_BINDING:BOOL=OFF
68+
windows-options: -DPYTHON_BINDING:BOOL=OFF
7969
- name: Upload documentation
8070
# Only run on master branch and for one configuration
8171
if: matrix.os == 'ubuntu-18.04' && matrix.build-type == 'RelWithDebInfo' && matrix.compiler == 'gcc' && github.ref == 'refs/heads/master'

.github/workflows/conan.yml

-57
This file was deleted.

.github/workflows/package.yml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
uses: jrl-umi3218/github-actions/.github/workflows/package-project.yml@master
2222
with:
2323
deps: '["jrl-umi3218/Tasks"]'
24+
latest-cmake: true
2425
secrets:
2526
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
2627
GH_TOKEN: ${{ secrets.GH_PAGES_TOKEN }}

.pre-commit-config.yaml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
repos:
2+
- repo: meta
3+
hooks:
4+
- id: check-useless-excludes
5+
- id: check-hooks-apply
6+
- repo: https://github.com/pre-commit/mirrors-clang-format
7+
rev: v16.0.2
8+
hooks:
9+
- id: clang-format
10+
- repo: https://github.com/pre-commit/pre-commit-hooks
11+
rev: v4.4.0
12+
hooks:
13+
- id: check-added-large-files
14+
- id: check-ast
15+
- id: check-executables-have-shebangs
16+
- id: check-merge-conflict
17+
- id: check-yaml
18+
- id: debug-statements
19+
- id: destroyed-symlinks
20+
- id: detect-private-key
21+
- id: end-of-file-fixer
22+
- id: fix-byte-order-marker
23+
- id: mixed-line-ending
24+
- id: trailing-whitespace
25+
- repo: https://github.com/psf/black
26+
rev: 23.3.0
27+
hooks:
28+
- id: black
29+
- repo: https://github.com/MarcoGorelli/cython-lint
30+
rev: v0.15.0
31+
hooks:
32+
- id: cython-lint
33+
- id: double-quote-cython-strings
34+
- repo: https://github.com/PyCQA/flake8
35+
rev: 6.0.0
36+
hooks:
37+
- id: flake8
38+
exclude: ^binding/python/rbdyn/.*__init__.py
39+
args:
40+
- "--max-line-length=88"
41+
- repo: https://github.com/cheshirekow/cmake-format-precommit
42+
rev: v0.6.13
43+
hooks:
44+
- id: cmake-format

CMakeLists.txt

+13-7
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ include(cmake/base.cmake)
2424
include(cmake/cython/cython.cmake)
2525
include(cmake/msvc-specific.cmake)
2626

27-
project(RBDyn LANGUAGES C CXX VERSION "${PROJECT_VERSION}")
27+
project(
28+
RBDyn
29+
LANGUAGES C CXX
30+
VERSION "${PROJECT_VERSION}")
2831

2932
option(BENCHMARKS "Generate benchmarks." OFF)
3033

@@ -35,22 +38,25 @@ if(BUILD_RBDYN_PARSERS)
3538

3639
find_package(tinyxml2 QUIET NO_MODULE)
3740
if(NOT ${tinyxml2_FOUND})
38-
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/CMakeModules")
41+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
42+
"${PROJECT_SOURCE_DIR}/CMakeModules")
3943
find_package(RBDyn_TinyXML2 REQUIRED)
4044
install(FILES "${PROJECT_SOURCE_DIR}/CMakeModules/FindRBDyn_TinyXML2.cmake"
4145
DESTINATION "${CONFIG_INSTALL_DIR}")
42-
set(PACKAGE_EXTRA_MACROS "include(\${CMAKE_CURRENT_LIST_DIR}/FindRBDyn_TinyXML2.cmake)" CACHE INTERNAL "")
46+
set(PACKAGE_EXTRA_MACROS
47+
"include(\${CMAKE_CURRENT_LIST_DIR}/FindRBDyn_TinyXML2.cmake)"
48+
CACHE INTERNAL "")
4349
else()
4450
add_project_dependency(tinyxml2 REQUIRED NO_MODULE)
4551
endif()
4652

47-
# Note: technically we don't need system but it is likely to be here and
48-
# CMake <= 3.5.0 needs at least one component to define Boost::boost
53+
# Note: technically we don't need system but it is likely to be here and CMake
54+
# <= 3.5.0 needs at least one component to define Boost::boost
4955
add_project_dependency(Boost REQUIRED COMPONENTS system)
5056
endif()
5157

52-
# For MSVC, set local environment variable to enable finding the built dll
53-
# of the main library when launching ctest with RUN_TESTS
58+
# For MSVC, set local environment variable to enable finding the built dll of
59+
# the main library when launching ctest with RUN_TESTS
5460
if(MSVC)
5561
set(CMAKE_MSVCIDE_RUN_PATH "\$(SolutionDir)/src/\$(Configuration)")
5662
endif()

CMakeModules/FindRBDyn_TinyXML2.cmake

+17-19
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,33 @@
22
# Copyright 2012-2019 CNRS-UM LIRMM, CNRS-AIST JRL
33
#
44

5-
# Try to find TinyXML2
6-
# in standard prefixes and in ${TinyXML2_PREFIX}
7-
# Once done this will define
8-
# TinyXML2_FOUND - System has TinyXML
9-
# TinyXML2_INCLUDE_DIRS - The TinyXML include directories
10-
# TinyXML2_LIBRARIES - The libraries needed to use TinyXML
11-
# TinyXML2_DEFINITIONS - Compiler switches required for using TinyXML
12-
# Define TinyXML2::TinyXML2 if needed
5+
# Try to find TinyXML2 in standard prefixes and in ${TinyXML2_PREFIX} Once done
6+
# this will define TinyXML2_FOUND - System has TinyXML TinyXML2_INCLUDE_DIRS -
7+
# The TinyXML include directories TinyXML2_LIBRARIES - The libraries needed to
8+
# use TinyXML TinyXML2_DEFINITIONS - Compiler switches required for using
9+
# TinyXML Define TinyXML2::TinyXML2 if needed
1310

14-
find_path(TinyXML2_INCLUDE_DIR
11+
find_path(
12+
TinyXML2_INCLUDE_DIR
1513
NAMES tinyxml2.h
1614
PATHS ${TinyXML2_PREFIX}
17-
PATH_SUFFIXES include/tinyxml2
18-
)
19-
find_library(TinyXML2_LIBRARY
15+
PATH_SUFFIXES include/tinyxml2)
16+
find_library(
17+
TinyXML2_LIBRARY
2018
NAMES tinyxml2
21-
PATHS ${TinyXML2_PREFIX}
22-
)
19+
PATHS ${TinyXML2_PREFIX})
2320

2421
set(TinyXML2_LIBRARIES ${TinyXML2_LIBRARY})
2522
set(TinyXML2_INCLUDE_DIRS ${TinyXML2_INCLUDE_DIR})
2623

2724
include(FindPackageHandleStandardArgs)
28-
find_package_handle_standard_args(TinyXML2 DEFAULT_MSG TinyXML2_LIBRARY TinyXML2_INCLUDE_DIR)
25+
find_package_handle_standard_args(TinyXML2 DEFAULT_MSG TinyXML2_LIBRARY
26+
TinyXML2_INCLUDE_DIR)
2927
mark_as_advanced(TinyXML2_INCLUDE_DIR TinyXML2_LIBRARY)
3028
if(TinyXML2_FOUND AND NOT TARGET tinyxml2::tinyxml2)
3129
add_library(tinyxml2::tinyxml2 UNKNOWN IMPORTED)
32-
set_target_properties(tinyxml2::tinyxml2 PROPERTIES
33-
INTERFACE_INCLUDE_DIRECTORIES ${TinyXML2_INCLUDE_DIRS}
34-
IMPORTED_LOCATION ${TinyXML2_LIBRARY}
35-
)
30+
set_target_properties(
31+
tinyxml2::tinyxml2
32+
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${TinyXML2_INCLUDE_DIRS}
33+
IMPORTED_LOCATION ${TinyXML2_LIBRARY})
3634
endif()

binding/python/CMakeLists.txt

+20-10
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,33 @@
44

55
set(RBDYN_BINDINGS_MODULES rbdyn.rbdyn)
66
set(RBDYN_BINDINGS_EXPORT_SOURCES rbdyn/c_rbdyn.pxd rbdyn/rbdyn.pxd)
7-
set(RBDYN_BINDINGS_PRIVATE_SOURCES include/rbdyn_wrapper.hpp rbdyn/rbdyn.pyx rbdyn/c_rbdyn_private.pxd tests/test_rbdyn_pickle.py)
7+
set(RBDYN_BINDINGS_PRIVATE_SOURCES
8+
include/rbdyn_wrapper.hpp rbdyn/rbdyn.pyx rbdyn/c_rbdyn_private.pxd
9+
tests/test_rbdyn_pickle.py)
810
set(RBDYN_BINDINGS_TARGETS RBDyn)
911

1012
if(${BUILD_RBDYN_PARSERS})
1113
list(APPEND RBDYN_BINDINGS_MODULES rbdyn.parsers.parsers)
12-
list(APPEND RBDYN_BINDINGS_EXPORT_SOURCES rbdyn/parsers/c_parsers.pxd rbdyn/parsers/parsers.pxd rbdyn/parsers/__init__.py)
13-
list(APPEND RBDYN_BINDINGS_PRIVATE_SOURCES include/rbdyn_parsers_wrapper.hpp rbdyn/parsers/parsers.pyx rbdyn/parsers/c_parsers_private.pxd tests/test_rbdyn_parsers.py)
14+
list(APPEND RBDYN_BINDINGS_EXPORT_SOURCES rbdyn/parsers/c_parsers.pxd
15+
rbdyn/parsers/parsers.pxd rbdyn/parsers/__init__.py)
16+
list(APPEND RBDYN_BINDINGS_PRIVATE_SOURCES include/rbdyn_parsers_wrapper.hpp
17+
rbdyn/parsers/parsers.pyx rbdyn/parsers/c_parsers_private.pxd
18+
tests/test_rbdyn_parsers.py)
1419
list(APPEND RBDYN_BINDINGS_TARGETS RBDyn::Parsers)
1520
if(NOT BUILD_SHARED_LIBS)
1621
list(APPEND RBDYN_BINDINGS_TARGETS yaml-cpp tinyxml2::tinyxml2)
1722
endif()
1823
endif()
1924

20-
ADD_CYTHON_BINDINGS(rbdyn
21-
TARGETS ${RBDYN_BINDINGS_TARGETS}
22-
MODULES ${RBDYN_BINDINGS_MODULES}
23-
EXPORT_SOURCES ${RBDYN_BINDINGS_EXPORT_SOURCES}
24-
PRIVATE_SOURCES ${RBDYN_BINDINGS_PRIVATE_SOURCES}
25-
GENERATE_SOURCES rbdyn/__init__.py
26-
)
25+
make_cython_bindings(
26+
rbdyn
27+
TARGETS
28+
${RBDYN_BINDINGS_TARGETS}
29+
MODULES
30+
${RBDYN_BINDINGS_MODULES}
31+
EXPORT_SOURCES
32+
${RBDYN_BINDINGS_EXPORT_SOURCES}
33+
PRIVATE_SOURCES
34+
${RBDYN_BINDINGS_PRIVATE_SOURCES}
35+
GENERATE_SOURCES
36+
rbdyn/__init__.py)

binding/python/include/rbdyn_wrapper.hpp

+6-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* Copyright 2012-2019 CNRS-UM LIRMM, CNRS-AIST JRL
55
*/
66

7-
87
#include <RBDyn/Body.h>
98
#include <RBDyn/Joint.h>
109
#include <RBDyn/MultiBodyConfig.h>
@@ -37,24 +36,24 @@ std::vector<double> ZeroDof(Joint::Type t)
3736
return Joint::ZeroDof(t);
3837
}
3938

40-
ConfigConverter* ConfigConverterConstructor(const MultiBody& mb1, const MultiBody& mb2)
39+
ConfigConverter * ConfigConverterConstructor(const MultiBody & mb1, const MultiBody & mb2)
4140
{
4241
return rbd::ConfigConverter::sConstructor(mb1, mb2);
4342
}
4443

4544
MultiBody & const_cast_mb(const MultiBody & mb)
4645
{
47-
return const_cast<MultiBody&>(mb);
46+
return const_cast<MultiBody &>(mb);
4847
}
4948

50-
MultiBodyConfig& const_cast_mbc(const MultiBodyConfig& mbc)
49+
MultiBodyConfig & const_cast_mbc(const MultiBodyConfig & mbc)
5150
{
52-
return const_cast<MultiBodyConfig&>(mbc);
51+
return const_cast<MultiBodyConfig &>(mbc);
5352
}
5453

5554
MultiBodyGraph & const_cast_mbg(const MultiBodyGraph & mbg)
5655
{
57-
return const_cast<MultiBodyGraph&>(mbg);
56+
return const_cast<MultiBodyGraph &>(mbg);
5857
}
5958

6059
void dv_set_item(std::vector<double> & v, unsigned int idx, double value)
@@ -72,4 +71,4 @@ void mbcv_set_item(std::vector<MultiBodyConfig> & v, unsigned int idx, const Mul
7271
v[idx] = mbc;
7372
}
7473

75-
}
74+
} // namespace rbd

binding/python/rbdyn/__init__.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
2-
if hasattr(os, 'add_dll_directory'):
3-
os.add_dll_directory("@CMAKE_INSTALL_PREFIX@/bin")
42

5-
from . rbdyn import *
3+
if hasattr(os, "add_dll_directory"):
4+
os.add_dll_directory("@CMAKE_INSTALL_PREFIX@/bin")
5+
6+
from .rbdyn import *
67
from . import parsers

0 commit comments

Comments
 (0)