PDA

View Full Version : Problem connecting dataglove


Rik
11-20-2009, 03:13 AM
Hi,

I am trying to connect an Intersense 5DT glove. It works fine when I connect it within the main file of my program, but when I try to connect it in a different python module I always get an error. Of course I could just put the code in my main module, but I have a thing for keeping things nice and tidy.

Here is some sample code to illustrate my problem:

#file glovetest1.py
#this works fine when I run it in vizard
import viz
import hand
PORT_5DT_USB = 0
sensor = viz.add('5dt.dls')
glove = hand.add(sensor,hand.GLOVE_5DT)
viz.MainView.translate(0,0.02,-0.4)

viz.go()

-----

#file glovetest2.py
#this does not work
import glovetest

-----

The output on the console when I run glovetest1.py:
************************************************** ********
** Loading glovetest1.py
************************************************** ********
5dt.dls 5DT Glove Driver v1.0
** NOTIFY: Connected to 5DT DG5 Ultra USB on USB0
Loading File: hand.cfg
** Load Time: 0.38 seconds

And when I run glovetest2:
************************************************** ********
** Loading glovetest2.py
************************************************** ********
5dt.dls 5DT Glove Driver v1.0
** ERROR: Failed to connect to 5DT glove on COM1
Loading File: hand.cfg
** Load Time: 3.85 seconds

Can anyone help me with this problem? Thanks!

Jeff
12-08-2009, 05:34 PM
In your code that works it looks like you are connecting to the glove over USB but in the one with an error Vizard is looking for a glove over the serial connection. What if you specify a USB port in the module you import?