Earth

public class Earth

A Trackable implementation representing the Earth. Provides localization ability in Earth-relative coordinates.

To access Earth, configure the session with an appropriate Config.GeospatialMode and use Session.getEarth().

Not all devices support Config.GeospatialMode.ENABLED, use Session.isGeospatialModeSupported(Config.GeospatialMode) to check if the current device and selected camera support enabling this mode.

The Earth object should only be used when its TrackingState is TrackingState.TRACKING, and otherwise should not be used. Use getTrackingState() to obtain the current TrackingState. If the TrackingState does not become TrackingState.TRACKING, then getEarthState() may contain more information in a Earth.EarthState.

Use getCameraGeospatialPose() to obtain the Earth-relative virtual camera pose for the latest frame.

Use createAnchor(double, double, double, float, float, float, float) to attach anchors to Earth. Calling createAnchor(Pose) on Earth will fail to create a new anchor and will throw IllegalArgumentException.

Earth does not support hit testing and will never be a result from Frame.hitTest(MotionEvent). Because Earth is a type of Trackable, the singleton Earth instance may also be returned by Session.getAllTrackables(Class) when enabled.

Nested Classes

enum Earth.EarthState Describes the current state of Earth

Public Methods

Anchor
Anchor
createAnchor(double latitude, double longitude, double altitude, float[] rotation)
Creates a new Anchor at the specified geospatial location and orientation relative to the Earth.
Anchor
createAnchor(double latitude, double longitude, double altitude, float qx, float qy, float qz, float qw)
Creates a new Anchor at the specified geospatial location and orientation relative to the Earth.
boolean
equals(Object obj)
Indicates whether some other object is a Trackable referencing the same logical trackable as this one.
Collection<Anchor>
getAnchors()
Gets the Anchors attached to this trackable.
GeospatialPose
getCameraGeospatialPose()
Returns the GeospatialPose for the camera in the latest frame, describing the geospatial positioning of the device.
Earth.EarthState
getEarthState()
Gets the current Earth.EarthState of the Earth.
GeospatialPose
getGeospatialPose(Pose pose)
Converts the input pose to a GeospatialPose in the same position as the original Pose.
Pose
getPose(double latitude, double longitude, double altitude, float qx, float qy, float qz, float qw)
Converts the input geospatial location and orientation relative to the Earth to a Pose in the same position.
TrackingState
getTrackingState()
Gets the TrackingState of the Earth object as of the last frame.
int
hashCode()
Returns a hash code value for the object.
ResolveAnchorOnRooftopFuture
resolveAnchorOnRooftopAsync(double latitude, double longitude, double altitudeAboveRooftop, float qx, float qy, float qz, float qw, BiConsumer<AnchorAnchor.RooftopAnchorState> callback)
Creates an anchor at a specified horizontal position and altitude relative to the horizontal position's rooftop.
Anchor
resolveAnchorOnTerrain(double latitude, double longitude, double altitudeAboveTerrain, float qx, float qy, float qz, float qw)
ResolveAnchorOnTerrainFuture
resolveAnchorOnTerrainAsync(double latitude, double longitude, double altitudeAboveTerrain, float qx, float qy, float qz, float qw, BiConsumer<AnchorAnchor.TerrainAnchorState> callback)
Asynchronously creates a new Anchor at a specified horizontal position and altitude relative to the horizontal position's terrain.

Inherited Methods

Public Methods