Obtain the device camera's Geospatial transform
Once you have configured your app's settings to use the Geospatial API, you can obtain the device camera's GAREarth.cameraGeospatialTransform
. This transform, managed in a GAREarth
object, contains the following information:
- Location, expressed in latitude and longitude
- Altitude
- An orientation approximating the direction the user is facing in the EUS coordinate system with X+ pointing east, Y+ pointing up, and Z+ pointing south
Adjust the pose for accuracy
When the device is upright in the default orientation, the pitch (X+) and roll (Z+) angles tend to be precise due to a natural alignment with AR tracking. However, the yaw (Y+) angles can vary depending on VPS data availability and temporal conditions at the location. Your app may have to make adjustments for accuracy.
GARGeospatialTransform.orientationYawAccuracy
provides the radius of uncertainty for GARGeospatialTransform.eastUpSouthQTarget
, measured in degrees. This value indicates the standard deviation of the estimate for the local-level yaw (Y+) angle.
What's next
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-02-28 UTC.
[null,null,["Last updated 2025-02-28 UTC."],[[["Access the device camera's geospatial transform to get the user's location, altitude, and orientation in the real world."],["Adjust the yaw angle for accuracy as it can vary due to VPS data availability and local conditions."],["The `GARGeospatialTransform.orientationYawAccuracy` property provides the uncertainty radius for the yaw angle estimate."],["Use the geospatial data to place anchors and interact with the real-world environment through your AR app."]]],["After configuring the Geospatial API, the `GAREarth.cameraGeospatialTransform` provides location (latitude/longitude), altitude, and device orientation. Orientation uses the EUS coordinate system (X+ east, Y+ up, Z+ south). While pitch and roll are generally accurate, yaw can vary. `GARGeospatialTransform.orientationYawAccuracy` indicates yaw uncertainty. To proceed, use the data to place a Geospatial anchor, by obtaining the anchor's pose.\n"]]