# Location Drift Mitigation Source: https://www.nianticspatial.com/docs/nsdk/how-to/vps/location_manager/?platform=kotlin The `VPSConfig` class allows you to customize VPS (Visual Positioning System) behavior including localization frequency, quality settings, and advanced features like temporal fusion. Use this class to optimize VPS performance for your specific use case. ## Parameter Dependencies Some parameters have dependencies on others: 1. **`cloudContinuousRequestsPerSecond`, `enableTemporalFusion` and `enableInterpolation`** require `enableContinuousLocalization` 2. **`enableDeviceMapLocalization`** requires a local map to be created via the mapping feature ## Configuration Parameters - `enableContinuousLocalization` Enables continuous localization to mitigate AR tracking drift. When enabled, VPS will periodically send localization requests even after the first successful localization. This helps correct accumulated tracking drift but increases bandwidth usage. - `cloudInitialRequestsPerSecond` Number of localization requests per second before first successful localization. Controls how frequently VPS attempts initial localization. Higher values provide faster initial localization but use more bandwidth. - `cloudContinuousRequestsPerSecond` Number of localization requests per second after successful localization. Controls continuous localization frequency when `enableContinuousLocalization` is enabled. Lower values reduce bandwidth while still providing drift correction. - `enableTemporalFusion` Enables temporal fusion for more stable localization results. Temporal fusion combines multiple localization results over time to provide smoother, more stable positioning. This reduces jitter but requires continuous localization to be enabled. - `enableInterpolation` Enables smooth interpolation of anchor position updates. When enabled, anchor transforms are interpolated rather than snapped to new positions, providing smoother visual transitions when positions are refined. - `jpegCompressionQuality` JPEG compression quality for images sent to VPS server. Controls the quality-bandwidth tradeoff for localization images. Higher values improve localization success rate but increase bandwidth usage. - `enableDeviceMapLocalization` Enables localization against device-created maps. When enabled, VPS will attempt to localize against maps created locally by the mapping feature in addition to Niantic Spatial's cloud maps. This enables localization in areas without cloud VPS coverage. ***Note:** A local map must be created using `DeviceMappingSession.createMapping` and The device must have access to the local map data* - `enableVPSDebugger` Enable VPS Debugger. When enabled, more detailed internal VPS related events are logged into a file as well as accessible through the getter API. - `enableGpsCorrectionForContinuousLocalization` Enable GPS correction for continuous localization. When enabled, allows the cloud localizer to use available VPS information to refine future VPS localizations. This improves localization rates on large maps (>20 nodes). ## Complete Configuration Example Here's an example with configuration options set for High-Performance: ```kotlin val highPerfConfig = VPSConfig( enableContinuousLocalization = true, cloudInitialRequestsPerSecond = 2.0f, cloudContinuousRequestsPerSecond = 0.5f, enableTemporalFusion = true, enableInterpolation = true, jpegCompressionQuality = 90, enableGpsCorrectionForContinuousLocalization = true ) ```