WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
Old 06-16-2017, 09:04 AM
rdkirkden rdkirkden is offline
Join Date: May 2017
Posts: 20
Oculus Rift DK2 + gamepad controller


I’m trying to build an environment in which the subject wears an Oculus Rift DK2 headset and is additionally able to navigate using a gamepad controller (Logitech Dual Action). The controller should allow the subject to move along both horizontal axes using the left handle and also turn (i.e. rotate about the vertical axis) using the right handle.

The problem I have encountered is that when the subject turns using the controller, the horizontal axes are not re-aligned to the subject’s new orientation, with the consequence that after a 90 degree turn, the left/right handle action that previously caused movement along the x-axis now causes movement along the y-axis.

In an attempt to narrow down the cause of the problem, I started with the ‘’ example script (, which gives complete gamepad control over a view on the monitor, but does not incorporate a headset. To this, I added code from the ‘’ script (Program Files\WorldViz\Vizard5.2\examples\devices\, cited in, which incorporates an Oculus Rift DK2 headset, but has only limited keyboard controls (to move along the horizontal axes, but no turning). The problem emerged as soon as I instructed the headset sensor to link with the ‘MainView’. I attach two code listings: in the first, there is still full gamepad control but no headset control over the view because the link has not yet been made; in the second, the headset has been linked in and is working properly, but the problem with gamepad control has emerged.

You can see that in addition to adding the headset instructions, I’ve also made a few changes to the gamepad control code in the ‘UpdateJoystick’ function. This was necessary to get as much functionality as I could from the gamepad and headset, leaving just the problem with turning that I could not solve. The changes that I succeeded in making were as follows.

1) The ‘viz.MainView.move’ statement didn’t work at all after linking the Oculus sensor, so the gamepad could not be used to move along the horizontal axes. This was solved by using a ‘navigationNode.setPosition’ statement instead. I’ve noticed that the ‘’ script similarly uses ‘navigationNode.setPosition’ to get its keyboard controls working, although I don’t understand why this is necessary. (In contrast, the ‘viz.MainView.setEuler’ statement worked fine, so the gamepad could be used to rotate the view. Note that I’m using the ‘z’ variable here, not the ‘twist’ variable, because the Device Calibration Wizard got the horizontal and vertical actions of the right handle mixed up.)

2) After changing this, the gamepad could be used to move along the horizontal axes, but when the subject turned their head the horizontal axes were not re-aligned to the subject’s new orientation. To solve this, I had to incorporate the subject’s current yaw value into the ‘navigationNode.setPosition’ statement, using code that I do not understand, but copied from the keyboard controls in the ‘’ script.

To clarify my present situation, the horizontal axes are now being re-aligned when the headset turns, but not when the view is rotated using the right gamepad handle.

I’ve tried everything I can think of to get his working, but with no success. A large part of the problem is that I don’t understand all of the code, because the documentation in the Vizard 5 Reference is not very detailed.

I should add that I’m using Vizard 5.2 and Oculus SDK 0.5. Before attempting to write code and test any specific functionality, I was advised on this forum to update to the latest versions of both Vizard and Oculus; but I’m reluctant to do this unless I’m certain it is necessary, just in case it causes problems for some other hardware that I may need to use (some old NVIDIA 3D VISION 2 glasses). The two example scripts mentioned above each works perfectly on my system, it’s just that I can’t quite get them to fit together.

Any advice appreciated!

Attached Files
File Type: txt before_linking_headset.txt (853 Bytes, 1279 views)
File Type: txt after_linking_headset.txt (1.2 KB, 1324 views)
Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Which Vizard5 version to use with Oculus Rift DK2? rdkirkden Vizard 3 06-16-2017 08:33 AM
Oculus Rift + Vizard help required sukhpreet Vizard 1 01-03-2017 10:52 AM
Xbox controller and Oculus DK2 prilpi Vizard 17 03-28-2016 05:00 AM
Oculus Rift and 360 Panorama with Vizard Lite Edition mshukun Vizard 4 11-10-2015 11:17 AM
Multiple post-process effects with oculus rift lklab Vizard 2 03-13-2015 01:48 PM

All times are GMT -7. The time now is 11:42 PM.

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