YUXI: The Mixed Reality Hardware Toolkit
The Mixed Reality Hardware Toolkit (MRHT) makes it easier to blend hardware with Mixed Reality projects. It works to stay somewhat agnostic to technologies and what you download is an example set of technologies that work together.
Supported Hardware: Anything that can run Spacebrew (Raspberry Pi, Arduino Yun, Beaglebone Black)
Supported Software: There are two paths. One using Vuforia and the other using AR.JS. Example are provided using Unity and Vuforia.
Setting up your tools
Setting up your tools
Condensed Setup
Download Unity with Vuforia Plugin
Download the Github Package on your Raspberry Pi and on your Computer
Xcode or Visual Studio Community
If you are on a mac, download Xcode from the App Store
If you are on Windows, download Visual Studio Community
You will also want a text editor, we are going to use Visual Studio Code (Not required)
Unity Custom Setup
Download and Install Unity (Personal Version is fine - it includes Vuforia)
Download the Spacebrew Package
Download and Install the Google Poly Package
Download the MRHT: Hello World Project
MRHT BaseBoARd
Download and Print the Trackable Image at 10cm x 10cm
Download and laser cut a BaseBoARd base
Attach the trackable image print out to the BaseBoARd base
Attach the Raspberry Pi to the BaseBoARd base
Attach the electronics breadboard to the BaseBoARd base
Raspberry Pi (New? See Adafruit Tutorials here)
Install NOOBS or Raspbian OS for Raspberry Pi onto an SD card (Good tutorial on Adafruit)
Connect to Raspberry Pi using Serial Console in order to connect it to wifi
ls /dev/cu.*
screen /dev/cu.SLAB_USBtoUART 115200
Introduction to the MRHT - Hello World Example
Setup Raspberry Pi
1. Connect to the Pi from the terminal
ssh pi@rasberrypi.local
2. Run Spacebrew on the Raspberry Pi
cd /Spacebrew/spacebrew-master node node_server_forever.js
3. Check that Spacebrew is connecting properly
Open the Admin Interface for Spacebrew
http://spacebrew.github.io/spacebrew/admin/admin.html?server=127.0.0.1
Click this link and replace the 127.0.0.1 with the IP address of your Spacebrew server
In a new tab open the Web based Spacebrew String Sender Example
http://spacebrew.github.io/spacebrew.js/spacebrew_string/index.html?server=127.0.0.1&name=cloudString
4. Run the MRHT_HelloWorld.py example on the Raspberry Pi
Open a new tab in your terminal (Command-t)
cd /Python
pico MRHT_HelloWorld.py
Change the 127.0.0.1 in the following line to the address of your Spacebrew server
brew = Spacebrew("MRHT_HelloWorld", description="Animate some wifi networks", server="127.0.0.1", port=9000)
Run the Hello World Example
python MRHT_HelloWorld.py
If you get this error - AttributeError: ‘module’ object has no attribute ‘WebSocketApp’ then install the web socket library for python (pip install websocket-client)
Setup and run Unity from Desktop
Notes: Connecting an external webcam will be make this easier to work with on your computer before transferring to mobile device.
5. Open the Unity Project
Open Unity/MRHW_Proto001/ in Unity
Select and open the BaseBoARd_HelloWorld Scene in the Scenes folder
6. Setup the Spacebrew Object in Unity
Select the Spacebrew object
Change the address to your IP address and leave all other variables as they are.
7. Press Play in Unity and Connect the Spacebrew nodes
You can route either the Spacebrew button or the python script which will send wifi routers to the visualization
8. Orbiting Satellites
Connecting Sensors and Actuators - Lights and Buttons Example
This example follows the same pattern as the Hello World example above for the first 3 steps so we will start with step 4.
Setup the button and light on your breadboard and connect to the Raspberry Pi
(THE DIAGRAM ON THE RIGHT IS CURRENTLY TOTALLY WRONG)
4. Run the MRHT_LightsButtons.py example on the Raspberry Pi
5. In Unity, Open the BaseBoARd_LightsButtons Scene in the Scenes folder
6. Setup the Spacebrew Object in Unity
Select the Spacebrew object
Change the address to your IP address and leave all other variables as they are.
7. Press Play in Unity and Connect the Spacebrew nodes
You can route either the physical buttonPress or the virtual buttonPress. To make the button work as expected
8. Route as you wish and forget what is real
Press the physical button to turn the Virtual light off and on. If you deploy to iOS you can touch the virtual button to turn the physical light off and on.
Advanced Example - SenseHat Example
This example follows the same pattern as the Hello World example above for the first 3 steps so we will start with step 4. this example uses the SenseHat Hat (Shield) for the Raspberry Pi - https://www.raspberrypi.org/products/sense-hat/
4. Run the MRHT_SenseHat.py example on the Raspberry Pi
5. In Unity, Open the BaseBoARd_SenseHat Scene in the Scenes folder
6. Setup the Spacebrew Object in Unity
Select the Spacebrew object
Change the address to your IP address and leave all other variables as they are.
7. Press Play in Unity and Connect the Spacebrew nodes
You can route the letters to the LED shield or create another routing that you are interested in.
8. See Physical Elements extend in Virtual Space
Optional Deploy to iOS for All Examples:
First Compile Xcode Project for iOS from Unity
Open Build Settings
Change to iOS
Open Player Settings
Set bundle identifier
Change Camera Usage Description to anything
Target iOS minimum of 9.0
Back in Build Settings press Build and hope for the best
Compile to iOS device:
Open Unity-iPhone.xcodeproj in Xcode
Select Unity-iPhone in left Column
Change Team to your Personal Team
Switch to run in debug in Xcode
Switch device to your plugged in iOS device and deploy to the device and cross your fingers