Please Select Your Location
Australia
Österreich
België
Canada
Canada - Français
中国
Česká republika
Denmark
Deutschland
France
HongKong
Iceland
Ireland
Italia
日本
Korea
Latvija
Lietuva
Lëtzebuerg
Malta
المملكة العربية السعودية (Arabic)
Nederland
New Zealand
Norge
Polska
Portugal
Russia
Saudi Arabia
Southeast Asia
España
Suisse
Suomi
Sverige
台灣
Ukraine
United Kingdom
United States
Please Select Your Location
België
Česká republika
Denmark
Iceland
Ireland
Italia
Latvija
Lietuva
Lëtzebuerg
Malta
Nederland
Norge
Polska
Portugal
España
Suisse
Suomi
Sverige

Marker-Based Location Sharing APIs (AIO)

LBSS provides several application programming interfaces (APIs) to assist in Marker-Based Location Sharing.
Note:

These APIs can only be used with compatible All-in-One (AIO) VR applications developed using the VIVE Wave VR SDK. For APIs designed for use with PC VR applications, see Marker-Based Location Sharing APIs (PC VR).

Configure marker ID and dictionary

This API configures the marker ID and dictionary for one or two ArUco markers. When configuring two markers, the API defines both the primary and secondary markers so location sharing starts only after users scan the second marker.

The marker ID is defined using integers, and the marker size is defined in meters using a decimal. For example, the size value for a marker with an area of 280 millimeters squared would be 0.280.

One ArUco marker

In this sample, the marker ID is 66, and the marker size is 0.280.
string polling_value;
        string key = "‍PLAYER00InitMA"‍;
        key += "‍{\"‍marker1\"‍: {\"‍id\"‍: 66,\"‍behavior\"‍: 3,\"‍size\"‍: 0.280}}"‍;
        uint RETURN_SIZE = 256;
        IntPtr value = Marshal.AllocHGlobal(new IntPtr(RETURN_SIZE));
        Interop.WVR_GetParameters(WVR_DeviceType.WVR_DeviceType_HMD, Marshal.StringToHGlobalAnsi(key), value, RETURN_SIZE);
        polling_value = Marshal.PtrToStringAnsi(value);
        Marshal.FreeCoTaskMem(value);
        if(string.Compare(polling_value, "‍InitErr"‍) == 0) // initialization failed, should check config string
        {
            // write your error handling code here
        }

Two ArUco markers

In this sample, the marker IDs are 66 and 88 and both marker sizes are 0.280.
string polling_value;
        string key = "‍PLAYER00InitMA"‍;
        key += "‍{\"‍marker1\"‍: {\"‍id\"‍: 66,\"‍behavior\"‍: 3,\"‍size\"‍: 0.280,\"‍isMainMarker\"‍: true,\"‍pairMarkerID\"‍: 88},\"‍marker2\"‍: {\"‍id\"‍: 88,\"‍behavior\"‍: 3,\"‍size\"‍: 0.280,\"‍isMainMarker\"‍: false,\"‍pairMarkerID\"‍: 66}}"‍;
        uint RETURN_SIZE = 256;
        IntPtr value = Marshal.AllocHGlobal(new IntPtr(RETURN_SIZE));
        Interop.WVR_GetParameters(WVR_DeviceType.WVR_DeviceType_HMD, Marshal.StringToHGlobalAnsi(key), value, RETURN_SIZE);
        polling_value = Marshal.PtrToStringAnsi(value);
        Marshal.FreeCoTaskMem(value);
        if(string.Compare(polling_value, "‍InitErr"‍) == 0) // initialization failed, should check config string
        {
            // write your error handling code here
        }

Scan marker

This API prompts the headset's tracking engine to detect an ArUco marker and process the data.

string key = "‍ClearRecenterXform"‍;
        Interop.WVR_SetParameters(WVR_DeviceType.WVR_DeviceType_HMD, Marshal.StringToHGlobalAnsi(key));
        
        key = "‍PLAYER00StartScan"‍;
        uint RETURN_SIZE = 256;
        IntPtr value = Marshal.AllocHGlobal(new IntPtr(RETURN_SIZE));
        Interop.WVR_GetParameters(WVR_DeviceType.WVR_DeviceType_HMD, Marshal.StringToHGlobalAnsi(key), value, RETURN_SIZE);
        Marshal.FreeCoTaskMem(value);
Note: This API will affect any tracking devices or other accessories connected to the headset.

Stop scan and reset position

This API stops the scanning process and resets the headset position to the default parameters.

string key = "‍PLAYER00StopScan"‍;
        uint RETURN_SIZE = 256;
        IntPtr value = Marshal.AllocHGlobal(new IntPtr(RETURN_SIZE));
        Interop.WVR_GetParameters(WVR_DeviceType.WVR_DeviceType_HMD, Marshal.StringToHGlobalAnsi(key), value, RETURN_SIZE);
        Marshal.FreeCoTaskMem(value);

Check scan status (optional)

This API checks the status of the latest scan at regular intervals.

Note: To avoid affecting system performance, do not set the checking frequency to more than two times per second.
string key = "‍PLAYER00CheckMA"‍;
        uint RETURN_SIZE = 256;
        IntPtr value = Marshal.AllocHGlobal(new IntPtr(RETURN_SIZE));
        
        Interop.WVR_GetParameters(WVR_DeviceType.WVR_DeviceType_HMD, Marshal.StringToHGlobaltrToStringAnsi(value);
Ansi(key), value, RETURN_SIZE);
        string polling_value = Marshal.PtrToStringAnsi(value);
        Marshal.FreeCoTaskMem(value);
        if (string.Compare(polling_value, "‍CTdone"‍) == 0)  // 2 markers scanned
            {
                //handling with all marker scanned
            } 
            else if (string.Compare(polling_value, "‍CTpass"‍) == 0)  // 1 marker scanned
            {
                //handling with the 1st marker scanned if you are using 2 markers. Remove it when using 1 marker.
            }

Resume location sharing

When you exit an application during play, location sharing will stop and the headset position will reset to the default parameters. This API resumes location sharing and restores the headset position using the latest available location sharing data after you reopen the application.

string key = "‍PLAYER00CheckMA"‍;
        uint RETURN_SIZE = 256;
        IntPtr value = Marshal.AllocHGlobal(new IntPtr(RETURN_SIZE));
        Interop.WVR_GetParameters(WVR_DeviceType.WVR_DeviceType_HMD, Marshal.StringToHGlobalAnsi(key), value, RETURN_SIZE);
        string polling_value = Marshal.PtrToStringAnsi(value);
        Marshal.FreeCoTaskMem(value);

        if (string.Compare(polling_value, "‍CTdone"‍) == 0)
            {
        key = "‍ClearRecenterXform"‍;
        Interop.WVR_SetParameters(WVR_DeviceType.WVR_DeviceType_HMD, Marshal.StringToHGlobalAnsi(key));
Note: This API will affect any tracking devices or other accessories connected to the headset.
Submit
Thank you! Your feedback helps others to see the most helpful information.