Implementing AR Navigation in Mobile Application
AR navigation — arrow direction drawn over real world through camera. Sounds simple, but three technically different scenarios with different complexity: outdoor navigation, indoor building, and floor navigation in mall or airport. Each solved by separate stack.
Outdoor AR Navigation: GPS + Compass + ARKit/ARCore
Basic approach — anchoring AR objects to GPS coordinates. Use CLLocationManager + CLHeading for compass, ARKit/ARCore for orientation stabilization. GPS accuracy in city — 3-8 meters, enough for "go straight 200 meters", but not for "turn here" with sidewalk precision.
ARKit Geo Tracking (iPhone XS+, iOS 14+, supported cities) — different level. ARGeoTrackingConfiguration uses GPS, compass, and street-level imagery from Apple Maps for localization with 1-3 meter accuracy. ARGeoAnchor pinned to WGS84 coordinates, ARKit maintains anchor in world space as user moves.
let anchor = ARGeoAnchor(
coordinate: CLLocationCoordinate2D(latitude: 53.9045, longitude: 27.5615),
altitude: nil
)
arView.session.add(anchor: anchor)
ARGeoTrackingStatus.stateReason shows why geo tracking not working (.notYetInitialized, .geoDataNotLoaded, .visualLocalizationFailed). Last happens with poor lighting or on obscure streets — need fallback to GPS+compass.
Indoor Navigation: More Complex
GPS inside buildings doesn't work. Options:
Beacon/BLE (iBeacon, Eddystone). Trilateration by RSSI. Accuracy — 2-5 meters best case, 5-10 real (metal shelves, Wi-Fi interference). CLLocationManager.startRangingBeacons(satisfying:) on iOS, BluetoothLeScanner on Android.
ARKit/ARCore + floor map. User scans QR code at entrance → gets start position → ARKit does relative tracking from there. Position error accumulates — every 50 meters, position error grows 0.5-2%. Need control points (QR codes at turns) for recalibration.
Visual Positioning System (VPS). Google Visual Positioning Service (ARCore 1.24+) works in supported locations (Mall of America, partner airports). StreetscapeGeometryMode + special endpoint for indoor maps. For Russia/CIS coverage minimal — need custom VPS with Immersal SDK or Sturfee.
Immersal SDK — most practical option for custom indoor VPS. Cloud localization: photograph space in Immersal Mapper, SDK localizes user by visual match with 10-30 cm accuracy. Works on iOS (ARKit) and Android (ARCore). License from $199/mo.
Drawing Route in AR
Path in AR — chain of 3D points connected by arrows or "breadcrumbs" at floor level. For smooth route following, need parametric curve (Catmull-Rom spline) through waypoints — else arrows too angular at turns.
Render direction arrow as ModelEntity with USDZ model (GLB for ARCore), billboard rotation to camera on Y axis. At turns — pulsing animation via FromToByAnimation in RealityKit.
Important: arrows should "stick" to detected floor plane, not hang in air. For this — raycast down from each waypoint to detected planes.
Typical Production Pain
Compass on Android — SensorManager.SENSOR_DELAY_GAME with low-pass filter. Without filtering, compass jitters and arrow "jumps" 15-20° per second. Poorly calibrated magnetometer (near metal) gives 30° deviation. Add UI compass calibration request on SensorAccuracy.LOW.
Timeline
Outdoor AR navigation on GPS+compass — 2-3 weeks. With ARKit Geo Tracking — plus 1 week. Indoor solution on Immersal VPS — from 4 weeks (including photography and mapping). Cost calculated individually.







