Spatial anchors
Spatial anchors are persistent reference points in the real world that augmented reality (AR) and mixed reality (MR) systems use to lock virtual objects to a fixed location in physical space.[1] In essence, a spatial anchor defines a point in the environment with a unique coordinate frame that the device will track over time, so that any digital content attached to that anchor remains accurately world‑locked (i.e., tied to a real‑world position and orientation) rather than floating or drifting as the user moves.[1][2] By rendering virtual objects relative to an anchor’s coordinate system, those objects appear fixed in the real world with minimal drift, even as the user changes their viewpoint or returns to the scene later.[1]
Spatial anchors are implemented on top of the device’s environmental tracking, typically using simultaneous localization and mapping (SLAM) and visual-inertial odometry to identify and track distinctive feature points and surface geometry in the environment.[3] Some platforms also support geospatial anchors that tie content to geographic coordinates (latitude/longitude/altitude) using a global localization system.[4][5]
Technical overview
At a high level, an AR/MR system continuously estimates its pose (position/orientation) relative to a map of the environment and maintains anchor poses within that map:
- World‑locking and coordinate systems. Each spatial anchor establishes its own coordinate system. Rendering content in an anchor’s space gives the most precise positioning, while the system makes small adjustments over time to keep holograms aligned to the real world.[1] ARCore notes that as its understanding of the environment changes, the numerical locations of the camera and anchors can change to maintain correct relative positions.[3]
- Creation and attachment. Applications create anchors programmatically or after a raycast/hit‑test against detected geometry; content is then attached to that anchor.[6][7]
- Persistence and sharing. Platforms provide local (on‑device) and/or cloud mechanisms to persist and, in some cases, share anchors across sessions and devices (see below).[1][8][9]
Types of anchors
- Local anchors. Stored and resolved on the same device for single‑user persistence across sessions.[1]
- Cloud/shared anchors. Hosted to a cloud service so multiple devices can resolve the same real‑world anchor for multi‑user alignment (e.g., ARCore Cloud Anchors; Meta Spatial Anchors via OpenXR extensions).[8][9]
- Geospatial anchors. Anchors specified by WGS84 latitude/longitude/altitude (ARCore WGS84/Terrain/Rooftop) or platform‑specific location anchors (ARKit ARGeoAnchor).[4][5]
Persistence and sharing
A major benefit of spatial anchors is the ability to persist content across app sessions and share content between users:
- On Microsoft HoloLens, applications can save and reload local anchors so that holograms remain in place between sessions on that device.[1]
- ARKit enables session persistence by saving an ARWorldMap (a serialized snapshot of the session’s mapping data and anchors) which can be restored later; ARKit also supports location anchors via ARGeoAnchor on compatible devices/regions.[10][5][11]
- ARCore provides Cloud Anchors so developers can host anchor data and later resolve it on other devices; with Persistent Cloud Anchors the time‑to‑live can be configured from 1 to 365 days (with appropriate authorization mode).[8][12][13]
- Meta Quest (via OpenXR) exposes spatial anchors that can be saved, loaded, and shared; Meta’s OpenXR extensions (e.g.,
XR_FB_spatial_entityand related storage/query extensions) enable persistence across sessions.[9][14] - Magic Leap 2 supports local spatial anchors via its OpenXR‑based subsystem, and its earlier AR Cloud offering is noted as deprecated in current developer docs.[15]
Support in major AR frameworks
- Apple ARKit — The base ARAnchor represents “a real‑world position and orientation,” with platform features that include plane/image/object anchors; persistence can be achieved via ARWorldMap; ARKit also supports location anchors (ARGeoAnchor) in supported regions.[7][10][5][11]
- Google ARCore — Provides an Anchor API for local anchors and Cloud Anchors (including persistent TTL) for cross‑device sharing; the Geospatial API supports WGS84, Terrain, and Rooftop anchors using Google’s VPS.[6][8][4]
- Microsoft Windows Mixed Reality / Microsoft HoloLens — Anchors (sometimes called world anchors) keep holograms fixed; Microsoft’s design guidance covers anchor creation, placement, and trade‑offs. Azure Spatial Anchors (ASA) was retired on November 20, 2024.[1][16]
- Meta Quest (OpenXR runtime) — Spatial anchors with save/load/share operations and best‑practice guidance; persistence and discovery use Meta’s OpenXR spatial entity extensions.[9][14]
- Magic Leap 2 — OpenXR‑based spatial anchor subsystem with AR Foundation integration; Spaces and earlier AR Cloud notes are documented in Magic Leap’s developer site.[15]
- OpenXR standard — Includes vendor extensions for anchors, notably Microsoft’s
XR_MSFT_spatial_anchorandXR_MSFT_spatial_anchor_persistence, and Meta’sXR_FB_spatial_entityfamily for persistence and sharing.[2][17][14]
Comparison of major APIs
| Platform | API / Feature | Key capabilities |
|---|---|---|
| Apple ARKit | ARAnchor, ARWorldMap, ARGeoAnchor | Anchor placement and session persistence via ARWorldMap; location anchors in supported regions.[7][10][5] |
| Google ARCore | Anchor, Cloud Anchors (1–365 day TTL), Geospatial (WGS84/Terrain/Rooftop) | Local & cloud anchors; cross‑device sharing; VPS‑backed geospatial anchors.[6][8][4] |
| Microsoft OpenXR (WMR/HoloLens) | XR_MSFT_spatial_anchor, XR_MSFT_spatial_anchor_persistence |
Spatial anchor creation and persistence per the OpenXR registry.[2][17] |
| Meta Quest (OpenXR) | XR_FB_spatial_entity (+ storage/query) |
Save, load, erase, and share anchors across sessions/devices via spatial entities.[14][9] |
| Magic Leap 2 | Magic Leap Spatial Anchor Subsystem (OpenXR) | Local anchors through AR Foundation / OpenXR; developer docs detail setup and permissions.[15] |
Geospatial anchors
AR at world scale is enabled by anchors tied to geographic coordinates:
- ARCore Geospatial API. Provides WGS84 Anchors (lat/long/alt), Terrain Anchors (lat/long with altitude relative to ground via VPS), and Rooftop Anchors (lat/long with altitude relative to building roofs).[4]
- ARKit Location Anchors. ARKit’s ARGeoAnchor lets apps place anchors by latitude/longitude (and optionally altitude), with ARKit continually refining the position during geotracking sessions.[5][11]
Best practices and limitations
- Keep content close to its anchor. Microsoft’s guidance highlights that rendering content in an anchor’s coordinate system is most precise, while large lever‑arms (objects far from their anchor) can magnify small angular errors; keep holograms close to their anchor and create additional anchors for distant content.[1]
- Use anchors for persistent world‑locked content, not fast movers. Dynamic objects are often better rendered in device‑centric or stationary frames rather than attached to anchors; platforms advise using anchors judiciously due to tracking and compute costs.[1][18]
- Environment quality matters. Feature‑poor, reflective, or poorly lit scenes make anchor creation/resolution harder; platforms recommend scanning from multiple viewpoints and ensuring adequate lighting when hosting or resolving cloud/geospatial anchors.[6][8]
See also
- Augmented reality
- Mixed reality
- Simultaneous localization and mapping
- OpenXR
- Microsoft HoloLens
- Magic Leap
- Meta Quest
References
- ↑ 1.00 1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 Microsoft Learn — Spatial anchors (design guidance)
- ↑ 2.0 2.1 2.2 Khronos OpenXR — XR_MSFT_spatial_anchor
- ↑ 3.0 3.1 Google ARCore Concepts — Coordinates and poses
- ↑ 4.0 4.1 4.2 4.3 4.4 Google ARCore — Use Geospatial anchors (iOS): WGS84, Terrain, Rooftop
- ↑ 5.0 5.1 5.2 5.3 5.4 5.5 Apple Developer — ARGeoAnchor (Location Anchors)
- ↑ 6.0 6.1 6.2 6.3 Google ARCore — Working with Anchors
- ↑ 7.0 7.1 7.2 Apple Developer — ARAnchor
- ↑ 8.0 8.1 8.2 8.3 8.4 8.5 Google Codelab — Cloud Anchors; persistent 1–365 day TTL
- ↑ 9.0 9.1 9.2 9.3 9.4 Meta — Persist Content Across Sessions (OpenXR Spatial Anchors)
- ↑ 10.0 10.1 10.2 Apple Developer — ARWorldMap
- ↑ 11.0 11.1 11.2 Apple Developer — Tracking geographic locations in AR
- ↑ Google ARCore — Cloud Anchors Quickstart (TTL up to 365 days)
- ↑ Google ARCore — What’s new (Persistent Cloud Anchors)
- ↑ 14.0 14.1 14.2 14.3 Khronos OpenXR — XR_FB_spatial_entity
- ↑ 15.0 15.1 15.2 Magic Leap Developer Docs — Spatial Anchor Overview (ML2 OpenXR)
- ↑ Microsoft Lifecycle — Azure Mixed Reality services (Azure Spatial Anchors retired Nov 20, 2024)
- ↑ 17.0 17.1 Khronos OpenXR — xrPersistSpatialAnchorMSFT (persistence)
- ↑ Unity Documentation — AR Foundation ARAnchorManager (anchors & considerations)