Closed Simontho001 closed 4 years ago
Please, post the code using the code formatting (markdown).
fixed it sorry not very familiar with this website
its doing what i want it to except that its getting data from the head mount display and i want it to get data from a controller instead how would i do so?
This code of yours:
poses, _ = openvr.VRCompositor().waitGetPoses(poses, None)
reads poses for all devices, which are currently tracked. This includes headset, lighthouses, controllers. You are reading the first pose:
hmd_pose = poses[openvr.k_unTrackedDeviceIndex_Hmd]
which indeed is a HMD pose. You need to figure out, which pose corresponds to what (i.e. at which index is your controller) and get it there.
I found a little script online that finds the index but what would I do with that I'm not familiar with this library
You will get the pose exactly the same way as you did for the HMD:
controller_pose = poses[controller_index]
and then do whatever you want with it.
There is not much documentation for the Python code, as it basically mimics the native API. So for example, for how to use WaitGetPoses
you might want to read the official doc (https://github.com/ValveSoftware/openvr/wiki/IVRCompositor::WaitGetPoses), or even read the source code (https://github.com/ValveSoftware/openvr/blob/master/headers/openvr.h).
heres my code
its doing what i want it to except that its getting data from the head mount display and i want it to get data from a controller instead how would i do so?