View Single Post
  #1  
Old 01-23-2013, 08:49 AM
piyush piyush is offline
Member
 
Join Date: Jan 2013
Posts: 7
position tracking

i wrote following code for tracking position of ppt wand thru vrpn7 in vizard4
it is unable to track position but runs without any errors
import viz
viz.go()

piazza = viz.addChild('maze.osgb')
viz.MainView.move([3,2,8])

vrpn = viz.add('vrpn7.dle')
posTracker = vrpn.addTracker('PPT0@WORLDVIZ-PC',0)

#Connect to Intersense on local machine running Vizard
isense = viz.add('intersense.dle')
oriTracker = isense.addTracker()

#Create a 6DOF tracker by merging position data from PPT with
#Orientation data from Intersense
headTracker = viz.mergeLinkable(posTracker,oriTracker)

#Link viz.MainView with headTracker
headlink = viz.link(headTracker, viz.MainView)

#Once the user is facing PPT north pressing the 'r' key will align
#Intersense's coordinate system with PPT's coordinate system
vizact.onkeydown ('r', oriTracker.reset)
data=headlink.getData()
print data
Reply With Quote