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:

  • Oculus Rift Sensor
  • SIGViewer later than 2.3.0
    • You can use Oculus DK2 From v2.3.2
  • Oculus SDK (and Runtime) for Windows (please download it from here)
    • We had used version 0.4.3 in this development.
  • HDMI port in your PC.
  • Visual C++ Express 2010

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 have any questions after reading this page: Please feel free to email at: sigverse-users@googlegroups.com


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. From L-R (a)Front View, (b) Back View and ( c) 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/ViewerService

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 OculusRift 
$ 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 "kinect_man"
      [SYS]  0.0.0.0 connected
      [SYS]  kinect_man : 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.

main.png
entry.png
human.png

Figure2: From L-R (a)SIGViewer 2.3.0 (b) After login inside SIGViewer (and black boundary on to-left is clicked) and (c) the NII-Man Avatar.

Registration of user interface plug-in

Click the [Service]-->[Add] menu on the top-left of the SIGViewer window bar.

SIGNi_1.PNG

You then can see the following window. Click the Add button to registrate OculusRift.sig

SIGNi_2.PNG

After the registration of OculusRift.sig to the Service list, click the OK button to close the window.

Next, click the [Service]-->[Start] menu; then select the OculusRift.sig

After adding and starting the SIGService for OculusRift, it starts to receive signals from the sensors and the agent controller starts to get messages from SIGViewer.

Now, according to the orientation of sensor, you can notice the change in head orientation of nii-man avatar.

IMG_1687.JPG
IMG_1681.JPG

To see the view from avatar's eyes:

  • please click the || || of the small rectangular view window
  • please wear the OculusRift and get agent's view.

Attach file: fileSIGNi_2.PNG 568 download [Information] fileSIGNi_1.PNG 613 download [Information] fileoculusRift.sig 188 download [Information] fileIMG_1687.JPG 588 download [Information] fileIMG_1681.JPG 74 download [Information] filehuman.png 500 download [Information] fileentry.png 483 download [Information] filemain.png 569 download [Information] filedeveloper.jpg 598 download [Information] fileback.jpg 534 download [Information] filefront.jpg 552 download [Information]

Front page   Edit Freeze Diff Backup Upload Copy Rename Reload   New List of pages Search Recent changes   Help   RSS of recent changes
Last-modified: 2015-12-25 (Fri) 14:35:49 (454d)