-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
PCLVisualizer tutorial issue on Windows #1601
Comments
I have tried the PCLVisualizer tutorial on Windows.
Test results of each command argument is here.
Does this tutorial will operate correctly in other environments (Linux, Mac OS)? |
Thanks a lot Tsukasa. On Linux yes, I will try on Mac over the weekend but assume that it does. I've requested people a bunch of stacktraces but the thing was kind of cryptic. The only thing I know is that the problem is triggered once you request the viewer to I would also suggest we now start with the |
This runtime error didn't occur when VTK_RENDERING_BACKEND is OpenGL.
From now on, PCL is desirable to be able to use the OpenGL2 backend for performance. |
Is the runtime error on the interactive mode, triggered when you start interacting with the mouse or does it happens regardless of the interaction? I've had a crash on Linux on '-i' when I started using the mouse. |
That runtime error will occur at the same situation on Windows. |
Does anyone have ideas to solve these errors? |
I have distribute "PCL 1.8.0 RC2 All-in-one Installer" that include VTK OpenGL/OpenGL2 backend for verify this issues. |
Thanks Tsukasa. I'll try to at least sort the bug with the interactive mode before the Hackfest. But I won't be able to sort the issue with the OpenGL2 backend. |
@SergioRAgostinho |
I don't have any of these crashes with opengl2 backend, only crashing with -i and that is caused because the viewer pointer somehow doesn't get passed to event handlers. When I changed the viewer to global variable, everything works without crashing. And I think that in this case the tutorial is wrong because it is passing the address of local variable viewer when registering callback (lines 216 and 217) |
oh and another problem on windows is when mixing static and dynamic vtk/pcl libraries, it is causing a lot of crashes. I'm currently using both vtk and pcl libraries as static without problems. It also worked when I was using both as dynamic dll's. |
Is this related to addsphere() crash? I am using win10+pcl1.8.0 and when I call addshpere() it always crashes. |
Fixed by switching VTK backend from OpenGL2 to OpenGL backend. Hope that PCL (VTK) fix this bug soon. |
Is this issue continue fixing? addPointCloudNormals still crash with
Have run VTK tests, all passed except TestStructuredGridLIC2DYSlice(this is not reason of addPointCloudNormals crash). the crash reason is:
vtkObjectFactory::RegisteredFactories->InitTraversal() got NULL result, which cause the pointer of vtkActor is NULL and the next operation is crashed. I do not know how to fixed, so... |
Recompiling PCL and VTK with OPENGL option works for me. All of the samples under pcl visualisation works for me. My env is as ::
I wrote a resolve solution https://youyue123.github.io/tech/2018/01/19/Fix-Add-Normal-Crash-Bug-for-PCL.html Hope next release of PCL could consider this issue and make a progressive way by leveraging OPENGL2 performance bonus and some regression bug. |
I went through your blog post but didn't exactly see any solution posted, just instructions for building PCL and selecting the VTK rendering engine. Nevertheless if you have indeed solved it, please consider submitting a pull request. |
After more debugging, I could confirm that almost more reasons about addPointCloudNormals crashed at Windows is cauesed by User that he does not operate completely by this rule of "How Implementation Modules Are Initialized at VTK/Build System Migration" . Put the following definition before the code will fix almost all of them: |
@bygreencn Thanks for digging that up. We now have some pointers on what to look for. @taketwo How about we migrate the default rendering engine to OpenGL 2 and see how it goes during the RC? |
I'm not sure what you mean. Backend version is a property of VTK installation that the user has, we have no control over it. |
Tsukasa controlled it in its all in one installer. I mixed concepts and thought we were setting it ourselves somehow. |
Oh, I see what you mean. But what would this bring? We already know that OpenGL 2 on Windows causes problems. Having a bunch of people try pre-compiled library and report this again won't help. I think we rather need a Windows person who knows how to compile PCL to figure out what's wrong with
And when compiling against VTK with OpenGL 2 backend, the version number in these options is changed accordingly:
|
Can this issue be add in pcl-1.9.0 milestone? |
👍 Jump on it. I'll be cleaning up things on the other topics. Edit: Don't forget to confirm that the VTK definitions are being passed properly to the tutorial. |
I can also make test on Windows (but only during work days). |
Any updates on this? |
Update Status (pcl-master ac27a0d)
|
I think we simply can't integrate static VTK into dynamic PCL dlls. If I compile PCL static as well, all works as expected. I did find a flag for g++ like this, which maybe could have solved the issue, but I haven't found a equivalent for MSVC - nor if it matters for MSVC. It seems that some functions is not correctly found (NULL pointers) - depending on the code layout - but I'm almost guessing now as its way beyond my knowledge of compiler and linking. Regards Lars |
It will take time to fully resolve this issue.
diff --git a/cmake/Modules/NSIS.template.in b/cmake/Modules/NSIS.template.in
index 09e8aa4a5..471e2756b 100644
--- a/cmake/Modules/NSIS.template.in
+++ b/cmake/Modules/NSIS.template.in
@@ -735,6 +735,13 @@ Section "-Add to path"
StrCmp $DO_NOT_ADD_TO_PATH "1" doNotAddToPath 0
Call AddToPath
doNotAddToPath:
+ ; This is temporary solution for issue #1601.
+ Push $INSTDIR\3rdParty\VTK\bin
+ StrCmp "ON" "ON" 0 doNotAddVTKToPath
+ StrCmp $DO_NOT_ADD_TO_PATH "1" doNotAddVTKToPath 0
+ StrCmp $VTK_selected "0" doNotAddVTKToPath 0
+ Call AddToPath
+ doNotAddVTKToPath:
SectionEnd
;--------------------------------
@@ -900,6 +907,12 @@ Section "Uninstall"
StrCmp $DO_NOT_ADD_TO_PATH_ "1" doNotRemoveFromPath 0
Call un.RemoveFromPath
doNotRemoveFromPath:
+ ; This is temporary solution for issue #1601.
+ Push $INSTDIR\3rdParty\VTK\bin
+ StrCmp $DO_NOT_ADD_TO_PATH_ "1" doNotRemoveVTKFromPath 0
+ StrCmp $VTK_was_installed "0" doNotRemoveVTKFromPath 0
+ Call un.RemoveFromPath
+ doNotRemoveVTKFromPath:
SectionEnd
;-------------------------------- What do you think? |
This sounds like the most reasonable approach. Do you know if there are any deficits or potential problems if we go this way? |
I think there's nothing. It just add/remove the VTK path for temporary solution. C:\Program Files\PCL\bin
+ C:\Program Files\PCL\3rdParty\VTK\bin Also, It means we are ready to generate and publish the PCL 1.10.0 All-In-One Installer (that include pre-built PCL with dynamic linked VTK as a temporary solution for this issue). |
Add install and uninstall process to add and remove VTK path to environment variables PATH. This is temporary solution for issue PointCloudLibrary#1601.
I'm not sure if this is the right place to make further comments, but for anyone else working with PCL on Windows who had been searching for a solution to this issue: I had to add the following lines #include <vtkAutoInit.h> to a cpp source file before including any other vtk libraries (meaning that these lines need to go before say, the PCL visualization module which itself includes the VTK libraries) as per explained in this vtk migration guide page. However, this means that you can't use precompiled headers to include the PCL modules that do use vtk, so you'll have to find some other workaround for that. |
Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs. |
@UnaNancyOwen does this issue only occur with deprecated OpenGL bindings? If so, we can consider the "temporary" solution as a bit more permanent (and close this issue). If it occurs with OpenGL2 bindings too, then we need to continue looking for solutions. |
@kunaltyagi It works fine with OpenGL1 rendering backend that deprecated/removed option in VTK, but it not works fine with OpenGL2 rendering backend that built as a static linking library. |
Oh. That's the reverse of expected situation. Got it 😄 |
Bumping off milestones due to lack of activity |
@UnaNancyOwen is there a recent PCL for windows release? |
@AndreV84 The latest version of PCL All-in-one Installer has been published now! Please see release page. |
@UnaNancyOwen I tried with pcl-1.11.1 all in one installer and I´m still having issue: and many more such errors concering vtk dll files. Has a solution for this kind of issues been already found? I cannot run visualizer in windows because of this. Or is my issue comming from something different? |
@Cras1990 The pre-built PCL are use dynamically linked VTK. Therefore, You need to add |
There's been some people getting exceptions on the PCLVisualizer tutorial on Windows platforms. More info in threads
http://www.pcl-users.org/Can-t-visualize-normals-Exception-thrown-td4041574.html
http://www.pcl-users.org/Access-Violation-vtkOpenGLBufferObject-GenerateBuffer-enum-vtkOpenGLBufferObject-ObjectType-td4041634.html
@UnaNancyOwen do you mind giving it a try? You're kind of our Windows person :)
The text was updated successfully, but these errors were encountered: