Skip to main content
←API Reference ←NianticSpatial.NSDK.AR.VPS2 ←ARVps2Manager

TryGetPose


Declaration​

public bool TryGetPose(LocationInfo location, out XRVps2Pose poseOut)

Summary​

Attempts to convert a Unity LocationInfo to a pose in AR session 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 the subsystem is unavailable or VPS2 has not localized yet.

Parameters​

NameTypeSummary
locationLocationInfo
The LocationInfo containing latitude, longitude, and altitude.
poseOutout XRVps2Pose
Receives the AR pose on success.

Overload 1​

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

Summary​

Attempts to convert a position and orientation in the global coordinate system to a
pose in AR session 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 the subsystem is unavailable or VPS2 has not localized yet.

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
Receives the pose of the given geolocation in AR session space, with
position in meters.

Overload 2​

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

Summary​

Attempts to convert a position and orientation in the global coordinate system to a
pose in AR session space, using the supplied localization snapshot.

Remarks​

The pose is in AR session space, not Unity world space. To place a world-space
transform at it, compose it with the XR origin first via
origin.TrackablesParent.TransformPose. 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. Throws if
localization is unavailable. The geolocation can be any location,
not just the device's; the result does not depend on the current camera pose.

Returns​

true if the subsystem exists; otherwise false.

Parameters​

NameTypeSummary
localizationXRVps2Localization
The localization snapshot to use for conversion.
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
Receives the pose of the given geolocation in AR session space, with
position in meters.