ARCore is back at Google I/O on May 10! Register now.

Config

Stay organized with collections Save and categorize content based on your preferences.
public class Config

Holds settings that are used to configure the session. To apply a configuration, use Session.configure(Config).

Nested Classes

enum Config.AugmentedFaceMode Selects the behavior of Augmented Faces subsystem. 
enum Config.CloudAnchorMode The cloud anchor mode in Config
enum Config.DepthMode Selects the desired depth mode. 
enum Config.FocusMode On supported devices, selects the desired camera focus mode. 
enum Config.GeospatialMode Describes the desired behavior of the ARCore Geospatial API. 
enum Config.InstantPlacementMode Select the behavior of Instant Placement. 
enum Config.LightEstimationMode Select the behavior of the lighting estimation subsystem. 
enum Config.PlaneFindingMode Select the behavior of the plane detection subsystem. 
enum Config.UpdateMode Selects the behavior of Session.update()

Public Constructors

Config(Session session)
Constructs a sensible default configuration.

Public Methods

Config.AugmentedFaceMode
getAugmentedFaceMode()
Returns the currently configured Augmented Faces mode.
AugmentedImageDatabase
getAugmentedImageDatabase()
Returns the currently configured AugmentedImageDatabase.
Config.CloudAnchorMode
getCloudAnchorMode()
Returns the currently configured cloud anchor mode.
Config.DepthMode
getDepthMode()
Gets the currently configured Config.DepthMode.
Config.FocusMode
getFocusMode()
Returns the currently configured desired focus mode.
Config.GeospatialMode
getGeospatialMode()
Returns the Geospatial mode set on this Config.
Config.InstantPlacementMode
getInstantPlacementMode()
Returns the currently configured Config.InstantPlacementMode.
Config.LightEstimationMode
getLightEstimationMode()
Returns the currently configured lighting estimation mode.
Config.PlaneFindingMode
getPlaneFindingMode()
Returns the currently configured plane finding mode.
Config.UpdateMode
getUpdateMode()
Returns the currently configured behavior of Session.update().
Config
setAugmentedFaceMode(Config.AugmentedFaceMode augmentedFaceMode)
Sets the desired Augmented Faces mode.
Config
setAugmentedImageDatabase(AugmentedImageDatabase augmentedImageDatabase)
Sets the currently active AugmentedImageDatabase.
Config
setCloudAnchorMode(Config.CloudAnchorMode cloudAnchorMode)
Sets the cloud anchor mode of the Session.
Config
Config
setFocusMode(Config.FocusMode focusMode)
Sets the desired focus mode.
Config
setGeospatialMode(Config.GeospatialMode geospatialMode)
Sets the desired Geospatial mode.
Config
setInstantPlacementMode(Config.InstantPlacementMode instantPlacementMode)
Sets the desired Instant Placement mode.
Config
setLightEstimationMode(Config.LightEstimationMode lightEstimationMode)
Sets the desired lighting estimation mode.
Config
setPlaneFindingMode(Config.PlaneFindingMode planeFindingMode)
Sets the desired plane finding mode.
Config
setUpdateMode(Config.UpdateMode updateMode)
Sets the behavior of Session.update().

Inherited Methods

Public Constructors

Config

public Config(
  Session session
)

Constructs a sensible default configuration. Plane detection and lighting estimation are enabled, and blocking update is selected. This configuration is guaranteed to be supported on all devices that support ARCore.

Details
Parameters
session

Public Methods

getAugmentedFaceMode

public Config.AugmentedFaceMode getAugmentedFaceMode()

Returns the currently configured Augmented Faces mode.

getAugmentedImageDatabase

public AugmentedImageDatabase getAugmentedImageDatabase()

Returns the currently configured AugmentedImageDatabase.

This returns a copy of the internally stored database, so any changes to the copy will not affect the current configuration or session.

Details
Returns The AugmentedImageDatabase from the session config, or an empty AugmentedImageDatabase constructed by AugmentedImageDatabase.AugmentedImageDatabase(Session) if no AugmentedImageDatabase has been configured.

getCloudAnchorMode

public Config.CloudAnchorMode getCloudAnchorMode()

Returns the currently configured cloud anchor mode.

getDepthMode

public Config.DepthMode getDepthMode()

Gets the currently configured Config.DepthMode.

getFocusMode

public Config.FocusMode getFocusMode()

Returns the currently configured desired focus mode.

Note: Desired focus mode may be different from the actual focus mode. See the ARCore supported devices page for a list of affected devices.

getGeospatialMode

public Config.GeospatialMode getGeospatialMode()

Returns the Geospatial mode set on this Config.

getInstantPlacementMode

public Config.InstantPlacementMode getInstantPlacementMode()

Returns the currently configured Config.InstantPlacementMode.

getLightEstimationMode

public Config.LightEstimationMode getLightEstimationMode()

Returns the currently configured lighting estimation mode.

getPlaneFindingMode

public Config.PlaneFindingMode getPlaneFindingMode()

Returns the currently configured plane finding mode.

getUpdateMode

public Config.UpdateMode getUpdateMode()

Returns the currently configured behavior of Session.update().

setAugmentedFaceMode

public Config setAugmentedFaceMode(
  Config.AugmentedFaceMode augmentedFaceMode
)

Sets the desired Augmented Faces mode. See Config.AugmentedFaceMode for available options. Augmented Faces is currently only supported when using the front-facing (selfie) camera. See Session.Feature.FRONT_CAMERA for details and restrictions.

Details
Parameters
augmentedFaceMode The Augmented Face mode to select.

setAugmentedImageDatabase

public Config setAugmentedImageDatabase(
  AugmentedImageDatabase augmentedImageDatabase
)

Sets the currently active AugmentedImageDatabase.

Overrides the existing AugmentedImageDatabase in the configuration, if any. Any images in the currently active image database that have a TRACKING/PAUSED state will immediately be set to the STOPPED state if a different or null image database is set.

This makes a copy of the database, so any changes to the database after calling this method will not be reflected in the current configuration or session.

Details
Parameters
augmentedImageDatabase The AugmentedImageDatabase to be used, or null to disable augmented images.

setCloudAnchorMode

public Config setCloudAnchorMode(
  Config.CloudAnchorMode cloudAnchorMode
)

Sets the cloud anchor mode of the Session.

Details
Parameters
cloudAnchorMode The cloud anchor mode.

setDepthMode

public Config setDepthMode(
  Config.DepthMode mode
)

Sets the desired Config.DepthMode.

Notes:

Details
Parameters
mode

setFocusMode

public Config setFocusMode(
  Config.FocusMode focusMode
)

Sets the desired focus mode. See Config.FocusMode for available options.

The default focus mode varies by device and camera, and is set to optimize AR tracking. Currently the default on most ARCore devices and cameras is Config.FocusMode.FIXED, although this default might change in the future.

Note: On devices where ARCore does not support auto focus due to the use of a fixed focus camera, setting Config.FocusMode.AUTO will be ignored. Similarly, on devices where tracking requires auto focus, setting Config.FocusMode.FIXED will be ignored. See the ARCore supported devices page for a list of affected devices.

To determine whether the configured ARCore camera supports auto focus, query CameraCharacteristics.CONTROL_AF_AVAILABLE_MODES.

Details
Parameters
focusMode The desired focus mode.

setGeospatialMode

public Config setGeospatialMode(
  Config.GeospatialMode geospatialMode
)

Sets the desired Geospatial mode. See Config.GeospatialMode for available options.

Details
Parameters
geospatialMode The Geospatial mode to select.

setInstantPlacementMode

public Config setInstantPlacementMode(
  Config.InstantPlacementMode instantPlacementMode
)

Sets the desired Instant Placement mode. See Config.InstantPlacementMode for available options.

Details
Parameters
instantPlacementMode the desired Instant Placement mode

setLightEstimationMode

public Config setLightEstimationMode(
  Config.LightEstimationMode lightEstimationMode
)

Sets the desired lighting estimation mode. See the Config.LightEstimationMode enum for available options.

Details
Parameters
lightEstimationMode The lighting estimation mode to select.

setPlaneFindingMode

public Config setPlaneFindingMode(
  Config.PlaneFindingMode planeFindingMode
)

Sets the desired plane finding mode. See the Config.PlaneFindingMode enum for available options.

Details
Parameters
planeFindingMode The plane finding mode to select.

setUpdateMode

public Config setUpdateMode(
  Config.UpdateMode updateMode
)

Sets the behavior of Session.update(). See the Config.UpdateMode enum for available options.

Details
Parameters
updateMode The behavior to select.