Git Product home page Git Product logo

mre-harvesting-virtual-environment's Introduction

Virtual Environment

This repository has been developed as part of the project "Mixed Reality Environment For Harvesting Study" done by Alessandro Dalbesio.

Introduction

This repository contains all the code relative to the Virtual Environment.
The development has been done for the Oculus Quest 2 but it should be compatible with other Oculus devices.

Installation

To install this Unity project follow these steps:

  1. Clone the repository
  2. Open Unity Hub
  3. Click on "Add" and select the cloned repository
  4. Open the project
  5. Import from Asset store the package "Oculus Integration"
  6. Go to File > Build Settings
  7. Go to "Android" and click on "Switch Platform"
  8. If in the bottom right of the unity windows the Oculus icon has some dot on it click on it and then click to "Apply all"
  9. Modify the parameters in the file Scripts/Parameters.cs according to your needs. At the moment the synchronization of the parameters is not automatic as in the case of the other components of the system.

Note: The Oculus Integration is very helpfull to manage the Oculus Quest (It's possible to use the Oculus Quest without it but it's much simpler to use it).
If you see lots of warnings in the console, don't worry, they are all related to the Oculus Integration and they don't affect the project.

Run the project onto the Oculus Quest

Folow these steps to be able to run the project onto the Oculus Quest:

  1. Connect the Oculus Quest to the computer with the link cable
  2. If you have any VPN active, disable it (ZeroTier doesn't give any problem but other VPNs do)
  3. Open the project in Unity
  4. Go to File > Build Settings > Platform: Android
  5. If the Oculus Quest has been correctly connected to the computer and the access permissions has been done from the Headset you should be able to see the device in the section "Run Device"
  6. [Optional] If you wish to see the logs from the Headset you should click on the button "Development Build"
  7. Click on "Build and Run"
  8. [Optional] If you have clicked on the button "Development Build" you can now go in the "Console" window and click on "Editors" and then on "Oculus". All the logs from the Headset will be shown in the console.

Code structure

Here a overview over the main folders is given. Below you will find a more detailed description on the files of the Scripts folder.
The main folders of the project are:

  • Materials: this folder contains all the materials used in the project
  • Prefabs: this folder contains all the prefabs used in the project.
  • OBJImport: this is a third party library used to import .obj files into Unity. It's not well documented but it's very easy to use and to modify (you just need to spend a little bit of time).
  • Scenes: this folder contains all the scenes of the project.
  • Scripts: this folder contains all the scripts of the project. The other folders are generated automatically from Unity and so a deep description is not given.

Below you can find a structure of the code in the folder Scripts

  • OptitrackObjects/Rigidbody.cs: This file contains the class Rigidbody that is used to store all the information relative to a rigidbody from the Optitrack server.
  • OptitrackObjects/Tracker.cs: This file contains the class Tracker that is used to store all the information relative to a tracker from the Optitrack server.
  • DataSynchronizer.cs: This file manage the synchronization of the data between the server and the client.
  • Model.cs: This file contains the class Model that is used to store all the information relative to a model.
  • Parameters.cs: This file contains some settings related to the parameters of the project.
  • SceneLoader.cs: This file contains all the methods needed to load the scenes.
  • StorageManager.cs: This file contains all the function to store and retrieve the data from the storage. This file might also be used to implement a database (but it's not implemented yet because I had problems compatibility issues between SQLite and the Oculus).
  • Texture: This file contains the class Texture that is used to store all the information relative to a texture.
  • TrackerSynchronizer.cs: This file manage the synchronization of tracker data from the Optitrack (through the websocket server) to the client.

Still to do

Here a list of the things that still need to be done (in order from the most important):

  • Do a calibration system to be sure that the virtual environment is aligned with the real one
  • Create the scene from the trackers
  • Add a reconnection system if the connection to the server is lost
  • Synchronize the options in the Virtual Environment automatically with the server (as the user interface does)
  • Synchronize the options in the Virtual Environment automatically with the Optitrack Bridge (IDs and names)
  • Manage the situation in which a user has disconnected from the user interface but the virtual environment is still running
  • Add the possibility of selecting the model and texture also from the Oculus Quest The two main files that should be modified are TrackerSynchronizer.cs and SceneLoader.cs.

Used versions

The following versions have been used:

  • Unity 2021.3.19f1
  • Oculus Integration 54.0

Authors

This repository is part of the project "Mixed Reality Environment For Harvesting Study" done by Alessandro Dalbesio.
The project has been done in the CREATE LAB (EPFL).
Professor: Josie Hughes
Supervisor: Ilic Stefan

License

This project is under MIT license.

mre-harvesting-virtual-environment's People

Contributors

alessandrodalbesio avatar

Watchers

 avatar

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.