Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Feature: Add Python bindings #276

Draft
wants to merge 35 commits into
base: master
Choose a base branch
from
Draft

Conversation

wbthomason
Copy link
Collaborator

This PR adds a generator for Python bindings, using pybind11 and libclang. It is intended as a MVP for Python bindings; additional features (e.g. bidirectional bindings to allow overriding of virtual methods from Python) would be good to add in the future.

This isn't 100% ready for merge yet, but it's done enough that I wanted to make a draft PR to start getting eyes on the work. Currently, the generate_bindings.py script can successfully generate pybind11 code for the entirety of robowflex_library, with the following caveats/TODOs which should be resolved prior to merge.

  • It doesn't currently recognize and filter out template methods (these are only supported in specific instantiations)
  • No support for keyword/default arguments
  • generate_bindings could use some cleanup and commenting/documentation
  • We don't yet have a solution for generating bindings for external types that robowflex needs, e.g. moveit_msgs::RobotState (which currently blocks fetch_test.py from executing correctly)
  • Integration with the build isn't quite right: the extension library isn't installed to Python's search path
  • [optional] Should allow multiple modules/a hierarchical structure
  • [optional] Should allow combination with manual bindings for special cases

@wbthomason
Copy link
Collaborator Author

Should consider switching to https://github.com/wjakob/nanobind - it's pybind11 (by the same author), but for C++17 and faster (compile time and run time) as a result.

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.

1 participant