#1
|
|||
|
|||
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) |
#2
|
|||
|
|||
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?
|
#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 |
#4
|
|||
|
|||
You could link the viewpoint orientation to the head tracker:
Code:
viz.link(headTracker,viz.MainView,mask=viz.LINK_ORI) Code:
viz.MainView.setPosition([x,0,z],viz.REL_GLOBAL) 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) |
#5
|
|||
|
|||
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! |
|
|