resolve

fun resolve(engine: Engine, session: Session, latitude: Double, longitude: Double, altitudeAboveRooftop: Double, eusQuaternion: Quaternion, onCompleted: (state: Anchor.RooftopAnchorState, node: RooftopAnchorNode?) -> Unit): ResolveAnchorOnRooftopFuture?

Creates an anchor at a specified horizontal position and altitude relative to the horizontal position's rooftop. See the Rooftop anchors developer guide for more information.

The specified altitudeAboveRooftop is interpreted to be relative to the top of a building at the given horizontal location, rather than relative to the WGS84 ellipsoid. If there is no building at the given location, then the altitude is interpreted to be relative to the terrain instead. Specifying an altitude of 0 will position the anchor directly on the rooftop whereas specifying a positive altitude will position the anchor above the rooftop, against the direction of gravity.

This launches an asynchronous operation used to query the Google Cloud ARCore API. See Future for information on obtaining results and cancelling the operation.

You may resolve multiple anchors at a time, but a session cannot be tracking more than 100 Terrain and Rooftop anchors at time. Attempting to resolve more than 100 Terrain or Rooftop anchors will throw ResourceExhaustedException.

Creating a Rooftop anchor requires an active Earth which is Earth.EarthState.ENABLED. If it is not, then this function throws java.lang.IllegalStateException. This call also requires a working internet connection to communicate with the ARCore API on Google Cloud. ARCore will continue to retry if it is unable to establish a connection to the ARCore service.

A Rooftop anchor's tracking state will be TrackingState.PAUSED while Earth's Earth.getTrackingState is TrackingState.PAUSED. Its tracking state will permanently become TrackingState.STOPPED if Session.configure is used to set Config.GeospatialMode.DISABLED.

Latitude and longitude are defined by the WGS84 specification

The rotation quaternion provided is with respect to an east-up-south coordinate frame. An identity rotation will have the anchor oriented such that X+ points to the east, Y+ points up away from the center of the earth, and Z+ points to the south.

Return

A handler that can be polled or cancelled.

Parameters

latitude

The latitude of the anchor relative to the WGS84 ellipsoid.

longitude

The longitude of the anchor relative to the WGS84 ellipsoid.

altitudeAboveRooftop

The altitude of the anchor above the Earth's rooftop.

eusQuaternion

The EUS (east-up-south) rotation quaternion.

onCompleted

An optional callback, called when the operation is finished, unless the future is cancelled. May be null.

Throws

if Earth is TrackingState.STOPPED due to Config.GeospatialMode.DISABLED configured on the Session. Reacquire Earth if the Geospatial mode was re-enabled.

if latitude is outside the allowable range.

NotTrackingException

when localisation is not yet available.

ResourceExhaustedException

if too many Terrain and Rooftop anchors have already been held.