Vivi Wu Posted February 3 Share Posted February 3 To identify if the device is lost tracking, the developer needs to use OpenVR API to get the device status. Also if you'd like to know whether your controller / wrist tracker is in 6Dof or 3Dof status, please follow the guidelines below and refer to OpenVR GitHub for more information. Required: VIVE Business Streaming version : 1.10.5 or later. Focus 3 – FOTA version : 5.0.999.676 or later Check OpenVR API to get status IVRSystem : IVRSystem::GetDeviceToAbsoluteTrackingPose IVRSystem::GetControllerStateWithPose IVRCompositor : IVRCompositor::GetLatestPoses (similar with WaitGetPoses) Both API can get TrackedDevicePose_t of devices with parameter-“ETrackingResult”, which is the tracking status of device. 6Dof = TrackingResult_Running_OK 3Dof = TrackingResult_Fallback_RotationOnly All of the APIs can get TrackedDevicePose_t which includes several parameters to identify the device tracking status. bPoseIsValid bDeviceIsConnected eTrackingResult TrackingResult_Running_OK: 6DoF TrackingResult_Fallback_RotationOnly: 3DoF Only the “bPoseIsValid” is true, “bDeviceIsConnected” is true and “eTrackingResult” is TrackingResult_Running_OK or TrackingResult_Fallback_RotationOnly means tracked. Otherwise, the device status should be lost tracking. The index of each device:To use the APIs, please use below device index for vr::TrackedDeviceIndex_t or pose array to get target device pose data. index device 0 HMD 1 Right controller 2 Left controller 3 Right wrist tracker 4 Left wrist tracker To access the target device and retrieve its status, please generate a large enough array and call the appropriate API. Use the index specified in the above table to obtain the status of the target device. Sample code: Sample 1: vr::IVRSystem * pvr = vr::VR_Init(&eError, vr::VRApplication_Utility); TrackedDevicePose_t result[5]; pvr->GetDeviceToAbsoluteTrackingPose(vr::TrackingUniverseStanding, 0, &result, 5); result[1].eTrackingResult; // right controller tracking result result[2].eTrackingResult; // left controller tracking result result[3].eTrackingResult; // right wrist tracker tracking result result[4].eTrackingResult; // left wrist tracker tracking result Sample 2: TrackedDevicePose_t result[5]; Vr::VRCompositor()->GetLatestPoses(result, 5, NULL, 0); result[0].eTrackingResult; // HMD tracking result result[1].eTrackingResult; // right controller tracking result result[2].eTrackingResult; // left controller tracking result result[3].eTrackingResult; // right wrist tracker tracking result result[4].eTrackingResult; // left wrist tracker tracking result Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now