Skip to content
A simple single-file python library and example program to get data from a TrackIR camera
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md Add screenshot and improve README Dec 31, 2019
log_to_csv.py Add screenshot and improve README Dec 31, 2019
log_to_csv_gui.py
trackir.py
trackir_screenshot.png Add screenshot and improve README Dec 31, 2019

README.md

This is a windows-only program and library to read the 6 DOF (six degrees of freedom: x,y,z,roll,pitch,yaw) data from a TrackIR camera.

Screenshot of example console program running log_to_csv.py

To use, buy a TrackIR device, and run the TrackIR software, and make sure that it's working there. If you want raw data, make sure you set the profile to "one:one" and set the smoothing to 0.

Then run the log_to_csv.py program, and see the data printed out at approximately 100hz.

Running python 3 in Windows

To run, you can use run it within visual studio code, or from a git bash command line like:

winpty python3.exe ./log_to_csv.py

(It might ask you to install python3 first)

Or log to a file like:

winpty python3.exe ./log_to_csv.py > log.csv

Using the library

To use the library it is as simple as:

    import tkinter
    import time
    from trackir import TrackIRDLL

    trackrIr = TrackIRDLL(tkinter.Tk().wm_frame())
    while True:
        data = trackrIr.NP_GetData()
        print(data)
        time.sleep(0.1)

Please see log_to_csv.py for more details.

You can’t perform that action at this time.