Skip to content

WIP! Python bindings#29

Draft
tiesus wants to merge 4 commits intoros-perception:mainfrom
silolytics:Python_bindings
Draft

WIP! Python bindings#29
tiesus wants to merge 4 commits intoros-perception:mainfrom
silolytics:Python_bindings

Conversation

@tiesus
Copy link

@tiesus tiesus commented Jul 10, 2023

A first draft to add python bindings for open3d_conversions using pybind11.
Needs tests and a setup.py to install the code. Currently it's only usable after import through ctypes.

@nkhedekar
Copy link
Collaborator

Great initiative @tiesus !
(Converting it to a draft while its a WIP)

@nkhedekar nkhedekar marked this pull request as draft July 10, 2023 17:00
@nkhedekar nkhedekar mentioned this pull request Jul 10, 2023
@tiesus
Copy link
Author

tiesus commented Jul 17, 2023

@nkhedekar I'm sorry, really struggling with the bindings. My problem is, that the pybind code compiles, but if I use it in my own pipeline, I get the runtime error, that the whole pointcloud msg is printed to the console. I receive the following output, when i try to use the python binding for void rosToOpen3d(const sensor_msgs::PointCloud2ConstPtr& ros_pc2, open3d::geometry::PointCloud& o3d_pc, bool skip_colors)
....90, 161, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, 156, 179, 65, 118, 148, 148, 191, 36, 11, 199, 191, 0, 0, 128, 63, 60, 81, 129, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 140, 188, 179, 65, 75, 58, 202, 191, 22, 244, 198, 191, 0, 0, 128, 63, 75, 97, 67, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 163, 143, 183, 65, 78, 88, 149, 191, 31, 156, 198, 191, 0, 0, 128, 63, 183, 145, 137, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 132, 220, 182, 65, 60, 24, 1, 191, 248, 70, 198, 191, 0, 0, 128, 63, 6, 126, 155, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 188, 181, 65, 224, 37, 250, 189, 216, 54, 198, 191, 0, 0, 128, 63, 100, 112, 162, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 209, 181, 65, 32, 100, 36, 191, 82, 30, 198, 191, 0, 0, 128, 63, 236, 182, 66, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 229, 182, 65, 64, 82, 83, 189, 208, 2, 198, 191, 0, 0, 128, 63, 135, 15, 130, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 240, 183, 65, 21, 161, 171, 191, 204, 241, 197, 191, 0, 0, 128, 63, 18, 75, 133, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 208, 181, 65, 76, 230, 234, 191, 121, 234, 197, 191, 0, 0, 128, 63, 5, 157, 128, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 239, 81, 180, 65, 240, 13, 46, 190, 244, 212, 197, 191, 0, 0, 128, 63, 242, 111, 130, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 195, 5, 183, 65, 134, 85, 183, 191, 12, 101, 197, 191, 0, 0, 128, 63, 23, 177, 129, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] is_dense: True, PointCloud with 0 points., False Did you forget to #include <pybind11/stl.h>? Or <pybind11/complex.h>, <pybind11/functional.h>, <pybind11/chrono.h>, etc. Some automatic conversions are optional and require extra headers to be included when compiling your pybind11 module.

I think I'm misssing some headers, probably
sensor_msgs/point_cloud2_iterator.h but I'm new to pybind11 and don't know how to fix the error.

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.

2 participants