Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Resolved controller virtual position and physical position do not align

Discussion in 'XR Interaction Toolkit and Input' started by yinqihuang, Oct 18, 2022.

  1. yinqihuang

    yinqihuang

    Joined:
    Aug 30, 2022
    Posts:
    3
    1. Controller and headset from HTC Vive Pro;
    2. The Unity version is 2018.4.9f1;
    3. XR packages are SteamVR 1.24.6;
    4. Controller's physical position readout is consistent with its actual position in the room;
    5. The code is modified from another one that has no such issue. We updated all the dependent files to be the same, but the problem persists;
    6. When the controller is placed beside the headset, the virtual controller on hud is offset by a certain degree.

    See example here:

    Notice how the person has to hold the controllers in front of them, and turn the head to find the controllers on the side.

    Question: how to trouble-shoot or what to look for

    I am a first time user of the forums, please let me know if I need to update the question
     
    Last edited: Oct 20, 2022
  2. VRDave_Unity

    VRDave_Unity

    Unity Technologies

    Joined:
    Nov 19, 2021
    Posts:
    255
    Hi @yinqihuang,

    Can you please provide a bit more information about the project? Specifically we are looking for:
    1. Unity Editor version
    2. What XR packages and versions you are using (OpenXR, SteamVR, Oculus, etc)
    3. A snapshot of your main hierarchy from the project (XR Origin / XR Rig) with the headset and controllers expanded so we can see how things are laid out.
    4. You mention modified code that doesn't work like the original. Are you able to share the code and/or the modifications?
    Once we have some more information, hopefully we can give some guidance.
     
  3. yinqihuang

    yinqihuang

    Joined:
    Aug 30, 2022
    Posts:
    3
    Sorry for the delay.

    1. The Unity version is 2018.4.9f1
    2. XR packages are SteamVR 1.24.6
    3. The faulty controller hierarchy is attached below - the controllers are children of [SteamCameraRig]:
    faulty.png
    4. The original hierarchy is attached below:
    original.png

    4. The modified code is under LM_Timeline, it was modified intensively as it is for a different project. The modified part related to controllers is when the person walk outside of the red carpet, the controllers will vibrate. We didn't change the camera or controller hierarchy.
    5. The LM stands for Landmarks package for spatial navigation experiment: https://github.com/mjstarrett/Landmarks
     
    Last edited: Oct 20, 2022
  4. VRDave_Unity

    VRDave_Unity

    Unity Technologies

    Joined:
    Nov 19, 2021
    Posts:
    255
    Okay, thank you for the information. Unfortunately the code and package is maintained and supported by Valve. I will see if anyone from their end can help provide some support or guidance with what is going on.

    That being said, based on what I am observing (without deeper knowledge of the code), the forward direction of the play area is not being used to update the left/right hand position correctly. It seems to be updating only in tracking-space relative to the tracking origin, but not translating the point to the correct rotational offset using the forward direction. I would look at how the Left Hand and Right Hand objects are configured in the Inspector and then double-check the code to see if their position is bein overridden by some other information.
     
  5. yinqihuang

    yinqihuang

    Joined:
    Aug 30, 2022
    Posts:
    3
    Hello, we have fixed the problem by updating all of the scripts to the most current version. We didn't figure out what exactly happened, but very likely there was a version conflict.
     
    VRDave_Unity likes this.