WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Handling connected devices (https://forum.worldviz.com/showthread.php?t=5107)

mshukun 07-17-2014 10:03 AM

Handling connected devices
 
I created an application that requires both the Microsoft Xbox controller and Oculus Rift HMD connections. The Vizard throws error messages in Vizard IDE when these devices are not connected. I would like notify device connection errors to the user using vizinput.message(). Unfortunately, I haven't been able to find the way to do it. I appreciate if you have any suggestions/solutions regarding the problem.


Pseudocode:
IF Both Oculus Rift HMD and Xbox controller are connected
THEN start the application
ELSE
THEN show message and Exit the application


Thank you,
Makiko

Jeff 07-17-2014 04:27 PM

The joystick.py example script exits if a DirectInput device is not connected:

If both the display and sensor cables of the Oculus are not connected getSensor will return None:

Code:

import oculus
hmd = oculus.Rift()
if hmd.getSensor() is None:
        print 'Rift not connected'



All times are GMT -7. The time now is 09:18 AM.

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