SteamVR Developer Hardware

SteamVR Developer Hardware

Rush Mid Only Oct 31, 2018 @ 11:52pm
How to get Vive Tracker Raw Pose/Position Data?
Personal Intro
I am completely new to OpenVR and I have limited experience in coding (I am a senior Mechatronics engineering student at Kennesaw State University) We basically touch on simple C++ stuff in terms of coding. I have done a good bit of work on I/O and data analysis for microcontrollers and the like but nothing for professional proprietary stuff .

My senior project is coming up in spring of 2019 and I am basically trying to use the Vive tracker to translate pose data from a human hand to a robotic arm (I am not using the wand because I am using the human digits for something else).

What I Have Done
Acquired all necessary VR gear (standard HTC Vive kit + tracker)

Looked at coding examples for acquiring HMD and wand pose
Link: https://github.com/Omnifinity/OpenVR-Tracking-Example
-Vaguely understood coding methodology (was completely lost for everything but functions that fetched HMD/wand pose and saved them to an array)
-Ran code and command prompt successfully displayed pose data for HMD and wands

What I am primarily focused/confused on
-How to edit the code to fetch Tracker data

-Is there a way I can easily obtain this data within a few lines of code and store it into an array or whatever variables necessary? (This is just me trying to be lazy so I can focus on other aspects of the project.)

-Any resources to explain the OpenVR coding environment from square one?

Thanks in advance!
Originally posted by BOLL:
Not sure if I can be of any help as I use C#, but the API is the same so hopefully.

Are you loading the device poses using GetDeviceToAbsoluteTrackingPose()[github.com]?

If so the Tracker poses are also in there, they are devices classed as GenericTracker[github.com].

To find the Trackers, this might work but I have not had any luck in C#: GetSortedTrackedDeviceIndicesOfClass()[github.com].

Instead you could just loop over the indexes using GetTrackedDeviceClass()[github.com].

The maximum index is k_unMaxTrackedDeviceCount[github.com].

When you have the Tracker indexes and the array of poses, simply grab the tracking data out of the right index of the array 😋 The pose is a transformation matrix, but it's easy to get positional data out of in any case, I think index 3, 7, and 11 in the matrix.

Edit: I might have jumped to coding a bit quickly, you have a project you can build right, but you're not a too familiar with coding? Is C++ a must, if not I have a small help library for C# here[github.com]. I've made my own tracking robot using Arduino and C# with USB COM sockets or whatever (two years ago now) and I found it fairly straight forward.
< >
Showing 1-1 of 1 comments
The author of this thread has indicated that this post answers the original topic.
BOLL Nov 1, 2018 @ 6:08am 
Not sure if I can be of any help as I use C#, but the API is the same so hopefully.

Are you loading the device poses using GetDeviceToAbsoluteTrackingPose()[github.com]?

If so the Tracker poses are also in there, they are devices classed as GenericTracker[github.com].

To find the Trackers, this might work but I have not had any luck in C#: GetSortedTrackedDeviceIndicesOfClass()[github.com].

Instead you could just loop over the indexes using GetTrackedDeviceClass()[github.com].

The maximum index is k_unMaxTrackedDeviceCount[github.com].

When you have the Tracker indexes and the array of poses, simply grab the tracking data out of the right index of the array 😋 The pose is a transformation matrix, but it's easy to get positional data out of in any case, I think index 3, 7, and 11 in the matrix.

Edit: I might have jumped to coding a bit quickly, you have a project you can build right, but you're not a too familiar with coding? Is C++ a must, if not I have a small help library for C# here[github.com]. I've made my own tracking robot using Arduino and C# with USB COM sockets or whatever (two years ago now) and I found it fairly straight forward.
Last edited by BOLL; Nov 1, 2018 @ 11:49am
< >
Showing 1-1 of 1 comments
Per page: 1530 50

Date Posted: Oct 31, 2018 @ 11:52pm
Posts: 1