Git Product home page Git Product logo

tablet-vr's Introduction

Tablet VR

Controller for virtual reality tasks for execution of arbitrary experimental paradigms. The virtual environments (aka scenes) are displayed in several monitor tablets around the field of view of the subject.

alt text

Getting Started

Here's a short video showing how to run an example, assuming you fulfill the prerequisites: Circle maze demo

Prerequisites

Code was last built and tested with

  • MATLAB R2018a
  • Unity 2018.a.0f2
  • Java JDK1.8.0_172
  • Android Studio 3.1.2
    • Android SDK Platform 27 revision 3
    • Android SDK Build-Tools 28-rc2 version 28.0.0 rc2
  • PC
    • OS: Windows 10
    • CPU: Intel i7-6700HQ
    • RAM: 16 GB
    • Graphics: GEFORCE GTX 960M
    • SSD: Samsung SM951
  • Tablets
    • OS: Android 5.0
    • SoC: Qualcomm Snapdragon 410 APQ8016

Installation

  • Install MATLAB

    • Download library from repository and place the MATLAB folder under Documents folder.
    • Create/modify Documents/MATLAB/startup.m and put addpath('Tools');
  • If creating new scenes

    • Install Java SDK. Add /bin to the System Environment Variables.
    • Install Android Studio.
    • Install Unity, adding support for Android.
    • Open Unity and create a new project.
    • Import the Unity package or add the <>source code for Unity.
  • Otherwise

  • If using an Arduino in your treadmill

Testing scenes in Unity

  • Add scenes to build settings.
  • Open Main scene and hit play.

Deployment

  • Add scenes to build settings.
  • Open Main scene.
  • Build for Android.
  • Run TabletVR.apk in each tablet.

Usage examples

  • Run TabletVR.exe or run the Main scene in Unity.
  • Open MATLAB.
  • Run the examples below.
  • After each example, type delete(obj); to release resources.

Example 1 - Reuse task controller

obj = CircularMaze();
obj.start();

Example 2 - Reuse task controller

obj = LinearMaze();
obj.start();
obj.speed = 15;
pause(3);
obj.speed = 1;

Example 3 - Interact at a lower level

% Messages are communicated via UDP packages on port 32000.
obj = UDPSender(32000);
obj.send('scene,Classroom;enable,Menu,0;', '127.0.0.1');
for i = 1:10
	% Play a tone, show a blank, and pause.
	Tools.tone(1250, 0.5);
	obj.send('enable,Blank,1;', '127.0.0.1');
	pause(0.25);
	% Rotate camera randomly.
	obj.send(sprintf('rotation,Main Camera,0,%.2f,0;', 360 * rand), '127.0.0.1');
	% Play another tone, hide blank, and pause.
	Tools.tone(2250, 0.5);
	obj.send('enable,Blank,0;', '127.0.0.1');
	pause(1);
end

API Reference

While these libraries acquire better shape, read their documentation from within MATLAB by typing help followed by the name of any class (those files copied to Documents/MATLAB). Most classes list methods and properties with links that expand their description. For example, type help LinearMaze.

Version History

0.1.0

  • TreadmillMaze.m moved to LinearMaze.m
  • Tracker/GUI.m moved to Tracker.m
  • Arguments to LinearMaze.m and CircleMaze.m are passed as key-value pairs, e.g., CircleMaze('com', 'COM4', 'monitors', {'127.0.0.1', 0, '192.168.1.100', 90})
  • Initial Release: Library and example code

License

© 2018 Leonardo Molina

This project is licensed under the GNU GPLv3 License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.