In this blog, you'll learn how to create an application that uses a Visual Positioning System (VPS) to overlay BIM (Building Information Modeling) models onto your physical environment. This has real-world applications such as:
Pre-construction validation: Contractors can augment BIM models onto physical sites, ensuring perfect alignment and avoiding costly errors.
Maintenance: Visualize hidden systems like plumbing, electrical wiring, or HVAC systems to guide technicians precisely to the areas that need repairs or upgrades.
We’ll leverage the Immersal SDK for this application. Immersal provides tools like spatial mapping and VPS to enable developers to create advanced AR experiences. A special thanks to Immersal for sponsoring this tutorial!
Want to watch the video instead?
Prerequisites
Before diving in, make sure you’ve completed these three steps:
1. Developer Account Setup
- Create a free developer account on the Immersal website. It’s straightforward, and the link can be found here.
2. Map Your Environment
- Download the Immersal Mapper App from the Play Store or App Store.
- Capture and upload photos of your environment. Immersal’s backend processes these images to identify feature points for spatial mapping.
3. Unity Project with Immersal SDK
- Open Unity and navigate to Window > Package Manager.
- Click the "+" icon, select Add Package from Git URL, and paste the Immersal SDK URL (https://github.com/immersal/imdk-unity). Click "Add."
- Switch your platform to Android in File > Build Settings and resolve any project validation issues in the popup window.
Setting Up the Scene
1. Initial Setup
- Delete the default Main Camera.
- Add AR Session and XR Origin from Hierarchy -> XR.
- Reset the transforms of both objects.
2. Add Immersal SDK Prefab
- Search for the Immersal prefab in the Project Window (make sure the search includes all folders).
- Drag and drop the prefab into your scene.
- Log in to your Immersal developer account and retrieve the developer token
3. Configure XR Space
- Create an empty object named XR Space and attach the XR Space component.
- Add two child objects named Pose Smoother and Pose Filter, then attach their respective components.
- In XR Space, add Pose Smoother and Pose Filter to the data processors list.
4. Map Integration
- Create an empty object named XR Map and attach the XR Map component.
- Retrieve your Map ID from the Immersal developer portal and paste it into the XR Map component
- Enable Map File and Visualization options, then click "Download."
- You should now see a point cloud representing your environment’s feature points.