PointCloudLibrary / PointCloudLibrary/pcl
PCLVisualizer slows down considerably when calling spinOnce from keyboardCallback
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.1k
- Forks
- 4.7k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 6
Description
Your Environment
- Operating System and version: Ubuntu 18.04
- Compiler: gcc 7.4.0
- PCL Version: 1.9
- VTK Version : 6.3
Context
I have created a simple cloud viewer which loops through every .pcd file in a directory and
upon hitting the "n" key, updates the currently viewer point cloud on screen
When i call the viewer->spinOnce() method from inside the callback function, after a few
callbacks the viewer slows down to the point where it's unusable and i have to interrupt the program
Solution, simply remove the viewer->spinOnce() method from inside the keyboard callback and keep it only in the "main loop"
Code to Reproduce
- slow_viewer.cpp contains the source code for the "project"
slow_viewer.zip
I have no idea if this is a bug.
I could not find an implementation of the spinOnce method to investigate.
I am aware of #2386 but upon looking at the memory usage of the programm (with htop) it does not seem to leak memory..
I guess this is more of a question of why is this happening, thnx :)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the attached slow_viewer.cpp and reproduce the slowdown by calling PCLVisualizer::spinOnce from the keyboard callback, comparing it with calling spinOnce only in the main loop. Trace the available spinOnce implementation and callback behavior; done means identifying whether this is a bug and documenting or addressing the cause.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-vision
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100