PDA

View Full Version : Change rotational gain on HMD


Alex
02-06-2017, 09:17 AM
Hello,

I'm currently attempting to create a Psychology undergraduate experiment using Vizard and an Oculus Rift HMD. I'm very inexperienced with Python, so apologies if I don't explain myself properly.

I'd like to be able to manipulate the rotational gain of the HMD. For example, if a person were to move their head 45 degrees to the right, I'd like to be able to apply a multiplier (e.g. 2) and have the virtual environment appear to move 90 degrees to the left. I'm only interested in manipulating the yaw movements of the head, but if it has to be applied to pitch and roll movements as well then that will also work.

I've currently connected the Oculus tracker and display through vizconnect.

I understand this goes against best practices for VR development, but I'm testing whether certain participants will be able to detect these changes.

Is this possible?

Many thanks,

Alex

Jeff
02-06-2017, 03:45 PM
You can apply a scale operator on the tracker link:

trackerLink = vizconnect.getTracker('head_tracker').getLink()
trackerLink.scaleEuler([2,1,1],viz.LINK_ORI_OP)

Alex
02-09-2017, 06:15 AM
This works perfectly. Thanks a lot for your help :)

Alex

ryang1006
11-13-2017, 11:03 AM
Hi

I was wondering if anyone knows how to change rotational gain in a stair case (basically make the gain go up or down depending on whether someone can state whether the gain is normal or not).

Ideally, I want to get to the point where a person states that at a certain degree they believe the world to be moving correctly.

Thank you - and apologies if I have made myself unclear I am new to Vizard.

Jeff
11-14-2017, 11:32 PM
Sorry, I don't understand. Do you want to change the rotational gain of the tracker only when moving on the staircase? What hardware are you using?

ryang1006
01-31-2018, 02:42 AM
Hi Jeff,

Apologises, I did not make myself clear. I want to change the rotational gain based on the response an individual gives. So that the responses go up and down (like a staircase) in order to find a point at which they cannot notice the gain has been changed.

The problem I am currently having is that the scale euler seems to multiply the gain based on the previous gain value. Is there a way that I can set it back to 'norma'l before I then move to the next value.

For example if I have a gain of [1.3,1,1] and I then want it to be [0.9,1,1] is there a way to get to 0.9 with multiplying 1.3 by 0.9? Ideally, the gain will be [1.3,1,1] then reset to [1,1,1] before [0.9,1,1] is applied. Is this possible?

Thank you!

Jeff
02-04-2018, 11:24 PM
You can apply a reset to the link and remove the operator previously assigned before applying a new one:

trackerLink.reset(viz.RESET_OPERATORS)

Will the scale be changing as the participant is moving or only between trials? If while moving then it will also be necessary to apply an orientation offset to account for the difference between the scaled orientation value and the raw orientation value. For example the following code adds an offset so the view does not jump when the scale factor is removed:

rawTracker = vizconnect.getTracker('head_tracker').getRaw()
trackerLink = vizconnect.getTracker('head_tracker').getLink()
trackerLink.scaleEuler([2,1,1],viz.LINK_ORI_OP)

def removeScaleFactor():
yaw_link = trackerLink.getEuler()[0]
yaw_raw = rawTracker.getEuler()[0]
yaw_diff = yaw_link - yaw_raw
trackerLink.reset(viz.RESET_OPERATORS)
trackerLink.postEuler([yaw_diff,0,0],viz.LINK_ORI_OP)

vizact.onkeydown('1',removeScaleFactor)

The postEuler offset would change each time the scale factor changes.

ryang1006
06-02-2018, 07:58 AM
Hi,

Thank you so much for this. This worked for me. :)

However, I am now trying to do a similar experiment where I change the 'gain' when moving forwards and back wards. Do you know if there is a similar function to the 'scale Euler' function which would allow gain manipulations when translating forward and backwards? Basically, I would like the user to move forward by, say one step, and ask them if they think the world moved like it normally would or if it moved further away/closer.

Thank you!
Ryan