View Single Post
  #5  
Old 07-12-2012, 12:51 PM
DillonB DillonB is offline
Member
 
Join Date: Jul 2012
Posts: 7
Actually, I was looking through some more documentation and I had just tried that. I updated my code so that now it looks like this (difference begins at line 22):
Code:
#################################################################
#	WorldViz Copyright 2002										#
#  This script demonstrates how perform grab the raw data 		#
#  from the head tracker plugin.								#
#																#
#################################################################

import viz
import vizact

viz.setMultiSample(4)
viz.fov(60)
viz.go()

import vizinfo
vizinfo.add('This script demonstrates how to perform manual head tracking.\nIt will retrieve data from the tracker and only rotate the yaw.\nBy default this script will connect to an intersense.\nPress the \'r\' key to reset the tracker')

#Add environment
viz.addChild('gallery.osgb')

InertialLabs = viz.add('InertialLabs.dle')
sensors =InertialLabs.addSensorBus(workset=0,port=5)

# Get handle to first sensor
sensor1 = sensors[0]

def updateView():
    #pos = sensor.getPosition()
    euler = sensor.getEuler()

    #viz.MainView.setPosition([pos[0], pos[1]+1.82, pos[2]])
    viz.MainView.setEuler(euler)
    print euler

vizact.ontimer(0,updateView)
However, I get this error:
Quote:
Traceback (most recent call last):
File "<string>", line 11, in <module>
File "C:\Users\dbak\Documents\vizard-programs\Vizard1.py", line 21, in <module>
sensors = InertialLabs.addSensorBus(workset=0,port=5)
AttributeError: '_InertialLabsExtension' object has no attribute 'addSensorBus'
In summary, I am in fact using a sensor bus, but the addSensorBus method is not working for me.
Reply With Quote