Partilhar via


TrackingMapManager Class

Definition

TrackingMapManager class allows an application to opt into running in an Application-Exclusive tracking mode instead of default shared environment.

public class TrackingMapManager
type TrackingMapManager = class
Public Class TrackingMapManager
Inheritance
TrackingMapManager

Remarks

Activating an Application-Exclusive tracking map creates a brand-new environment for the application, unencumbered by any Device Space tracking inaccuracies as the result of degradation over time. This is equivalent to using the "Remove All Holograms" command from Settings, but only applicable to the running application. Holograms for all other applications (including the HoloLens Shell) remain intact and available as before. Returning to the Shell or activating another application will return the HoloLens to the Device Shared tracking mode automatically.

When first entering the Application-Exclusive tracking mode, the calling application will be issued a unique identifier that can be used to resume tracking the app-specific map in future sessions of the application (like if the user switches away from the application and it is terminated in the background due to system resource constraints). However, if the device simply goes to sleep or the user briefly interacts with the Shell, the application will automatically resume in the Application-Exclusive tracking mode once it is reactivated (and all application state will remain available).

There are two limitations to be aware of when using the Application-Exclusive tracking mode:

  1. Only a single Application-Exclusive tracking map can exist on the HoloLens at one time. If an application requests a new Application-Exclusive tracking mode, then any previous Application-Exclusive tracking data would be erased and all SpatialAnchor objects (and attached holograms) would be lost, even if the data was created by a completely different application using its own Application-Exclusive tracking mode. Therefore, attempting to return to a previous Application-Exclusive map (by specifying the identifier received when this map was created) may result in a return value indicating that the previous map was not found. Applications must be prepared to handle the scenario where a previous Application-Exclusive tracking map is not available.
  2. The disk storage available to the Application-Exclusive tracking mode is limited to one third of what is available for the Device Shared tracking mode, although this is unlikely to be an issue for most users. When this limit is reached, HoloLens will begin erasing its least valuable tracking data, which will eventually result in poorer tracking accuracy. The smaller limit is still large enough to maintain good accuracy for house-sized environments and is unlikely to be a concern for most application scenarios.

Given these limitations, the target scenario for the Application-Exclusive tracking mode is for applications with high accuracy requirements that are task oriented, where a task may be interrupted by the user returning the HoloLens Shell or the device going to sleep. However, once the user's task is complete, nothing about the task (with respect to the 3D environment) needs to be saved and so can be erased.

Examples:

  1. High-accuracy alignment of holograms to a real-world object, using QR codes to bootstrap the scenario.
  2. Editing a 3D model with high-accuracy requirements when no 3D spatial persistence of the model needs to occur after the session ends.
  3. Tracking in places that have a lot of environmental churn (like people moving around), which sometimes results in poorer tracking quality than more static environments.

Properties

ActiveTrackingMapType

Indicates the active tracking map type.

Methods

ActivateApplicationExclusiveMapAsync(Nullable<Guid>)

Creates and activates a new application-exclusive map.

ActivateSharedMapAsync()

Leaves the current application-exclusive map and returns to the default shared map. If the device was already in the default shared map, this method does nothing.

GetAsync()

Gets an instance of TrackingMapManager.

IsSupported(TrackingMapType)

Indicates if a tracking map type is supported

Applies to