Search Unity

Differentiating between SteamVR Trackers and Controllers

Discussion in 'VR' started by FelixLightshape, Jan 15, 2020.

  1. FelixLightshape

    FelixLightshape

    Joined:
    Nov 25, 2019
    Posts:
    9
    I'm currently building an application for the Vive that uses 3 trackers for body tracking in addition to the controllers. I'm using SteamVR's player rig and I added 3 objects representing the trackers and gave them the indices 3 to 5. However it seems that the devices constantly get mixed up, both with controllers being recognized as trackers and the other way around. It seems that they are assigned completely randomly, not even turning them on one by one in a certain sequence works. What can I do to have trackers assigned as trackers and controllers as controllers?
     
  2. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Use SteamVR Input 2.0 (comes with the SteamVR Unity Plugin, current version is 2.5.0). Attach SteamVR_Behaviour_Pose to the game objects that represent the Vive trackers and select the appropriate Input Source (e.g. Left Foot, Right Foot, Waist ... knees and elbows are still missing, which kind of sucks, but I believe Valve is working on that right now).

    This will then look like this (this is how we handle it in Holodance and Beat the Rhythm VR):

    Capture_ViveTrackersSetup.PNG

    Then, in the SteamVR Dashboard, you can assign the appropriate tracker roles using Manage Vive Trackers (this works both from the flatscreen UI as well as inside VR):

    Capture_ManageViveTrackers.PNG (old UI) or (new UI) Capture_ManageViveTrackers_New.PNG

    ... and there you can assign the tracker roles:

    Capture_AssignTrackerRoles.PNG
     
    FelixLightshape likes this.
  3. FelixLightshape

    FelixLightshape

    Joined:
    Nov 25, 2019
    Posts:
    9
    Thank you!
     
    jashan likes this.
  4. VCUMCL

    VCUMCL

    Joined:
    Jun 5, 2017
    Posts:
    24

    I too have had device ordering issues and switched to the method you explained. However, even though the tracker roles are properly assigned, and the SteamVR_Behaviour_Pose roles are set properly as well, it does not assign them during runtime. I have a tracker set to "right foot" in both locations, but it does not track at all. It is almost like the Behaviour_Pose script is not finding the tracker set to "right foot" or something.
     
  5. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Have you set up the bindings as well? That might be the step that's missing. I had added the bindings to a comment in one of the issues on GitHub: https://github.com/ValveSoftware/steamvr_unity_plugin/issues/526

    Does that help?
     
  6. VCUMCL

    VCUMCL

    Joined:
    Jun 5, 2017
    Posts:
    24
    Yep that was actually the problem. It's odd that I have to assign the pose, but I appreciate you figuring that out for the rest of us haha! Thanks for the response man
     
    jashan likes this.
  7. VCUMCL

    VCUMCL

    Joined:
    Jun 5, 2017
    Posts:
    24
    Well it only actually worked until I built the software, now it only currently works in the editor. I'm gonna have some fun trying to figure the new issue out now haha
     
  8. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    On the Steam partner site, under Edit Steamworks settings / Application / Virtual Reality, you need to assign the correct folder under SteamVR Input System. In my case, the folder is:

    Holodance_Data/StreamingAssets/SteamVR/actions.json
     
  9. VR_Junkie

    VR_Junkie

    Joined:
    Nov 26, 2016
    Posts:
    77
    Hello, I am trying to do the same as before but am misunderstanding where I should place the Vive Tracker Binding json files.
     
  10. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    You put the Vive Tracker binding files into the same folder as the controller binding files. Usually, that will be StreamingAssets/SteamVR/ in your game data folder. And this also has to be set up correctly in the Steamworks publisher backend (assuming your game is already released, or you're at least pushing test-builds to Steam).
     
    VR_Junkie likes this.