Trackable

public interface Trackable
Known Indirect Subclasses

A Trackable is something that ARCore can track and that Anchors can be attached to.

Public Methods

abstract Anchor
createAnchor(Pose pose)
Creates an anchor that is attached to this trackable, using the given initial pose in the world coordinate space.
abstract Collection<Anchor>
getAnchors()
Gets the Anchors attached to this trackable.
abstract TrackingState
getTrackingState()
Gets the TrackingState of this Trackable.

Public Methods

createAnchor

public abstract Anchor createAnchor(
  Pose pose
)

Creates an anchor that is attached to this trackable, using the given initial pose in the world coordinate space. The type of trackable will determine the semantics of attachment and how the anchor's pose will be updated to maintain this relationship. Note that the relative offset between the pose of multiple anchors attached to a trackable may adjust slightly over time as ARCore updates its model of the world.

Details
Parameters
pose
Throws
NotTrackingException if the trackable's tracking state was not TrackingState.TRACKING
SessionPausedException if the session had been paused.
ResourceExhaustedException if too many anchors exist.
IllegalStateException if this trackable doesn't support anchors.

getAnchors

public abstract Collection<Anchor> getAnchors()

Gets the Anchors attached to this trackable.

getTrackingState

public abstract TrackingState getTrackingState()

Gets the TrackingState of this Trackable.

Note: Starting in ARCore 1.12, changing the active camera config using Session.setCameraConfig(CameraConfig) may cause the tracking state on certain devices to become permanently PAUSED. For consistent behavior across all supported devices, release any previously created trackables when setting a new camera config.