View Single Post
Old 09-10-2016, 02:09 AM
Jeff Jeff is offline
WorldViz Team Member
Join Date: Aug 2008
Posts: 2,466
If both controllers are connected, try the following:

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

def printData():
	print 'pos right:',rightController.getPosition()
	print 'pos left :',leftController.getPosition()
However, I would recommend using vizconnect to connect to the Vive in Vizard. In the preset configuration list there is a 'HTC Vive' option. That connects to all hardware and renders a hand for each controller. The transport allows you to navigate using the controller track pad. You can also get the controller position in your own script:

rightTracker = vizconnect.getTracker('r_hand_tracker').getRaw()
leftTracker = vizconnect.getTracker('l_hand_tracker').getRaw()

def printData():
	print 'pos right:',rightTracker.getPosition()
	print 'pos left :',leftTracker.getPosition()
Reply With Quote