NSDKDeviceMappingSession
A session for creating VPS maps from AR data on the local device, with Combine publisher support....
Declaration
final class NSDKDeviceMappingSessionSummary
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
| Name | Type | Summary |
|---|---|---|
| @Published var latestMapUpdate | NSDKBuffer |
Methods
| Name | Type | Summary |
|---|---|---|
| configure | void | 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. |
| featureStatus | NSDKFeatureStatus | 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. |
| start | void | 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. |
| startMapping | void | 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 $latestMapUpdateto 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(). |
| stop | void | Stop all mapping processes. - Note: If mapping is in progress, this will stop mapping. |
| stopMapping | void | Stop the current mapping sequence. This stops adding new frames to the current on-device VPS Map. |
Nested Types
Structs
| Name | Type | Summary |
|---|---|---|
| Configuration | Configuration | 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
NSDKSessionwhile active.niluntil 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.