Real world spaces. Blurring the lines between HoloLens devices and emulators.

By far the most amazing feature behind the HoloLens and mixed reality as a whole is the ability to build upon your real world. I personally feel this is where mixed reality blows virtual reality out of the water. We can take real spaces, where we work, live, anywhere we spend our days and nights, and build them out, expand upon them and make incredible things happen.

For myself and other developers who have dropped the coin for a HoloLens device of our own, we have the incredible opportunity to work first hand in our own environments while developing. This allows us to experience our own apps in great detail and precision that no emulator could ever replicate for such a unique experience. Now don’t get me wrong, the HoloLens emulator does a pretty spectacular job of allowing someone to work and interact with holograms or the spatial mapping the HoloLens offers. The deploy time to the emulator vs a real device over Wi-Fi is also significantly faster and I personally vet most my changes on the emulator before taking the time to deploy to the device for an extended run.

Because I tend to work back and forth between the emulator and real device so frequently, I found it exceptionally useful to take my real life mapped workspace from the device and import it into my emulator. This allows me to interact with a very familiar space on the emulator as well as on the device. Especially without a visual representation of the patial mapping turned on in the emulator (more on this in a future post), a foreign room can make it difficult to get ones bearings or to get the desired results out of their actions.

Being able to export a room from the device onto the emulator has a number of great use cases. For example, being the only person in my circle of development friends with a physical device, I can map their home work spaces on my device (already done since they all wanted me to bring it over so they could check it out for themselves) and provide each of their emulators with a representation of their work space. Or maybe you work for a company that’s fortunate enough to be developing HoloLens applications. A HoloLens for each developer likely isn’t in the budget (kudos to you if it is). By exporting and importing the space, any number of development machines can each run their own emulator with a common space. This makes sure everyone has a similar experience, and frees up some of the demand for real device time.

Because I think this is so useful, I thought I would share here how to set it up. Here is a quick breakdown of the steps we need to make this happen:

1. Configure the device to use the device portal.
2. Connect to the device portal and export your room.
3. Import the room into our emulator.

Configuring the device to use the device portal is all done through the settings menu on the HoloLens device. Follow these simple steps to configure it:
1. Find and open the settings window from the main menu.
2. Select “Update” from the settings window.
3. Select “For developers” from the left hand menu.
4. Enable “developer mode” and scroll down and enable “device portal“.

Now that the device is configured, we need to connect to the device portal on a PC. We will need the IP address of our device. We can get this from the settings menu on the HoloLens under Settings > Network & Internet > Wi-Fi > Advanced Options. Punch this IP address into your web browser to head to the device portal. The first time you access the portal, you will be prompted to create a username and password:
1. In the browser, click “request pin“. This will display a pin on the HoloLens.
2. Enter the pin into the field in your browser along with the username and password you want to use.
3. Click “pair” to connect to the device portal. You will likely get a security error, but can ignore it.

The device portal has a ton of cool features that we will go over in more detail in future posts. For now, select “3D View” from the left hand menu. Scroll down and click “update” under spatial mapping. This will load a 3D image of the room as your HoloLens knows it, into the window above. If the room isn’t complete enough for what you want, walk around and look at the sections of the room to flesh them out. Click update to get a new look at what the room looks like.

Once you are happy with the state of the scanned room, click “Simulation” in the left hand menu. In the room name field under capture room, enter a name for your room like “Basement” or “Office”. Click the “capture” button to download a .xef file.

Now that we have our exported room, it’s time to upload it into our emulator. Start your emulator by running  any HoloLens project from Visual Studio with the HoloLens Emulator as your deploy target.

Once the emulator starts, click on the Tools button on the sidebar menu (The >> button). Select the “room” tab from the window that opens. Click “load room“, select the .xef file we got from the device portal and click open.

Your device is now using a copy of the room from the physical device. You can pilot around in the emulator to check it out, or click the device portal button right above the tools button in the emulator menu. This opens the device portal for the HoloLens, and by selecting the 3D view menu option, and clicking update under spatial mapping, you can display the room in the same way we did for the HoloLens to get a better feel for the space.

That’s all there is to it! You can repeat this process any number of times with any number of rooms and swap them out whenever you want from the tools menu in the emulator. I hope you found this tutorial helpful and can make us of your own real spaces in your emulator.

 

Leave a comment