Skip to main content
←API Reference ←NianticSpatial.NSDK.AR.XRSubsystems ←XRVps2Subsystem

TryGetPose


Declaration​

public bool TryGetPose(LocationInfo location, out XRVps2Pose poseOut)

Summary​

Convert a Unity LocationInfo to a pose in the device's AR tracking space, using the latest VPS2
localization.

Remarks​

LocationInfo.altitude is passed through unconverted, but NSDK expects altitude above the
WGS84 ellipsoid. On iOS, Unity reports mean sea level altitude, so the resulting pose can be off
vertically by tens of meters; use the overload taking an explicit ellipsoidal altitude instead.

Returns​

False if VPS2 has not localized yet, in which case poseOut is default.

Parameters​

NameTypeSummary
locationLocationInfo
The LocationInfo containing latitude, longitude, and altitude.
poseOutout XRVps2Pose
The AR pose corresponding to the given location.

Overload​

public bool TryGetPose(double latitude, double longitude, double altitude, Quaternion orientationEdn, out XRVps2Pose poseOut)

Summary​

Convert a position and orientation in the global coordinate system to a pose in the device's AR tracking
space, using the latest VPS2 localization.

Remarks​

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

Returns​

False if VPS2 has not localized yet, in which case poseOut is default.

Parameters​

NameTypeSummary
latitudedouble
WGS84 latitude, in degrees.
longitudedouble
WGS84 longitude, in degrees.
altitudedouble
Altitude in meters above the WGS84 ellipsoid (not mean sea level).
orientationEdnQuaternion
Orientation relative to the local East-Down-North frame, passed to
NSDK as is: it is not in Unity axes. Quaternion.identity aligns the pose with that frame.
poseOutout XRVps2Pose
The pose of the given geolocation in AR session space, with position in meters.