Geospatial


public final class Geospatial


Provides localization ability in Earth-relative coordinates.

To use the Geospatial object, configure the session with Config.GeospatialMode.VPS_AND_GPS.

Not all devices support Config.GeospatialMode.VPS_AND_GPS, use ConfigMode.isSupported to check if the current device supports enabling this mode.

The Geospatial object should only be used when its State is State.Running, and otherwise should not be used. Use Geospatial.state to obtain the current State.

Summary

Nested types

public final class Geospatial.State

Describes the state of Geospatial.

Public methods

final @NonNull VpsAvailabilityResult
checkVpsAvailability(double latitude, double longitude)

Gets the availability of the Visual Positioning System (VPS) at a specified horizontal position.

final @NonNull CreateGeospatialPoseFromPoseResult

Converts the input Pose to a GeospatialPose in the same position as the original pose.

final @NonNull CreatePoseFromGeospatialPoseResult

Converts the input geospatial location and orientation relative to the Earth to a Pose in the same position.

boolean
equals(Object other)
static final @NonNull Geospatial

Returns the Geospatial object for the given Session.

final @NonNull StateFlow<@NonNull Geospatial.State>

The current State of Geospatial.

int

Extension functions

final @NonNull ListenableFuture<@NonNull VpsAvailabilityResult>
GuavaGeospatial.checkVpsAvailabilityAsync(
    @NonNull Geospatial receiver,
    @NonNull Session session,
    double latitude,
    double longitude
)

Gets the availability of the Visual Positioning System (VPS) at a specified horizontal position.

final @NonNull Flowable<@NonNull Geospatial.State>

The current State of Geospatial.

Public methods

checkVpsAvailability

public final @NonNull VpsAvailabilityResult checkVpsAvailability(double latitude, double longitude)

Gets the availability of the Visual Positioning System (VPS) at a specified horizontal position. The availability of VPS in a given location helps to improve the quality of Geospatial localization and tracking accuracy.

This launches an asynchronous operation used to query the Google Cloud ARCore API. It may be called without calling Session.configure.

Your app must be properly set up to communicate with the Google Cloud ARCore API in order to obtain a result from this call, otherwise the result will be VpsAvailabilityNotAuthorized.

Parameters
double latitude

The latitude in degrees.

double longitude

The longitude in degrees.

Returns
@NonNull VpsAvailabilityResult

the result of the VPS availability check.

createGeospatialPoseFromPose

Added in 1.0.0-alpha08
public final @NonNull CreateGeospatialPoseFromPoseResult createGeospatialPoseFromPose(@NonNull Pose pose)

Converts the input Pose to a GeospatialPose in the same position as the original pose.

This method may return a GeospatialPoseNotTracking result if Geospatial is not currently tracking.

Parameters
@NonNull Pose pose

the Pose to be converted into a GeospatialPose.

createPoseFromGeospatialPose

Added in 1.0.0-alpha08
public final @NonNull CreatePoseFromGeospatialPoseResult createPoseFromGeospatialPose(@NonNull GeospatialPose geospatialPose)

Converts the input geospatial location and orientation relative to the Earth to a Pose in the same position.

This method may return a PoseNotTracking result if Geospatial is not currently tracking.

Positions near the north pole or south pole is not supported. If the latitude is within 0.1 degrees of the north pole or south pole (90 degrees or -90 degrees), this function will throw an IllegalArgumentException.

Parameters
@NonNull GeospatialPose geospatialPose

the GeospatialPose to be converted into a Pose.

Throws
kotlin.IllegalArgumentException

if the latitude is within 0.1 degrees of the north pole or south pole (90 degrees or -90 degrees).

equals

public boolean equals(Object other)

getInstance

Added in 1.0.0-alpha08
public static final @NonNull Geospatial getInstance(@NonNull Session session)

Returns the Geospatial object for the given Session.

Parameters
@NonNull Session session

the Session to get the Geospatial object from.

getState

Added in 1.0.0-alpha08
public final @NonNull StateFlow<@NonNull Geospatial.StategetState()

The current State of Geospatial.

hashCode

public int hashCode()

Extension functions

GuavaGeospatial.checkVpsAvailabilityAsync

public final @NonNull ListenableFuture<@NonNull VpsAvailabilityResultGuavaGeospatial.checkVpsAvailabilityAsync(
    @NonNull Geospatial receiver,
    @NonNull Session session,
    double latitude,
    double longitude
)

Gets the availability of the Visual Positioning System (VPS) at a specified horizontal position. The availability of VPS in a given location helps to improve the quality of Geospatial localization and tracking accuracy.

This launches an asynchronous operation used to query the Google Cloud ARCore API. It may be called without calling Session.configure.

Your app must be properly set up to communicate with the Google Cloud ARCore API in order to obtain a result from this call, otherwise the result will be VpsAvailabilityNotAuthorized.

Parameters
@NonNull Session session

The current Session.

double latitude

The latitude in degrees.

double longitude

The longitude in degrees.

Returns
@NonNull ListenableFuture<@NonNull VpsAvailabilityResult>

the result of the VPS availability check.

RxJava3GeospatialKt.getStateAsFlowable

public final @NonNull Flowable<@NonNull Geospatial.StateRxJava3GeospatialKt.getStateAsFlowable(@NonNull Geospatial receiver)

The current State of Geospatial.