Skip to content

jonytipton/Theia-Wayfinding

Repository files navigation

Theia Wayfinding

icon

Overview

Android/iOS application that utilizes Microsoft Azure Spatial Anchors (ASA) to enable wayfinding in specific environments. Spatial anchors stored in an Azure Resource Group and session sharing enabled with an Azure App Service.

Demo/Walkthrough

Theia_Demo.mp4

icon

Prerequisites

Android

  • TBD

iOS

  • a macOS machine with the latest version of Xcode and Unity (LTS) installed. Use Unity 2020.3.17 LTS with ASA SDK version 2.10.2 or later (which uses the Unity XR Plug-In Framework).
  • Git installed via HomeBrew. Enter the following command into a single line of the Terminal:
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    Then, run brew install git and brew install git-lfs
  • A developer enabled ARKit compatible iOS device

Installation

  • Clone TheiaWayfinding repository into a new directory
  • Download the ASA packages for import into Unity. Or use the commands below at root of directory:
    • Core
      • npm pack com.microsoft.azure.spatial-anchors-sdk.core@2.12.0 --registry https://pkgs.dev.azure.com/aipmr/MixedReality-Unity-Packages/_packaging/Unity-packages/npm/registry/
    • Android (required for Android build)
      • npm pack com.microsoft.azure.spatial-anchors-sdk.android@2.12.0 --registry https://pkgs.dev.azure.com/aipmr/MixedReality-Unity-Packages/_packaging/Unity-packages/npm/registry/
    • iOS (required for iOS build)
      • npm pack com.microsoft.azure.spatial-anchors-sdk.ios@2.12.0 --registry https://pkgs.dev.azure.com/aipmr/MixedReality-Unity-Packages/_packaging/Unity-packages/npm/registry/

Build/Run

Setup Unity Project

  • Add TheiaWayfinding folder to Unity Hub and open project. Unity might prompt you about a difference between the version in the project and the version that's installed on your machine. This warning is okay, as long as your version of Unity Editor is newer than the one that the project was created with. If your version is newer, select Continue. If your version is older than the one the project needs, select Quit, and upgrade your Unity Editor.
  • Import all downloaded ASA packages into Unity
  • Open Build Settings by selection File > Build Settings
  • In the Platform selection, select desired target platform (Android or iOS)
  • Drag all scenes from the Unity Project pane into the Scenes In Build section of Build Settings
    • HINT: type "t: Scene" into search bar of Project pane to show all scenes in project

Configure Azure Account Information

  • In the Project pane, go to Assets/AzureSpatialAnchors.SDK/Resrouces
  • Select SpatialAnchorConfig. In the Inspector pane, enter the Account ID as the value for Spatial Anchors Account Id, Account Key as the value for Spatial Anchors Account Key, and the Account Domain as the value for Spatial Anchors Account Domain
  • In the Project pane, go to Assets/AzureSpatialAnchors.Examples/Resources
  • Select SpatialAnchorSamplesConfig. In the Inspector pane, enter the App URL as the value for Base Sharing URL
    • HINT: See TheiaWayfinding shared drive for Account ID, Account Key, Account Domain, and App URL values

Android Deployment

  • TBD

iOS Deployment

  • Open Build Settings by selecting File > Build Settings.
  • Under Scenes In Build, ensure that each scene has a check mark next to it.
  • Select Build. On the pane that opens, select a folder to export the Xcode project to.
  • When the export is complete, a folder that contains the exported Xcode project appears.

Open the Xcode project

  • Now you can open your Unity-iPhone.xcodeproj project in Xcode.
  • You can either launch Xcode and open the exported Unity-iPhone.xcodeproj project or launch the project in Xcode by running the following command from the location where you exported the project: open ./Unity-iPhone.xcodeproj
  • Select the root Unity-iPhone node to view the project settings, and then select the General tab.
  • Under Deployment Info, make sure that the deployment target is set to iOS 11.0 or newer.
  • Select the Signing & Capabilities tab and make sure that Automatically manage signing is enabled. If it's not, enable it, and then reset the build settings by selecting Enable Automatic on the pane that appears.
  • Select the Team drop-down and either select a current account or add a new one using an Apple ID
  • Set Bundle Identifier to be "com.FirstnameLastname" (i.e. com.JonSmith)
  • Remove the in-app purchase add-on at bottom of page

Deply the app to your iOS device

  • Connect the iOS device to the Mac, and set the active scheme to your iOS device. Image of Xcode menu bar
  • Select Build and then run the current scheme.
    Image of Play icon in Xcode menu bar

- Once the app is installed on your iOS device, enable developer mode by opening Settings -> General -> VPN & Device Management -> Select the Not Trusted Developer App -> Tap Trust - Relaunch app from Xcode, future applications will now install and run with developer access
  • With Create & Share Anchor, you can create an anchor and save it to your sharing service. In return, you will get back an identifier for it that you can use to retrieve it from the sharing service. You can then run the second scenario, Locate Shared Anchor, from either your device or a different one.
  • With Locate Shared Anchor, you can locate previously shared anchors by entering the identifier mentioned earlier. After you pick your scenario, the app will guide you with further instructions. For example, you'll be asked to move your device around to collect environment information. Later on, you'll place an anchor in the world, wait for it to save, start a new session, and then locate it.

References

About

Android/iOS application utilizing Azure Spatial Anchors (ASA) and Unity for wayfinding at specific locations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published