python-ovrsdk icon indicating copy to clipboard operation
python-ovrsdk copied to clipboard

No output for DK2

Open HansSanitizer opened this issue 11 years ago • 7 comments

Tried running the test a few times in python. I got errors when the Oculus was disconnected, which is to be expected. After hooking up the output the test produces raw output but there is no actual data, just a 1 and a bunch of zeros for the tracking data being repeated. The test also detects that it is a DK2 connected. Any help appreciated.

Thanks a lot for this, hope to get it working.

HansSanitizer avatar Nov 28 '14 02:11 HansSanitizer

Experiencing the same issue. DK2 out of the box.

Running the demo, unchanged. It worked with the DK1.

jpanikulam avatar Nov 30 '14 23:11 jpanikulam

Hey jpanikulam, I got raw output using a DK2 and jhericos ovrsdk. https://github.com/jherico/python-ovrsdk

Got it to work using something along these lines with python 2.7, take the jherico oculusvr folder and dump it into the lib folder inside your python directory. (ie: C:\python27\lib\oculusvr)

import oculusvr as ovr ovr.ovr_Initialize() hmd = ovr.ovrHmd_Create(0) ovr.ovrHmd_ConfigureTracking(hmd, ovr.ovrTrackingCap_Orientation | ovr.ovrTrackingCap_MagYawCorrection | ovr.ovrTrackingCap_Position, 0) while True: ts = ovr.ovrHmd_GetTrackingState(hmd, ovr.ovr_GetTimeInSeconds()) if (ts.StatusFlags & (ovr.ovrStatus_OrientationTracked | ovr.ovrStatus_PositionTracked)) != True: time.sleep(0.016) if (ts.HeadPose.ThePose): ps = ts.HeadPose.ThePose pitch = ps.Orientation.x roll = ps.Orientation.z yaw = ps.Orientation.y headTrackerString = str(yaw) headTrackerString += "," headTrackerString += str(pitch) headTrackerString += "," headTrackerString += str(0) print (headTrackerString) time.sleep(0.016)

HansSanitizer avatar Dec 30 '14 17:12 HansSanitizer

Thanks!!

Have you had any luck with applying the distortion using the jherico's sdk?

On Dec 30, 2014, at 11:50 AM, HansSanitizer [email protected] wrote:

Hey jpanikulam, I got raw output using a DK2 and jhericos ovrsdk. https://github.com/jherico/python-ovrsdk

Got it to work using something along these lines with python 2.7, take the jherico oculusvr folder and dump it into the lib folder inside your python directory. (ie: C:\python27\lib\oculusvr)

import oculusvr as ovr ovr.ovr_Initialize() hmd = ovr.ovrHmd_Create(0) ovr.ovrHmd_ConfigureTracking(hmd, ovr.ovrTrackingCap_Orientation | ovr.ovrTrackingCap_MagYawCorrection | ovr.ovrTrackingCap_Position, 0) while True: ts = ovr.ovrHmd_GetTrackingState(hmd, ovr.ovr_GetTimeInSeconds()) if (ts.StatusFlags & (ovr.ovrStatus_OrientationTracked | ovr.ovrStatus_PositionTracked)) != True: time.sleep(0.016) if (ts.HeadPose.ThePose): ps = ts.HeadPose.ThePose pitch = ps.Orientation.x roll = ps.Orientation.z yaw = ps.Orientation.y headTrackerString = str(yaw) headTrackerString += "," headTrackerString += str(pitch) headTrackerString += "," headTrackerString += str(0) print (headTrackerString) time.sleep(0.016)

— Reply to this email directly or view it on GitHub.

jpanikulam avatar Dec 30 '14 20:12 jpanikulam

No, I haven't been able to apply distortion using jherico's. So far I have done a project with two 3d cameras aligned and then arranged the stream video windows side by side without distortion. It still works well.

HansSanitizer avatar Dec 30 '14 22:12 HansSanitizer

I didn't see a way to apply the Oculus SDK's transformations using python-ovrsdk. I've been working on using OpenCV to read in two USB camera streams and apply a barrel distortion. I'm planning to do a write up sometime this week, and will share on Github then. But seeing the comments here, I figure I'd at least mention this. I have been successful with that approach, and then displaying it fullscreen in the Oculus DK2 display.

clebio avatar Dec 30 '14 23:12 clebio

Good to hear! I'm looking forward to seeing your write-up, especially how you figured out the distortion parameters. I'd really like to try implementing your method in glsl.

There is a shader for the DK1 but needs updating for the DK2. Since I'm just rendering static overlays, I don't care about movement compensation or other wacky stuff. It seems like you might be in the same boat?

On Dec 30, 2014, at 5:03 PM, Caleb Hyde [email protected] wrote:

I didn't see a way to apply the Oculus SDK's transformations using python-ovrsdk. I've been working on using OpenCV to read in two USB camera streams and apply a barrel distortion. I'm planning to do a write up sometime this week, and will share on Github then. But seeing the comments here, I figure I'd at least mention this. I have been successful with that approach, and then displaying it fullscreen in the Oculus DK2 display.

— Reply to this email directly or view it on GitHub.

jpanikulam avatar Dec 31 '14 00:12 jpanikulam

I borrowed the calculations from a source I found. Look in my src/algos.py. I'm only trying to re-display video from two sources, at this point. Overlays might be nice, down the road (HUD, text, etc.).

Enjoy! https://github.com/clebio/oculus-opencv

clebio avatar Jan 02 '15 20:01 clebio