Tutorial?

The aim of this tutorial is to show how virtual reality can be integrated using SIGVerse via Oculus Rift Sensor, virtual reality head-mounted display.

System Requirements:

NOTE: There are two development kits available DK1 and DK2 (as of Dec 22,2014). Please use OculusRift DK1 for the following tutorial.


If you questions after reading this page: Please feel free to email at:: {jain@nii.ac.jp, inamura@nii.ac.jp}


Introduction

This tutorial describes how to use the sensor implemented on Oculus Rift in SIGVerse. It consists of two modules: a SIGService module which can receive signals from Oculus Rift and an agent controller to get messages from SIGViewer.

front.jpg
back.jpg
developer.jpg

Figure1: The Oculus Rift Sensor. Front View, Back View and the Control Board. Source: Wikipedia.

Please make the suitable cable connections with your PC (e.g. connections with HDMI port) and with the power outlet.

Building SIGService module for OculusRiftSensor on Windows.

The steps are explained as follows:

1. First of all, you will need to setup SIGService_v2-2-0_vc2010.zip service libraries, downloadable from here.

Also, to build the required SIG file for sending the signals from sensor to the SIGViewer, please read the tutorial for "Interprocess Communication", if you have not done it so far.

2. On Windows, obtain the code for SIGService model by cloning from the GitHub and moving to the Plugin/OculusRiftSensor directory.

  $ git clone https://github.com/SIGVerse/Client.git
  $ cd Plugin/OculusRiftSensor

3. Open the project's property pages -> C/C++ -> General and make sure that the include path of your Boost Library is specified in "Additional Include Directories" field, e.g. C:\boost_1_55_0.

4. Open the project's property pages -> Linker -> General and make sure that the library path of your Boost Library is specified in "Additional Library Directories" field, e.g. C:\boost_1_55_0\lib.

5. Click Build -> Build Solution to build the SIG file.

Creating the workspace on Linux

Please create a directory and place the Controller code, Makefile and World XML file given below.

$  sigcreate.sh OculusRift 

Controller for entity

The controller code for obtaining the data from SIGService is shown below. To remind the reader, a controller is one of the main programs which should be written by SIGVerse users. This controller determines the behavior of agents, robots and objects in the virtual world. These 'objects' are called as entities in the SIGVerse.

Let's see the controller sample.

$ cd MyWorld 
$ emacs OculusRiftCtrl.cpp

The agent controller creates a class named "RobotController" by inheriting Controller class. In this case, onAction function is called every 1.0 seconds, which is specified as the return value of the onAction. But, as you can see, this controller does nothing.

Compiling the controller

A shell script for the compilation has been automatically prepared in your working space. You can compile the controller by

$ ./sigmake.sh OculusRiftCtrl.cpp

If the compilation succeeded, you can see OculusRiftCtrl.so.

World file

World file describes the configuration of the virtual world. In the SIGVerse system, world file is described in XML format. The following world file is already prepared in your working space.

$ emacs OculusRiftCtrl.xml

OculusRiftCtrl.xml

The world file reads the file Man-nii.xml as an agent. This agent belongs to the human avataor inside SIGVerse.

Starting the simulation

The script sigserver.sh is used to run the simulation and it placed in sigverse-<version>/bin directory. But you can run the simulation from anywhere because the PATH for the simulation is already set. Type the following command in your working directory.

$ sigserver.sh -w ./OculusRiftCtrl.xml
      :
      :
[SYS]  waiting for connection...
[SYS]  Controller attached to "Toy_D"
[SYS]  127.0.0.1 connected
[SYS]  Toy_D : dataport
[SYS]  127.0.0.1 connected

Please specify a world file with -w option.

Start the SIGViewer and enter the host name and port number to connect to the SIGServer . Please use the button "Connect to SIGServer" by single click.


Front page   New List of pages Search Recent changes   Help   RSS of recent changes