PDA

View Full Version : room tilting when moving head up and down with HMD Nvis SX111


karinp
01-09-2012, 04:43 AM
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()

sleiN13
01-10-2012, 12:02 AM
Is the tracker positioned in a angle on the HMD? if so you need to compensate for that.

karinp
01-10-2012, 08:36 AM
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.

sleiN13
01-11-2012, 04:06 AM
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.

karinp
01-13-2012, 07:02 AM
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

sleiN13
01-16-2012, 12:01 AM
That is indeed a different kind of tracker.

karinp
01-16-2012, 01:57 AM
OK, any idea what can be wrong then? Any help would be really appreciated...Has maybe something to do with the yaw, pitch, roll?

karinp
01-24-2012, 03:01 AM
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()