[vtkusers] VTK with OpenVR on Linux (HTC Vive)

Ken Martin ken.martin at kitware.com
Tue Oct 9 08:42:22 EDT 2018


You have to explicitly instantiate the OpenVR classes. Basically change

  vtkNew<vtkRenderWindow> renderWindow;

to

vtkNew<vtkOpenVRRenderWindow> renderWindow;

for renderwindow, renderer, interactor and camera.  Give that a shot.

Thanks!
Ken


On Tue, Oct 9, 2018 at 7:55 AM, <deubel at dornheim-medical-images.com> wrote:

> Dear Ken,
> I finally managed to get my code building and running on both Windows and
> Linux.
> You can find it here:
> https://transfer.sh/gJ1Sg/vtkOpenVRHelloWorld.zip
>
> Unfortunately, it doesn't work with the latest VTK-Version from
> https://gitlab.kitware.com/vtk/vtk
> After some testing, I found the first commit it doesn't build with:
> https://gitlab.kitware.com/vtk/vtk/commit/61bc6b5b4b8f0d2d111f6c10af3dd7
> 9488f919cc
> (VTK builds, but my program doesn't build with this VTK Version)
>
> Even though I already use the vtkOpenVR* classes explicitly, it doesn't
> build.
> Is there something else I have to change to make it compatible?
>
> Make produces the following Linker error:
>
> [ 50%] Linking CXX executable vtkOpenVRHelloWorld
> CMakeFiles/vtkOpenVRHelloWorld.dir/CylinderRenderingProperties.cxx.o: In
> function `vtkRenderingOpenGL2_AutoInit::vtkRenderingOpenGL2_AutoInit()':
> /media/max/home/max/build-vtk-current-master-Desktop_Qt_5_
> 11_2_GCC_64bit-Default/Rendering/OpenGL2/vtkRenderingOpenGL2Module.h:47:
> undefined reference to `vtkRenderingOpenVR_AutoInit_Construct()'
> CMakeFiles/vtkOpenVRHelloWorld.dir/CylinderRenderingProperties.cxx.o: In
> function `vtkRenderingOpenGL2_AutoInit::~vtkRenderingOpenGL2_AutoInit()':
> /media/max/home/max/build-vtk-current-master-Desktop_Qt_5_
> 11_2_GCC_64bit-Default/Rendering/OpenGL2/vtkRenderingOpenGL2Module.h:47:
> undefined reference to `vtkRenderingOpenVR_AutoInit_Destruct()'
>
> Any help would be appreciated!
>
> Best regards,
> Max.D.
>
>
> 4. Oktober 2018 16:10, "Ken Martin" <ken.martin at kitware.com
> <ken.martin at kitware.com?to=%22Ken%20Martin%22%20%3Cken.martin at kitware.com%3E>>
> schrieb:
>
> You need to create an use an OpenVRCamera. From your code it doesn't look
> like you are. I doubt that is the crash but it could be.
> Does the example work on windows? Since linux is an unknown I would think
> it would be best to make sure you have something working on windows, then
> port to linux.
> On Thu, Oct 4, 2018 at 9:56 AM, <deubel at dornheim-medical-images.com>
> wrote:
>
> Hey Guys,
> Has anyone of you been able to use the vtkOpenVR classes on Linux?
> I can run Steam with SteamVR on a Ubuntu 18.04 system, but when I try to
> run the HelloWorld Example of VTK modified for VR, I encounter a
> segmentation fault.
> You can find the code I used here: https://pastebin.com/gjsvKy58
> The whole project with binary and core dump can be found here:
> https://transfer.sh/6vONY/build.zip
>
> Do you have any suggestions on how to get this working?
>
> Thanks in advance!
>
> Best regards,
> Max.Deubel
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensou
> rce/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/vtkusers
>
>
>
>
> --
> Ken Martin PhD
> Distinguished Engineer
> Kitware Inc.
> 101 East Weaver Street
> <https://maps.google.com/?q=101+East+Weaver+Street+Carrboro,+North+Carolina+27510+USA&entry=gmail&source=g>
> Carrboro, North Carolina
> <https://maps.google.com/?q=101+East+Weaver+Street+Carrboro,+North+Carolina+27510+USA&entry=gmail&source=g>
> 27510 USA
> <https://maps.google.com/?q=101+East+Weaver+Street+Carrboro,+North+Carolina+27510+USA&entry=gmail&source=g>
> This communication, including all attachments, contains confidential and
> legally privileged information, and it is intended only for the use of the
> addressee. Access to this email by anyone else is unauthorized. If you are
> not the intended recipient, any disclosure, copying, distribution or any
> action taken in reliance on it is prohibited and may be unlawful. If you
> received this communication in error please notify us immediately and
> destroy the original message. Thank you.
>
>
>
>


-- 
Ken Martin PhD
Distinguished Engineer
Kitware Inc.
101 East Weaver Street
Carrboro, North Carolina
27510 USA

This communication, including all attachments, contains confidential and
legally privileged information, and it is intended only for the use of the
addressee.  Access to this email by anyone else is unauthorized. If you are
not the intended recipient, any disclosure, copying, distribution or any
action taken in reliance on it is prohibited and may be unlawful. If you
received this communication in error please notify us immediately and
destroy the original message.  Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20181009/7f707b4f/attachment.html>


More information about the vtkusers mailing list