Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getControllerStateWithPose() returns all zeros #86

Open
mungewell opened this issue Nov 27, 2020 · 0 comments
Open

getControllerStateWithPose() returns all zeros #86

mungewell opened this issue Nov 27, 2020 · 0 comments

Comments

@mungewell
Copy link

More hacking around and discovered another problem. I do NOT have real hardware, so the possibility exists that it is bug else where... but 'fake' trackers are shown in Virtual World.

Discovered that waitGetPoses() only works when you are operating as VRApplication_Scene, meaning that script terminates (or is terminated) other VR application - runs in construct though...

So I have shifted to getControllerStateWithPose().

            if options.kinect:
                '''
                poses, game_poses = openvr.VRCompositor().waitGetPoses(poses, None)
                kinect = poses[1]
                '''
                res, state, kinect = openvr.VRSystem().getControllerStateWithPose(0,2)

                mat = kinect.mDeviceToAbsoluteTracking
                A = np.matrix(
                    ((mat.m[0][0], mat.m[0][1], mat.m[0][2], mat.m[0][3]),
                    (mat.m[1][0], mat.m[1][1], mat.m[1][2], mat.m[1][3]),
                    (mat.m[2][0], mat.m[2][1], mat.m[2][2], mat.m[2][3]),)
                    , np.float32)

                P = A.dot(np.matrix('0; 0; 0; 1')) + np.array( \
                    [[options.Y], [options.X], [options.Z]])

                position = (P[2][0], P[0][0], P[1][0])

Any suggestions as to why? Do the 'controllers' have to have a button press before this function returns data?

https://github.com/mungewell/pyPSVR/blob/master/example5_threaded/threaded_psvr.py#L347
https://github.com/SDraw/driver_kinectV1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant