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

Automatic python bindings using Cppyy or similar system #332

Open
3 tasks
TheBricktop opened this issue Jun 29, 2022 · 5 comments
Open
3 tasks

Automatic python bindings using Cppyy or similar system #332

TheBricktop opened this issue Jun 29, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@TheBricktop
Copy link

What issue is the feature request related to?

I've noticed that in readme.md is a TODO for python bindings, i think that this is pretty easy to do now using numerous automatic binding solutions for c/cpp using python

Describe the solution you'd like

I'll probably try to create python bindings using pybind or cppyy as they are quite mature and used in few other projects, that might even allow to automate the binding process whenever new change will appear in the source code.

How to achieve this

  • TASK1 Cppyy works by feeding it header file and then linker symbols, then you can use the library itself (hopefully)
  • TASK2 according to the documentation it goes like that
  • >>> import cppyy

cppyy.include('zlib.h') # bring in C++ definitions
cppyy.load_library('libz') # load linker symbols
cppyy.gbl.zlibVersion() # use a zlib API

Describe alternatives you've considered

ive found a list of possible binding generators for python and it is here https://github.com/jslee02/awesome-cpp-python-binding-generator

@TheBricktop TheBricktop added the enhancement New feature or request label Jun 29, 2022
@ymd-stella
Copy link
Contributor

I've noticed that in readme.md is a TODO for python bindings,

I left the OpenVSLAM description as is and forgot about it. It is not a high priority for me. I am not sure what demand there is.

@TheBricktop
Copy link
Author

Well im just using the python as a gluecode for opencv, depthai and some networking for me at least the native libs that do the heavy load and a fast modifiable python code is the most optimal approach. And considering that there is a lot people experimenting with computer vision and robotics that do primarily c and python it might be a nice thing to do.

@Squiro
Copy link

Squiro commented Jul 7, 2022

Hi,

First of all I'm speaking from ignorance here: I don't know anything about Cppyy.

But... I'm not sure if an automatic binding tool can generate bindings that work properly for a system like this. I've been doing some work on Python bindings for StellaVSLAM and it's not as straightforward as it would appear.

For example, to run SLAM and the viewer together in Python, you need to create bindings that release the Python GIL. Otherwise the execution will be blocked. I'm not sure if that's something that Cppyy could infer.

(also, the bindings I've been working on are still a work in progress, there's a lot of room for improvement, I'm still fairly new at this so any help or tips are appreciated)

@TheBricktop
Copy link
Author

Wow thats a lot of work right there. Thank You very much.

@zicklag
Copy link

zicklag commented Mar 3, 2024

I can confirm that Python bindings would be useful to me. I'm working on combining Stella VSLAM with OpenCV and OpenMVS for dense reconstruction, and I could connect everything with Python and get my custom camera feed into Stella VSLAM if it had a Python API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants