Skip to main content
←API Reference

nsdk


Type Aliases​

NameTypeSummary
UUIDUUID
-

Classes​

NameTypeSummary
AsyncResultAsyncResult<out TData, out TError : ErrorCodeProvider>
Represents the final result of a completed asynchronous operation, which can either be
a success, a failure, or a timeout. *
This is the public-facing result type returned by suspend functions. It intentionally
omits an "in-progress" state, guaranteeing that the operation has reached a terminal state.
AwarenessImageParamsAwarenessImageParams
Describes inferred image results.
CameraIntrinsicsCameraIntrinsics
Camera intrinsics. This is a copy of the ARCore CameraIntrinsics class.
CameraIntrinsicsFromARCoreCameraIntrinsicsFromARCore
-
DepthConfigDepthConfig
Configuration parameters for ARDK's Depth System.
## Basic Usage
val config = DepthConfig(
framerate = 120
featureMode = AwarenessFeatureMode.SMOOTH,
)
ARDK.ConfigureDepth(handle, config)
DeviceMappingConfigDeviceMappingConfig
-
FrameDataFrameData
Container for all frame data sent to ARDK for processing.
FrameData encapsulates camera frames, sensor data, and metadata that ARDK
uses for tracking, mapping, VPS localization, and other AR features.
Create one FrameData instance per camera frame and populate it with
available sensor data before calling [NSDKSession.sendFrame].
## Required Data
- [cameraTimestampMs] - Frame timestamp for synchronization
- [frameId] - Unique identifier for this frame
## Optional Data
- [cameraImagePlanes] - Camera image data (YUV420_888 format)
- [cameraImageWidth] - Width of the camera image in pixels
- [cameraImageHeight] - Height of the camera image in pixels
- [cameraImageFormat] - Format of the camera image (YUV_420_888 or 0 if none)
- [cameraPose] - Camera pose in world coordinates
- [cameraIntrinsics] - Camera calibration parameters
- [depthImageData] - Depth buffer (Float32, meters per pixel)
- [depthConfidenceData] - Per-pixel depth confidence (UInt8)
- [depthImageDataWidth] - Width of the depth image in pixels
- [depthImageDataHeight] - Height of the depth image in pixels
- [depthImageIntrinsics] - Depth camera intrinsics (falls back to scaled camera intrinsics if null)
- [location] - GPS location data
- [compass] - Compass/magnetometer data
- [screenOrientation] - Device orientation
- [trackingState] - ARCore tracking state
ImageImage
-
MeshDownloaderConfigMeshDownloaderConfig
Configuration structure for the Mesh Downloader session's on-disk cache.
Downloaded geometry and textures are cached per graph node, so revisiting a location reads from
disk instead of the CDN, and an interrupted download resumes where it stopped rather than
starting over. Cached content never goes stale: a re-run of the mapping pipeline publishes new
node ids, so an id always names the same geometry.
Caching is off by default. A session acquired without it does not read, write, or delete
anything in the cache directory, so enabling caching in one run and not the next leaves
previously cached data intact.
MeshingConfigMeshingConfig
-
NsdkCameraNsdkCamera
Camera view over the current frame (live or playback). Mirrors ARCore [com.google.ar.core.Camera]
so callers can use one API for both live and playback.
Use [pose] and [getDisplayOrientedPose] for overlays, VPS2, etc. Use [imageIntrinsics] for
CPU image coordinates, [trackingState] / [getTrackingFailureReason] for tracking status, and
[getViewMatrix] for rendering. Use [backing] when you need ARCamera- or PlaybackCamera-specific APIs.
NsdkCamera.BackingBacking
-
NsdkCamera.LiveLive
-
NsdkCamera.PlaybackPlayback
-
NsdkFeatureAlreadyInitializedStatusExceptionNsdkFeatureAlreadyInitializedStatusException
Thrown when a feature is already initialized.
Corresponds to [NSDKStatus.FEATURE_ALREADY_INITIALIZED].
NsdkFeatureNotInitializedStatusExceptionNsdkFeatureNotInitializedStatusException
Thrown when a required feature has not been initialized.
Corresponds to [NSDKStatus.FEATURE_NOT_INITIALIZED].
NsdkFrameNsdkFrame
Abstraction over the current frame so callers can use one API for both live AR (ARCore [Frame])
and playback ([PlaybackFrame]). Use [camera] for pose, intrinsics, and tracking.
Use [backing] when you need Frame- or PlaybackFrame-specific APIs (e.g. acquireCameraImage).
NsdkFrame.BackingBacking
-
NsdkInvalidArgumentStatusExceptionNsdkInvalidArgumentStatusException
Thrown when a native argument has an invalid value.
Corresponds to [NSDKStatus.INVALID_ARGUMENT].
NsdkInvalidHandleStatusExceptionNsdkInvalidHandleStatusException
Thrown when a native handle is invalid or has been destroyed.
Corresponds to [NSDKStatus.INVALID_NSDK_HANDLE].
NsdkInvalidOperationStatusExceptionNsdkInvalidOperationStatusException
Thrown when a native operation is not valid in the current state.
Corresponds to [NSDKStatus.INVALID_OPERATION].
NsdkNullArgumentStatusExceptionNsdkNullArgumentStatusException
Thrown when a required native argument is null.
Corresponds to [NSDKStatus.NULL_ARGUMENT].
NSDKResultNSDKResult<out TData, out TError : ErrorCodeProvider>
ResultDeprecated wrapper for NSDK operations that can succeed or fail.
NSDKResult is a Kotlin sealed class designed to provide a type-safe abstraction
over the return values of low-level C APIs. Instead of directly handling raw
integer status codes from the C layer, Kotlin callers receive structured results
as either Success or Error.
NSDKSessionNSDKSession
Creates a new NSDK instance with auth tokens or a configuration file.
This is the primary entry point for initializing NSDK functionality.
You must call this before using any other NSDK features.
Only one [NSDKSession] may be active at a time. Creating a second instance while one is
active will throw [IllegalStateException]. Call [close] on the existing session before
creating a new one.
The session and its feature sessions may be used from any thread. [close] waits for NSDK calls
already running on other threads to return; after it, those calls fail or return empty
results instead of touching the destroyed native instance.
NsdkStatusExceptionNsdkStatusException
Base class for all NSDK-specific exceptions originating from the native layer.
NsdkUnknownStatusExceptionNsdkUnknownStatusException
Thrown when an internal, unrecoverable error occurs in the native layer.
that is unexpected
ScannerConfigScannerConfig
Configuration parameters for scanning functionality.
ScannerConfig allows you to customize scan recording behavior including recording
framerate, visualization settings, depth range, and output resolution.
Use this class to optimize scanning performance for your specific use case.
## Basic Usage
val config = ScannerConfig(
framerate = 30,
enableRaycastVisualization = true,
enableVoxelVisualization = true
)
scanningSession.configure(config)
abstract SessionBaseSessionBase<T : SessionBase<T>>
Base class of NSDK's feature sessions: a reference-counted handle on one native feature.
Threading: call [acquire] and [close] on the main thread. Each feature's native creation
method is annotated @MainThread, but the annotation is on a private member, so lint does not
check callers of [acquire]; NSDK is only tested with acquisition on the main thread. A
feature's other methods can be called from any thread, and its Flows deliver values in the
collector's own context.
UUIDKeyUUIDKey
-
Vps2ConfigVps2Config
Configuration structure for the VPS2 session.

Interfaces​

NameTypeSummary
ErrorCodeProviderErrorCodeProvider
-
ErrorFactoryErrorFactory<E : ErrorCodeProvider>
-
NsdkLogCallbackNsdkLogCallback
Functional interface for receiving log messages from NSDK.
This callback is invoked by the native NSDK library to send log messages
to the Kotlin/Java layer. The callback receives the log level, message,
and optional source location information.
Threading: [onLog] runs on whichever thread logged: NSDK's own native worker threads, and
the thread calling into NSDK. It can run on several threads at once, so it must be thread-safe
and should return quickly. Post to the main thread before touching UI. It is never called
once [NSDKSession.close] has begun, and [NSDKSession.close] waits for calls already running.
Do not call NSDK from [onLog]: [NSDKSession.close] in particular would deadlock.
An exception thrown from [onLog] cannot reach the native thread that logged. It is printed to
logcat and otherwise discarded.
NsdkSessionDataSourceNsdkSessionDataSource
Provides synchronous, pull-based access to the latest available sensor data
required by [NSDKSession].
All methods must be non-blocking and thread-safe. Returned values represent
the most recent samples already captured by the underlying services.
Implement this interface and assign it to [NSDKSession.dataSource], then call
[NSDKSession.update] once per camera frame to submit data to the native layer.

Data Classes​

NameTypeSummary
AnchorUpdateAnchorUpdate
Contains the latest tracking information for a VPS anchor.
AnchorUpdate provides comprehensive information about an anchor's current state,
including its pose, tracking quality, and status information. This data is updated
as VPS refines its localization.
### Overview
Anchor updates are retrieved via getAnchorUpdate(uuid) and provide the
most current information about an anchor's position, orientation, and tracking status.
The data includes confidence metrics and timestamps for quality assessment.
### Example
val update = vpsSession.getAnchorUpdate(anchorId)
println("Anchor ID: ${update.uuid}")
println("Pose: ${update.anchorToLocalTrackingTransform}")
println("Tracking State: ${update.trackingState}")
println("Confidence: ${update.trackingConfidence}")
if (update.trackingState == AnchorTrackingState.TRACKED && update.trackingConfidence > 0.8f) {
// Use anchor pose for AR content placement
placeARContent(update.anchorToLocalTrackingTransform)
}
AreaTargetAreaTarget
-
AsyncResult.ErrorError<out TData, out TError : ErrorCodeProvider>
Represents a failed operation, containing an error [code].
AsyncResult.SuccessSuccess<out TData, out TError : ErrorCodeProvider>
Represents a successful operation, containing the resulting [value].
AuthInfoAuthInfo
Authentication information containing token claims.
Contains parsed JWT claims including token string, expiration, user information, and other standard JWT fields.
AwarenessContextAwarenessContext
-
CameraSampleCameraSample
A snapshot of camera sensor data for a single frame.
CompassCompass
-
CoverageAreaCoverageArea
-
DepthBufferDepthBuffer
Depth result from ARDK's Depth System after computing disparity.
DepthSampleDepthSample
A snapshot of platform depth data (e.g. LiDAR or ToF sensor) for a single frame.
GeolocationDataGeolocationData
A geographic position and orientation, using the WGS84 datum. Depending on the API, this
describes the device, a VPS asset's origin, an anchor, or an arbitrary location passed in.
Image.ByteImageByteImage
-
Image.FloatImageFloatImage
-
Image.IntImageIntImage
-
Image.ShortImageShortImage
-
LatLngLatLng
Geographic coordinates representing latitude and longitude.
LatLng is used throughout ARDK for specifying geographic locations,
particularly for VPS coverage queries and area-based operations.
LocalizationTargetLocalizationTarget
A real-world point of interest that is a target for VPS localization.
MapMetadataMapMetadata
-
MeshDataMeshData
Triangle mesh geometry.
For downloaded mesh chunks, [vertices] are packed x, y, z positions in meters in the chunk's
local space, and carry no geographic data. They are in NSDK's native OpenCV convention (x right,
y down, z forward), not ARCore's: negate y and z to convert them before applying
[MeshDownloaderData.transform].
MeshDownloaderChunkMeshDownloaderChunk
-
MeshDownloaderDataMeshDownloaderData
One downloaded mesh chunk.
MeshGeoReferenceMeshGeoReference
Georeference of a mesh download's asset: the geodetic origin its chunk transforms are expressed
relative to, plus the transform into that origin's frame.
Identical on every [MeshDownloaderChunk] / [MeshDownloaderData] of one download, because it
describes the space rather than any single node. A chunk's own geographic position is obtained
by composing this with that chunk's transform — not from anything inside [MeshData], which
carries no geographic data at all.
Both the origin and the transform are required: depending on the asset, the altitude offset may
live entirely in [referenceAltitude] (with [trackingToReference] carrying no vertical
translation) or entirely in [trackingToReference] (with [referenceAltitude] zero). Applying the origin without
the transform is wrong in the general case.
MeshingUpdateInfoMeshingUpdateInfo
-
NsdkCamera.Backing.LiveLive
-
NsdkCamera.Backing.PlaybackPlayback
-
NsdkConfiguration.CloudEnvConfigCloudEnvConfig
Cloud service endpoints used by various NSDK features.
NsdkConfiguration.ConfigurationConfiguration
Top-level NSDK configuration container.
NsdkConfiguration.UserConfigUserConfig
User configuration including auth-related inputs.
NsdkFrame.Backing.LiveLive
-
NsdkFrame.Backing.PlaybackPlayback
-
NsdkFrame.LiveLive
-
NsdkFrame.PlaybackPlayback
-
NSDKResult.ErrorError<out TData, out TError: ErrorCodeProvider>
Represents a failed outcome, where the requested data was not available.
NSDKResult.SuccessSuccess<out TData, out TError: ErrorCodeProvider>
Represents a successful outcome, where the requested data was available.
PathConfigPathConfig
Optional path overrides mirroring native ARDK_PathConfig.
Null or empty values mean: let native auto-detect paths.
RecordingInfoRecordingInfo
-
ScanSaveInfoScanSaveInfo
Information about a saved scan.
This class contains details about a scan that has saved (or attempted to be saved),
including its unique identifier, file system path, and ultimate state.

Enums​

NameTypeSummary
AnchorTrackingStateAnchorTrackingState
Represents the current tracking state of a VPS anchor.
The tracking state indicates how well the system is able to track an anchor's position
and orientation in the current environment. This information is crucial for determining
the reliability of anchor pose data.
### Overview
Tracking states progress from not tracked to fully tracked, with limited tracking
representing an intermediate state where tracking is possible but may be less reliable.
Note: [TRACKED] can persist while a device is disturbed, such as a covered camera or a dark
room, and persists indefinitely while the device stays still. It changes once confidence
drops low enough. Use [AnchorUpdate.trackingConfidence] and [AnchorUpdate.trackingStateReason]
to react more sensitively to device disturbances.
### Example
val update = vpsSession.getAnchorUpdate(anchorId)
when (update.trackingState) {
AnchorTrackingState.NOT_TRACKED ->
println("Anchor is not currently being tracked")
AnchorTrackingState.LIMITED ->
println("Anchor tracking is limited - pose may be unreliable")
AnchorTrackingState.TRACKED ->
println("Anchor is fully tracked - pose is reliable")
}
AnchorTrackingStateReasonAnchorTrackingStateReason
Provides additional context about why an anchor is in a particular tracking state.
When an anchor is not tracked or has limited tracking, this enum provides specific
reasons that can help developers understand and respond to tracking issues.
### Overview
Tracking state reasons help diagnose why tracking may be failing or limited,
enabling applications to provide appropriate user feedback or take corrective actions.
### Example
val update = vpsSession.getAnchorUpdate(anchorId)
when (update.trackingStateReason) {
AnchorTrackingStateReason.INITIALIZING ->
println("Anchor is still initializing - tracking will improve")
AnchorTrackingStateReason.PERMISSION_DENIED ->
println("Tracking failed due to permission issues")
AnchorTrackingStateReason.FATAL_NETWORK_ERROR ->
println("Network error preventing tracking")
else ->
println("Other tracking issue: ${update.trackingStateReason}")
}
AwarenessFeatureModeAwarenessFeatureMode
-
AwarenessStatusAwarenessStatus
-
ClockBaseClockBase
Reference clock that a timestamp is measured against. Mirrors the native ARDK_ClockBase
enum; [value] must stay in sync with it.
FeatureStatusFeatureStatus
Status of an NSDK feature.
More than one status can apply at once, so [value] is a distinct flag rather than a sequential
index. Values must not be renumbered or reordered.
ImageTypeImageType
-
InputDataFlagsInputDataFlags
-
LocalizabilityLocalizability
-
MeshDownloaderChunkStatusMeshDownloaderChunkStatus
-
MeshDownloaderErrorMeshDownloaderError
-
MeshGeoReferenceModeMeshGeoReferenceMode
Whether a mesh download carries a usable georeference.
NSDKStatusNSDKStatus
Status codes returned by NSDK operations.
NSDKStatus represents the outcome of NSDK API calls, indicating
success or various types of failures. These codes help diagnose
issues with NSDK integration and usage.
OrientationOrientation
Device orientation when capturing camera frames.
Orientation affects how ARDK interprets camera data and poses.
Ensure the correct orientation is set in [FrameData.screenOrientation]
for accurate tracking and localization.
ScanSaveErrorScanSaveError
Error codes that can be returned when a scan fails to save.
ScanSaveStateScanSaveState
Enumeration of possible scan recording save states.
This enum represents the current state of a scan recording operation,
indicating whether the scan data has been successfully saved, discarded, or failed.
VpsCoverageErrorVpsCoverageError
-
VpsGraphOperationErrorVpsGraphOperationError
Error codes for VPS graph operations.
These errors can occur during VPS operations that query the internal graph structure,
such as converting device poses to geolocations. Each error provides specific information
about why the operation failed.

Functions​

NameTypeSummary
toKeyUUIDKey
-