WVR_GetHandTrackerInfo

WVR_EXPORT WVR_Result WVR_GetHandTrackerInfo(WVR_HandTrackerType type, WVR_HandTrackerInfo_t * info)

Use this function to get the capability of hand tracker device.

Version
API Level 6
Parameters
Return Value
  • WVR_Success: Get information successfully.
  • Others: WVR_Result mean failure.

struct WVR_HandTrackerInfo

The information of hand tracker device.

Version
API Level 6

Public Members

uint32_t jointCount

The count of hand joints.

uint64_t handModelTypeBitMask

Support how many types of WVR_HandModelType.

WVR_HandJoint *jointMappingArray

The array corresponds to the conventions of hand joints. Refer to WVR_HandJoint.

uint64_t *jointValidFlagArray

The array that indicates which data of each hand joint is valid, refer to WVR_HandJointValidFlag.

float pinchTHR

Threshold of Pinch activate for strength in WVR_HandPosePinchState

float pinchOff

Threshold of Pinch deactivate (optional) for strength in WVR_HandPosePinchState

enum WVR_HandJoint

The conventions of hand joints.

Version
API Level 6

Values:

WVR_HandJoint_Palm = 0
WVR_HandJoint_Wrist = 1
WVR_HandJoint_Thumb_Joint0 = 2
WVR_HandJoint_Thumb_Joint1 = 3
WVR_HandJoint_Thumb_Joint2 = 4
WVR_HandJoint_Thumb_Tip = 5
WVR_HandJoint_Index_Joint0 = 6
WVR_HandJoint_Index_Joint1 = 7
WVR_HandJoint_Index_Joint2 = 8
WVR_HandJoint_Index_Joint3 = 9
WVR_HandJoint_Index_Tip = 10
WVR_HandJoint_Middle_Joint0 = 11
WVR_HandJoint_Middle_Joint1 = 12
WVR_HandJoint_Middle_Joint2 = 13
WVR_HandJoint_Middle_Joint3 = 14
WVR_HandJoint_Middle_Tip = 15
WVR_HandJoint_Ring_Joint0 = 16
WVR_HandJoint_Ring_Joint1 = 17
WVR_HandJoint_Ring_Joint2 = 18
WVR_HandJoint_Ring_Joint3 = 19
WVR_HandJoint_Ring_Tip = 20
WVR_HandJoint_Pinky_Joint0 = 21
WVR_HandJoint_Pinky_Joint1 = 22
WVR_HandJoint_Pinky_Joint2 = 23
WVR_HandJoint_Pinky_Joint3 = 24
WVR_HandJoint_Pinky_Tip = 25

How to use

Sample function:

#include <wvr/wvr_hand.h>

WVR_HandTrackerInfo_t info = {};

if (info.jointMappingArray != nullptr)
    delete[] info.jointMappingArray;

if (info.jointValidFlagArray != nullptr)
    delete[] info.jointValidFlagArray;

info.jointMappingArray = new WVR_HandJoint[info.jointCount];
info.jointValidFlagArray = new uint64_t[info.jointCount];
memset(info.jointMappingArray, 0, sizeof(WVR_HandJoint) * info.jointCount);
memset(info.jointValidFlagArray, 0, sizeof(uint64_t) * info.jointCount);

if (WVR_GetHandTrackerInfo(WVR_HandTrackerType_Natural, &info) == WVR_Success) {
    for (int i = 0; i < info.jointCount; i++) {
        LOGI("%2d: [%s] =  %" PRId64 ")", i, toString(info.jointMappingArray[i]), info.jointValidFlagArray[i]);
    }
} else {
    // Get Hand Tracker info failed!
}