WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-06-2014, 01:29 PM
apboone apboone is offline
Member
 
Join Date: Mar 2014
Posts: 3
oculus rift and inertia cube interaction problems

We have an oculus set up to define head direction and an inertia cube that defines the body orientation. The inertia cube is set up such that the program ignores the roll and pitch information. The problem is that when you run the program and turn around in the environment the systems (oculus and inertia cube) are additive. That is, when you turn 90 degrees in the real world, you've turned 180 in the virtual environment. We think it has something to do with relative vs. absolute designations of the two systems.

This is what we have with the inertia cube. We are trying to define a similar function for the oculus so that we can control whether it's relative or absolute etc.

Code:
def updateOriBody():
	ori = tracker.getEuler()
	pitch = 0
	roll = 0
	viz.MainView.setEuler([ori[0],0,0],viz.BODY_ORI,viz.ABS_GLOBAL)
Thanks for you help!
Reply With Quote
  #2  
Old 03-10-2014, 02:41 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Can you explain the setup in more detail? Is it necessary to move the viewpoint with the body updates or do you just need to record that data?
Reply With Quote
  #3  
Old 03-11-2014, 01:25 PM
apboone apboone is offline
Member
 
Join Date: Mar 2014
Posts: 3
The inertia cube is our tracker for the body orientation of the main viewpoint and oculus default head tracking is enabled. A main purpose is that we do not want to navigate by head tracking, but rather we want head tracking and body tracking to remain independent. This way when you walk (via joystick) through the environment, you can look around with your head without going that direction (unless you walk that direction). Our problem is this, in attempting to make a 90 degree turn, in the VE you have only turned through 45 degrees. It seems that during rotations the orientation tracking of both the inertia cube and oculus add up. Basically it is possible to decouple the inertia cube from the oculus?

thanks
Reply With Quote
  #4  
Old 03-12-2014, 07:15 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
You could link the viewpoint orientation to the head tracker:
Code:
viz.link(headTracker,viz.MainView,mask=viz.LINK_ORI)
Then calculate the change in x, z position every frame based on body tracker yaw and joystick data and set the viewpoint position:
Code:
viz.MainView.setPosition([x,0,z],viz.REL_GLOBAL)
Or you could set the viewpoint body orientation so position movements are relative to that and then adjust the final viewpoint orientation:
Code:
MOVE_SPEED = 5

def updateViewpoint():
	
	x,y,z = joy.getPosition()
	move_amount = MOVE_SPEED * viz.getFrameElapsed()
	viz.MainView.move([x*move_amount,0,y*move_amount], viz.BODY_ORI)
		
	headOri = headTracker.getEuler()
	bodyOri = bodyTracker.getEuler()
	viz.MainView.setEuler([bodyOri[0],0,0],viz.BODY_ORI)
	viz.MainView.setEuler([headOri[0] - bodyOri[0],headOri[1],headOri[2]])
		
vizact.onupdate(0,updateViewpoint)
Reply With Quote
  #5  
Old 03-13-2014, 11:45 AM
apboone apboone is offline
Member
 
Join Date: Mar 2014
Posts: 3
This is working now!

I guess that our problem was that we didn't think to apply the get.euler to our headtracking component in the oculus. This makes sense.

Thank you!
Reply With Quote
Reply


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:24 AM.


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