Search Unity

Extracting hand controller world position data from HTC Vive

Discussion in 'VR' started by whackett, Nov 18, 2018.

  1. whackett

    whackett

    Joined:
    Nov 18, 2018
    Posts:
    1
    Hey everyone!

    I'm a student in cognitive neuroscience and computer science, and I am developing a tool for HTC Vive that tracks user reaching movements and then does some preliminary pre-processing. Because our Vive has two handheld controllers, I want to extract the 3D (x,y,z) coordinate data from the hand controllers. This seems like it would be a relatively simple task, as the Vive has to have that global positional data to track the controllers, but I am having trouble accessing it.

    Does anyone know how to access and record the position data of Vive hand controllers, using Unity? I am not confined to just Unity and am open to explore other options - would greatly appreciate any insight!
     
  2. TenFiddy

    TenFiddy

    Joined:
    Sep 28, 2017
    Posts:
    21
    Use VRTK - grab the newest version on GitHub. You can also just get the position from the steam vr controllers.

    I use playmaker / so it’s simply a get position event and drag the controller you want into the game object space.

    You will then get a vector 3 with world space coordinates ... you will also want to use get rotation for the Euler angles ...

    Also you probably want to attach a small cube to the front of the controller so that you are tracking that instead of the controller transform.

    Hope that helps