WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Intersense tracker (https://forum.worldviz.com/showthread.php?t=4155)

Harchet 02-29-2012 04:15 AM

Intersense tracker
 
Hello, I want to create an intersense tracker with vizard. This is my code:
Quote:

isense = viz.add('intersense.dle')
glasses = isense.addTracker(port=1,station=1)
wand = isense.addTracker(port=1,station=2)
while(1):
print("Glasses position")
print(glasses.getPosition())
print("Glasses Rotation")
print(glasses.getEuler())
print("Wand position")
print(wand.getPosition())
print("Wand analog")
print(wand.getJoystickPosition())
print '\n' * 14
time.sleep(0.01)
The thing is that all the information is the same everytime, even if I move the wand and the glasses. What am I doing wrong?

PS: I want to track position, euler and wand buttons and joystick

Thanks

Harchet 03-01-2012 02:51 AM

I just solved using this code:
Quote:

viztracker.go()
isense = viz.add('intersense.dle')
wandTracker = isense.addTracker(port=1,station=2)

def printTrackerData():
print wandTracker.getJoystickPosition()

vizact.ontimer(0.01,printTrackerData)
Now is working fine


All times are GMT -7. The time now is 07:50 PM.

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