WorldViz User Forum

WorldViz User Forum (
-   Vizard (
-   -   Headset Coordinates and Euler angles (HTC Vive) (

BEP2018 04-24-2018 05:17 AM

Headset Coordinates and Euler angles (HTC Vive)

We are a group of Bachelor-level Mechanical Engineering students and we want to use position data out of the headset of the HTC Vive. We are building a virtual driving simulation in a program called Prescan connected to the control program Simulink. We want to use the HTC Vive to show the road environment, for this we need to export the position data from the HTC Vive to Simulink. Our first step is collecting this position data real-time. Then we need to send it to Simulink in some way.

We already have this piece of code (that we partly found here), we started out with using the controllers to get this position data (because we didn't know the name of the headset):

import viz
import vizact
import vizshape
import steamvr
import vizconnect

rightController = steamvr.getControllerList()[0]
leftController = steamvr.getControllerList()[1]

def printData():
print 'pos right:',rightController.getPosition()
print 'pos left :',leftController.getPosition()


--> where can we find this position data and how can we import this to Simulink?

Jeff 04-24-2018 01:01 PM

If you're using vizconnect to connect to the Vive, get a handle to the head tracker using the name in the vizconnect file. Then get its position. See the trackers page in the vizconnect section for more information.

Vizard has built in support for sending data over the network via UDP. There's sample code that shows how to send and receive raw byte data in Vizard in the networking page. Or you could use Python sockets for sending data.

All times are GMT -7. The time now is 01:59 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC