Problems with screenshot taking and closing PCD Viewer

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problems with screenshot taking and closing PCD Viewer

Mr.Giskard
Greetings,

I need to have PCD Viewer take a snapshot of the rendering window on startup
and then exit

I'm running PCL 1.8.1 on Rasbian (RasPI3)

My first approach was to add a call to the saveScreenshot  method at the
very end of the main method. What I discovered was that the PNG file was
only created when i quit the viewer (pressing 'q' or closing the window). I
do not understand why that is - does the viewer keep the screenshot in a
buffer that gets flushed on quitting?

In any case, I can live with that if I can close the viewer via code. So I
added a call to close()  - again in main - after the call to saveScreenshot.
The problem is, it does not appear to work - the window stays open. I have
checked past posts in the forum on this and the problem was said to have
been resolved in 1.8.1 so am I doing something wrong?




--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Problems with screenshot taking and closing PCD Viewer

Mr.Giskard
To be more exact on what I've found after going through past posts, it
appears that there was an issue when more than 1 viewer windows were
opened and the user attempted to close the first one - even though the
close() method was called the window still remained visible

That bug was stated to have been fixed sometime last year with VTK 8
(not PCL as I mistakenly wrote) so I can't figure out why I'm facing
this issue.

If anyone is facing a similar problem or if they managed to get
PCLVisualizer.close() to work in a Linux environment please comment so
that I can understand what the status of the issue is wrt PCL

Regards

Savvas

> I need to have PCD Viewer take a snapshot of the rendering window on startup
> and then exit
>
> I'm running PCL 1.8.1 on Rasbian (RasPI3)
>
> My first approach was to add a call to the saveScreenshot  method at the
> very end of the main method. What I discovered was that the PNG file was
> only created when i quit the viewer (pressing 'q' or closing the window). I
> do not understand why that is - does the viewer keep the screenshot in a
> buffer that gets flushed on quitting?
>
> In any case, I can live with that if I can close the viewer via code. So I
> added a call to close()  - again in main - after the call to saveScreenshot.
> The problem is, it does not appear to work - the window stays open. I have
> checked past posts in the forum on this and the problem was said to have
> been resolved in 1.8.1 so am I doing something wrong?
>
>
>
>
> --
> Sent from: http://www.pcl-users.org/
> _______________________________________________
> [hidden email] / http://pointclouds.org
> http://pointclouds.org/mailman/listinfo/pcl-users
>
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Problems with screenshot taking and closing PCD Viewer

Mr.Giskard
I think I've found what I was doing wrong

In main() I was calling saveScreenshot() and close() after p->spin()
was called. From what I now understand spin() starts an infinite
rendering/interaction loop which would explain why none of my calls
had any effect until after I closed the window. I have changed spin()
to spinOnce() and now it works exactly as I wanted - the cloud is
rendered once, the screenshot is saved and the application exits
smoothly



On 02/04/2018, The Passenger <[hidden email]> wrote:

> To be more exact on what I've found after going through past posts, it
> appears that there was an issue when more than 1 viewer windows were
> opened and the user attempted to close the first one - even though the
> close() method was called the window still remained visible
>
> That bug was stated to have been fixed sometime last year with VTK 8
> (not PCL as I mistakenly wrote) so I can't figure out why I'm facing
> this issue.
>
> If anyone is facing a similar problem or if they managed to get
> PCLVisualizer.close() to work in a Linux environment please comment so
> that I can understand what the status of the issue is wrt PCL
>
> Regards
>
> Savvas
>
>> I need to have PCD Viewer take a snapshot of the rendering window on
>> startup
>> and then exit
>>
>> I'm running PCL 1.8.1 on Rasbian (RasPI3)
>>
>> My first approach was to add a call to the saveScreenshot  method at the
>> very end of the main method. What I discovered was that the PNG file was
>> only created when i quit the viewer (pressing 'q' or closing the window).
>> I
>> do not understand why that is - does the viewer keep the screenshot in a
>> buffer that gets flushed on quitting?
>>
>> In any case, I can live with that if I can close the viewer via code. So
>> I
>> added a call to close()  - again in main - after the call to
>> saveScreenshot.
>> The problem is, it does not appear to work - the window stays open. I
>> have
>> checked past posts in the forum on this and the problem was said to have
>> been resolved in 1.8.1 so am I doing something wrong?
>>
>>
>>
>>
>> --
>> Sent from: http://www.pcl-users.org/
>> _______________________________________________
>> [hidden email] / http://pointclouds.org
>> http://pointclouds.org/mailman/listinfo/pcl-users
>>
>
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users