GoogleARCore. Session
Represents an ARCore session, which is an attachment point from the app to the ARCore service.
Summary
Holds information about the global state for ARCore, manages tracking of Anchors and Planes, and performs hit tests against objects ARCore is tracking in the world.
Properties |
|
---|---|
LostTrackingReason
|
static LostTrackingReason
Gets the reason for ARCore having lost tracking.
|
PlaybackStatus
|
static PlaybackStatus
Gets the current state of playback.
|
RecordingStatus
|
static RecordingStatus
Gets the current state of the recorder.
|
Status
|
static SessionStatus
Gets current session status.
|
Public static functions |
|
---|---|
CheckApkAvailability()
|
AsyncTask< ApkAvailabilityStatus >
Checks the availability of the ARCore APK on the device.
|
CreateAnchor(Pose pose, Trackable trackable)
|
|
GetCameraConfig()
|
Get the camera configuration the ARCore session is currently running with.
|
GetTrackables< T >(List< T > trackables, TrackableQueryFilter filter)
|
void
Gets Trackables ARCore has tracked.
|
IsDepthModeSupported(DepthMode depthMode)
|
bool
Check whether the depth mode is supported on this device.
|
RequestApkInstallation(bool userRequested)
|
AsyncTask< ApkInstallationStatus >
Requests an installation of the ARCore APK on the device.
|
SetPlaybackDataset(string datasetFilepath)
|
Sets the filepath for a dataset to be played back.
|
StartRecording(ARCoreRecordingConfig config)
|
Starts a new recording, using the provided ARCoreRecordingConfig to define the location to save the dataset and other options.
|
StopRecording()
|
Stops the current recording.
|
Properties
LostTrackingReason
static LostTrackingReason LostTrackingReason
Gets the reason for ARCore having lost tracking.
PlaybackStatus
static PlaybackStatus PlaybackStatus
Gets the current state of playback.
Details | |
---|---|
Returns |
The current PlaybackStatus.
|
RecordingStatus
static RecordingStatus RecordingStatus
Gets the current state of the recorder.
Details | |
---|---|
Returns |
The current RecordingStatus.
|
Public static functions
CheckApkAvailability
AsyncTask< ApkAvailabilityStatus > CheckApkAvailability()
Checks the availability of the ARCore APK on the device.
Details | |
---|---|
Returns |
An AsyncTask that completes with an ApkAvailabilityStatus when the availability is known.
|
CreateAnchor
Anchor CreateAnchor( Pose pose, Trackable trackable )
Creates a new Anchor at the given Pose
that is attached to the Trackable
.
If trackable is null, it creates a new anchor at a world pose. As ARCore updates its understading of the space, it will update the virtual pose of the of the anchor to attempt to keep the anchor in the same real world location.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
The newly created anchor or null.
|
GetCameraConfig
CameraConfig GetCameraConfig()
Get the camera configuration the ARCore session is currently running with.
Details | |
---|---|
Returns |
The CameraConfig that the ARCore session is currently running with. The value is only correct when there is a valid running ARCore session.
|
GetTrackables< T >
void GetTrackables< T >( List< T > trackables, TrackableQueryFilter filter )
Gets Trackables ARCore has tracked.
Details | |||||
---|---|---|---|---|---|
Template Parameters |
|
||||
Parameters |
|
IsDepthModeSupported
bool IsDepthModeSupported( DepthMode depthMode )
Check whether the depth mode is supported on this device.
Not all devices support depth, see the ARCore supported devices page for details.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
true if the depth mode is supported, false if it is not supported or the session has not yet been initialized.
|
RequestApkInstallation
AsyncTask< ApkInstallationStatus > RequestApkInstallation( bool userRequested )
Requests an installation of the ARCore APK on the device.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
An AsyncTask that completes with an ApkInstallationStatus when the installation status is resolved.
|
SetPlaybackDataset
PlaybackResult SetPlaybackDataset( string datasetFilepath )
Sets the filepath for a dataset to be played back.
The ARCore session must be paused when using this method. Resume the session for the change to take effect.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
PlaybackResult.
OK if playback filepath was was set without issue. A different PlaybackResult will be returned in the case of an error. |
StartRecording
RecordingResult StartRecording( ARCoreRecordingConfig config )
Starts a new recording, using the provided ARCoreRecordingConfig to define the location to save the dataset and other options.
If a recording is already in progress this call will fail, check the RecordingStatus before making this call. When an ARCore session is paused, recording may continue, during this time the camera feed will be recorded as a black screen, but sensor data will continue to be captured.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
RecordingResult.
OK if the recording is started (or will start on the next Session resume.) Or a RecordingResult if there was an error. |
StopRecording
RecordingResult StopRecording()
Stops the current recording.
If there is no recording in progress, this method will return RecordingResult.OK
.
Details | |
---|---|
Returns |
RecordingResult.
OK if the recording was stopped successfully, or RecordingResult.ErrorRecordingFailed if there was an error. |