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

[lidar] speedup create_cloud #614

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PierrickKoch
Copy link

@PierrickKoch PierrickKoch commented May 31, 2022

Up to 4000 times faster, depending on points cloud size.
Don't use struct pack_into over each point, copy numpy raw buffer instead.

  • See profiling and test scripts at [1].
  • Inspired from eric-wieser/ros_numpy [2].
  • Besides, fromstring is deprecated [3].

[1] https://gist.github.com/PierrickKoch/01181660d3427990db64056df43257a5#file-lidar_timeit-py
[2] https://github.com/eric-wieser/ros_numpy/blob/master/src/ros_numpy/point_cloud2.py
[3] https://github.com/numpy/numpy/blob/main/numpy/core/src/multiarray/multiarraymodule.c#L2248


This change is Reviewable

Up to 4000 times faster, depending on points cloud size.
Don't use struct pack_into over each point, copy numpy raw buffer instead.

* See profiling and test scripts at [1].
* Inspired from eric-wieser/ros_numpy [2].
* Besides, fromstring is deprecated [3].

[1] https://gist.github.com/PierrickKoch/01181660d3427990db64056df43257a5#file-lidar_timeit-py
[2] https://github.com/eric-wieser/ros_numpy/blob/master/src/ros_numpy/point_cloud2.py
[3] https://github.com/numpy/numpy/blob/main/numpy/core/src/multiarray/multiarraymodule.c#L2248
@ksuszka
Copy link

ksuszka commented Jun 8, 2022

Isn't this duplicate of #557 ? In any case it would be nice to have one of those merged.

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.

None yet

2 participants