GARSessionConfiguration(Geospatial)
Category adding Geospatial functionality to GARSessionConfiguration
.
Summary
Properties |
|
---|---|
geospatialMode
|
Describes the desired behavior of the ARCore Geospatial API.
|
streetscapeGeometryMode
|
Describes the behavior of the Geospatial Streetscape Geometry API.
|
Properties
geospatialMode
@property(nonatomic) GARGeospatialMode geospatialMode;
Describes the desired behavior of the ARCore Geospatial API.
The Geospatial API uses a combination of Google's Visual Positioning System (VPS) and GPS to determine the geospatial pose.
The Geospatial API is able to provide the best user experience when it is able to generate high accuracy poses. However, the Geospatial API can be used anywhere, as long as the device is able to determine its location, even if the available location information has low accuracy.
- In areas with VPS coverage, the Geospatial API is able to generate high accuracy poses. This can work even where GPS accuracy is low, such as dense urban environments. Under typical conditions, VPS can be expected to provide positional accuracy typically better than 5 meters and often around 1 meter, and a rotational accuracy of better than 5 degrees. Use
checkVPSAvailabilityAtCoordinate:completionHandler: (GARSession(Geospatial))
to determine if a given location has VPS coverage. - In outdoor environments with few or no overhead obstructions, GPS may be sufficient to generate high accuracy poses. GPS accuracy may be low in dense urban environments and indoors.
A small number of ARCore supported devices do not support the Geospatial API. Use isGeospatialModeSupported: (GARSession(Geospatial))
to determine if the current device is supported. Affected devices are also indicated on the ARCore supported devices page.
The default mode is GARGeospatialModeDisabled
. If the mode is changed, existing Geospatial anchors will stop tracking.
Remember to set a credential for authentication with Google Cloud before configuring, or you may receive auth errors. See sessionWithAPIKey:bundleIdentifier:error: (GARSession)
and setAuthToken: (GARSession)
, as well as documentation on Enable the Geospatial API.
Configuring may result in the following error codes:
GARSessionErrorCodeLocationPermissionNotGranted
- Geospatial mode requires location permission (at least when-in-use) with full accuracy.GARSessionErrorCodeConfigurationNotSupported
- Geospatial mode not supported on this device or OS version. UseisGeospatialModeSupported: (GARSession(Geospatial))
to determine this before attempting to configure the session.
streetscapeGeometryMode
@property(nonatomic) GARStreetscapeGeometryMode streetscapeGeometryMode;
Describes the behavior of the Geospatial Streetscape Geometry API.
The Streetscape Geometry API provides polygon meshes of terrain, buildings, and other structures in a radius surrounding the device. See the Streetscape Geometry Developer Guide for additional information.
When Streetscape Geometry is enabled, GARFrame.streetscapeGeometries
can be used to obtain GARStreetscapeGeometry
s. Additionally, raycastStreetscapeGeometry:direction:error: (GARSession(Geospatial))
can be used to perform a hit-test using Streetscape Geometry.
The Streetscape Geometry API requires both GARSessionConfiguration.streetscapeGeometryMode
to be set to GARStreetscapeGeometryModeEnabled
and for GARSessionConfiguration.geospatialMode
to be set to GARGeospatialModeEnabled
.
The default value is GARStreetscapeGeometryModeDisabled
.