Geospatial
class Geospatial
Provides localization ability in Earth-relative coordinates.
To use the Geospatial object, configure the session with Config.GeospatialMode.VPS_AND_GPS.
Not all devices support Config.GeospatialMode.VPS_AND_GPS, use ConfigMode.isSupported to check if the current device supports enabling this mode.
The Geospatial object should only be used when its State is State.Running, and otherwise should not be used. Use Geospatial.state to obtain the current State.
Summary
Nested types |
|---|
class Geospatial.StateDescribes the state of Geospatial. |
Public companion functions |
|
|---|---|
Geospatial |
getInstance(session: Session)Returns the Geospatial object for the given |
Public functions |
|
|---|---|
suspend VpsAvailabilityResult |
checkVpsAvailability(latitude: Double, longitude: Double)Gets the availability of the Visual Positioning System (VPS) at a specified horizontal position. |
CreateGeospatialPoseFromPoseResult |
createGeospatialPoseFromPose(pose: Pose)Converts the input |
CreatePoseFromGeospatialPoseResult |
createPoseFromGeospatialPose(geospatialPose: GeospatialPose)Converts the input geospatial location and orientation relative to the Earth to a |
open operator Boolean |
|
open Int |
hashCode() |
Public properties |
|
|---|---|
StateFlow<Geospatial.State> |
The current |
Extension functions |
|
|---|---|
ListenableFuture<VpsAvailabilityResult> |
Geospatial.checkVpsAvailabilityAsync(Gets the availability of the Visual Positioning System (VPS) at a specified horizontal position. |
Extension properties |
|
|---|---|
Flowable<Geospatial.State> |
The current State of |
Public companion functions
getInstance
fun getInstance(session: Session): Geospatial
Returns the Geospatial object for the given Session.
| Parameters | |
|---|---|
session: Session |
the |
Public functions
checkVpsAvailability
suspend fun checkVpsAvailability(latitude: Double, longitude: Double): VpsAvailabilityResult
Gets the availability of the Visual Positioning System (VPS) at a specified horizontal position. The availability of VPS in a given location helps to improve the quality of Geospatial localization and tracking accuracy.
This launches an asynchronous operation used to query the Google Cloud ARCore API. It may be called without calling Session.configure.
Your app must be properly set up to communicate with the Google Cloud ARCore API in order to obtain a result from this call, otherwise the result will be VpsAvailabilityNotAuthorized.
| Returns | |
|---|---|
VpsAvailabilityResult |
the result of the VPS availability check. |
createGeospatialPoseFromPose
fun createGeospatialPoseFromPose(pose: Pose): CreateGeospatialPoseFromPoseResult
Converts the input Pose to a GeospatialPose in the same position as the original pose.
This method may return a GeospatialPoseNotTracking result if Geospatial is not currently tracking.
| Parameters | |
|---|---|
pose: Pose |
the |
createPoseFromGeospatialPose
fun createPoseFromGeospatialPose(geospatialPose: GeospatialPose): CreatePoseFromGeospatialPoseResult
Converts the input geospatial location and orientation relative to the Earth to a Pose in the same position.
This method may return a PoseNotTracking result if Geospatial is not currently tracking.
Positions near the north pole or south pole is not supported. If the latitude is within 0.1 degrees of the north pole or south pole (90 degrees or -90 degrees), this function will throw an IllegalArgumentException.
| Parameters | |
|---|---|
geospatialPose: GeospatialPose |
the |
| Throws | |
|---|---|
kotlin.IllegalArgumentException |
if the latitude is within 0.1 degrees of the north pole or south pole (90 degrees or -90 degrees). |
Public properties
state
val state: StateFlow<Geospatial.State>
The current State of Geospatial.
Extension functions
checkVpsAvailabilityAsync
fun Geospatial.checkVpsAvailabilityAsync(
session: Session,
latitude: Double,
longitude: Double
): ListenableFuture<VpsAvailabilityResult>
Gets the availability of the Visual Positioning System (VPS) at a specified horizontal position. The availability of VPS in a given location helps to improve the quality of Geospatial localization and tracking accuracy.
This launches an asynchronous operation used to query the Google Cloud ARCore API. It may be called without calling Session.configure.
Your app must be properly set up to communicate with the Google Cloud ARCore API in order to obtain a result from this call, otherwise the result will be VpsAvailabilityNotAuthorized.
| Parameters | |
|---|---|
session: Session |
The current |
latitude: Double |
The latitude in degrees. |
longitude: Double |
The longitude in degrees. |
| Returns | |
|---|---|
ListenableFuture<VpsAvailabilityResult> |
the result of the VPS availability check. |
Extension properties
stateAsFlowable
val Geospatial.stateAsFlowable: Flowable<Geospatial.State>
The current State of Geospatial.