CloudSpatialAnchorSession Class
Definition
Use this class to create, locate and manage spatial anchors.
public class CloudSpatialAnchorSession
- Inheritance
-
java.lang.Objectjava.lang.AutoCloseableCloudSpatialAnchorSession
Constructors
| CloudSpatialAnchorSession() |
Initializes a new instance with a default configuration. |
Methods
| addAnchorLocatedListener(AnchorLocatedListener listener) |
Adds the specified listener to receive AnchorLocated events. Occurs when an anchor's location is determined. |
| addErrorListener(SessionErrorListener listener) |
Adds the specified listener to receive Error events. Occurs when the session is unable to continue processing. |
| addLocateAnchorsCompletedListener(LocateAnchorsCompletedListener listener) |
Adds the specified listener to receive LocateAnchorsCompleted events. Occurs when all the results from a watcher that is locating anchors are processed. |
| addOnLogDebugListener(OnLogDebugListener listener) |
Adds the specified listener to receive OnLogDebug events. Occurs when a debug log message is generated. |
| addSessionUpdatedListener(SessionUpdatedListener listener) |
Adds the specified listener to receive SessionUpdated events. Occurs when all the session state is updated. |
| addTokenRequiredListener(TokenRequiredListener listener) |
Adds the specified listener to receive TokenRequired events. Occurs when the session requires an updated access token or authentication token. |
| addUpdatedSensorFingerprintRequiredListener(UpdatedSensorFingerprintRequiredListener listener) |
Adds the specified listener to receive UpdatedSensorFingerprintRequired events. Occurs when the session requests an updated sensor fingerprint from the application. |
| close() |
Closes this resource. |
| createAnchorAsync(final CloudSpatialAnchor anchor) |
Creates a new persisted spatial anchor from the specified local anchor and string properties. The local anchor passed into this method must have a valid transform. Note some platforms supported by Azure Spatial Anchors such as iOS allow transforms with scale component != 1.0. Azure Spatial Anchors SDK does not support such transforms and it will fail to create the spatial anchor with error code InvalidAnchorTransformRigidity. Any scale handling for anchors must be done at the app level. |
| createWatcher(AnchorLocateCriteria criteria) |
Creates a new object that watches for anchors that meet the specified criteria. |
| deleteAnchorAsync(final CloudSpatialAnchor anchor) |
Deletes a persisted spatial anchor. |
| finalize() |
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. |
| getAccessTokenWithAccountKeyAsync(final String accountKey) |
Gets the Azure Spatial Anchors access token from account key. |
| getAccessTokenWithAuthenticationTokenAsync(final String authenticationToken) |
Gets the Azure Spatial Anchors access token from authentication token. |
| getActiveWatchers() |
Gets a list of active watchers. |
| getAnchorPropertiesAsync(final String identifier) |
Gets a cloud spatial anchor for the given identifier, even if it hasn't been located yet. |
| getConfiguration() |
Gets the configuration information for the session. Configuration settings take effect when the session is started. |
| getDiagnostics() |
Gets the diagnostics settings for the session, which can be used to collect and submit data for troubleshooting and improvements. |
| getLocationProvider() |
Location provider used to create and locate anchors using [Coarse Relocalization](https://aka.ms/CoarseRelocalization). |
| getLogLevel() |
Logging level for the session log events. |
| getNearbyAnchorIdsAsync(final NearDeviceCriteria criteria) |
Gets a list of all nearby cloud spatial anchor ids corresponding to a given criteria. |
| getSession() |
Gets the tracking session used to help locate anchors. This property is not available on the HoloLens platform. |
| getSessionId() |
Gets the unique identifier for the session. |
| getSessionStatusAsync() |
Gets an object describing the status of the session. |
| getTelemetryEnabled() | |
| processFrame(Frame frame) |
Applications must call this method on platforms where per-frame processing is required. This method is not available on the HoloLens platform. |
| refreshAnchorPropertiesAsync(final CloudSpatialAnchor anchor) |
Refreshes properties for the specified spatial anchor. |
| removeAnchorLocatedListener(AnchorLocatedListener listener) |
Removes the specified listener to receive AnchorLocated events. Occurs when an anchor's location is determined. |
| removeErrorListener(SessionErrorListener listener) |
Removes the specified listener to receive Error events. Occurs when the session is unable to continue processing. |
| removeLocateAnchorsCompletedListener(LocateAnchorsCompletedListener listener) |
Removes the specified listener to receive LocateAnchorsCompleted events. Occurs when all the results from a watcher that is locating anchors are processed. |
| removeOnLogDebugListener(OnLogDebugListener listener) |
Removes the specified listener to receive OnLogDebug events. Occurs when a debug log message is generated. |
| removeSessionUpdatedListener(SessionUpdatedListener listener) |
Removes the specified listener to receive SessionUpdated events. Occurs when all the session state is updated. |
| removeTokenRequiredListener(TokenRequiredListener listener) |
Removes the specified listener to receive TokenRequired events. Occurs when the session requires an updated access token or authentication token. |
| removeUpdatedSensorFingerprintRequiredListener(UpdatedSensorFingerprintRequiredListener listener) |
Removes the specified listener to receive UpdatedSensorFingerprintRequired events. Occurs when the session requests an updated sensor fingerprint from the application. |
| reset() |
Resets environment data that has been captured in this session; applications must call this method when tracking is lost. On any platform, calling the method will clean all internal cached state. |
| setLocationProvider(PlatformLocationProvider value) |
Location provider used to create and locate anchors using [Coarse Relocalization](https://aka.ms/CoarseRelocalization). |
| setLogLevel(SessionLogLevel value) |
Logging level for the session log events. |
| setSession(Session value) |
Sets the tracking session used to help locate anchors. This property is not available on the HoloLens platform. |
| setTelemetryEnabled(boolean value) | |
| start() |
Begins capturing environment data for the session. |
| stop() |
Stops capturing environment data for the session and cancels any outstanding locate operations. Environment data is maintained. |
| updateAnchorPropertiesAsync(final CloudSpatialAnchor anchor) |
Updates the specified spatial anchor. |