WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-09-2012, 04:43 AM
karinp karinp is offline
Member
 
Join Date: Jan 2012
Posts: 6
room tilting when moving head up and down with HMD Nvis SX111

Hi there,

I'm a new bee here and hope you can help me on a matter. I wrote a script that presents randomised rooms with a duck that when shot with a ball falls behind a panel positioned at the corner of the room, then participants are disoriented by spinning and fading the room, and need to find the corner where the duck dissapeared after the room fade in again.

Everything is going quite well except I cannot understand why when looking up with the HMD the room tilts down on the left and when looking down it tilts up on the left. When rotating on the horizontal plan there is not such a problem and everything happens as it should.

I tried with scripts in the tutorial to check whether I was doing something wrong in my script, but the problem is always there no matter which script I run. So I guess I'm forgetting something or doing something wrong when integrating the Vicon Bonita system through Vizard to the HMD Nvis SX111. The initial part of code where I set the tracker and all of that is below...hope someone can help, thank you very much in advance!!

###initial part of the code where setting tracker etc...
import viz
import random
import vizact
import viztask
import glob
import viztracker
import nvis

viz.setMultiSample(4)
viz.fov(60)
viz.setDisplayMode(2560, 1024)
viz.go(viz.QUAD_BUFFER| viz.FULLSCREEN)

nvis.nvisorSX111()

vrpn = viz.add('vrpn7.dle')
headTrkr = vrpn.addTracker("head2@10.0.0.1")

##Negate Z value of position
headTrkr.swapPos([-1,3,-2])

##Negate X,Y value of quaternion
headTrkr.swapQuat([1,-3,2,4])

viz.link(headTrkr,viz.MainView)
print headTrkr.getEuler()
print viz.MainView.getEuler()
print viz.MainView.getAxisAngle()
print headTrkr.getAxisAngle()
Reply With Quote
  #2  
Old 01-10-2012, 12:02 AM
sleiN13 sleiN13 is offline
Member
 
Join Date: Dec 2008
Posts: 83
Is the tracker positioned in a angle on the HMD? if so you need to compensate for that.
Reply With Quote
  #3  
Old 01-10-2012, 08:36 AM
karinp karinp is offline
Member
 
Join Date: Jan 2012
Posts: 6
Hi sleiN13,

thank you very much for replying, but could you better explain what you mean with "Is the tracker positioned in a angle on the HMD?" I'm not sure I understand what you mean, sorry.
Reply With Quote
  #4  
Old 01-11-2012, 04:06 AM
sleiN13 sleiN13 is offline
Member
 
Join Date: Dec 2008
Posts: 83
If the tracker isn't perfectly level on all axis and you don't compensate for that in your code you get the behaviour you described earlier.
Reply With Quote
  #5  
Old 01-13-2012, 07:02 AM
karinp karinp is offline
Member
 
Join Date: Jan 2012
Posts: 6
Hi sleiN13,

thank you for clarifying, hope I understand what you mean now. However, with Vicon Bonita you have a set of markers (we put 5) on the HMD and after initially calibrating the tracker and building the volume with its x,y and z axes, one builds the object to track based on the position of the markers and this object (in the script I posted is called head2) then is used by Vizard to update the subject position etc...so it is at level since is built on the HMD, maybe you were thinking to a different kind of tracker? or maybe I didn't get you yet? thanks again
Reply With Quote
  #6  
Old 01-16-2012, 12:01 AM
sleiN13 sleiN13 is offline
Member
 
Join Date: Dec 2008
Posts: 83
That is indeed a different kind of tracker.
Reply With Quote
  #7  
Old 01-16-2012, 01:57 AM
karinp karinp is offline
Member
 
Join Date: Jan 2012
Posts: 6
OK, any idea what can be wrong then? Any help would be really appreciated...Has maybe something to do with the yaw, pitch, roll?
Reply With Quote
  #8  
Old 01-24-2012, 03:01 AM
karinp karinp is offline
Member
 
Join Date: Jan 2012
Posts: 6
OK I solved it, now works perfectly...here is how for anyone else might need it in future...

import viz
import random
import vizact
import viztask
import glob
import viztracker
import nvis

viz.setMultiSample(4)
viz.fov(60)
viz.setDisplayMode(2560, 1024)
viz.go(viz.QUAD_BUFFER| viz.FULLSCREEN)
nvis.nvisorSX111()

vrpn = viz.add('vrpn7.dle')
headTrkr = vrpn.addTracker("head2@10.0.0.1")

###Negate Z value of position
headTrkr.swapPos([-1,3,-2])

###Negate X,Y value of quaternion
headTrkr.swapQuat([1,-3,2,4])

link = viz.link(headTrkr,viz.MainView)

link.preEuler([-45, 0, 0])

print headTrkr.getEuler()
print viz.MainView.getEuler()
print viz.MainView.getAxisAngle()
print headTrkr.getAxisAngle()
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 09:35 AM.


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