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

Linux only: PCLVisualizer.close() does not close the window #172

Closed
tcavallari opened this issue Jul 7, 2013 · 11 comments

Comments

Projects
None yet
7 participants
@tcavallari
Copy link
Contributor

commented Jul 7, 2013

#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:

I've looked into the pcl code and into some vtk references and it seems to me that the odd Linux behavior depends on a potentially incomplete implementation of the vtkRendererWindowInteractor's specialization for the X environment (I'm not 100% sure about this though, I don't have enough knowledge of the vtk internals).

What makes me think so is the following:
The vtkRendererWindowInteractor's TerminateApp documentation states that the function "should be overridden by platform dependent subclasses to provide a termination procedure if one is required." The Win32 and MacOS versions apparently are doing so but the X version has those "question marks" in the docs. That leaves me thinking that the implementation might have some issues..

Still, I'm not a vtk nor an X programming expert, I honestly have no idea. If someone else wants to take a look at this it might be better...

@rbrusu

This comment has been minimized.

Copy link
Member

commented Sep 7, 2013

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.

@tcavallari

This comment has been minimized.

Copy link
Contributor Author

commented Sep 9, 2013

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
}
@VictorLamoine

This comment has been minimized.

Copy link
Contributor

commented Jun 4, 2014

I have the same problem with the CloudViewer, I posted it on the mailing list few months ago:
http://www.pcl-users.org/Closing-CloudViewer-td4032686.html

I opened an issue on the VTK bug tracker:
http://www.vtk.org/Bug/view.php?id=14985

@KermMartian

This comment has been minimized.

Copy link

commented Mar 17, 2016

This bug appears to still be extant. Thanks in advance for any help with it.

@VictorLamoine

This comment has been minimized.

Copy link
Contributor

commented Mar 18, 2016

Please append a message to the VTK bug report so that it gains visibility!

http://www.vtk.org/Bug/view.php?id=14985

@giacomodabisias

This comment has been minimized.

Copy link
Contributor

commented Jun 22, 2016

Hi,
still no solution to that?

@KermMartian

This comment has been minimized.

Copy link

commented Jun 22, 2016

Nope, still no solution that I'm aware of. I bumped the VTK thread, for what it's worth.

@VictorLamoine

This comment has been minimized.

Copy link
Contributor

commented Aug 26, 2016

@IgniparousTempest

This comment has been minimized.

Copy link
Contributor

commented Sep 4, 2017

This has been fixed in 1.8.0: https://gitlab.kitware.com/vtk/vtk/issues/14985

@VictorLamoine

This comment has been minimized.

Copy link
Contributor

commented Sep 4, 2017

  • Works with VTK trunk
  • I did not test with VTK 8.0.1 release
  • Does not work with VTK 8.0 release

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;
}
@taketwo

This comment has been minimized.

Copy link
Member

commented Sep 4, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.