-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Update point_cloud2.py to support type point xyzi #18
base: master
Are you sure you want to change the base?
Conversation
@eric-wieser Do you want me to look into it? |
This seems not particularly worth it to me. You can get what you want with numpy builtins these days: from numpy.lib.recfunctions import structured_to_unstructured
fields = ['x', 'y', 'z', 'intensity']
xyzi_arr = structured_to_unstructured(pointcloud2_to_array(cloud_msg)[fields]) |
Sure, but Ran's solution is more elegant. |
I'd argue more elegant would be to not combine the arrays into a flat array in the first place. I can't think of a convincing use-case for an array like |
Agreed. I would also expect the structure of the array to be [(x,y,z), i]. I was not talking about the implementation, but rather the ease of use. |
Perhaps then what is actually missing is |
To me, it seems unnecessary to bloat the code with special functions for many possible point types if a generic conversion is simple as |
The one advantage of |
I have use your library for a long time and am very appreciate for your hard working towards advancing this field! Thanks for your contribution all the time, Awesome work!
I updated the function in
point_cloud2.py
to support typeXYZI
point cloud, when I was trying to use your code to convert into Kitti bin format.