Config.GeospatialMode


public final class Config.GeospatialMode implements Config.ConfigMode


Feature that allows Geospatial localization and tracking. The Geospatial API uses a combination of Google's Visual Positioning System (VPS) and GPS to determine the geospatial pose.

The Geospatial API is able to provide the best user experience when it is able to generate high accuracy poses. However, the Geospatial API can be used anywhere, as long as the device is able to determine its location, even if the available location information has low accuracy.

  • In areas with VPS coverage, the Geospatial API is able to generate high accuracy poses. This can work even where GPS accuracy is low, such as dense urban environments. Under typical conditions, VPS can be expected to provide positional accuracy typically better than 5 meters and often around 1 meter, and a rotational accuracy of better than 5 degrees. Use Geospatial.checkVpsAvailability to determine if a given location has VPS coverage.

  • In outdoor environments with few or no overhead obstructions, GPS may be sufficient to generate high accuracy poses. GPS accuracy may be low in dense urban environments and indoors.

Note that setting this mode will consume additional runtime resources.

Summary

Public fields

static final @NonNull Config.GeospatialMode

The Geospatial API is disabled.

static final @NonNull Config.GeospatialMode

The Geospatial API is enabled.

Public methods

@NonNull String

Inherited methods

From androidx.xr.runtime.Config.ConfigMode
boolean

Queries whether the ConfigMode is supported and is available to be configured for the session via Session.configure.

Public fields

DISABLED

public static final @NonNull Config.GeospatialMode DISABLED

The Geospatial API is disabled. When GeospatialMode is disabled, current Anchor objects created from Geospatial will stop updating, and have their TrackingState set to TrackingState.STOPPED.

VPS_AND_GPS

public static final @NonNull Config.GeospatialMode VPS_AND_GPS

The Geospatial API is enabled. Geospatial should enter the running state shortly after this mode is set.

Using this mode requires your app do the following, depending on the Runtime:

On mobile and projected devices:

On mobile devices:

  • Include the Google Play Services Location Library as a dependency for your app. See dependencies for Google Play services for instructions on how to include this library in your app. If this library is not linked, Session.configure returns SessionResultGooglePlayServicesLocationLibraryNotLinked.

Location is tracked only while the Session is resumed.

On mobile devices, when the Geospatial API and the Depth API are enabled, output images from the Depth API will include terrain and building geometry when in a location with VPS coverage.

Not all devices support GeospatialMode.VPS_AND_GPS, use ConfigMode.isSupported to check if the current device and selected camera support enabling this mode. These checks are done in the call to Session.configure.

Public methods

toString

public @NonNull String toString()