Skip to main content
←API Reference ←com.nianticspatial.nsdk.vps2 ←Vps2Session

getPose


Declaration​

fun getPose(location: GeolocationData): Vps2Pose?

Summary​

Convert a geolocation to an AR pose using the latest localization.


location can be any geolocation, not just the device's; the result does not depend on the
current camera pose.

Returns​

The pose in AR tracking space (with its tracking state and accuracy), or null if VPS2 has not localized yet.

Parameters​

NameTypeSummary
locationGeolocationData
The geolocation to use for the pose calculation (WGS84; altitude in meters above the WGS84 ellipsoid).

Overload 1​

fun getPose(location: Location): Vps2Pose?

Summary​

Convert an Android Location to an AR pose using the latest localization.


Location.getAltitude is already height above the WGS84 ellipsoid, as NSDK expects.
location carries no orientation, so the pose is aligned with East-Down-North.

Returns​

The pose in AR tracking space (with its tracking state and accuracy), or null if VPS2 has not localized yet.

Parameters​

NameTypeSummary
locationLocation
-

Overload 2​

fun getPose(localization: Vps2Localization, location: GeolocationData): Pose

Summary​

Convert a geolocation to an AR pose using a localization snapshot.


location can be any geolocation, not just the device's; the result is where that
geolocation lies in AR tracking space, and does not depend on the current camera pose.


In most cases you want the overload that uses the latest localization automatically; use
this one only when a batch of geolocations must share a single snapshot.

Returns​

The pose in AR tracking space (ARCore's coordinate convention), with translation in meters from the tracking space origin.

Throws​

  • NsdkInvalidOperationStatusException — if the current localization tracking state is Vps2TrackingState.UNAVAILABLE.

Parameters​

NameTypeSummary
localizationVps2Localization
-
locationGeolocationData
The geolocation to use for the pose calculation (WGS84; altitude in meters above the WGS84 ellipsoid).

Overload 3​

fun getPose(localization: Vps2Localization, location: Location): Pose

Summary​

Convert an Android Location to an AR pose using a localization snapshot.


Location.getAltitude is already height above the WGS84 ellipsoid, as NSDK expects.
location carries no orientation, so the pose is aligned with East-Down-North.

Returns​

The pose in AR tracking space (ARCore's coordinate convention), with translation in meters from the tracking space origin.

Throws​

  • NsdkInvalidOperationStatusException — if the current localization tracking state is Vps2TrackingState.UNAVAILABLE.

Parameters​

NameTypeSummary
localizationVps2Localization
-
locationLocation
-