Open throni3git opened 1 year ago
Do you get that error message on the very first frame?
I saw a similar error message many times while debugging that script.
I recommend carefully examining the time values. Add frame_info = xr.wait_frame(...)
and look at the frame_info.predicted_display_time
. Do the numbers look similar?
I too was using Win10 and HTC Vive. I presume you are using the SteamVR runtime?
thanks for your quick answer, i will try when i am back on the machine. the error occured after some state flags were printed, then on the first frame, yes. when i checked the xr_time.value
it was zero.
as i am new to openXR and beforehand i used OpenVR with SteamVR runtime, can you please point me to instructions to avoid the SteamVR runtime?
my use case will be a simple tracking with my own calibration that should run on Linux and on Windows without HMD. once this example runs, i will try to port it to Linux as well. do you also plan to port it?
i closed this by accident but i reopened it.
my output is:
OpenXR session state changed to xr.SessionState.IDLE
OpenXR session state changed to xr.SessionState.READY
OpenXR session state changed to xr.SessionState.SYNCHRONIZED
OpenXR session state changed to xr.SessionState.VISIBLE
OpenXR session state changed to xr.SessionState.FOCUSED
frame_info.predicted_display_time:
75619184201800
xr_time_now.value:
708503500
Traceback (most recent call last):
File "c:\Users\TT\Desktop\Arbeit\pyopenxr_examples-main\xr_examples\headless.py", line 196, in <module>
space_location = xr.locate_space(
File "C:\Users\TT\Desktop\Arbeit\BLS-python\venv39\lib\site-packages\xr\functions.py", line 375, in locate_space
raise result
xr.exception.TimeInvalidError: The provided basetype:XrTime was zero, negative, or out of range.
please try the latest version of headless.py
i suspect that different versions of python return different things for time.perf_counter_ns()
, so i cut out the middleman and reached straight for the official QueryPerformanceCounter() function using ctypes.
thanks! now this works. i am using Python 3.9, what is your version?
regarding your statement "I presume you are using the SteamVR runtime?": is it avoidable? i am using HTC Vive Pro. [1] says: "[3] HTC headsets with outside-in tracking (Lighthouse) only work through SteamVR. HTC headsets with inside-out tracking have native OpenXR support (enabled through the VIVE Console software)."
[1] https://mbucchia.github.io/OpenXR-Toolkit/opencomposite.html
That's great you got it working. I've been developing using python 3.11 recently, and I've been testing successfully against python versions 3.6 through 3.11. The only other runtime that I know of that supports XR_MND_HEADLESS is Monado. I haven't even got Monado working on Linux yet. But if you somehow had Monado working on Windows I would definitely want to know about it. That's why I asked. Today I've been working on getting the headless example working on Linux too. It's going well, but it's part of an ambitious refactoring so it might be a while.
i did only a brief look into Monado the other day, but i had to shift back to my other task using SteamVR to get headless operation with the null driver. sadly the support on Linux is not that good and i would like to understand why it is less stable on Fedora KDE than on Kubuntu but this is another topic^^
how is your port for this headless.py to Linux going?
I'm still in the middle of a major refactoring, where I'll be changing the way the highest level classes like xr.Context work. But you can find the headless example I got working on Linux buried in a dev branch at https://github.com/cmbruns/pyopenxr_examples/blob/d90f2bbeed86ee570b1a42230340413868f3d47f/xr_examples/headless2.py
I'd appreciate any level of code review on the code you see. I'm mostly toiling alone at the moment so any outside opinions would be helpful.
i am interested in the very fresh
headless.py
script. but on my system (Win10 with a HTC Vive) i getxr.exception.TimeInvalidError: The provided basetype:XrTime was zero, negative, or out of range.
when trying to runheadless.py
. what can i get out of this message?thanks and greetings Thomas