Skip to content

Instantly share code, notes, and snippets.

@DanielArnett
Last active April 15, 2025 06:16
Show Gist options
  • Select an option

  • Save DanielArnett/c9a56c9c7cc0def20648480bca1f6772 to your computer and use it in GitHub Desktop.

Select an option

Save DanielArnett/c9a56c9c7cc0def20648480bca1f6772 to your computer and use it in GitHub Desktop.
How to use the HTC Vive Trackers in Ubuntu using Python 3.6.

Prerequesites

Up to date graphics drivers

x86 architecture

SteamVR requires >4GB disk space

Installation Instructions

  1. Install Steam

    1. sudo apt-get install steam

    2. Make Steam account & Log in.

  2. Install SteamVR

    1. Click Library

    2. Click VR

    3. Click under Tools there should be SteamVR. Click the blue download button.

  3. Install OpenVR and Python (libssl-dev) dependencies

    1. sudo apt-get install libsdl2-dev libvulkan-dev libudev-dev libssl-dev

    2. Make a Symbolic Link from libudev.so.0 to libudev.so.1 for SteamVR to use

    3. sudo ln -s /lib/x86_64-linux-gnu/libudev.so.1 /lib/x86_64-linux-gnu/libudev.so.0

  4. Download a python source tarball >3.6

    1. https://www.python.org/downloads/

    2. Unpack Python, enter the Python* directory, then install it.

tar -xvzf Python-3.6.*.tgz && cd Python-3.6*
./configure
make
sudo apt-get install zlib1g-dev
sudo make install
  1. Install openvr

    1. sudo python3.6 -m pip install openvr
  2. Clone triad_openvr in a working directory

    1. git clone https://github.com/TriadSemi/triad_openvr.git
  3. (Optional) Disable the headset requirement with your preferred text editor

    1. gedit ~/.steam/steam/steamapps/common/SteamVR/resources/settings/default.vrsettings

    2. Change the third line from "requireHmd" : true, to "requireHmd" : false,

    3. Save and exit the settings document.

Usage

  1. Start SteamVR from the Steam Library

  2. Turn on the tracker with its button, and make sure that its wireless USB dongle is plugged in to your computer. If its light is green skip to step 4.

  3. Sync the tracker. Hold the button on the tracker until the light blinks. On the SteamVR overlay click the "SteamVR" dropdown menu. Click Devices->Pair Controller. The Tracker should then pair with the computer, and a green outline of the tracker should appear on the SteamVR overlay. If this doesn't work try unplugging the wireless USB dongle, plugging it back in, and restarting SteamVR.

  4. Ensure the Lighthouse base stations are turned on, facing each other, and have green lights showing on them. Place the tracker in view of the Base Stations. The SteamVR overlay should now show two green square Base Stations and a solid green Tracker hexagon. The tracker is now working.

  5. Start the tracker_test.py python script to view the x y z roll pitch yaw output from the tracker.

cd triad_openvr/`
`python3.6 ./tracker_test.py

Links

This is based off of Triad Semiconductor's awesome tutorial found here: http://help.triadsemi.com/steamvr-tracking/steamvr-tracking-without-an-hmd/

Also thanks to Christopher Bruns for his work on pyopenvr. https://github.com/cmbruns/pyopenvr

@eric-schleicher
Copy link

eric-schleicher commented Oct 11, 2017

It might be a good idea to add a section for setting up the null driver so that SteamVR will report ready. will fork. It also would be useful to roll this into the pyopenvr wiki.

@chopin1998
Copy link

i can read position data now, thank you very much!

But in my computer(Linux, t480s), i cannot run room setup, and it said "a key component of StreamVR isn't working.......(306)"

do you know why? Thank you!

@PannetierJ
Copy link

Hello ,

I tried to install your project ( Ubuntu 18.04 )
Nevertheless , I have an error :
python3.6 ./tracker_test.py
VR Path Registry node config is not an array
VR Path Registry node log is not an array
VR Path Registry node config is not an array
VR Path Registry node log is not an array
Traceback (most recent call last):
File "./tracker_test.py", line 5, in
v = triad_openvr.triad_openvr()
File "/home/jpannnetier/Documents/DevelopmentPython/Triad Open VR/triad_openvr-master/triad_openvr.py", line 107, in init
self.vr = openvr.init(openvr.VRApplication_Other)
File "/usr/local/lib/python3.6/dist-packages/openvr/init.py", line 6039, in init
initInternal2(applicationType, pStartupInfo)
File "/usr/local/lib/python3.6/dist-packages/openvr/init.py", line 6143, in initInternal2
_checkInitError(error.value)
File "/usr/local/lib/python3.6/dist-packages/openvr/init.py", line 6025, in _checkInitError
raise OpenVRError("%s (error number %d)" %(getVRInitErrorAsSymbol(error), error))
openvr.OpenVRError: b'VRInitError_Init_NoConfigPath' (error number 111)

@DanielArnett
Copy link
Author

Hey, for some reason I'm not getting notifications for this. Feel free to post an issue on the github page for my ROS node. Here's some of my troubleshooting advice from that page:

The Tracker should then pair with the computer, and a green outline of the tracker should appear on the SteamVR overlay. If this doesn't work try unplugging the wireless USB dongle, plugging it back in, and restarting SteamVR. Restarting your computer wouldn't hurt either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment