-
Notifications
You must be signed in to change notification settings - Fork 39
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
how to write c++ functions that accept numpy arrays with custom numeric types exposed via EigenPy #378
Comments
because i removed minieigen. but now function signatures don't match. i asked for help from the eigenpy people at stack-of-tasks/eigenpy#378, since they've likely solved this problem and there's a model of it in their codebase somewhere
this SO post suggests copying in the data for the python --> c++ direction, but i dislike this. there should be a way to do it directly, to provide an overload / interoperability layer. |
related open question, i think: https://stackoverflow.com/questions/76065711/converting-pyarray-to-eigenref-from-c |
one more closely-related SO question, this time using eigency (but sadly not eigenpy) |
Please look at this test eigenpy/unittest/user_type.cpp Lines 134 to 138 in e945a06
|
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
I'm looking for a bit of help.
I have C++ functions that accept Eigen vectors and matrices. And those functions are exposed to Python via Boost.Python, as are my numeric types, and I have exposed Eigen containers of my numeric types via EigenPy. So I think this is an eigenpy question.
But I'm struggling to provide inter-operability between the Eigen vectors for C++ calls and numpy containers with dtype my custom numeric type.
Do you have examples in eigenpy or pinnochio of a C++ function accepting Eigen data, but which when exposed to Python accepts numpy?
super cut-down example code
where
N
is my wrapped custom numeric type.But the call in Python fails because the C++ function expects an Eigen container, but it's getting a numpy container.
My specific error message:
The text was updated successfully, but these errors were encountered: