Skip to content

Conversation

@arntanguy
Copy link
Collaborator

@arntanguy arntanguy commented Apr 17, 2025

This PR is a work-in-progress on rewriting the current cython bindings using nanobind.

Why?

  • With the increasing use of reinforcement learning, python has to become a first-class citizen. In this space many things are at-best hard to achieve without python, and at worst nigh to impossible (e.g IsaacSim integration, pytorch, etc).
  • Current python bindings are incomplete and very hard to maintain. They were originally implemented with cython as at the time this seemed to be the best and most efficient option. Nowadays pybind11/nanobind easily fill that gap and fit much better with our C++ code base. The philosophy shifts from wrapping c++ from python, to generating python bindings from C++.
  • Current bindings rely on old versions of numpy which greatly hinders usability with modern learning frameworks
  • No documentation, no intellisense

Added niceties:

  • Strong typing and stub generation for intellisense (yes we can have nice completion and documentation directly in vscode/any modern editor)
  • Readthedoc/sphynx integration
  • Bindings available as a pip package

Status:

My priority is on getting the minimal set of bindings required for IsaacSim integration.

  • mc_rtc
    • Configuration: in progress
  • mc_rbdyn: high priority
    • Robot
    • RobotModule
  • mc_control
    • MCGlobalController
    • MCController
  • mc_tasks (Thomas)

@arntanguy arntanguy self-assigned this Oct 17, 2025
arntanguy and others added 27 commits November 18, 2025 10:15
Convert cython's test to the new bindings
Unhandled cases are left as comments, old api as well for easy
comparison. To be removed before merging.
Not fully working on ubuntu 22.04 because we need sphinx>=8.2 which
requires python > 3.10. Sphinx < 8.2 cannot use pyi stub files for
documentations
arntanguy and others added 20 commits November 18, 2025 10:15
Make RobotData non-copyable but moveable (std::unique_ptr is
non-copyable)

Bind all members, but some should probably require careful consideration
if used on robots that are already in the controller (the same holds for
c++). To be seen if these bindings should be kept alltogether
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants