WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-26-2010, 03:59 PM
znchb znchb is offline
Member
 
Join Date: Sep 2008
Posts: 21
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
Reply With Quote
  #2  
Old 07-26-2010, 06:25 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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.
Reply With Quote
  #3  
Old 07-26-2010, 10:32 PM
znchb znchb is offline
Member
 
Join Date: Sep 2008
Posts: 21
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)
Reply With Quote
  #4  
Old 07-26-2010, 11:06 PM
znchb znchb is offline
Member
 
Join Date: Sep 2008
Posts: 21
Hi, Jeff,

If you have time, please give me some idea. thanks
Reply With Quote
  #5  
Old 07-27-2010, 01:00 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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')
Reply With Quote
  #6  
Old 07-28-2010, 09:28 AM
znchb znchb is offline
Member
 
Join Date: Sep 2008
Posts: 21
Unhappy

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 "<string>", line 11, in ?
File "Vizard2.py", line 23, in ?
tracker = isense.addTracker()
AttributeError: 'VizExtension' object has no attribute 'addTracker'
Reply With Quote
  #7  
Old 07-28-2010, 12:11 PM
mspusch mspusch is offline
WorldViz Team Member
 
Join Date: Feb 2003
Posts: 223
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')
Reply With Quote
  #8  
Old 07-28-2010, 12:30 PM
znchb znchb is offline
Member
 
Join Date: Sep 2008
Posts: 21
# 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)
Reply With Quote
  #9  
Old 07-30-2010, 01:10 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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.
Reply With Quote
  #10  
Old 08-02-2010, 02:48 PM
znchb znchb is offline
Member
 
Join Date: Sep 2008
Posts: 21
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 ?
Reply With Quote
  #11  
Old 08-03-2010, 04:51 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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.
Reply With Quote
  #12  
Old 08-05-2010, 08:51 AM
znchb znchb is offline
Member
 
Join Date: Sep 2008
Posts: 21
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?
Reply With Quote
  #13  
Old 12-06-2010, 09:12 AM
blessonisaac blessonisaac is offline
Member
 
Join Date: Sep 2010
Posts: 18
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)
Reply With Quote
  #14  
Old 12-06-2010, 09:13 AM
blessonisaac blessonisaac is offline
Member
 
Join Date: Sep 2010
Posts: 18
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)
Reply With Quote
  #15  
Old 12-06-2010, 09:59 AM
blessonisaac blessonisaac is offline
Member
 
Join Date: Sep 2010
Posts: 18
Hi,

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

please reply
Blesson
Reply With Quote
  #16  
Old 12-06-2010, 10:00 AM
blessonisaac blessonisaac is offline
Member
 
Join Date: Sep 2010
Posts: 18
Scene rotation

Hi,

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

please reply
Blesson
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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