PDA

View Full Version : Upward Drift with HMD


Plasma
01-29-2004, 08:12 PM
I'm using a Virtual Research HMD and InterSense tracker.

I want the user to be able to look up and down without drifting in that direction as they move forward. Is this possible?

farshizzo
01-30-2004, 11:08 AM
Hi,

Is this question related to the post about joystick navigation? I'm not exactly sure what you are asking. If you are wanting the joystick navigation to only move the user in the x-z plane then this is very simple to do. Simply replace the following code of your joystick navigation:if abs(y) > 0.2:
viz.move(0,0,-y*0.1)
if abs(x) > 0.2:
viz.move(x*0.1,0,0)to:if abs(y) > 0.2:
viz.move(0,0,-y*0.1,viz.BODY_ORI)
if abs(x) > 0.2:
viz.move(x*0.1,0,0,viz.BODY_ORI)This just makes you move relative to your body orientation, which is always level with the x-z plane, unless you manually added a pitch to the body orientation. Hope this helps!

Plasma
01-30-2004, 12:36 PM
I'll try to be more specific. As it is, when the user is wearing the HMD and is moving forward, Vizard automatically propels the user in the direction they're looking. This is fine, except that when they look up or down they drift up or down.

I want the simulation to simulate walking rather than flying through the environment.

I have set up the joystick to only move forward and back and control speed, not rotation and not strafing.

I still want the user to move where they are looking, unless they are looking up or down. How do I restrict this?

Thanks!

farshizzo
01-30-2004, 12:53 PM
Hi,

Okay, in that case you need to turn off automatic head tracking and manually apply the rotations. You want to apply the yaw rotation of the intersense to the body orientation and the pitch,roll to the head orientation. Here's some code to help you:
import viz
import sid

viz.go()

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

#Get the main viewpoint object
viewpoint = viz.get(viz.MAIN_VIEWPOINT)

def mytimer(num):
y = sid.get()[1]
x = sid.get()[0]
#Get the data from the intersense
data = isense.get()
#Apply the yaw to the body orientation
viewpoint.rotate(data[3],0,0,'',viz.BODY_ORI)
#Apply pitch and roll to the head orientation
viewpoint.rotate(0,data[4],data[5],'',viz.HEAD_ORI)
#Navigate relative to body orientation
if abs(y) > 0.2:
viz.move(0,0,-y*0.1,viz.BODY_ORI)
if abs(x) > 0.2:
viz.move(x*0.1,0,0,viz.BODY_ORI)

viz.callback(viz.TIMER_EVENT,mytimer)
viz.starttimer(0,0.001,viz.FOREVER)This will restrict navigation to the x-z plane but still let the user look up and down.

Hope this helps!

Plasma
01-31-2004, 08:41 AM
Thanks for the help, but I had trouble implementing your code. I am a very novice programmer and get confused easily, so it's not your fault, it's entirely my inexperience.

I managed to solve the problem by placing the viz.eyeheight command within my joystick timer loop.

Thanks again!

eugcc
04-06-2004, 07:50 AM
Hi, are you using the Intertrax2 tracker then? Just one question, though not related to your topic. I'm using win2000 and winXP machines with I-Visor HMD and Intertrax2 tracker with Vizard which worked after installation, but the moment I rebooted the machines and logged back in, they just wouldn't track anymore. The demo I used with Vizard was the gallery.py

The intertrax I used is USB and the error I get on all my 3 machines (2 XP 1 Win2k) is:

Failed to connect to COM1
Failed to connect to COM2
Failed to connect to COM3
Failed to connect to COM4
**ERROR: Failed to connect to PPT
** ERROR: Failed to connect to intersense
FFB device create failed

Any ideas?

Thanks

mspusch
04-06-2004, 09:10 AM
Hi Eugene,

There are three possibilities about what could cause the problems you see. Please do the following:

A) Use a new Intersense driver provided at www.worldviz.com/download/files/intersense_215.zip and attached to this post. Replace the driver intersense.dls in the Vizard20/plugins folder with the new driver. This driver lets you specify the port the Intersense is connected to. For example, if the intersense is plugged into COM2 you would do the following:

PORT_INTERSENSE = 2
Isense = viz.add('intersense.dls')

B) You might have installed the Intersense Server on your computer, which runs automatically after restart and is known to conflict with other Intersense drivers. Please make sure the IServer is not running when you run the Vizard applications.

C) It sounds like you are only using an Intersense cube, not the PPT (WorldViz Precision Position Tracker for walking around in the simulation). For this, please get rid of the lines

pos = viz.add('vizppt.dls')
pos.command(4.002)
pos.command(13)

and lower down (where the reset button is defined) the line

pos.reset()

Hope that helps.

Matthias

eugcc
04-07-2004, 01:01 AM
Dear Support, what would we do without you???!!!

Its working now after closing the intersense server! The other SkyDiver Demo from Maelstrom also worked. The intersense server is at fault.

Thank you