WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   No Output from InertialLabs Sensor (https://forum.worldviz.com/showthread.php?t=4292)

DillonB 07-11-2012 12:03 PM

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)


Jeff 07-12-2012 01:57 AM

Do you have any InertialLabs software connecting to the tracker at the same time? If so, try closing that down. Can you post the script output?

DillonB 07-12-2012 06:32 AM

I don't have the software running at the same time. When I do I get this error:
Code:

InertialLabs.dle                InertialLabs Extension
** ERROR: Failed to open OSv3 device on port 5 (Error: Can't open commport.)
** ERROR: Failed to create extension sensor with InertialLabs.dle
** Load Time: 0.22 seconds
[0.0, 0.0, 0.0]
[0.0, 0.0, 0.0]
[0.0, 0.0, 0.0]

Otherwise I get:
Code:

Loading File: gallery.osgb
InertialLabs.dle                InertialLabs Extension
** Load Time: 1.34 seconds
[0.0, -0.0, 0.0]
[0.0, -0.0, 0.0]
[0.0, -0.0, 0.0]

From this I'm fairly certain that Vizard is finding the sensor. For example, notice that the pitch changes from zero to negative zero. However, the sample of the script's output shows that output from the device (or a change in the output) is not received.

farshizzo 07-12-2012 11:37 AM

Is the sensor connected to an Inertial Labs Sensor Bus? If so, you will need to use the InertialLabs.addSensorBus method instead to connect to the sensor.

DillonB 07-12-2012 12:51 PM

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 "", line 11, in
File "C:\Users\dbak\Documents\vizard-programs\Vizard1.py", line 21, in
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.

farshizzo 07-12-2012 02:34 PM

Are you using the Inertial Labs plugin that comes with the latest version of Vizard? My guess is you are not.

DillonB 07-13-2012 06:03 AM

I found the file in the plug-ins folder. It says it was last modified on 8/19/2011. I'm assumming this is the day it was finished. What version of Vizard does this correspond with? If there is a newer version of the file, where would I be able to download it? Currently I am using Vizard 4.02.0315.

farshizzo 07-13-2012 09:11 AM

You don't have the latest version. Go to Help -> Check for Updates

DillonB 07-13-2012 12:44 PM

Thank you for all the help; it is working now. My bad, I should have made sure all my software was up-to-date.


All times are GMT -7. The time now is 04:10 AM.

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