WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-15-2016, 01:35 AM
prilpi prilpi is offline
Member
 
Join Date: Feb 2016
Posts: 11
Xbox controller and Oculus DK2

hi there,

I started doing some tests with the Oculus Rift DK2 for Architectural walk-thru..

last week I also add the xbox PC wireless controller.
separately with demos they both work fine.
however when combined the scripts - only one will work

for example, in the "maze" controller demo the OCULUS wont work.
i get no error msgs.. it just. dont work..
(the blue hdmi signal led in the oculus is on, screens OK but it doesn't respond)

i also getting some kind of conflict when use the pit (walk on the plank) demo with the oculus DK2 :
when the oculus works OK, the "faller" doesn't work. i mean.. no gravity.
when disable the oculus import script (""") and controlling the views with the keyboard it works fine..

it would be great if you can provide me the correct script for both scenes or guide me thru this..

thanks
Reply With Quote
  #2  
Old 03-15-2016, 02:01 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Can you attach the vizconnect config file you're using for Oculus with Xbox controller?
Reply With Quote
  #3  
Old 03-15-2016, 06:38 AM
prilpi prilpi is offline
Member
 
Join Date: Feb 2016
Posts: 11
Hi Jeff,
Thanks for your reply.
Where can i find the vizconnect config file ?

What do you think about the other issue ?
(adding the oculus import script to the Pit demo disables the "falling" -
when the floor goes down or the plank goes up it doesn't effect the eye level..)

Thanks,
Ofri
Reply With Quote
  #4  
Old 03-15-2016, 09:33 AM
Erikvdb Erikvdb is offline
Member
 
Join Date: May 2013
Posts: 63
If you don't know where to find the vizconnect config file, you probably didn't use vizconnect

Check what tracker the viz.MainView is linked to, and what things are done to that tracker. Sounds to me like the MainView is just stuck in the ground (or somewhere else outside the level) in your "maze" demo because it's not connected to the controller node, and in case of the pit demo, the PitTrackedFaller class is not applied to the correct tracker either.
Reply With Quote
  #5  
Old 03-15-2016, 10:57 PM
prilpi prilpi is offline
Member
 
Join Date: Feb 2016
Posts: 11
Well..

I'm kinda new to this so i try to catch up with you..
Thing is i dont need to import vizconnect in for the oculus or the controller to work. vizard detects them

In that case (if i understand correctly) why is the vizconnect config matters ?
Is there a vizconnect config to each scene ?

If i get it right there is a kind of conflict with the mainview link (?)
(linked to the oculus / linked to the xbox controller)

I have the feeling its a minor thing i'm missing here
I just need the oculus for the view and the controller to walk in the maze demo instead of the keypad (sounds simple..

Attached is the script for the controller
(i disabled the oculus) and the controller works fine.
Again, when i enables the oculus the controller doesn't respond (thou all its buttons responding..)

Guess i just need the correct script for running them both together

the script i use -
(basicly connect oculus + maze + controller):

import viz
import vizact
import vizcam
import sys
import vizinfo
import oculus

# Initialize window
viz.setMultiSample(8)
viz.go()
"""
# Setup Oculus Rift HMD
hmd = oculus.Rift()
if not hmd.getSensor():
sys.exit('Oculus Rift not detected')

# Setup navigation node and link to main view
navigationNode = viz.addGroup()
viewLink = viz.link(navigationNode,viz.MainView)
viewLink.preMultLinkable(hmd.getSensor())

# Apply user profile eye height to view
profile = hmd.getProfile()
if profile:
viewLink.setOffset([0,profile.eyeHeight,0])
else:
viewLink.setOffset([0,1.8,0])
"""
# Add environment model
viz.addChild('maze.osgb')

# Load DirectInput plug-in
dinput = viz.add('DirectInput.dle')

# Add first available joystick
joy = dinput.addJoystick()

# Set dead zone threshold so small movements of joystick are ignored
joy.setDeadZone(0.2)

def UpdateMovement():

elapsed = viz.elapsed()

# Get the joystick position
x,y,z = joy.getPosition()

# Get the twist of the joystick
twist = joy.getTwist()

# Move the viewpoint based on xy-axis value
move_amount = 5 * elapsed
viz.MainView.move([x*move_amount,0,y*move_amount], viz.BODY_ORI)
# Turn the viewpoint left/right based on twist value
turn_amount = 90 * elapsed
viz.MainView.setEuler([twist*turn_amount,0,0], viz.BODY_ORI, viz.REL_PARENT)

vizact.ontimer(0, UpdateMovement)
Reply With Quote
  #6  
Old 03-16-2016, 01:46 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
In the following code the Oculus sensor data is applied to the viewpoint and the viewpoint is linked to a navigation node:

Code:
# Setup navigation node and link to main view
navigationNode = viz.addGroup()
viewLink = viz.link(navigationNode, viz.MainView)
viewLink.preMultLinkable(hmd.getSensor())
In your UpdateMovement function the joystick data should be used to update navigationNode rather than viz.MainView.

If you want to set this up directly through the code, I would recommend you start with the oculusExample.py script. Then swap out the lines that check for key events with joystick events in the UpdateView function.

The Vizconnect Introduction page describes the advantages of using vizconnect. The Vizconnect Tutorials are useful for learning vizconnect. To accomplish this same task in vizconnect, parent the display to the oculus tracker and then parent the tracker to a transport that's driven by joystick data.
Reply With Quote
  #7  
Old 03-17-2016, 01:01 AM
prilpi prilpi is offline
Member
 
Join Date: Feb 2016
Posts: 11
Hi Jeff,

I tried to set this up directly through the code, start with the oculusExample.py script.
I Then swap out the lines for key events with joystick events in the UpdateView function.
still, no response from controller
(probably as you said, the oculus linked to viewpoint and view linked to navigation node..)
Again, when disable the oculus code the controller works.

I also tried to config them thru the vizconnect,
but i couldn't parent the controller since its not shown in the root map (?)
(i set oculus DK2 as tracker and display and the xbox controller as input)

I understand that i can either write the code for the devices directly in vizard or config them in vizconnect and import to vizard..

I will dive deeper into vizconnect but at this moment i only need some basic features (oculus and controller) for testing architectural walk thrus
(the wireless controller is just for easier walking instead of mouse / keypad )

Regarding this, what do you think is better (code scripting or vizconnect) ?

I would really appreciate it if you can provide me with the full vizard code for the oculus plus xbox controller since i cant solve that viewlink / navigation node issue..

Thanks,
Ofri
Reply With Quote
  #8  
Old 03-17-2016, 06:38 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
It will be easier to use vizconnect for the setup. You can also use the same vizconnect file with the demo launcher and any of your own Vizard applications. Attached is a file you can try out. First run the vizconnect file directly. You'll need to go to the transports tab and press the mapping button to choose which xbox signals drive the transport. There's a height offset added to the DK2 tracker. Remove this offset if you're using position tracking. Once the config file works on it's own you can import it into other scripts.
Attached Files
File Type: zip vizconnect_oculus_xbox.zip (3.2 KB, 3407 views)
Reply With Quote
  #9  
Old 03-20-2016, 11:00 PM
prilpi prilpi is offline
Member
 
Join Date: Feb 2016
Posts: 11
Hi Jeff,

VUALA !! It works!!!

Thanks a lot for the help
It keeps me improving every day...

I used the vizconnect file you sent me for the "piazza" and also copy it to the "maze" - both works great.
I didn't need to set the xbox controller mapping for the transport since it was already set (by default? or set by you before ?)

I tried to copy that same vizconnect config and use it with the "pit" but again
there is still a conflict and i cant get it to work (?)

I think its cuz "faller" linked to head_tracker / main view:

# Create tracked faller and link to main view
faller = PitTrackedFaller(head_tracker)
viz.link(faller,viz.MainView)

and vizcam assigned "head_tracker" to keyboard/mouse navigator :

# Simulate head tracker using keyboard/mouse navigator
head_tracker = vizcam.addWalkNavigate()
head_tracker.setPosition([0,1.5,0])
viz.mouse.setVisible(False)

When i disable the code above and import vizconnect -
oculus + controller works fine but..
No falling when i shift the floor..

I really hope you can guide me thru that "pit" faller issue..
(its not a must for me but that is a great way convincing people with VR..)

Next, ill try to run some tests with imported sketchup scenes (oculus + controller) and to get knowing my way with the inspector..

Thanks again for the great help !
I look forward to your response

Ofri
Reply With Quote
  #10  
Old 03-20-2016, 11:46 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
The demo launcher includes a version of the pit demo that works with vizconnect. Copy your vizconnect config file into the same folder as the launcher and then you'll have the option to select that config at run time. See the demo launcher tech tip for instructions on installing/running the launcher. It's not necessary to follow the 'configuring hardware' section since you already have a vizconnect file.
Reply With Quote
  #11  
Old 03-23-2016, 03:48 PM
prilpi prilpi is offline
Member
 
Join Date: Feb 2016
Posts: 11
Hi Jeff,

I run the demo launcher and downloaded the demo scenes.
Then i copied vizconnect config file into the same folder as the launcher

It all worked great until suddenly for some reason (?) when i'm looking around or moving around with the controller, the image in the oculus turns "jumpy" !!!

It just appeared from no where... i didn't change anything in the vizconnect config..
by the way, image on the PC screen is smooth
and the "maze" scene runs smooth.
any other scene with or without vizconnect turns "jumpy" in the Oculus..

what am i missing here ???
Reply With Quote
  #12  
Old 03-23-2016, 07:59 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
What are the system specs?
Reply With Quote
  #13  
Old 03-23-2016, 11:02 PM
prilpi prilpi is offline
Member
 
Join Date: Feb 2016
Posts: 11
Hi
I'm running it on a new powerful machine matching high demands of VR uses:

MB - ASUS Z170K
OS - Win 8.1 pro 64
CPU - i7 6700 3.4
RAM - 16 GB
GPU - NVIDIA Geforce GTX 970 12 Mb
DIRECTX 11

VIZARD 5.3 64
Oculus - SDK 0.8.0.0
controls - Wireless keyboard + wifi XBOX con'
Reply With Quote
  #14  
Old 03-24-2016, 12:02 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Is the framerate stable (press F4 with script running)? You could try updating the nvidia drivers or rolling back to a previous version if you already have the latest.
Reply With Quote
  #15  
Old 03-24-2016, 12:58 AM
prilpi prilpi is offline
Member
 
Join Date: Feb 2016
Posts: 11
opening any demo with demo launcher is "jumpy", frame rate stable at 74 - 75 fps
however, opening other file directly in Vizard (modern lobby demo) runs in extremely low frame rate (2 - 4 fps) !!!
ill check the nvidia driver and let you know if it changes
thanks.
Reply With Quote
  #16  
Old 03-28-2016, 12:51 AM
prilpi prilpi is offline
Member
 
Join Date: Feb 2016
Posts: 11
Hi Jeff,
I updated the Nvidia driver to the latest.
It fixed the flickering problems in the Vizard Demos.

Moving on with this -
1. When opening the "modern apartment" demo:
eyes level is too high (and furniture looks little smaller as if the FOV in the oculus is not matching the real eyes FOV)
Is that a vizconnect config issue ?

2. When opening an skp model and walking inside:
looking in few directions looks good (stable at 75 fps)
while other directions are flickering (down to 34 fps)
(happens in the same places i look at - not randomly)
I deleted all furniture and high poly' objects so the total poly' count would be low but it still flickers..(?)

I will try it with some other skp models.
What might be the problem ?
Reply With Quote
  #17  
Old 03-28-2016, 03:30 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
1. Are you using Oculus position tracking or just orientation? The vizconnect file I attached was configured with a height offset that assumes position tracking is not used. You can change the height offset in vizconnect. Press the offsets button for the oculus tracker and change the post trans y value.

2. Take a look at the optimization and performance pages in the Vizard help. The information there may help you determine what is causing the slow down if it's due to the models.
Reply With Quote
  #18  
Old 03-28-2016, 06:00 AM
prilpi prilpi is offline
Member
 
Join Date: Feb 2016
Posts: 11
Yes. I'm using oculus positional tracker.
I will try your suggestions.
Thanks
Reply With Quote
Reply

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
Turn using keyboard when using Oculus Seadna Vizard 9 01-12-2016 11:54 PM
Oculus setZoom mshukun Vizard 3 10-24-2014 09:04 AM


All times are GMT -7. The time now is 04:12 AM.


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