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

OpenGL rendering of PointClouds (2X speedup) #558

Merged
merged 6 commits into from Nov 13, 2018

Conversation

facontidavide
Copy link
Contributor

Hi,

working on another plugin (that I will submit soon) I figured out that we may use a more modern OpenGl API as described here:

https://cognitivewaves.wordpress.com/opengl-vbo-shader-vao/

I decided to try it on a plugin that I know well that display a lot of points, i.e. PointCloud2.
On my machine, under heavy load (Velodyne points with buffer size 10), the CPU usage is halved.

I also took the opportunity to use C++11 range-loops here and there.

Cheers

Davide

@facontidavide
Copy link
Contributor Author

I took the opportunity to add some improvements.

  1. Use less memory, using bytes instead of floats to represent colors.
  2. Added a button to clear the buffer (other PR of mines will also include that in the future)
  3. Unsubscribe from topic when the widget is marked as "not visible"

The latter one might be controversial, but I have a good argument ;)
PointCloud2 might be a very large message and I believe that many users will connect to the robot using Mapviz remotely, using Wifi connection.

When the plugin is disabled, it is fair to expect that no bandwidth is used.

let me know what you think :)

@facontidavide facontidavide changed the title OpenGL rendering of PointClouds speedup (2X) OpenGL rendering of PointClouds (2X speedup) Jan 12, 2018
@pjreed pjreed changed the base branch from kinetic-devel to master November 12, 2018 15:33
@pjreed pjreed merged commit 7c33baf into swri-robotics:master Nov 13, 2018
@pjreed
Copy link
Contributor

pjreed commented Nov 13, 2018

Thanks, this looks good. I also agree that it's a good idea to unsubscribe from a topic when a plugin isn't visible; I guess that was just missed on this plugin.

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