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
Linux only: PCLVisualizer.close() does not close the window #172
Comments
Can we build a small example that we can run to replicate this bug? I'm not familiar with the issue - I always assumed .close () works well. |
The code snippet in #85 should be fine; I'm pasting it here to avoid confusion: #include <pcl/io/pcd_io.h>
#include <pcl/visualization/pcl_visualizer.h>
int main (int argc, char ** argv)
{
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>());
pcl::io::loadPCDFile("bunny.pcd", *cloud);
{
pcl::visualization::PCLVisualizer viewer;
viewer.addPointCloud(cloud);
viewer.spin(); // if you press Q the spin loop terminates but
viewer.close(); // the window does not close,
// it remains open and frozen behind the new window
}
{
pcl::visualization::PCLVisualizer viewer;
viewer.addPointCloud(cloud);
viewer.spin();
viewer.close();
}
// both windows close now because the program terminates
} |
I have the same problem with the CloudViewer, I posted it on the mailing list few months ago: I opened an issue on the VTK bug tracker: |
This bug appears to still be extant. Thanks in advance for any help with it. |
Please append a message to the VTK bug report so that it gains visibility! |
Hi, |
Nope, still no solution that I'm aware of. I bumped the VTK thread, for what it's worth. |
Issue has moved to: https://gitlab.kitware.com/vtk/vtk/issues/14985 |
This has been fixed in 1.8.0: https://gitlab.kitware.com/vtk/vtk/issues/14985 |
I have tested with the latest VTK and PCL trunk; it works. #include <pcl/io/pcd_io.h>
#include <pcl/visualization/pcl_visualizer.h>
int main(void)
{
{
pcl::visualization::PCLVisualizer viewer;
viewer.spin();
viewer.close();
}
{
pcl::visualization::PCLVisualizer viewer;
viewer.spin();
viewer.close();
}
return 0;
} |
The merge request that fixed the problem in VTK is marked for the 8.0.1 milestone, so I suppose this is the first version that has the problem fixed. |
This bug still seems to exist in some form in 1.9.1. When I run the above test the window does not close. When I use spinOnce instead of spin it closes but only in the test case, and because the whole program closes. When the program doesn't close the window also does not close. I'm using following code:
I guess this is a bug? Is there a way to close the window with another method or a workaround? |
@Kaju-Bubanja In my case, the line #include <pcl/io/pcd_io.h>
#include <pcl/visualization/pcl_visualizer.h>
int main(void)
{
{
pcl::visualization::PCLVisualizer viewer;
viewer.spin();
viewer.close();
}
{
pcl::visualization::PCLVisualizer viewer;
viewer.spin();
viewer.close();
}
return 0;
} I was using pcl1.11 and vtk8.2. |
I need to ask for some user input after visualizing clouds but the viewer does not close when quitted. #include <pcl/io/pcd_io.h>
#include <pcl/visualization/pcl_visualizer.h>
int main(void)
{
{
pcl::visualization::PCLVisualizer viewer;
viewer.spin();
viewer.close();
} // closes fine
{
pcl::visualization::PCLVisualizer viewer;
viewer.spin();
viewer.close();
} // will not close until return 0
cout << "Input: ";
cin >> type;
cout << type;
return 0;
} When waiting for a user input the viewer window wont close until the application ends. Any ideas on how to get the viewer window closed before continuing with cin? When running: {
pcl::visualization::PCLVisualizer viewer("viewer1");
viewer.spin();
viewer.close();
}
for(int i = 0; i < 100000; i++) {
std::cout << i;
}
std::cout << std::endl;
{
pcl::visualization::PCLVisualizer viewer("viewer2");
viewer.spin();
viewer.close();
} also "viewer1" will freeze until the for loop is over. |
Any updates on this? I experience the same behavior as @PerceptMD with PCL 1.11 and VTK 6.3 on Ubuntu 18.04. |
@vebjornjr , did you figure out how to solve this issue? I have the same problem on Ubuntu 20.04 and vtk7-7.1.1 |
I also tried what is mentioned in #3959 (comment) without success. |
#85 fixed the bug for Windows and MacOS but apparently that is not enough on Linux with vtk 5.8.
A quote from that thread that might help:
The text was updated successfully, but these errors were encountered: