Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
e7a5066
doc: Fix typo
arntanguy Jul 18, 2025
4052ad7
ci(doc): install documentation
arntanguy Mar 25, 2025
d6b6c7a
ci(doc): build doc from correct mc_rtc source folder
arntanguy Mar 25, 2025
ccfa4b1
ci(doc): build doc from correct mc_rtc source folder
arntanguy Mar 25, 2025
5c8baf6
ci: Build correct remote branch of mc_rtc
arntanguy Mar 25, 2025
112b006
ci: get the repository name in pull requests
arntanguy Mar 25, 2025
0be641f
[RobotMsh] fix wrong vector conversion for tau, alpha, and alphaD
antodld Apr 16, 2024
cbb6eab
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 16, 2024
b2f4968
[cmake] upgrade min cmake version to match cmake4.0.0 requirements
ThomasDuvinage Apr 1, 2025
660c765
Revert "[cmake] upgrade min cmake version to match cmake4.0.0 require…
arntanguy Apr 1, 2025
616ab55
Reapply "[cmake] upgrade min cmake version to match cmake4.0.0 requir…
arntanguy Apr 1, 2025
90004a4
chore: Update mc_rtc_new_fsm_controller according to cmake 4.0 requir…
arntanguy Apr 3, 2025
6716aea
doc(tutorial): Better description on starting controllers with python3
arntanguy Apr 4, 2025
d55dd6b
bindings: Set up packaging
arntanguy Apr 11, 2025
719df24
bindings: wip integration of mc_rtc::Configuration
arntanguy Apr 11, 2025
58212fd
bindings: Generate stubs file for intellisense
arntanguy Apr 12, 2025
32fbb33
Working lsp completion and clang format
arntanguy Apr 15, 2025
584481a
wip: add add
arntanguy Apr 15, 2025
d9d6bb1
bindings: use typelist to bind Configuration::add for most types
arntanguy Apr 15, 2025
2deed93
binding: Fix stub generation
arntanguy Apr 16, 2025
8928267
binding(mc_rtc): Bind add and get with typelist_visitor
arntanguy Apr 16, 2025
2ddbe45
bindings(wip): bind most elements
arntanguy Apr 16, 2025
1c79832
bindings(mc_rtc::Configuration): support vector types
arntanguy Apr 17, 2025
548d5cc
binding(mc_rtc::Configuration): Near feature-parity with former tests
arntanguy Apr 17, 2025
6e23f2e
bindings(mc_rbdyn): Setup mc_rbdyn submodule
arntanguy Apr 22, 2025
9f524b5
bindings: Refactor to only include python files in generated module
arntanguy Apr 22, 2025
e77fc89
bindings(sphinx): setup documentation
arntanguy Apr 22, 2025
1d68dfe
bindings: working sphinx autoapi documentation and modularize python …
arntanguy Apr 23, 2025
47a158c
bindings(mc_rbdyn): Bind most of RobotModule and RobotLoader
arntanguy Apr 24, 2025
c260ac3
bindings(mc_rbdyn): Bind RobotModule::Gripper and Mimic
arntanguy Apr 24, 2025
050f062
bindings(mc_rbdyn): Bind Collision and Flexibility
arntanguy Apr 24, 2025
84c7451
bindings: support importing and using sva types
arntanguy Apr 25, 2025
8813409
bindings(packaging): Import symbols into mc_rtc parent module
arntanguy Apr 25, 2025
1da759b
bindings(sphinx): Cross-reference sva doc
arntanguy Apr 25, 2025
dbb3070
bindings(mc_rbdyn): bind ForceSensor and ForceSensorCalibData
arntanguy Apr 26, 2025
eb9b022
wip(bindings): Start binding Robots/Robot
arntanguy Apr 26, 2025
26d4cfd
wip(bindings): Temporary binding of loadRobot
arntanguy Apr 28, 2025
5ad39b5
bindings(mc_rbdyn): bind all Devices
arntanguy Apr 28, 2025
62d4837
bindings(mc_rbdyn/mc_control): Bind Grippers
arntanguy Apr 28, 2025
2e5206a
bindings(mc_rbdyn): bind RobotData
arntanguy Apr 29, 2025
e4c3e21
build(bindings): Setup build targets
arntanguy Jul 23, 2025
5f17294
build(mc_rtc): Make version.h depend on build targets instead of files
arntanguy Jul 24, 2025
2306600
bindings(mc_rbdyn): bind RobotFrame
arntanguy Jul 24, 2025
0449a7e
build(bindings): Build sphinx documentation
arntanguy Jul 24, 2025
70f6e52
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 24, 2025
e7348d1
wip(bindings): add Robot bindings, untested
arntanguy Jul 25, 2025
3ee1249
doc(bindings): fix paths to python-venv in doc
arntanguy Nov 18, 2025
f3fa95b
wip(bindings): Disable ForceSensorData and RobotData bindings
arntanguy Nov 18, 2025
6c75bdd
build(bindings): use venv + forward library path + sphinx build in cmake
arntanguy Nov 19, 2025
d5ce176
build(mc_log_ui): adapt install of mc_log_ui
arntanguy Nov 19, 2025
66ecc0e
bindings(mc_log_ui): Adapt to nanobind
arntanguy Nov 19, 2025
fe41f10
refactor: move TVMKinematicsConstraint.h to include folder
ThomasDuvinage Dec 16, 2025
b1d9a95
wip: add nanobind for mc_tasks and mc_solver
ThomasDuvinage Dec 16, 2025
a36c8eb
wip(binding): switch to jrl-cmakemodules v2 | fix issues and integrat…
ThomasDuvinage Jan 20, 2026
181b002
feat(plugin): use jrl-cmakemodules v2
ThomasDuvinage Jan 20, 2026
f92ffac
fix(cmake): remove alias duplicata
ThomasDuvinage Jan 20, 2026
1c62daf
feat(plugin): use jrl-cmakemodules v2
ThomasDuvinage Jan 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: false
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/build-others.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ on:
branches:
- '**'

env:
# Branch that triggered this workflow
GITHUB_BRANCH: ${{ github.head_ref || github.ref_name }}
# Repository that triggered this workflow
GITHUB_REPO_TRIGGER: ${{ github.actor }}/${{ github.event.repository.name }}

jobs:
build:
strategy:
Expand All @@ -28,7 +34,6 @@ jobs:
with:
submodules: recursive
- name: Clone superbuild
if: matrix.os != 'windows-latest'
uses: actions/checkout@v4
with:
submodules: recursive
Expand All @@ -52,8 +57,13 @@ jobs:
echo "::group::Build base image"
docker build -t mc-rtc-ci-${{matrix.os}} .
echo "::endgroup::"
echo "::group::Run install"
docker run mc-rtc-ci-${{matrix.os}} /bin/bash -c '/source/.github/workflows/docker/build-docker.sh'
echo "::group::Build in docker"
WITH_ROS_SUPPORT=ON
if [ ${{ matrix.os }} == "debian_bullseye" ]; then
WITH_ROS_SUPPORT=OFF
fi
echo "WITH_ROS_SUPPORT=${WITH_ROS_SUPPORT}"
docker run mc-rtc-ci-${{matrix.os}} /bin/bash -c "cd /source/mc-rtc-superbuild && ./utils/bootstrap-linux.sh && git config --global user.email '[email protected]' && git config --global user.name 'Arnaud Tanguy (Automated CI update)' && mkdir -p ${TMPDIR-/tmp}/build-mc-rtc && cmake -S /source/mc-rtc-superbuild -B ${TMPDIR-/tmp}/build-mc-rtc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVERBOSE_TEST_OUTPUT=ON -DWITH_ROS_SUPPORT=${WITH_ROS_SUPPORT} -DMC_RTC_SUPERBUILD_OVERRIDE_mc_rtc_GITHUB=${GITHUB_REPO_TRIGGER} -DMC_RTC_SUPERBUILD_OVERRIDE_mc_rtc_GIT_TAG=origin/${GITHUB_BRANCH} && cmake --build ${TMPDIR-/tmp}/build-mc-rtc --config RelWithDebInfo"
echo "::endgroup::"
- name: Slack Notification
if: failure()
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ on:
branches:
- '**'

env:
# Branch that triggered this workflow
GITHUB_BRANCH: ${{ github.head_ref || github.ref_name }}
# Repository that triggered this workflow
GITHUB_REPO_TRIGGER: ${{ github.actor }}/${{ github.event.repository.name }}

jobs:
build:
strategy:
Expand Down Expand Up @@ -70,7 +76,12 @@ jobs:
shell: bash
run: |
mkdir -p ${TMPDIR-/tmp}/build-mc-rtc
cmake -S ${GITHUB_WORKSPACE}/mc-rtc-superbuild -B ${TMPDIR-/tmp}/build-mc-rtc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVERBOSE_TEST_OUTPUT=ON
cmake -S ${GITHUB_WORKSPACE}/mc-rtc-superbuild \
-B ${TMPDIR-/tmp}/build-mc-rtc \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DINSTALL_DOCUMENTATION=ON \
-DMC_RTC_SUPERBUILD_OVERRIDE_mc_rtc_GITHUB=${GITHUB_REPO_TRIGGER} \
-DMC_RTC_SUPERBUILD_OVERRIDE_mc_rtc_GIT_TAG="origin/${GITHUB_BRANCH}"

- name: "[superbuild] Install mc_rtc and related projects"
if: matrix.os != 'windows-latest'
Expand Down Expand Up @@ -141,11 +152,11 @@ jobs:

- name: Upload documentation
# Only run on master branch and for one configuration
if: matrix.os == 'ubuntu-20.04' && matrix.build-type == 'RelWithDebInfo' && matrix.compiler == 'gcc' && github.ref == 'refs/heads/master' && github.repository == 'jrl-umi3218/mc_rtc'
if: matrix.os == 'ubuntu-22.04' && matrix.build-type == 'RelWithDebInfo' && matrix.compiler == 'gcc' && github.ref == 'refs/heads/master' && github.repository == 'jrl-umi3218/mc_rtc'
run: |
set -x
pushd .
cd doc
cd ${TMPDIR-/tmp}/build-mc-rtc/src/mc_rtc/doc
cp -r /usr/local/share/doc/mc_rtc/doxygen-html .
find . -type f -print0 | xargs -0 sed -i -e's@/usr/local/share/doc/SpaceVecAlg/doxygen-html/@https://jrl-umi3218.github.io/SpaceVecAlg/doxygen/HEAD/@g'
find . -type f -print0 | xargs -0 sed -i -e's@/usr/local/share/doc/RBDyn/doxygen-html/@https://jrl-umi3218.github.io/RBDyn/doxygen/HEAD/@g'
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/docker/build-docker.sh

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ compile_commands.json
.vscode/
utils/build_and_install_user_config.sh
.cache/
binding/nanobind/build/
binding/nanobind/dist/
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "cmake"]
path = cmake
url = https://github.com/jrl-umi3218/jrl-cmakemodules
url = https://github.com/ahoarau/jrl-cmakemodules.git
[submodule ".jrl-ci"]
path = .jrl-ci
url = https://github.com/jrl-umi3218/jrl-travis.git
Expand Down
2 changes: 1 addition & 1 deletion 3rd-party/qhull/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
# $Id: //main/2019/qhull/CMakeLists.txt#21 $$Change: 3039 $
# $DateTime: 2020/09/03 21:26:22 $$Author: bbarber $

cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.5)
project(qhull)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_VISIBILITY_PRESET default)
Expand Down
50 changes: 26 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright 2015-2020 CNRS-UM LIRMM, CNRS-AIST JRL
#

cmake_minimum_required(VERSION 3.15)
cmake_minimum_required(VERSION 3.24)
if(POLICY CMP0063)
cmake_policy(SET CMP0063 NEW)
endif()
Expand All @@ -29,17 +29,18 @@ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_C_STANDARD 99)
set(CMAKE_CXX_STANDARD 17)

find_package(jrl-cmakemodules 0.2.0 CONFIG QUIET)

include(cmake/get-jrl-cmakemodules.cmake)
include(cmake/base.cmake)
include(cmake/cython/cython.cmake)
include(cmake/msvc-specific.cmake)
include(cmake/version-script.cmake)
jrl_configure_defaults()

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

project(${PROJECT_NAME} C CXX)
set(MC_RTC_SOURCE_DIR "${PROJECT_SOURCE_DIR}")

set_default_cmake_build_type(RelWithDebInfo)
# set_default_cmake_build_type(RelWithDebInfo)

if(NOT DEFINED MC_RTC_INSTALL_PREFIX)
set(MC_RTC_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
Expand All @@ -51,7 +52,7 @@ else()
set(MC_RTC_LOADER_DEBUG_SUFFIX "")
endif()

option(GENERATE_COVERAGE "Generate coverage data" FALSE)
jrl_option(GENERATE_COVERAGE "Generate coverage data" FALSE)
if("${CMAKE_CXX_FLAGS}" MATCHES "--coverage")
set(GENERATE_COVERAGE
TRUE
Expand All @@ -64,25 +65,26 @@ if("${CMAKE_CXX_FLAGS}" MATCHES "--coverage")
)
endif()

option(TREAT_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF)
jrl_option(TREAT_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF)

option(BUILD_CONTROLLER_SAMPLES "Build sample controllers in the project" ON)
option(DISABLE_CONTROLLER_TESTS "Disable controller unit tests" OFF)
option(DISABLE_ROBOT_TESTS "Disable RobotModule unit tests" OFF)
option(ENABLE_FAST_TESTS "Run controllers tests for a few iterations" OFF)
jrl_option(BUILD_CONTROLLER_SAMPLES "Build sample controllers in the project" ON)
jrl_option(DISABLE_CONTROLLER_TESTS "Disable controller unit tests" OFF)
jrl_option(DISABLE_ROBOT_TESTS "Disable RobotModule unit tests" OFF)
jrl_option(ENABLE_FAST_TESTS "Run controllers tests for a few iterations" OFF)
jrl_option(NANOBIND_BINDINGS "Build nanobind Python bindings" ON)

option(BUILD_BENCHMARKS "Build benchmarks" OFF)
jrl_option(BUILD_BENCHMARKS "Build benchmarks" OFF)

option(MC_RTC_BUILD_STATIC
jrl_option(MC_RTC_BUILD_STATIC
"Build a static version of mc_rtc, this has no support for pluggable components"
OFF
)
option(MC_RTC_DISABLE_NETWORK "Build without network support" OFF)
option(MC_RTC_DEVELOPER_MODE
jrl_option(MC_RTC_DISABLE_NETWORK "Build without network support" OFF)
jrl_option(MC_RTC_DEVELOPER_MODE
"Disable exact version embedding to speed up recompilations" OFF
)

option(DISABLE_ROS "Build without ROS support (even if ROS was found)" OFF)
jrl_option(DISABLE_ROS "Build without ROS support (even if ROS was found)" OFF)

set(BOOST_STACKTRACE "")
set(BOOST_USE_STACKTRACE_DEFINE "")
Expand Down Expand Up @@ -115,15 +117,15 @@ if(BOOST_STACKTRACE STREQUAL "")
)
endif()

add_project_dependency(Boost REQUIRED COMPONENTS filesystem timer ${BOOST_STACKTRACE})
add_project_dependency(Tasks REQUIRED)
add_project_dependency(TVM REQUIRED)
jrl_find_package(Boost REQUIRED COMPONENTS filesystem timer ${BOOST_STACKTRACE})
jrl_find_package(Tasks REQUIRED)
jrl_find_package(TVM REQUIRED)
if(NOT TARGET RBDyn::Parsers)
message(FATAL_ERROR "RBDyn must be built with parsers support")
endif()
add_project_dependency(eigen-quadprog REQUIRED)
add_project_dependency(state-observation REQUIRED)
add_project_dependency(ndcurves REQUIRED)
jrl_find_package(eigen-quadprog REQUIRED)
jrl_find_package(state-observation REQUIRED)
jrl_find_package(ndcurves REQUIRED)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules)

Expand Down Expand Up @@ -273,8 +275,8 @@ add_subdirectory(src)
add_subdirectory(plugins)
add_subdirectory(utils)

if(${PYTHON_BINDING})
add_subdirectory(binding/python)
if(NANOBIND_BINDINGS OR PYTHON_BINDING)
add_subdirectory(binding)
endif()

if(${BUILD_TESTING})
Expand Down
21 changes: 21 additions & 0 deletions binding/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
if(NANOBIND_BINDINGS)
message(STATUS "[${PROJECT_NAME}] Building Python bindings")
jrl_find_python(3.8 REQUIRED COMPONENTS Interpreter Development.Module)
jrl_find_nanobind(2.4.0 CONFIG REQUIRED)
jrl_find_package(nanoeigenpy CONFIG REQUIRED)
add_subdirectory(nanobind)

# Adds a target to build docs using Sphinx The sphinx mode is any mode supported by
# Sphinx, e.g., html, latexpdf, etc.
function(add_sphinx_target sphinx_mode)
add_custom_target(
mc_rtc-nanobind-docs
COMMAND make html
WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/nanobind/docs"
COMMENT "Build Sphinx ${sphinx_mode} documentation for nanobind"
)
endfunction()
add_sphinx_target(html)
elseif(PYTHON_BINDING)
add_subdirectory(binding/python)
endif()
2 changes: 2 additions & 0 deletions binding/nanobind/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CMakeCache.txt
CMakeFiles/
115 changes: 115 additions & 0 deletions binding/nanobind/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# We are now ready to compile the actual extension module
nanobind_add_module(
# Name of the extension
_mc_rtc
# Target the stable ABI for Python 3.12+, which reduces the number of binary wheels
# that must be built. This does nothing on older Python versions
STABLE_ABI
# Build libnanobind statically and merge it into the extension (which itself remains a
# shared library)
#
# If your project builds multiple extensions, you can replace this flag by NB_SHARED
# to conserve space by reusing a shared libnanobind across libraries
NB_STATIC
LTO
# Main mc_rtc module
src/mc_rtc_module/mc_rtc_module.cpp
# mc_rtc.mc_rtc submodule
src/mc_rtc_module/mc_rtc/bind_Configuration.cpp
src/mc_rtc_module/mc_rtc/bind_Loader.cpp
# mc_rtc.mc_rbdyn submodule
src/mc_rtc_module/mc_rbdyn/mc_rbdyn_module.cpp
src/mc_rtc_module/mc_rbdyn/bind_ForceSensor.cpp
src/mc_rtc_module/mc_rbdyn/bind_JointSensor.cpp
src/mc_rtc_module/mc_rbdyn/bind_RobotModule.cpp
src/mc_rtc_module/mc_rbdyn/bind_Device.cpp
src/mc_rtc_module/mc_rbdyn/bind_RobotData.cpp
src/mc_rtc_module/mc_rbdyn/bind_RobotFrame.cpp
src/mc_rtc_module/mc_rbdyn/bind_Robots.cpp
src/mc_rtc_module/mc_rbdyn/bind_Robot.cpp
# mc_rtc.mc_control submodule
src/mc_rtc_module/mc_control/mc_control_module.cpp
src/mc_rtc_module/mc_control/bind_Gripper.cpp
# mc_rtc.mc_tasks submodule
src/mc_rtc_module/mc_tasks/mc_tasks_module.cpp
src/mc_rtc_module/mc_tasks/bind_MetaTask.cpp
src/mc_rtc_module/mc_tasks/bind_TrajectoryTaskGeneric.cpp
src/mc_rtc_module/mc_tasks/bind_PostureTask.cpp
src/mc_rtc_module/mc_tasks/bind_TransformTask.cpp
src/mc_rtc_module/mc_tasks/bind_GazeTask.cpp
src/mc_rtc_module/mc_tasks/bind_PositionTask.cpp
src/mc_rtc_module/mc_tasks/bind_OrientationTask.cpp
src/mc_rtc_module/mc_tasks/bind_EndEffectorTask.cpp
src/mc_rtc_module/mc_tasks/bind_ImpedanceTask.cpp
src/mc_rtc_module/mc_tasks/bind_CoMTask.cpp
src/mc_rtc_module/mc_tasks/bind_CoPTask.cpp
src/mc_rtc_module/mc_tasks/bind_ComplianceTask.cpp
src/mc_rtc_module/mc_tasks/bind_BSplineTrajectoryTask.cpp
# mc_rtc.mc_solver submodule
src/mc_rtc_module/mc_solver/mc_solver_module.cpp
src/mc_rtc_module/mc_solver/bind_QPSolver.cpp
src/mc_rtc_module/mc_solver/bind_KinematicsConstraint.cpp
src/mc_rtc_module/mc_solver/bind_DynamicsConstraint.cpp
src/mc_rtc_module/mc_solver/bind_ContactConstraint.cpp
src/mc_rtc_module/mc_solver/bind_CompoundJointConstraint.cpp
src/mc_rtc_module/mc_solver/bind_CoMIncPlaneConstr.cpp
src/mc_rtc_module/mc_solver/bind_CollisionsConstraint.cpp
src/mc_rtc_module/mc_solver/bind_BoundedSpeedConstr.cpp
)

jrl_check_python_module_name(_mc_rtc)
target_link_libraries(_mc_rtc PRIVATE mc_rtc::mc_rtc_utils mc_rtc::mc_rbdyn mc_rtc::mc_tasks mc_rtc::mc_solver mc_rtc::mc_control)
target_include_directories(
_mc_rtc PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
jrl_target_set_default_compile_options(_mc_rtc PRIVATE)
jrl_target_set_output_directory(_mc_rtc OUTPUT_DIRECTORY
${CMAKE_BINARY_DIR}/lib/site-packages/mc_rtc)


set(MC_RTC_MODULES mc_rtc mc_rbdyn mc_control mc_tasks mc_solver)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/__init__.py
${CMAKE_BINARY_DIR}/lib/site-packages/mc_rtc/__init__.py COPYONLY)

foreach(MODULE IN LISTS MC_RTC_MODULES)
set(MOD_DIR "${CMAKE_BINARY_DIR}/lib/site-packages/mc_rtc/${MODULE}")
file(MAKE_DIRECTORY "${MOD_DIR}")

set(MODULE_NAME ${MODULE})
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/__init__stub.conf.py
${MOD_DIR}/__init__.py
@ONLY
)

nanobind_add_stub(
mc_rtc_${MODULE}_stub
MODULE
mc_rtc._mc_rtc.${MODULE}
OUTPUT
${MOD_DIR}/__init__.pyi
MARKER_FILE
${MOD_DIR}/py.typed
PYTHON_PATH
${CMAKE_BINARY_DIR}/lib/site-packages
DEPENDS
_mc_rtc
VERBOSE
)
endforeach()

jrl_python_compile_all(DIRECTORY ${CMAKE_BINARY_DIR}/lib/site-packages/mc_rtc
VERBOSE)

jrl_python_compute_install_dir(python_install_dir)
install(
DIRECTORY ${CMAKE_BINARY_DIR}/lib/site-packages/mc_rtc
DESTINATION ${python_install_dir}
FILES_MATCHING
PATTERN "*.py"
PATTERN "*.pyc"
PATTERN "*.pyi"
PATTERN "*.typed"
PATTERN "*.so"
PATTERN "*.pyd")
17 changes: 17 additions & 0 deletions binding/nanobind/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# nanobind python bindings for mc_rtc

## Build

This is integrated in CMake, the following targets are available:
- `mc_rtc-nanobind-bindings`
- `force-mc_rtc-nanobind-bindings`

See https://nanobind.readthedocs.io/en/latest/packaging.html for details

## Doc

```
cd docs
pip install sphinx sphinx-autoapi sphinx-book-theme
make html
```
Loading