I’m trying to build a persistent world map of my college campus using ARKit, but it’s not very reliable. Anchors don’t consistently appear in the same place across sessions.
I’ve tried using image anchors, but they didn’t improve accuracy much.
How can I create a stable world map for a larger area and reliably relocalize anchors? Are there better approaches or recommended resources for this?
Hi @cosmicsid
A single image anchor gives you one precise reference point, but ARKit's world tracking accuracy degrades with distance from known references. Over the distances involved in a campus, the device's pose estimate relative to that one anchor can drift, which is likely what you're seeing.
ARKit offers several anchor types that produce a pose from a recognized real-world target. Distributing them throughout the space gives the session repeated opportunities to re-anchor as the user moves:
- ARObjectAnchor — useful for permanent landmarks like statues or kiosks. See Scanning and Detecting 3D Objects.
- ARImageAnchor — what you're already using, for known 2D images.
- ARGeoAnchor — anchors defined by latitude, longitude, and altitude, giving a shared coordinate system across sessions and devices. See ARGeoTrackingConfiguration and Tracking geographic locations in AR.
- ARAppClipCodeAnchor — not ideal for anchoring virtual content, but useful to identify a location and launch an experience. See Interacting with App Clip Codes in AR. See Interacting with App Clip Codes in AR.
Consider a hybrid experience: ARGeoAnchor outdoors where geotracking is supported, and ARImageAnchor / ARObjectAnchor (optionally identified via App Clip Codes) as fallbacks and for indoor spaces.