The below software is required for this guide, except those marked as optional:
|
Description |
Version |
|
3.0.12-PRO, |
|
|
Unity Editor |
|
|
1.10.0 |
|
|
1.7.0 or 1.8.0 |
|
|
Unity XR Interaction Toolkit (optional) |
2.5.4 |
|
latest |
|
|
2.5.5 |
* Older versions of Unity may be supported, like Unity 2021.3, however these have not been recently tested with this workflow.
This guide supports the following hardware options:
|
Motion Capture Gloves (choose one) |
Image |
|
StretchSense Studio Gloves, Pro Studio for Xsens, Pro Studio. |
|
|
Pro Fidelity |
|
|
XR Trackers (choose one) |
Image |
|
2x Tundra Tracker (includes 2x SteamVR dongles). |
|
|
Tracker Mounts (choose one) |
Image |
|
2x StretchSense Studio Optical/Universal Mounts |
|
|
|
|
|
|
|
VR Headsets (choose one) |
Image |
|
|
|
|
|
|
|
Valve Index (headset only) |
|
|
|
|
|
Other Required Hardware |
Image |
|
3-4x Valve Index Base Station 2.0 |
|
These steps will take you through how to connect and configure two trackers for use with SteamVR.
1. Download and install the Steam Desktop client and SteamVR.
2. Launch SteamVR and let it run the first-time setup.
NOTE: For this example, we are using SteamVR Version 2.5.5 with an HTC Vive Pro, 3x Base Station 2.0s, and 2x Tundra Trackers. These instructions may vary slightly depending on your headset so make sure to follow the initial setup instructions from the headset manufacturer.
3. Connect your headset and base stations, conduct the Room Setup and choose Room Scale when prompted.
4. (optional) With SteamVR running, go to the SteamVR settings menu and toggle Show Advanced Settings. Adjust the following setting: Video → Pause VR when the headset is idle and set it to Off. This will allow SteamVR to send tracker data to Unity when the headset is not worn.
5. Mount each Tundra Tracker to the track strap as per the Correcting Hand Rig Offsets for Tundra Trackers section further below in this guide. Ensure that the trackers are fastened tightly.
6. Connect your Tundra Trackers as per the device manufacturers instructions. Once the trackers are paired right-click on one of the trackers and click Manage Trackers (see image below).
In the Steam VR settings select Manage Trackers (see below)
For the trackers you have connected leave the Tracker Role set to Left Elbow or Right Elbow depending on which hand you have attached the trackers to. Click Close and also close SteamVR Settings.
7. Leave SteamVR running in the background and begin to set up your Unity project.
These steps will explain how to setup your Unity project to receive tracker data from SteamVR. It assumes you have already setup your character with the StretchSense Plugin for Unity and have configured two RetargetHand scripts, one for each of your character’s hands.
The instructions are based on a tutorial from VR With Andrew which explains the tracker setup instructions below in Unity 2020, which should also work for Unity 2021 and Unity 2022 with slight modifications.
1. Add the following packages via the Unity Package Manager (UPM):
c. Unity XR Interaction Toolkit
2. Download and add the following Vive Tracker device profile and import into your project:
HTCXRTrackerProfile.unitypackage
3. Edit your project’s OpenXR settings and under XR Plugin Management in the Interaction Profiles list, check the entry for HTC Vive Tracker OpenXR.
4. Set the Play Mode OpenXR Runtime to SteamVR.
Setting the OpenXR runtime in Play Mode to SteamVR
5. Setup your input actions to bind the Tundra tracker position and rotations so they can be used to animate the hand in space.
a. Create an Input Action Asset in your project asset browser within the Unity Editor. Alternately, download the XR Tracker Input Actions asset below and import it into your project. It is setup to work with Tundra or Vive trackers set to the Left Elbow or Right Elbow roles and supports additional tracker roles for Chest, Waist, Left Foot, Right Foot.
XR Tracker Input Actions.unitypackage
b. Create a GameObject in your scene then go to Component > Input > Input Action Manager to add the component to the GameObject you created.
c. Add the correct input asset mapping for each tracker as follows (the example shows the configuration of the RightElbow tracker role in Unity):
i. Tracker RightElbow Position action (Vector 3) - Position binding path:
<XRTracker>{Right Elbow}/devicePose/position
ii. Tracker RightElbow Rotation action (Quaternion) - Rotation binding path:
<XRTracker>{Right Elbow}/devicePose/rotation
iii. Tracker RightElbow Tracking State action (Integer) - Rotation binding path:
<XRTracker>{Right Elbow}/trackingState
6. If you have additional trackers, you can use this process to enable full body tracking for your legs, knees and elbows or other SteamVR tracker roles, in addition to your hands.
1. If not using the XR Interaction Toolkit, and you have a rigged humanoid character, add Tracked Pose Driver (Input System) component to each wrist joint of your character’s skeleton and configure this to map to an input action set and position and rotation action maps in the Unity Input System. This will directly set the position and rotation of the hands.
If you need to mix this with animation clips played in an AnimationController, change the Update Type to Late Update.
StretchSense provides an optional first-party mount to attach smaller trackers directly to StretchSense Studio Gloves. This provides the best balance of tracking accuracy for the hand orientation as it accounts for wrist bending like with the Palm Ring straps but doesn’t put extra pressure on your hand.
When ordering Studio Gloves from the StretchSense website select Optical/Universal Mounts from the drop-down menu.