View Single Post
  #1  
Old 07-11-2012, 12:03 PM
DillonB DillonB is offline
Member
 
Join Date: Jul 2012
Posts: 7
No Output from InertialLabs Sensor

Hello. I am trying to modify one of the headtracking tutorials to work with a sensor from InertialLabs instead of one from intersense. Vizard seems to be able to connect to the sensor, but it does not seem to be receiving any output from the device ( line 33 prints the euler values and they are always zero). I was wondering if anyone might know why this is.
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')

# Create Inertial Labs extension
InertialLabs = viz.add('InertialLabs.dle')

# Connect to sensor on port 5
sensor = InertialLabs.addOSv3(5) 

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)
Reply With Quote