ExistentAlignmentComponent

Overview

The component is designed to work with VR tracking systems aimed at enhancing spatial alignment in immersive experiences. Provides functionality and tools for sampling, calculating, and applying offsets to align virtual and physical spaces accurately.

Key Features

  • Spatial Alignment: Helps align virtual and physical spaces accurately by calculating and applying offsets based on sampled data.

  • Sampling Process: Collects samples of subject and reference positions over time to understand the spatial discrepancy between them.

  • Offset Calculation: Analyses collected samples to calculate the necessary offset for aligning the subject's coordinate system with the reference's.

  • Continuous Alignment: Offers the option for continuous alignment, where the component periodically recalculates and applies the alignment offset to adjust for any spatial changes. This is particularly useful for older generation trackers e.g Vive Trackers 1.0 and 2.0 where the headset and the tracker coordinate systems may drift over time.

  • Auditory Feedback: Provides auditory cues (beeps) to indicate the start and end of the sampling process, enhancing user interaction.

  • Debugging Tools: Includes methods for testing alignment accuracy and drawing debug trails, aiding in troubleshooting and ensuring proper alignment.

  • Console Commands: Supports console commands for manual control over alignment and resetting, facilitating easy adjustments during runtime.

  • Configuration Management: Allows saving and applying alignment offsets through configuration files, enabling reuse of alignment settings across sessions.

Implementation Details

  • Initialization: At startup, the component loads configuration settings, such as sample collection parameters, from a configuration file.

  • Sample Collection: Utilises a sampling mechanism to collect positional data for both the subject and the reference. This can be done either once or continuously, controlled by the bContinuousAlignment flag.

  • Offset Calculation: After collecting a sufficient number of samples, it computes the best fit transformation offset using methods that minimise the spatial discrepancy between subject and reference.

  • Application of Offset: Applies the calculated offset to the virtual environment or objects, aligning them with the physical space or reference system.

  • Dynamic Adjustment: If continuous alignment is enabled, the component keeps adjusting the alignment in response to any movements or changes in the environment.

  • User Interaction: Implements auditory feedback for user interaction during the sampling process and provides console commands for alignment control.

  • Debugging and Testing: Offers functionalities to test the alignment's accuracy and to visualise the alignment process for debugging purposes.

  • Configuration Saving: Allows the offsets calculated during the alignment process to be saved to configuration files for later use.

How to use

If you are using an ExistentPlayer Pawn, the HMD Root of that pawn will be a UExistentAlignmentComponent.

  • Start by setting up the component within your VR project, ensuring it's attached to the relevant actor or object, ideally your Player Pawn.

  • Configure the component's parameters, such as the number of samples to collect and the interval between sample collections, based on your application's needs.

  • Identify the Subject (the object or space to be aligned) and the Reference (the physical counterpart or alignment target), e.g. ExistentPlayer uses HMD Reference Tracker as Reference Component and HMD Camera as Subject.

  • Use the component's properties to assign the subject and reference components, ensuring they are properly tagged or named for easy identification.

  • Begin the sampling process by invoking the BeginSampling method. This is done automatically in ExistentPlayer code through the Reality Bridge align command. Consider using a delay before starting if necessary for your application.

  • Collect samples over time, with the option to use continuous alignment for dynamic environments.

  • The component automatically calculates and applies the necessary offset to align the subject with the reference.

Testing and Debugging:

  • Utilise the component's testing and debugging tools to verify the accuracy of the alignment. This may include using auditory feedback for the sampling process, testing alignment accuracy, and drawing debug trails.

  • Adjust the component's parameters as needed based on testing results to improve alignment accuracy.

Applying and Saving Offsets:

  • Once satisfied with the alignment, apply the calculated offset to align the virtual and physical elements.

  • Optionally, save the alignment offset to a configuration file for future use, facilitating easy application of the same alignment settings in subsequent sessions or projects.

Additional Details

Last updated