WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Need help for "Position/Motion Tracking", using "InterSense I-900" (https://forum.worldviz.com/showthread.php?t=2853)

znchb 07-26-2010 03:59 PM

Need help for "Position/Motion Tracking", using "InterSense I-900"
 
Hi there,

I try to build up a VR system, using hardware: NVIS & InterSense I-900.

I write some little program based on Vizard help document, and the "Orientation" worked: if I turn around, the MainView on the screen will rotate.

However, I don't know how to perform the "Position tracking": if I walk forward or turn back, the view will also move?

Is there any example for solving this problem? Thanks

Jeff 07-26-2010 06:25 PM

Can you post the code you are testing with? The IS-900 supports position data so if you link the tracker to the view you should see the position change as well.

znchb 07-26-2010 10:32 PM

thank you for your reply, I copy the file to here.

import viz
viz.go()
viz.add('tut_ground.wrl')
viz.clearcolor(viz.GRAY)

view = viz.MainView
PORT_INTERSENSE = 1
sensor = viz.add('intersense.dls')
viz.tracker()
link = viz.link( sensor, view )#this link the Sensor's Orientation with View

#vrpn = viz.add('vrpn7.dle')
#tracker1 = vrpn.addTracker('Tracker0@localhost')
#tracker2 = vrpn.addTracker('Tracker0@localhost',1)

def onTimer(num):# try to control the MainView's position, by getPosition #from sensor, however, it doesn't work
pos = sensor.getPosition()
euler = sensor.getEuler()
print pos
print euler
view.setPosition(pos)
view.setEuler(euler)

viz.callback(viz.TIMER_EVENT,mytimer)
viz.starttimer(0,0.01,viz.FOREVER)

znchb 07-26-2010 11:06 PM

Hi, Jeff,

If you have time, please give me some idea. thanks

Jeff 07-27-2010 01:00 PM

Try using the newer intersense.dle plug-in. For more information on using that take a look in the Vizard docs. Does the following script work for you?
Code:

import viz
viz.go()

isense = viz.add('intersense.dle')
tracker = isense.addTracker()

viz.link(tracker,viz.MainView)

gallery = viz.add('gallery.ive')


znchb 07-28-2010 09:28 AM

I used the program you provided, and there is error.


** Load Time: 0.13 seconds
** ERROR: Failed to load plug-in: 'intersense.dle'
Traceback (most recent call last):
File "", line 11, in ?
File "Vizard2.py", line 23, in ?
tracker = isense.addTracker()
AttributeError: 'VizExtension' object has no attribute 'addTracker'

mspusch 07-28-2010 12:11 PM

In Vizard, go to Help -- > Check for Updates. Is your version up to date? If not, download and install the most recent version. Do you still get an error when you run the following?
Code:

import viz
viz.go()

isense = viz.add('intersense.dle')


znchb 07-28-2010 12:30 PM

# I just tried and get this work well: orientation & position for one of those 4 # sensers. (try to link View with just one Sensor, each try works.)
# Now I'm trying to use sensor 1 to control orientation& position

# and using sensor 2 to replace mouse
# sensor 3 & 4 replace left hand and right hand
# for sensor 2,3,4, could you give me any idea ? thanks

import viz
import viztracker
viz.go()
viz.clearcolor(viz.BLUE)
gallery = viz.add('gallery.ive')
view = viz.get(viz.MAIN_VIEWPOINT)
#tracker = sensor.addTracker()###error
#viz.tracker()
PORT_INTERSENSE = 1
sensor1 = viz.add('intersense.dls')
PORT_INTERSENSE = 2
sensor2 = viz.add('intersense.dls')
PORT_INTERSENSE = 3
sensor3 = viz.add('intersense.dls')
PORT_INTERSENSE = 4
sensor4 = viz.add('intersense.dls')
# link which sensor, which sensor will
# control the view orientation and walk position
S = sensor1
link = viz.link( S, view )#link the senser to view: perform orientation and #position with head tracker

def ontimer(num):
#the original pos and euler are [0.0, 0.0, 0.0]
pos = S.getPosition()
euler = S.getEuler()
print pos
print euler
viz.MainView.setPosition(pos[0]*10,pos[1]+1.82,pos[2]*10)
viz.MainView.setEuler(euler[0],euler[1],euler[2])

viz.callback(viz.TIMER_EVENT, ontimer)
viz.starttimer(0, 0.01, viz.FOREVER)

Jeff 07-30-2010 01:10 PM

Please post code using the code tags to preserve indentaton.

Are you saying that if you replace the line
Code:

S = sensor1
with a different sensor number the link works with the new sensor and the viewpoint? If that is the case then you just need to create four links for the four sensors. Updating the viewpoint position and orientation in the timer function is not necessary if you created a link between the two.

I'm not sure what you mean by using sensor 2 to replace the mouse.

Besides tracking the hands to you also have glove data for them? Either way you can add left and right hand models that are linked to the tracking data.

znchb 08-02-2010 02:48 PM

Actually, I need to use four viz.link,
(1) link(Intersense HeadTracker, ViewPoint)
(2) link(Intersense Wand, mouse)
(3) link(Intersense HandTracker, Data Glove)
(4) link(Intersense HandTracker, Another Data Glove)
also, the Data Glove is plug in by viz.add('5dt.dls')

I want to gain the performance as the following picture I draw. :)
\ /
\ Glove /
\ /
\ /
\ view /
the glove locates before our view, and if view move and hand move, the glove will also move.

after linking, the position of data glove is far away from viewpoint, even I put the headTracker & Handtracker together.

I think it's the problem of controlling positions of device. Is that right ?

Jeff 08-03-2010 04:51 PM

Sorry, I'm not sure where you are getting stuck. Have you successfully connected to 4 sensors at the same time and created 4 working links? You should be doing this with the intersense.dle plug-in as the intersense.dls plug-in is deprecated.

znchb 08-05-2010 08:51 AM

Thanks.

yes, I connected 4 sensor at the same time.

but their position and orientation are not precisely, and are difficult to control, some time I can find the hand(5DT_DataGlove), some time I can't. I'm still working on this.

BTY,
Is the PPT can be controlled precisely? Can we send data of position and orientation to the sensor of PPT?

blessonisaac 12-06-2010 09:12 AM

Hi,

Can u help me with this?

I tried to connect Head tracker and Wand at the same time
But my wand does not work. My script is wrong link=viz.link( T,mouse). Can u tell me
the correct script?


import viz
import viz
import viztracker
viz.go(viz.QUAD_BUFFER)
viz.clearcolor(viz.BLUE)
gallery = viz.add('gallery.ive')
view = viz.get(viz.MAIN_VIEWPOINT)
PORT_INTERSENSE = 1
sensor1 = viz.add('intersense.dls')
PORT_INTERSENSE = 2
sensor2 = viz.add('intersense.dls')
S = sensor1
T = sensor2
link=viz.link( S,view)
link=viz.link( T,mouse)
viz.collision(viz.ON)

blessonisaac 12-06-2010 09:13 AM

Two Intersenses
 
Hi,

Can u help me with this?

I tried to connect Head tracker and Wand at the same time
But my wand does not work. My script is wrong link=viz.link( T,mouse). Can u tell me
the correct script?


import viz
import viz
import viztracker
viz.go(viz.QUAD_BUFFER)
viz.clearcolor(viz.BLUE)
gallery = viz.add('gallery.ive')
view = viz.get(viz.MAIN_VIEWPOINT)
PORT_INTERSENSE = 1
sensor1 = viz.add('intersense.dls')
PORT_INTERSENSE = 2
sensor2 = viz.add('intersense.dls')
S = sensor1
T = sensor2
link=viz.link( S,view)
link=viz.link( T,mouse)
viz.collision(viz.ON)

blessonisaac 12-06-2010 09:59 AM

Hi,

When i activate the intersense, my scene rotates. why? I did not initialise any euler for the view

please reply
Blesson

blessonisaac 12-06-2010 10:00 AM

Scene rotation
 
Hi,

When i activate the intersense, my scene rotates. why? I did not initialise any euler for the view

please reply
Blesson


All times are GMT -7. The time now is 04:57 PM.

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