LocalizationConfig
Every LocalizationConfig property on Android: auto and background localization, multi frame capture, confidence, GPS hints and image quality.
Localization Configuration
The LocalizationConfig is a singleton object that provides centralized configuration for the MultiSet SDK localization behavior. It controls how the AR activities perform localization, including timing, quality, and feature settings.
Description
This configuration object allows you to customize the localization behavior before a query request is made. Settings include auto-localization triggers, background localization intervals, frame capture parameters, confidence thresholds, GPS integration, localization hints (to narrow the search for Map and MapSet localization), and UI feedback options. All settings can be modified at runtime and validated using the validate() method.
The AR activities read these values when localization starts, so any change you make to LocalizationConfig takes effect on the next query. When you integrate without the sample app, the same settings exist on MultiSetSDKConfig (the defaults for every session) and on LocalizationSession (per session); see FrameSource and Sessions. The sample app also exposes an in-app Settings dialog that edits these same properties at runtime and persists them across launches.
Properties
This section details the publicly accessible fields of the LocalizationConfig that can be configured via script.
Localization Behavior
autoLocalize
Boolean
true
Whether to automatically start localization when the AR session begins. If false, the user must manually tap the capture/localize button.
backgroundLocalization
Boolean
true
Whether to continue localization in the background after the first success. Helps maintain accurate positioning over time.
backgroundLocalizationIntervalSeconds
Float
30f
The time interval in seconds between background localization attempts. Only used when backgroundLocalization is true. Valid range: 10 - 180 seconds.
relocalization
Boolean
true
Re-localize after an AR tracking break that follows a fix, a return from the background included. The session re-localizes once tracking has held for 1 s, reports none of its misses, and says through needsRealignment when to hide the map. See Tracking breaks.
firstLocalizationUntilSuccess
Boolean
true
Retry a failed first localization silently, up to 5 times, before reporting it once. Works with background localization on or off. A rejected request (HTTP 4xx) is reported at once. See First localization until success.
Multi-Frame Capture Settings
numberOfFrames
Int
4
The number of frames to capture for multi-frame localization. More frames = better accuracy but longer capture time. Valid range: 4 - 6 frames.
frameCaptureIntervalMs
Long
500L
The interval between frame captures in milliseconds. Allows user movement between frames for better coverage. Valid range: 100 - 1000 ms.
Confidence Settings
confidenceCheck
Boolean
true
Whether to check confidence threshold before accepting localization. If true, localizations with confidence below the threshold will be rejected.
confidenceThreshold
Float
0.3f
Minimum confidence score to accept a localization result. Only used when confidenceCheck is true. Valid range: 0.2 - 0.8 (matches the Unity SDK).
False-Positive Rejection
A localization response can be confidently wrong when the query image matches a visually similar spot elsewhere in the map. The pose consistency check compares each new result against the device's own AR trajectory and discards any result that could not physically be reached. Discarded results are reported through onLocalizationFalsePositive and leave the scene untouched.
poseConsistencyCheck
Boolean
false
Whether to discard localization results that contradict the device's tracked trajectory. Off by default since 2.1.0.
poseConsistencyThreshold
Float
4f
Distance limit in metres. A result further than this from the anchor must be backed by enough separate viewpoints to move it. Valid range: 1.5 - 15 metres.
poseConsistencyYawThreshold
Float
25f
Heading limit in degrees, applied independently of the distance limit. Valid range: 10 - 60 degrees.
Note: The anchor is set by the first accepted result. Report AR tracking breaks to the session (
notifyTrackingInterrupted(),notifyWorldOriginReset()) so the check stops trusting an anchor the tracker no longer backs. A bad first fix cannot be out-voted: offerMultiSetSDK.resetLocalizationSession()to start over. See FalsePositiveInfo.
Query Mode
queryMode
QueryMode
QueryMode.VPS1
Search strategy. VPS1 is the standard search. VPS2 is a deeper, slower and more thorough search.
Note: Query mode is sent with single-frame and multi-frame queries, for a map or a MapSet. The sample app's Settings dialog offers it in either mode. See Query Mode.
GPS Settings
enableGeoHint
Boolean
false
Whether to send GPS coordinates as a hint to improve localization. Requires location permission and a geo-referenced map. The sample app asks for the permission when this is on and sends a fix at most 2 minutes old.
includeGeoCoordinatesInResponse
Boolean
false
Whether to ask for the fix in geographic terms. Fills LocalizationResult.geoCoordinates and geoPose.
Note: Outside the sample app, supply the fix yourself through
MultiSetSDK.geoHintProvider. See GPS hint.
Localization Hints
Localization hints let you constrain the search space before sending a query, which speeds up matching and reduces false positives in large maps or mapSets. All hints are optional. Leave them empty or at their default to disable them.
hintMapCodes
List<String>
emptyList()
Subset of map codes within a mapSet to restrict localization to. Sent as repeated hintMapCodes fields. Only applies to mapSet localization; ignored for single map localization.
hintPosition
String
""
Approximate position hint in "x,y,z" format to narrow the search around a known location. Leave empty to disable.
hintFloorHeight
String
""
Floor/ceiling height constraint in "floor,ceiling" format, e.g. "0,5". Leave empty to disable.
hintRadius
Int
25
Search radius in meters for spatial filtering. Applied only when a geo hint (enableGeoHint) or hintPosition is present. Valid range: 1 - 100.
use2DFiltering
Boolean
false
When spatial filtering is active, skip altitude (Y-axis) and filter on horizontal distance (X/Z) only.
Note:
hintRadiusanduse2DFilteringare spatial filters that are only meaningful relative to a geo hint or a position hint. They are sent only whenenableGeoHint(with a valid GPS fix) orhintPositionis set. Otherwise the server would filter out every candidate and report "Pose not found".
UI Settings
showAlerts
Boolean
true
Whether to show UI alerts (toasts) for localization status. Shows success/failure messages to the user.
enableMeshVisualization
Boolean
true
Whether to show 3D mesh overlay after successful localization. The mesh helps visualize the mapped environment.
Image Quality Settings
imageQuality
Int
90
JPEG quality for captured images sent to the localization API. Higher quality = better accuracy but larger upload size. Valid range: 50 - 100.
Methods
This section describes the publicly accessible methods of the LocalizationConfig.
resetToDefaults()
Resets all settings to their default values.
Declaration
Description
Calling this method will reset all configuration properties to their factory default values. This is useful when you want to ensure a clean configuration state before customizing specific settings.
Example
validate()
Applies validated bounds to all settings.
Declaration
Description
Calling this method will clamp all numeric settings to their valid ranges. This ensures that all configuration values are within acceptable bounds before they are used by the AR activities. It is recommended to call this method after modifying any settings.
Validation Rules:
backgroundLocalizationIntervalSeconds
10 - 180
numberOfFrames
4 - 6
frameCaptureIntervalMs
100 - 1000
confidenceThreshold
0.2 - 0.8
hintRadius
1 - 100
imageQuality
50 - 100
poseConsistencyThreshold
1.5 - 15
poseConsistencyYawThreshold
10 - 60
Example
Usage Examples
Basic Configuration
MapSet Localization with Hints
When localizing against a mapSet, you can narrow the search to a subset of maps and a known area before the query is sent:
Configuration Flow
Runtime Settings Dialog
The sample app lets you change the localization configuration at runtime, before starting a query, with no rebuild required. Tap the settings gear on the landing screen (MainActivity) to open a full-screen SettingsDialogFragment that edits every LocalizationConfig (and ObjectTrackingConfig) property described above, including the localization hints.
Changes are written straight back to the
LocalizationConfigsingleton, so the next localization query uses the updated values.Settings are persisted with
ConfigStore(backed bySharedPreferences) and restored on the next app launch viaConfigStore.load(this)inMainActivity.onCreate().Credentials and map / mapSet / object codes are not persisted. They always come from
multiset.properties(BuildConfig).Save applies and stores the values; Reset restores defaults via
resetToDefaults().
You can achieve the same result programmatically by setting
LocalizationConfigproperties directly and callingvalidate()before launchingMultiSetLocalizationActivity. The Settings dialog is simply a UI over those same properties.
Best Practices
Always call
validate()after modifying settings to ensure values are within valid ranges.Call
resetToDefaults()before configuring if you want to start from a known state.Increase
numberOfFramesfor environments with sparse or repetitive features.Enable
backgroundLocalizationfor applications that need to maintain accurate positioning over time.Use higher
imageQualityfor complex environments but be mindful of network bandwidth.Use
hintMapCodesto restrict large mapSets to the maps the user is likely in. This speeds up matching and avoids cross-map false positives.Turn on
poseConsistencyCheckin spaces with repeated structure, where a confidently wrong pose could place your content in the wrong part of the map. RaiseposeConsistencyThresholdonly if your space genuinely allows large jumps between fixes.Use
QueryMode.VPS2in visually repetitive spaces, accepting the extra latency. It applies to single-frame and multi-frame localization.Pair
hintRadius/use2DFilteringwith a hint (eitherenableGeoHintwith a GPS fix orhintPosition). On their own they have no reference point and the server will reject every candidate.
Related
Last updated
Was this helpful?

