AR Indoor Navigation Tutorial Overview

Aug 22, 2024

AR Indoor Navigation Tutorial Notes

Introduction

  • Host welcomes viewers and introduces the tutorial about AR indoor navigation.
  • Quick overview of what will be covered: creating a basic AR navigation prototype.

Setting Up Unity Project

  1. Create an empty Unity project with the 3D template.
  2. Player settings configuration:
    • Remove Vulkan API.
    • Enable Dynamic Batching.
    • Set Minimum API Level: Android 7.
    • Scripting Backend: IL2CPP.
    • API .NET Framework Target: .NET 4.x.
    • Set Target Architecture: ARM64.
  3. Switch to Android platform:
    • Go to Build Settings > Select Android > Switch Platform.
  4. Install XR Plugin Management:
    • Check AR Core under Android settings.

Importing AR Foundation

  • Open Package Manager and install AR Foundation from Unity Registry.
  • Delete Main Camera and set up AR session:
    • Right-click > XR > AR Session Origin (for AR camera) and AR Session.
    • Optionally add AR Input Manager (not covered in this tutorial).

Creating the Environment

  1. Create a folder named "Textures" and add a mini-map texture.
  2. Add a 3D object (Cube) as Floor:
    • Scale: Y = 0.016, X = 3, Z = 3 (approximate to hotel room dimensions).
  3. Create Materials:
    • Create folder "Materials".
    • Create material "Floor" with Unlit Texture shader and apply mini-map texture.
  4. Structure the environment:
    • Create an empty GameObject named "Environment".
    • Add wall cubes, scale, and position them to create a room layout.
  5. Create a material for the walls:
    • Use VR Spatial Mapping and Occlusion shader.

Navigation Mesh Setup

  1. Make environment static.
  2. Open Window > AI > Navigation to create a navigation mesh.
  3. Adjust Navigation Agent radius for proper navigation.
  4. Add a target object (Cube) for navigation:
    • Scale down and position in the bathroom.
    • Create a new material "Target" and make it visible.

Adding Indicators and Line Renderer

  1. Create an Indicator GameObject and add a sphere for visual representation.
  2. Set up position constraint for the indicator to follow the AR camera.
  3. Add a Line Renderer to visualize the path:
    • Set material color and adjust width.

Top-Down Camera Setup

  1. Add a top-down camera as a child of the indicator.
  2. Configure the camera settings:
    • Set projection to Orthographic, position it, and adjust size.
  3. Create a Render Texture for mini-map display.

UI Setup for Mini-Map

  1. Create a UI Canvas for the mini-map.
  2. Add a Raw Image to display the render texture.
  3. Adjust image properties for better visibility in the UI.

Script Setup

  1. Create a "Scripts" folder and add a script "Set Navigation Target."
  2. Outline the functionality for the navigation path calculation.
    • Toggle for line rendering and update path on screen touch.

Final Adjustments

  • Set layers for floor and wall for proper visibility.
  • Adjust geometry for accurate navigation and re-bake the navigation mesh.

Testing and Conclusion

  • Build and run the application on an Android device.
  • Show the working mini-map and navigation capability.
  • Encourage viewers to like, subscribe, and leave comments for future tutorials.