PDA

View Full Version : Vizard-PPT conversion


nihohit
11-29-2011, 02:37 AM
Hi, three questions which are basically the same:
a. is there a way to adjust the movement speed inside the vizard simulation, when the input is from a ppt-tracker? if so, how?
b. same for adjusting eye-height.
c. Is there a way to convert from the point-system in the ppt to the scene in the vizard, and vice-versa?

Basically, I'm replacing the former VR lab programmer which more or less disappeared, and there's a problem with the simulation he left, that the movement speed is very slow. I tried scaling the scene down, but this seemed to have just scaled the POV and movement speed of the PPT with it, as far as I can see - movement is very slow.

Jeff
11-29-2011, 04:37 PM
a. You can scale movement using the <link>.postScale command:
tracker = vrpn.addTracker('PPT0@hostname',0)
link = viz.link(tracker,viz.MainView)

#Scale X and Z movement by a factor of 2
link.postScale([2,1,2])

b. If you want to scale the Y data use the command above. If you want to add some value to the Y data use:
link.postTrans([0,2,0])

c. The position in both PPT and Vizard are in meters so there is no conversion necessary. If this does not answer your question please explain it some more.

nihohit
11-30-2011, 02:44 AM
Thanks!
I used this method, which solves the problems (although it needs extreme measures - I had to scale by [90,30,90]), but now I have odd jumps - on some fixed points, when I turn my head the view just jumps about 30-40 degrees to the left.

about c: I meant that I could work with the PPT's coordinate system directly in the vizard. would make setting up scenes a whole lot simpler.

Jeff
11-30-2011, 05:28 PM
It sounds like your model is still too large if you have to scale the movement by that amount.

The coordinate systems in Vizard and PPT are the same. If you're not scaling the movement in Vizard and you move one meter in PPT that will move the viewpoint one meter in Vizard.

nihohit
11-30-2011, 10:12 PM
Could it be that the PPT is scaling the movement? I tried using the "tune" function, but it didn't seem to change much.

My model is scaled to factory defaults, 1:1 - but even simple added white picket fences appear as too high without scaling.

Jeff
12-01-2011, 05:09 PM
No, PPT would not scale the movement. If you're using Vizard 4, try loading your model in Inspector to view it's dimensions and make sure the size is correct. If the model was not exported with meters as the unit of measurement it will not be scaled correctly once it's loaded in Vizard.

vizstan
12-01-2011, 11:09 PM
Hi, nihohit,

Could you try to recalibrate your PPT system with the cal-rig again?
Also, I want to verify the size of your calibration rig. The corner LEDs should be close to 57cm apart (not in diagonal direction). You can verify it one more time after the re-calibration process by checking the coordinate system of the light showing in PPT Studio.

nihohit
12-04-2011, 01:04 AM
Hey,
I'm using Vizard 3, and when using the 3d screem to check the stage, or when using the program in debug mode, where the input isn't from the PPT, everything is ok - the eye height is correct and so's the movement speed.

I've now recalibrated the PPT, and set evey value under "tune" to 1, but the problem of movement speed & wrong eye height persist when not scaled, and when scaled by the quoted factors, there's still view-point skipping.
Also, I recreated an empty set, with just the stage and no programming code whatsoever, and the same problems persisted.

nihohit
12-04-2011, 01:17 AM
I don't know if this is also related, but I just noticed that while I calibrated on the floor, and made sure (by the floor tiles) that the set will be perpendicular to the walls, models appear at some angle to what I would've expected.

nihohit
12-04-2011, 01:34 AM
Checked with another stage, now - the eye-height problem didn't appear, so that must be something that is due to the stage.

Gladsomebeast
12-05-2011, 10:08 AM
I think the code you are using is changing the PPT data before it is applied to the viewpoint. PPT always outputs in meters and is oriented in the positive z direction of the calibration square. Try running only this code only:

import viz
import vizact
viz.go()
viz.add('court.ive')

vrpn = viz.add('vrpn7.dle')
tracker = vrpn.addTracker('PPT0@hostname',0)

def updateView():
pptPos = tracker.getPosition()
viz.MainView.setPosition(pptPos)

vizact.onupdate(viz.PRIORITY_DEFAULT, updateView)

nihohit
12-07-2011, 01:50 AM
That certainly seems to help - movement still needs a bit of scaling up, but a lot less then before.
BUT with this code the program doesn't receive the helmet's tilt controls. When I add:
track = viztracker.add()

then there's tilt controls, but now the room and movement directions in the simulation are again at some degree from the room originally - forward movement is slightly skewed (and so's sidestepping), and the corners of the court are around the center of the lab's walls.

nihohit
12-07-2011, 02:05 AM
BTW, it seems that what has caused the slowdown in movement was using viz.link(track,viz.MainView) as the tutorials suggest. Any reason for it?

nihohit
12-07-2011, 02:16 AM
Also, I now checked the helmet, it seems its sensor is set to 30 degrees off - I used print track.getEuler() and when looking forward the average num was [60,0,0] - how do I recalibrate/reset it?

Gladsomebeast
12-07-2011, 09:03 AM
With the viztracker module, people often code in a "reset" to aligne the orientation sensors coordinate system with PPT cooreinate system. It works by facing the orientation sensor in the postive Z direction of PPT, then pressing some key on the keyboard. Usualy this key is 'r' or alt-r.

Its easy to code a reset yourself if you want to do that. On a key press, grab the current raw yaw value of orientation sensor and subtract all subsequent yaw readings from this saved value before applying orientation to view.