Access violation exception Oculus VR DK2

1

This python code raises vioaltion access error(last line):

import time
from ovrsdk import *

ovr_Initialize()
hmd = ovrHmd_Create(0)
hmdDesc = ovrHmdDesc()
ovrHmd_GetDesc(hmd, byref(hmdDesc))

Error:

  File "D:\Georgy2\mypyscripts\ovr01.py", line 12, in <module>
    ovrHmd_GetDesc(hmd, byref(hmdDesc))
WindowsError: exception: access violation reading 0x00001148

I've installed last version of

Technical info:

Display Driver Version: 1.2.6.0
Positional Tracker Driver Version: 1.0.14.0
Intel(R) HD Graphics
        Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz
HMD Firmware: 2.12
Connected to OVRService server.

Code is from the https://github.com/cmbruns/pyovr

I am new to python and (analogously to C case) I checked the values of hmd and hmdDesc. They are not zero:

<ovrsdk.windows.wrapper.LP_struct_ovrHmdStruct object at 0x02098210>
<ovrsdk.windows.wrapper.struct_ovrHmdDesc_ object at 0x020983F0>

How to solve this problem? (I need simple scene to do some math with image in VR.)

p.s. I have to ask here because of Oculus Forums are not working for me. (the page https://secure.oculus.com/login/ does not look correct)

python
oculus
asked on Stack Overflow Jul 20, 2016 by ged

2 Answers

3

What Oculus runtime version do you have installed? The import statement and the calls you're making make it look as if you're using this library, but that hasn't been updated in two years. I'm not sure it will even work with a DK2 compatible runtime.

If you're on Windows (and only targeting windows) you should be using the 1.3 runtime at least. If you're targeting Linux and Mac, you should be using the 0.8 runtime, with the understanding that it won't work with any Windows machine running the 1.3 runtime.

In order to use those versions with Python you need to be using the cmbruns python bindings, which include a number of examples along with the bindings.

answered on Stack Overflow Jul 20, 2016 by Jherico
1

Like @Jherico mentioned, your code

# Where the heck did you get this, Dunaev? Not from https://github.com/cmbruns/pyovr
from ovrsdk import *
ovr_Initialize()
...

is NOT using the API from https://github.com/cmbruns/pyovr

Look at the examples over there, and do something like

import ovr
ovr.initialize(None)
...
answered on Stack Overflow Nov 4, 2016 by Christopher Bruns

User contributions licensed under CC BY-SA 3.0