/IoThingsBeautifulLab

Helps creating and testing IoT devices in VR

Primary LanguageC#OtherNOASSERTION

IoThingsLab

The previous version of VRSimulator for IoT New Version

Table of contents

General info

By using VRSimulator platform researchers can connect real and virtual IoT devices, test new IoT devices inside VR environment (and don't even need to buy them!)

:VRSimulator Webpage:

Technologies

Same features are supported on VR IoT Platform as on Mixed Reality Toolkit (https://github.com/microsoft/MixedRealityToolkit-Unity#feature-areas), such as hand tracking and interaction techniques. In addition to that, some extra interaction methods were added into IoT VR Platform.

Connection to real-world IoT devices is performed by REST API calls to openHAB server, which runs either locally on user machine, or remotely on myopenhab server.

Required software and hardware:

  1. Unity Version 2019.4.13+

Additional software & hardware:

  1. Oculus Quest 1 or 2
  2. OpenHAB (running on local or remote server)
  3. IoT devices

IoT VR Platform package

Available items (the list is frequently updated):

Lamp Light Item Door Door WeightScaler Weight Scaler
A lamp thing with Location and Light items attached A door with a door close/open sensor item attached Weight Scaler item triggers according to the weight scaled on it
Camera Camera TV TV Vacuum Cleaner Vacuum Cleaner
A camera with a motion sensor connected A TV translating an image from the camera A vacuum cleaner thing, which can be docked/undocked and move around the scene

Gesture recognizer

GestureRecognizerItem.cs item class enables usage of user-defined gestures. In the example, the Lamp toggles when Index finger tips pushed together.

Thing constructor

In the Client scene you can find a GameObject called ThingContrustructor. Add up 6 item prefabs into it, and then create your own thing using the Control panel GameObject. You can instantiate new items, move them around the scene and even edit them (in the next update). Save the newly created thing as a prefab using Unity Editor (in Play Mode).

IoT VR Package Structure

The main part of the package is Server, where classes for the items and things are defined.

Things are Gameobjects added into Unity project which represent either a digital twin of a real IoT device or a purely virtual IoT device. Things potentially provide many functionalities in one.

Items are the parts things consist of: for example, smart light in the room can consist of several lamps and a receiver – each of them as an item.

Other parts of IoT VR Platform are: resources, prefabs, Thirdparty and scenes.

Setup

VR (Client) part

1.1 Clone the Repo;

1.1 Open Unity Hub; select Add; choose IoThingsLab folder;

1.3 Select Unity version 2019.4.13+ and Platform = Android; open the project;

  1. Download the following .unitypackages from the latest releases:
  • IoThingsLab-Resources-V*.unitypackage
  • IoThingsLab-Thirdparty-V*.unitypackage
  • IoThingsLab-Scenes-V*.unitypackage
  • IoThingsLab-Prefabs-V*.unitypackage

3.1 Inside Unity Editor, navigate to Assets->Import Package->Custom Package...;

3.2 Import the listed packages one by one;

3.3 Note that IoThingsLab-Thirdparty-V*.unitypackage importing may take several minutes;

  1. Inside the Project window, navigate to Assets/com.tsinghua.iotvrp/Scenes and click on Client.unity scene;

  2. On the top of Unity Editor, select Mixed Reality Toolkit -> Utilities -> Oculus -> Integrate Oculus Integration Unity Modules;

  3. Navigate to File-Build Settings. Inside Scenes in Build, select add open scenes, make sure that only Client scene is added, right click on the other scenes and delete them. Switch build platform to Android;

7.1 To run the platform on Oculus Quest, Build and Run the project;

7.2 To run the platform on PC (Unity editor) and use VR input simulation, Click play button;

  1. Have a look at the example items (Tsinghua.IoTVRP->IoTPlayground->Things inside Hierarchy window). Combine your own IoT thing from the items inside Unity Editor.

  2. When adding a new thing, follow the Design rules

Input simulation

Input simulation service Documentation

Tutorial on the IoT part and how to run the server on the local machine

  1. Install openHAB and run the server.;
  2. Add REST API binding;
  3. Follow the instructions for binding your IoT device;

Known Issues

  1. If when running the platform on PC (Unity Editor) you get the following error: Then you need to do step 5 of the setup process: On the top of Unity Editor, select Mixed Reality Toolkit -> Utilities -> Oculus -> Integrate Oculus Integration Unity Modules;

Contributing to the platform

请分享新想法, 谢谢! You can copy the Client Scene and test your ideas before merging the changes:) Thank you!