resolve
Asynchronously creates a new Anchor at a specified horizontal position and altitude relative to the horizontal position's terrain. See the Terrain anchors developer guide for more information.
The specified altitudeAboveTerrain
is interpreted to be relative to the Earth's terrain (or floor) at the specified latitude/longitude geospatial coordinates, rather than relative to the WGS84 ellipsoid. Specifying an altitude of 0 will position the anchor directly on the terrain (or floor) whereas specifying a positive altitude will position the anchor above the terrain (or floor), 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 Terrain anchor requires an active Earth which is 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 Terrain 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
The latitude of the anchor relative to the WGS84 ellipsoid.
The longitude of the anchor relative to the WGS84 ellipsoid.
The altitude of the anchor above the Earth's terrain (or floor).
The EUS (east-up-south) rotation quaternion.
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 geospatial mode was re-enabled.
if latitude
is outside the allowable range.
if too many anchors (counting both Terrain and Rooftop anchors) have already been held or are being resolved.