In this blog, we’ll see how to create an AR pathfinding/navigation app. All you need is a spatial map of your environment (creating one is super easy), and knowledge on how to use Unity Game Engine. We’ll be using Immersal’s SDK to build this application. So, let’s get started!
Want to watch the video instead?
1. Create a Spatial Map
- Register as a developer here on Immersal’s website.
- Download the Universal Mapper App (available on Android/iPhone) and log in using your credentials.
- Launch the immersal mapper app and click Create New Map.
You can map your environment in two ways:
- Real-Time Mode: Quick and automatic but lower quality.
- Manual Mode: Higher quality but requires careful image capture. Sice AR Pathfinding requires a good quality map it’s recommended the use Manual Mode for mapping.
💡 Pro Tip: Take your time mapping. Good maps = better AR experiences! Follow the mapping guidelines.
2. Set Up Unity
- Unity Project:
- Make sure you are using Unity Editor verison 2022.3 LTS or above.
- Create a new Unity Project, you can select either 3D core or URP as the starting template.
- Install the Immersal SDK:
- Open Unity’s Package Manager.
- Select the plaus(➕) icona → Add the package URL → paste this URL: https://github.com/immersal/imdk-unity.git
- Install the SDK and ensure it’s the latest version.
- Scene Setup:
- Create an empty scene.
- Add AR Session and XR Origin, from the XR menu
- In the project window, search for Immersal SDK and add the prefab to the scene.
- Create an empty gameobject and name it XR Space.
- Add XR Space Component to it.
- Create two child object and name them Pose Filter and Pose Smoother, and add the same components to them.
- Make sure to reference theses components inside the XR Space Component
- Create an empty gameobject, name it XR Map and the XRMap component to it .
- Download Your Maps:
- Log in to the SDK -> go to the developer portal and copy your map ID.
- Paste it into Unity’s XR Map component -> check the box for Metadata , Mapfile and Visualization. Then click Download.
- Duplicate thee XR Map -> go to developers portal and copy the next Map ID.
- Then back in Unity, click on 'Reconfigure Map' and paste the ID and make sure to check the box for Metadata , Mapfile and Visualization and click on Download.