plugin device sensor oculus
Credits: Ported from the Unity3D wrapper and shader by herbst.
Here is an initial take on the Oculus SDK (sensor access + distortion shader). It's mostly ported from the Unity3D stuff.
Note that there seems to be buggy behaviour in vvvv in regard to the HID device (Tracker DK) that the Oculus installs. If vvvv is running (has nothing to do with this patch, just open vvvv), no other application can access the Oculus. And, more importantly, vvvv will prevent itself from using it if just started.
The current workaround seems to be:
Could of course be done with a .bat file or something.
A simple .exe (PreventDeviceEnumeration.exe) which just opens a connection to the device and streams the values is provided within this package, so you can block vvvv from doing it's dark, sinister and unfortunate magic.
Thanks a lot herbst, vvvvery useful when I finally get my Rift...
Hey Herbst! Thanks again for this, and particularly the USB workaround. I've found that on WinXP it works without it; it seems to be a Win7 problem.
FINALLY got my Rift! And found there is an error in your patch: the right renderer has nothing connected to the View pin and so does not rotate.
I can see no depth in the blocks - as if the perspective shift is not occurring. I'll poke around on it...
Also, the demo program in the 0.2.3 SDK has lower tracking latency than this plugin - is there a way to make this use the more recent libs? Thanks!
Okie doke, this version works for me. That rotation was evil, I think that made it hard to see the lack of eye parallax (besides making me dizzy!). Tested with 29.2_x86 and 30.2_x86 on Win7.
Ooops, made a little mistake in my change to OculusRift.v4p - the two Translates that are going to the Transform input pin of the two PerspectiveOffset nodes should be using half the InterpupillaryDistance output of the OVRDevice node instead of the LensOffset output. It should be positive into the left Translate X, negative into the right.
I was able to quickly drop my depth camera head tracker into this, and was able to look down at my body and outstretched arms as a point cloud, too weird!
I've got some other changes to make a more general patch and will upload that soon.
(WHY can't we attach .v4p files here?!)
Hey mediadog, if you're sure about the wrong connections, go ahead - I ported directly from Unity and tried to make the same calculations as were done in the code there, but of course I may have done a mistake.
The original patch was just missing the eye perspective shifts (and the right eye orientation) - it had the image shift to compensate for the Rift display, but that's a 2D shift of the overall image. The "camera" of the two generated eye renders need to be separated in local X position by the interocular (interpupillary) distance as well. The wrong connections were in my first addition to add the perspective shift.
I'm not suggesting I did it the right way in this "fix", but I do have "correct" (;^}) stereoscopic patches which work very well with my VR wall, and I'll add those in once I get them checked out.
Your work here really is a great help, I was able to get up and running in a couple of hours. Now I need to figure out how to make the Rift wireless!
Concerning the HID grab by vvvv: it appears the HID nodes do scan and get all HID devices (there are some messages logged on the console during startup). I tried adding an HID Device node, setting the Device Type pin to "Tracker DK", and then the Enable pin to False, but it still was not seen by the Rift plugin.
Looks like there needs to be some way to really release an HID device via the HID nodes, and then initialize the Rift.
jannis had done some interesting project recently using the Oculus Rift:
I think initially it's based on herbst patches.
I think you're right, because those images appear to be lacking eye shift as well. If you freeze the video when there are objects very close, you can see there is no shift in them relative to the background between the right and left images - like there is when you look at your thumb in front of you and alternately blink your eyes, objects in the distance jump sideways.
There are many things that make up depth perception, R/L parallax just being one - so there is still a sense of depth even without it due to shading and relative motion. So when you freeze the motion the lack of parallax is more apparent.
And interestingly, about 10% of the population doesn't register R/L shift at all, so it adds nothing to their depth perception.
Hey guys, thanks for the contributions!
Everythings really nice, but...
the Oculus keeps disconnecting permanently. When banging the Oculus again
it's back to work, but this behaviour comes ang goes quite randomly...sometimes very often, sometimes stable for some time.
TTY says nothing...it's getting worse with a heavy patch. Any ideas?
Did you get the same behaviour? It's a big problem because the Oculus always
needs to face the same direction for calibration, so as someone walks around
and is not looking in one direction it's really a problem to rebang when the connection is lost...
Yes jannis, I have seen that too. Seems to only happen a few times when I first start using it, and then doesn't again. Also only seen it happen on one machine of two I've tried it on (oddly the faster one).
This plugin I believe is using an older version of the Rift SDK; updating may fix it but not sure what's required to do that.
@Herbst: there are two different "OculusPlugin.dll" files in the zip file, one in the base folder, and another (newer) down in the plugins\DevicesOVRDevice\bin\Dynamic folder. Wasup wid dat? (;^}) Thanks!
I can also remember that disconnect thing happening, but as mediadog says it seemed to never happen again after some initial hickups.
A temporary solution would be to S+H the last value you got and use that as an offset after reconnecting.
@mediadog: the one in the /bin/Dynamic folder is the one used, the other might be older/not from the Unity port.
For anyone who wants to update the plugin: just download the current version of the Unity SDK for Oculus, switch the dlls and the code... the modifications between the Unity and vvvv code are minor, basically I embedded the Unity one into vvvv.
Thanks guys. I think this is a really funny behaviour that the Oculus stabelizes after many hickups after starting the patch. So we all encounter the same problem. It was not so bad when I started patching but as the patch got heavier, the disconnection problem occured more often. It stabelizes, but not to a degree that makes me truly happy. Shouldn't disconnect after all :-)
Or only once a week :-) I think it's worth updating the SDK especially if it's not that big of a deal. I tried with 2 Oculus set's and 2 PC's with different setups, various vvvv beta's, the disconnection occured on all systems.
Let's update :-)
anyone here who succesfully tested this contribution with b32?
thanks herbst and mediadog.
Did anyone got this working for DK2 / Oculus SDK 0.4 already?
I tried briefly but did not get any tracking output.
No luck here either with the DK2. The DK2 uses a service now to handle the orientation data, so it's no longer via the USB. I expect the SDK is quite different and the plugin will need some mods, even just to get it to work in desktop-extension mode much less the DK2 custom renderer. If I can get some time in the next week I'll take a hack at it.
By the way, is there some general guideline converting Unity classes to vvvv?
any DK2 love yet? Have one arriving soon
Thanks for the update!
Did you get anywhere with getting the rest of the info out?
just added a new update. Most of the info is outputed now. Some parameters seem to be completely missing in the new API, though. Maybe I'll manage to make the new direct-to-rift-mode work with vvvv, which would make retrieving these parameters obsolete anyway, I guess..
With which version of vvvv and OculusSDK is last plugin working? I'm using vvvv 32 and 0.4.2 oculus sdk and the OVRDevice node is always red
EDIT: It's working now. I missed some visual studio libraries
So last plugin (TidenBarn's) is working for me, but I've got a strange behaviour.
If face forward and then rotate the head up, down, left and right; all camera rotations are correct.
But if I turn my head 90° right (or left) and then look up or down, camera rotation is all wrong.
Why is this happen? Please help
Yes, it appears the Rift SDK is using a different coordinate system than vvvv, or at least than the DK1 (or this plugin is not handling it the same). I made some hacks to get the rotations and position to work in the "proper" direction.
I also made some changes to fix the stereo eye offset once again, and also this plugin in already reporting the interocular distance of a single eye so I removed the divide-by-2.
What I did here is a total kluge, and I think the distortions, aberration, resolution, etc. still need fixing but hey it works! Thanks TidesBarn!
Now how to attach a patch here, without making a whole new download...?
how are you guys getting the missing values like for the distortion?
added my current version with a small test scene.
not sure if this is helpful, but worked quite well here already.
start with OculusRiftDK2-ROOT.v4p
I still don't get how you guys are correcting the distortion. I see that in the new SDK the distortion happens using a mesh rather than pixel shader as before, so there aren't any distortion coefficients.
In the absence of that data from the SDK are you manually tweaking the DistKXYZW values?
i just took what tidensbarn came up with (thanks!) and tried to correct the orientation problem that sonostrano mentioned by tweaking.
what i got is most probably not the most optimal solution and should not be considered final, as slight derivations happily introduce nausea and disorientation.
so i would be interested as well how some of this works, and also
if there is a way to get direct-to-rift with 75Hz working.
Yes me too.
You can set the renderer to 75hz in inspektor btw.
ok, good to know that it should work.
there seems to be a problem with my nvidia driver then.
the refresh rates dropdown in monitor settings shows an empty list and
hr. inspektor offers only 50, 59, 60 frames.
even when that renderer is on the rift display?
Hey, is anybody having luck with the distortion mesh? When i try only this one function: hmd.CreateDistortionMesh(...) in the Plugin i get an "Index out of range" Exception. No clue what to do.. Could the problem be inside the OculusSharp.dll?
Hey guys, I'm trying to run my Oculus patch on a friends computer and I get a red OVRdevice node, do you have any idea what could be wrong?
I installed Unity, and I'm happy to say it is working now.. But I do wonder why.. maybe it's the .net framework it needs, I'll check it out later
bump here, anybody got this working in direct access? anybody have idea woul would be needed?
right now, when i run oculus in direct access, the tracking and accelerometer data works, as soon as i run it in extended mode, it does not work
Same here, OVRDevice is always red. Which libraries do I miss?
@ all that got it working: which versions of v4 and DK runtime are you running?
It works c oculus dk2, sdk 0.6 and vvvv 45beta34.1 x64?
I do not go out = (
anonymous user login