This repository provides a system for synchronizing Virtual Reality (VR) head-mounted displays (HMDs) using hybrid SLAM-based tracking combined with external motion capture systems. The system supports multiple VR users and synchronizes their movements in real-time within a shared virtual environment.
- Compatible with any motion capture system (tested with HTC Vive Tracker and Qualisys).
- Hybrid SLAM-based tracking for accurate VR synchronization.
- Easy configuration for multiple simultaneous VR users.
This project contains two Unity projects:
- Server-side project:
VR&MotionTracking - Client-side project:
RealSyncVR
-
Open the
VR&MotionTrackingUnity project. -
Open the scene located at
Scenes/Start. -
In the scene hierarchy, find the
MotionTrackingDataGameObject:- This object contains default player objects (5 players by default).
- Each player object contains child GameObjects for tracking the head and hands.
-
For each player:
- Duplicate a player object if you need additional players.
- Ensure the
HeadGameObject receives correct motion capture data. - Disable any unused GameObjects (e.g., unused hand objects).
- Assign a unique ID in the
SyncTransformscript component on each tracking object. - Important: Note this unique ID as it will be required for the client-side setup.
-
If using Qualisys:
- Ensure the RT Object component is attached for data streaming.
- For other systems, remove the RT Object component.
-
Press the Play button in Unity to start the server.
-
Open the
RealSyncVRUnity project. -
Load the scene located at
01_GameDemo. -
Customize the environment in the scene as desired.
-
For each player instance:
- In the hierarchy, navigate to the
MotionTrackingDataGameObject. - Verify that each player object's
SyncTransformID matches the corresponding server-side player ID. - Ensure all player GameObjects are enabled and correctly configured.
- In the hierarchy, navigate to the
-
Set the current player's number:
- Locate the
GameManagerGameObject. - Update the
Player Numberfield to match the player you are setting up (e.g., Player 1, Player 2, etc.).
- Locate the
-
Build and deploy to Meta Quest:
- Go to
File > Build Settings. - Select
Androidas the build platform. - Adjust build quality settings as desired.
- Connect your Meta Quest 2/3 device and build directly onto it.
- Note: Each player requires a separate build with their respective player number set in the
GameManager.
- Go to
To synchronize additional physical objects:
- Add an empty GameObject to the server-side scene and assign it a unique ID via a
SyncTransformcomponent. - On the client side, add the corresponding digital representation and assign it the same unique ID.
- Unity (compatible version for your Meta Quest device)
- Motion capture system (e.g., Qualisys, HTC Vive Tracker)
- Meta Quest 2/3 devices
- HTC Vive Tracker
- Qualisys Motion Capture System