Mapping
Create a Spatial Anchor and Map your surroundings

Overview

The Mapping scene is responsible for creating an Azure Spatial Anchor and mapping a place by scanning any area (both indoors and outdoors) and create a point cloud map using it.
The point cloud map created can then be used for localization and creating persistent AR applications for the users.
On the Project pane, go to Assets\ARWAYSDK\Azure Spatial SDK\Scenes

Requirements

The Mapping scene currently only works with Android and iOS devices that support Google ARCore SDK and Apple ARKit SDK respectively.
For best results, use the latest high-end iOS or Android devices like -iPhone X/XR/XS/11/12 series, Samsung Galaxy S10/20 series, Note 10/20 series, Google Pixel 3/4/5, OnePlus 7/7T/8/8T series, and so on. The app works best with devices that support ARCore Depth API.
Mapping while screen recording reduces the performance of phones and makes the process difficult, so it's not recommended.

Tips for Mapping

  • For best results, use the latest high-end Android or iOS devices for fast and accurate mapping.
  • While mapping a place, make sure that the physical environment being mapped has adequate and evenly distributed lighting.
  • Move your phone slowly while mapping to avoid sudden rotations or other unintended effects. Try to move physically instead of moving the phone standing in one place.
  • Make sure the area you are mapping has enough visual feature points for better results.
  • Try to do the mapping from maximum viewports to enhance the 3D map and improved localization accuracy.
  • For mapping bigger areas, try to capture them in multiple maps.
  • You should map for a minimum of 45 seconds to have enough feature points in a maps
  • If the lighting in a scene changes drastically, try creating maps multiple times in different lighting scenarios.
  • For More Detailed Map creating strategy you look in these docs.​

Mapping Camera viewports/position

Mapping an environment in a single map

The complete environment should be connected while mapping, a single point cloud map will the output.
Ideal approach of mapping a environment in single mapping session

Mapping an environment in multiple maps

The complete environment can be mapped in multiple smaller maps, then multiple point cloud maps can be arranged relatively in Web Studio.
Ideal approach of mapping a environment in multiple mapping session

Steps for mapping real-world space

Step 1: Open the Mapping scene found in the Assets/ARWAYSDK/Azure Spatial SDK/Scenes folder within the Unity project.
Step 2: In the Hierarchy window, look for ARWAYSDK gameobject and then click on it.
Step 3: In the Inspector panel, look for Arway SDK Script and enter your unique Developer Token in the Developer Token field and save the scene.
ARWAY SDK (Script)
Step 4: After saving, add the current scene to the build settings. Then choose the platform of your choice (Android/iOS/HoloLens) and build the application.
Step 5: Install the built app on your device and then open it.
Step 6: Upon opening the app, you'll see the mapping page consisting of a start button, back button, map list button, and a button to switch to the localization scene.
Mapping Page
Step 7: To start mapping and create an Azure Spatial Anchor, point your camera towards the place that you want to scan and press the Start button to begin mapping your surroundings.
Follow the on-screen instructions for the best results.
Mapping a Place
Move slowly to avoid drift and capture the maximum number of feature points.
Cover each area twice for better mapping results.
Step 8: After you have mapped an area you can press the Stop button to stop mapping. Then you will be prompted to give a name to the map you just scanned. Enter a unique name to your map and then press Submit to save it to the cloud.
When done, give your map a name
Step 6: After saving the map, you can click on the Cloud List button at the top to see a list of all the point cloud maps which you have created.
List of captured point clouds
To see your captured point cloud data, visit the Developer Portal.

Set Map Expiration in Azure DemoScriptBase (Script)

1
// How to set an anchor to expire automatically. By default it is 100 days.
2
cloudAnchor.Expiration = DateTimeOffset.Now.AddDays(100);
Copied!