Unity's OpenXR+XR Interaction Toolkit connected to Pico VR all-in-one machine

I. Introduction

Pico VR all-in-one machine is currently one of the more popular VR devices in China. PICO was established in March 2015 and merged into Bytedance in September 2021. The price of the latest Pico4 all-in-one machine is only about 2400, which makes many families start with Pico devices. The functions of the VR all-in-one machine include: VR panoramic video, VR sports, VR games and so on. Let's access the Pico VR SDK through Unity's latest OpenXR standard today.

2. Preparations

PICO XR official website
PICO XR developer official website
[PICO Unity Integration SDK access document] (https://developer-global.pico-interactive.com/document/unity/chapter-overview/)
We can browse the official website first, and then Download the latest PICO Unity Integration SDK
(the OpenXR-based PICO Unity OpenXR Plugin plug-in is still an unofficial version and is not recommended.)

Create a 3D (URP) Demo project, and then switch to the Android platform (the Pico all-in-one is the installed APK, which can be understood as an Android device worn on the head). Well, the preparations are complete
.

3. Install the plug-in

After the plug-in is downloaded to the local, it is a compressed package: PICO Unity IntegrationSDK-214-20230302.zip, we decompress it to the local, as shown in the following directory:
insert image description here
This is a Unity Package, we can load the local Package through the PackageManager ( It can also be copied directly to the project.)
As shown in the figure below, select Add package from disk... Then find the decompressed folder above, and click package.json.
insert image description here
After importing, it is as follows:
insert image description here
Since Pico sdk uses the latest Unity Open XR standard interface for development, it uses Unity's latest Input System. Here we are prompted whether to restart the editor to open the latest InputSystem. We can choose Yes.
At this point Unity will briefly load and restart.

(Note, if you have not switched to the Android platform, there may be a warning prompt here, please pay attention to switching to the Android Platform)

After restarting, a Pico PXR SDK setting interface will be prompted, prompting us to enter the AppId. We can apply for an account on the official website of Pico developers and create a new App to obtain the AppId, or turn off the switch of Use Entitlement Check and click Apply. Pico can be set up
insert image description here

4. Install XR Interaction Toolkit

We open PackageManager, click the + sign, and select Add package by name.
insert image description here
Then enter: com.unity.xr.interaction.toolkit
insert image description here
This will directly install the latest version of the XR Interaction Toolkit plugin. (If it is installed through the Package directory, it may not be the latest version.)
After the installation, we manually import its Samples package. As shown below:
insert image description here

5. PICO XR configuration

Select XR Plugin Management in ProjectSetting, and then check PICO
insert image description here
. The basic configuration is now complete. If we have a Pico device, we can directly package the DemoScene in Samples for a try.
If we want to pass the editor test, we need to use the XR Device Simulator, which is available in the XRInteraction Toolkit. As shown in the figure below:
insert image description here
We can directly drag and drop it into the scene, or configure automatic loading through ProjectSetting-> XR Interaction Toolkit, as shown in the figure below:
insert image description here
But note that if you want to use the XR Device Simulator, you can only edit it in the If you want to run the VR all-in-one machine on the real machine, please uncheck the XR Device Simulator, otherwise it will affect the operation of the real machine.

Well, if you want to run the Demo in the Sample, then the configuration is completed here. Because its XR Origin has already configured for us
insert image description here

6. Create XR Origin

The demo above allows us to run the example, and its XR Origin is configured for us. Let's add the XR Origin component ourselves.
1. Create a new scene
2. Under the Hierarchy panel, right-click XR->XR Origin (VR) to create.
insert image description here
3. Configure the Hand Controller of XR Origin (VR)
after we create it, as shown in the figure below:
insert image description here
Note that although it is created, it cannot be used immediately. Because we said earlier, OpenXr uses Unity's latest InputSystem system, and of course the handle controller HandController we use here also uses the new version of InputSystem. We need to specify the configuration of InputSystem configured by XR Interaction Toolkit by default, as shown in the figure below:
insert image description here
There are two ways to specify these configurations to our HandController controller.

Method 1: Manual configuration

As shown in the figure below, we click LeftHand Controller and Right Hand Controller respectively, and then click the button marked in the red box, and select the corresponding hand configuration in the pop-up selection box.
insert image description here

insert image description here

Method 2: Automatic configuration

We know that Unity has a Preset preset function, and Preset presets allow us to save the property configuration of components, resources or the Project Settings window as preset resources. You can then use this preset resource to apply the same settings to different components, resources, or Project Settings windows.
Next, we save these Controller-related configurations of XR Interaction Toolkit as Presets, and then when we create XR Origin, it will automatically match the corresponding settings for us.
Select the Preset of each Controller that comes with the XR Interaction Toolkit, and add it to the default configuration of the Prese Manager system.
As shown below:
Click the Add to ActionBasedContinuousMoveProvider default button
insert image description here
. After clicking all the buttons, open the PresetManager panel, and you will see the following results:
Note: For left and right hand configuration, we need to manually add Filter Name to him, so that the system can automatically pass Left The and Right keywords help us set different Presets for the left and right hands respectively.
insert image description here
Well, the configuration is complete here, and after we create XR->XR Origin (VR), we will find that the Hand Controller has automatically set the Preset for us.

Guess you like

Origin blog.csdn.net/qq563129582/article/details/130334028