Skip to main content
API Reference NSDK

NSDKDeviceMappingSession

A session for creating VPS maps from AR data on the local device, with Combine publisher support....

Declaration

final class NSDKDeviceMappingSession

Summary

A session for creating VPS maps from AR data on the local device, with Combine publisher support. The device mapping feature provides capabilities for locally building persistent maps that can be used for Visual Positioning System (VPS) localization. These maps capture the visual features and spatial structure of an environment. $latestMapUpdate is refreshed automatically each frame by NSDKSession.update() while the session is active. Subscribe to it with Combine:

mappingSession.$latestMapUpdate
.compactMap { $0 }
.sink { mapUpdate in ... }
.store(in: &cancellables)

Properties

NameTypeSummary
@Published var latestMapUpdateNSDKBuffer
The latest incremental map update from the mapping session. Updated each frame by NSDKSession while active.
nil until the first map update becomes available after mapping starts.
Each non-nil value represents new nodes and edges added to the map since the last update.

Methods

NameTypeSummary
configurevoid
Configures the session with the specified settings.
- Attention: This method must be called while the session is stopped,
or else configuration will fail. In that case, while this function returns without
throwing, configuration will still fail asynchronously. Use featureStatus()
to check that configuration has not failed.
- Parameter config: An object that defines this session's behavior.
Only settings that differ from the defaults will be applied.
- Throws: NSDKError.invalidArgument if the configuration is invalid.
Check NSDK's C logs for more information.
featureStatusNSDKFeatureStatus
Reports the current status of the mapping session.
Check this periodically to see if any errors have occurred with processes running
inside this feature. Once an error has been flagged, it will remain flagged until the
culprit process has been run again and completed successfully.
- Returns: A flag indicating the current status of the mapping session.
startvoid
Starts the mapping session and initializes required processes.
Downloads the mapping algorithm model and prepares the session for mapping operations.
Does not begin map building; call startMapping() to start building a map.
startMappingvoid
Begin a mapping sequence.
This begins building an on-device map that can be used for VPS. Map data is accumulated
in the session's NSDKMapStorage while mapping is running. Subscribe to $latestMapUpdate
to retrieve incremental map updates reactively, or call NSDKMapStorage.mapData()
after mapping completes to get the full map.
- Attention: This method must be called after start() and before stop().
stopvoid
Stop all mapping processes.
- Note: If mapping is in progress, this will stop mapping.
stopMappingvoid
Stop the current mapping sequence.
This stops adding new frames to the current on-device VPS Map.

Nested Types

Structs

NameTypeSummary
ConfigurationConfiguration
Configuration settings for the mapping process.
This structure defines various parameters that control how the mapping algorithm
behaves during map creation, including feature detection, tracking edges, and
node splitting criteria.

Relationships

conforms to: NSDKFeatureSession