Skip to content

Commit 6fcebcb

Browse files
ARCore Android SDK v1.6.0
1 parent 25b4589 commit 6fcebcb

File tree

31 files changed

+315
-162
lines changed

31 files changed

+315
-162
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!-- Use this issue tracker to file bugs and feature requests
2+
related to the ARCore SDK for Android (Java / C).
3+
4+
For advice and general questions, please use the `ARCore` tag on
5+
Stack Overflow: stackoverflow.com/questions/tagged/ARCore
6+
7+
- For Sceneform issues, use https://github.com/google-ar/sceneform-android-sdk
8+
- If using Unity, use https://github.com/google-ar/arcore-unity-sdk
9+
- If using Unreal, use https://github.com/google-ar/arcore-unreal-sdk
10+
-->
11+
12+
13+
### SPECIFIC ISSUE ENCOUNTERED
14+
15+
16+
### VERSIONS USED
17+
- Android Studio:
18+
- ARCore SDK for Android:
19+
- Device manufacturer, model, and O/S:
20+
- ARCore:
21+
On Windows, use: `adb shell pm dump com.google.ar.core | findstr /i "packages: versionName"`
22+
On macOS, use: `adb shell pm dump com.google.ar.core | egrep -i versionName\|packages:`
23+
- Output of `adb shell getprop ro.build.fingerprint`:
24+
25+
26+
### STEPS TO REPRODUCE THE ISSUE
27+
1.
28+
1.
29+
1.
30+
31+
32+
### WORKAROUNDS (IF ANY)
33+
34+
35+
### ADDITIONAL COMMENTS

CONTRIBUTING.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# How to Contribute
2+
3+
We'd love to accept your patches and contributions to the source code included
4+
in this project. There are just a few small guidelines you need to follow.
5+
6+
## Contributor License Agreement
7+
8+
Contributions to this project must be accompanied by a Contributor License
9+
Agreement. You (or your employer) retain the copyright to your contribution;
10+
this simply gives us permission to use and redistribute your contributions as
11+
part of the project. Head over to <https://cla.developers.google.com/> to see
12+
your current agreements on file or to sign a new one.
13+
14+
You generally only need to submit a CLA once, so if you've already submitted one
15+
(even if it was for a different project), you probably don't need to do it
16+
again.
17+
18+
## Code reviews
19+
20+
Although we do not use the normal GitHub pull request process to incorporate
21+
contributions, it's okay to send us pull requests. Once we have received your
22+
CLA we will review and consider your contribution for inclusion in a future
23+
release of the SDK.
24+
25+
## Community Guidelines
26+
27+
This project follows
28+
[Google's Open Source Community
29+
Guidelines](https://opensource.google.com/conduct/).
30+

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Except as indicated at the end of this LICENSE file,
2+
files in this SDK are licensed as follows:
3+
14
Copyright (c) 2017, Google Inc.
25
Licensed under the Apache License, Version 2.0 (the "License");
36
you may not use this file except in compliance with the License.
@@ -156,3 +159,21 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
156159
incurred by, or claims asserted against, such Contributor by reason
157160
of your accepting any such warranty or additional liability.
158161
END OF TERMS AND CONDITIONS
162+
163+
===============================================================================
164+
165+
The following files:
166+
tools/arcoreimg/linux/arcoreimg
167+
tools/arcoreimg/macos/arcoreimg
168+
tools/arcoreimg/windows/arcoreimg.exe
169+
170+
are licensed as follows:
171+
Covered by the **Google APIs Terms of Service** at
172+
[https://developers.google.com/terms/](https://developers.google.com/terms/)
173+
174+
===============================================================================
175+
176+
The *.apk files attached to [GitHub releases](https://github.com/google-ar/arcore-android-sdk/releases)
177+
are licensed as follows:
178+
Covered by the **Google APIs Terms of Service** at
179+
[https://developers.google.com/terms/](https://developers.google.com/terms/)

libraries/include/arcore_c_api.h

Lines changed: 105 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
/// @defgroup hit HitResult
120120
/// Defines an intersection between a ray and estimated real-world geometry.
121121

122-
/// @defgroup image ImageMetadata
122+
/// @defgroup image Image
123123
/// Provides access to metadata from the camera image capture result.
124124

125125
/// @defgroup intrinsics Intrinsics
@@ -385,9 +385,13 @@ typedef struct ArAugmentedImageDatabase_ ArAugmentedImageDatabase;
385385
/// A position in space attached to a trackable
386386
/// (@ref ownership "reference type, long-lived").
387387
///
388-
/// Create with ArSession_acquireNewAnchor() or
389-
/// ArHitResult_acquireNewAnchor()<br>
390-
/// Release with ArAnchor_release()
388+
/// To create a new anchor call ArSession_acquireNewAnchor() or
389+
/// ArHitResult_acquireNewAnchor().<br>
390+
/// To have ARCore stop tracking the anchor, call ArAnchor_detach().<br>
391+
/// To release the memory associated with this anchor reference, call
392+
/// ArAnchor_release(). Note that, this will not cause ARCore to stop tracking
393+
/// the anchor. Other references to the same anchor acquired through
394+
/// ArAnchorList_acquireItem() are unaffected.
391395
typedef struct ArAnchor_ ArAnchor;
392396

393397
/// A list of anchors (@ref ownership "value type").
@@ -977,22 +981,40 @@ ArStatus ArCoreApk_requestInstallCustom(void *env,
977981
/// @addtogroup session
978982
/// @{
979983

980-
/// Attempts to create a new ARCore session.
984+
/// Creates a new ARCore session. Prior to calling this function, your app must
985+
/// check that ARCore is installed by verifying that either:
981986
///
982-
/// This is the entry point of ARCore. This function MUST be the first ARCore
983-
/// call made by an application.
987+
/// - ArCoreApk_requestInstall() or ArCoreApk_requestInstallCustom() returns
988+
/// #AR_INSTALL_STATUS_INSTALLED, or
989+
/// - ArCoreApk_checkAvailability() returns
990+
/// #AR_AVAILABILITY_SUPPORTED_INSTALLED.
991+
///
992+
/// This check must be performed prior to creating an ArSession, otherwise
993+
/// ArSession creation will fail, and subsequent installation or upgrade of
994+
/// ARCore will require an app restart and might cause Android to kill your app.
984995
///
985996
/// @param[in] env The application's @c JNIEnv object
986997
/// @param[in] application_context A @c jobject referencing the application's
987998
/// Android @c Context
988999
/// @param[out] out_session_pointer A pointer to an @c ArSession* to receive
9891000
/// the address of the newly allocated session.
9901001
/// @return #AR_SUCCESS or any of:
991-
/// - #AR_UNAVAILABLE_ARCORE_NOT_INSTALLED
992-
/// - #AR_UNAVAILABLE_DEVICE_NOT_COMPATIBLE
993-
/// - #AR_UNAVAILABLE_APK_TOO_OLD
994-
/// - #AR_UNAVAILABLE_SDK_TOO_OLD
995-
/// - #AR_ERROR_CAMERA_PERMISSION_NOT_GRANTED
1002+
/// - #AR_ERROR_FATAL if an internal error occurred while creating the session.
1003+
/// `adb logcat` may contain useful information.
1004+
/// - #AR_ERROR_CAMERA_PERMISSION_NOT_GRANTED if your app does not have the
1005+
/// [CAMERA](https://developer.android.com/reference/android/Manifest.permission.html#CAMERA)
1006+
/// permission.
1007+
/// - #AR_UNAVAILABLE_ARCORE_NOT_INSTALLED if the ARCore APK is not present.
1008+
/// This can be prevented by the installation check described above.
1009+
/// - #AR_UNAVAILABLE_DEVICE_NOT_COMPATIBLE if the device is not compatible with
1010+
/// ARCore. If encountered after completing the installation check, this
1011+
/// usually indicates a user has side-loaded ARCore onto an incompatible
1012+
/// device.
1013+
/// - #AR_UNAVAILABLE_APK_TOO_OLD if the installed ARCore APK is too old for the
1014+
/// ARCore SDK with which this application was built. This can be prevented by
1015+
/// the installation check described above.
1016+
/// - #AR_UNAVAILABLE_SDK_TOO_OLD if the ARCore SDK that this app was built with
1017+
/// is too old and no longer supported by the installed ARCore APK.
9961018
ArStatus ArSession_create(void *env,
9971019
void *application_context,
9981020
ArSession **out_session_pointer);
@@ -1384,10 +1406,13 @@ ArStatus ArSession_resolveAndAcquireNewCloudAnchor(ArSession *session,
13841406
///
13851407
/// The list will always return 3 camera configs. The GPU texture resolutions
13861408
/// are the same in all three configs. Currently, most devices provide GPU
1387-
/// texture resolution of 1920 x 1080, but devices might provide higher or lower
1388-
/// resolution textures, depending on device capabilities. The CPU image
1389-
/// resolutions returned are VGA, 720p, and a resolution matching the GPU
1390-
/// texture.
1409+
/// texture resolution of 1920 x 1080 but this may vary with device
1410+
/// capabilities. The CPU image resolutions returned are VGA, a middle
1411+
/// resolution, and a large resolution matching the GPU texture. The middle
1412+
/// resolution will often be 1280 x 720, but may vary with device capabilities.
1413+
///
1414+
/// Note: Prior to ARCore 1.6 the middle CPU image resolution was guaranteed to
1415+
/// be 1280 x 720 on all devices.
13911416
///
13921417
/// @param[in] session The ARCore session
13931418
/// @param[inout] list The list to fill. This list must have already
@@ -1479,17 +1504,28 @@ void ArPose_getMatrix(const ArSession *session,
14791504
/// @addtogroup camera
14801505
/// @{
14811506

1482-
/// Sets @c out_pose to the pose of the user's device in the world coordinate
1483-
/// space at the time of capture of the current camera texture. The position and
1484-
/// orientation of the pose follow the device's physical camera (they are not
1485-
/// affected by display orientation), <b>but are rotated around the Z axis by a
1486-
/// multiple of 90&deg; to (approximately) align the axes with those of the <a
1487-
/// href="https://developer.android.com/guide/topics/sensors/sensors_overview.html#sensors-coords"
1488-
/// >Android Sensor Coordinate System</a></b>.
1489-
///
1490-
/// This function will be deprecated in a future version of ARCore and replaced
1491-
/// with one that returns the camera's actual physical pose without the 90&deg;
1492-
/// rotation.
1507+
/// Sets @c out_pose to the pose of the physical camera in world space for the
1508+
/// latest frame. This is an OpenGL camera pose with +X pointing right, +Y
1509+
/// pointing right up, -Z pointing in the direction the camera is looking, with
1510+
/// "right" and "up" being relative to the image readout in the usual
1511+
/// left-to-right top-to-bottom order. Specifically, this is the camera pose at
1512+
/// the center of exposure of the center row of the image.
1513+
///
1514+
/// <b>For applications using the SDK for ARCore 1.5 and earlier</b>, the
1515+
/// returned pose is rotated around the Z axis by a multiple of 90 degrees so
1516+
/// that the axes correspond approximately to those of the <a
1517+
/// href="https://developer.android.com/guide/topics/sensors/sensors_overview#sensors-coords">Android
1518+
/// Sensor Coordinate System</a>.
1519+
///
1520+
/// See Also:
1521+
///
1522+
/// * ArCamera_getDisplayOrientedPose() for the pose of the virtual camera. It
1523+
/// will differ by a local rotation about the Z axis by a multiple of 90
1524+
/// degrees.
1525+
/// * ArFrame_getAndroidSensorPose() for the pose of the Android sensor frame.
1526+
/// It will differ in both orientation and location.
1527+
/// * ArFrame_transformDisplayUvCoords() to convert viewport coordinates to
1528+
/// texture coordinates.
14931529
///
14941530
/// Note: This pose is only useful when ArCamera_getTrackingState() returns
14951531
/// #AR_TRACKING_STATE_TRACKING and otherwise should not be used.
@@ -1502,18 +1538,24 @@ void ArCamera_getPose(const ArSession *session,
15021538
const ArCamera *camera,
15031539
ArPose *out_pose);
15041540

1505-
/// Sets @c out_pose to the pose of the user's device in the world coordinate
1506-
/// space at the time of capture of the current camera texture. The position of
1507-
/// the pose is located at the device's camera, while the orientation
1508-
/// approximately matches the orientation of the display (considering display
1509-
/// rotation), using OpenGL camera conventions (+X right, +Y up, -Z in the
1510-
/// direction the camera is looking).
1541+
/// Sets @c out_pose to the virtual camera pose in world space for rendering AR
1542+
/// content onto the latest frame. This is an OpenGL camera pose with +X
1543+
/// pointing right, +Y pointing up, and -Z pointing in the direction the camera
1544+
/// is looking, with "right" and "up" being relative to current logical display
1545+
/// orientation.
1546+
///
1547+
/// See Also:
1548+
///
1549+
/// * ArCamera_getViewMatrix() to conveniently compute the OpenGL View Matrix.
1550+
/// * ArCamera_getPose() for the physical pose of the camera. It will differ by
1551+
/// a local rotation about the Z axis by a multiple of 90 degrees.
1552+
/// * ArFrame_getAndroidSensorPose() for the pose of the android sensor frame.
1553+
/// It will differ in both orientation and location.
1554+
/// * ArSession_setDisplayGeometry() to update the display rotation.
15111555
///
15121556
/// Note: This pose is only useful when ArCamera_getTrackingState() returns
15131557
/// #AR_TRACKING_STATE_TRACKING and otherwise should not be used.
15141558
///
1515-
/// See also: ArCamera_getViewMatrix()
1516-
///
15171559
/// @param[in] session The ARCore session
15181560
/// @param[in] camera The session's camera (retrieved from any frame).
15191561
/// @param[inout] out_pose An already-allocated ArPose object into which the
@@ -1560,16 +1602,23 @@ void ArCamera_getProjectionMatrix(const ArSession *session,
15601602
float *dest_col_major_4x4);
15611603

15621604
/// Retrieves the unrotated and uncropped intrinsics for the image (CPU) stream.
1563-
/// @param camera The intrinsics may change per frame, so this should be called
1605+
/// The intrinsics may change per frame, so this should be called
15641606
/// on each frame to get the intrinsics for the current frame.
1607+
///
1608+
/// @param[in] session The ARCore session
1609+
/// @param[in] camera The session's camera.
1610+
/// @param[inout] out_camera_intrinsics The camera_intrinsics data.
15651611
void ArCamera_getImageIntrinsics(const ArSession *session,
15661612
const ArCamera *camera,
15671613
ArCameraIntrinsics *out_camera_intrinsics);
15681614

15691615
/// Retrieves the unrotated and uncropped intrinsics for the texture (GPU)
1570-
/// stream.
1571-
/// @param camera The intrinsics may change per frame, so this should be called
1616+
/// stream. The intrinsics may change per frame, so this should be called
15721617
/// on each frame to get the intrinsics for the current frame.
1618+
///
1619+
/// @param[in] session The ARCore session
1620+
/// @param[in] camera The session's camera.
1621+
/// @param[inout] out_camera_intrinsics The camera_intrinsics data.
15731622
void ArCamera_getTextureIntrinsics(const ArSession *session,
15741623
const ArCamera *camera,
15751624
ArCameraIntrinsics *out_camera_intrinsics);
@@ -1587,6 +1636,9 @@ void ArCamera_release(ArCamera *camera);
15871636
/// @{
15881637

15891638
/// Allocates a camera intrinstics object.
1639+
///
1640+
/// @param[in] session The ARCore session
1641+
/// @param[inout] out_camera_intrinsics The camera_intrinsics data.
15901642
void ArCameraIntrinsics_create(const ArSession *session,
15911643
ArCameraIntrinsics **out_camera_intrinsics);
15921644

@@ -1647,10 +1699,18 @@ void ArFrame_getTimestamp(const ArSession *session,
16471699
int64_t *out_timestamp_ns);
16481700

16491701
/// Sets @c out_pose to the pose of the <a
1650-
/// href="https://developer.android.com/guide/topics/sensors/sensors_overview.html#sensors-coords"
1651-
/// >Android Sensor Coordinate System</a> in the world coordinate space at the
1652-
/// time of capture of the current camera texture. The orientation follows the
1653-
/// device's "native" orientation (it is not affected by display orientation).
1702+
/// href="https://developer.android.com/guide/topics/sensors/sensors_overview#sensors-coords">Android
1703+
/// Sensor Coordinate System</a> in the world coordinate space for this frame.
1704+
/// The orientation follows the device's "native" orientation (it is not
1705+
/// affected by display rotation) with all axes corresponding to those of the
1706+
/// Android sensor coordinates.
1707+
///
1708+
/// See Also:
1709+
///
1710+
/// * ArCamera_getDisplayOrientedPose() for the pose of the virtual camera.
1711+
/// * ArCamera_getPose() for the pose of the physical camera.
1712+
/// * ArFrame_getTimestamp() for the system time that this pose was estimated
1713+
/// for.
16541714
///
16551715
/// Note: This pose is only useful when ArCamera_getTrackingState() returns
16561716
/// #AR_TRACKING_STATE_TRACKING and otherwise should not be used.
@@ -2036,13 +2096,12 @@ void ArAnchor_getTrackingState(const ArSession *session,
20362096
ArTrackingState *out_tracking_state);
20372097

20382098
/// Tells ARCore to stop tracking and forget this anchor. This call does not
2039-
/// release the reference to the anchor - that must be done separately using
2099+
/// release any references to the anchor - that must be done separately using
20402100
/// ArAnchor_release().
20412101
void ArAnchor_detach(ArSession *session, ArAnchor *anchor);
20422102

2043-
/// Releases a reference to an anchor. This does not mean that the anchor will
2044-
/// stop tracking, as it will be obtainable from e.g. ArSession_getAllAnchors()
2045-
/// if any other references exist.
2103+
/// Releases a reference to an anchor. To stop tracking for this anchor, call
2104+
/// ArAnchor_detach() first.
20462105
///
20472106
/// This method may safely be called with @c nullptr - it will do nothing.
20482107
void ArAnchor_release(ArAnchor *anchor);

samples/README.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

samples/augmented_image_c/app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ android {
2929
}
3030
}
3131
ndk {
32-
abiFilters "arm64-v8a", "x86"
32+
abiFilters "arm64-v8a", "armeabi-v7a", "x86"
3333
}
3434
}
3535
compileOptions {
@@ -51,8 +51,8 @@ android {
5151

5252
dependencies {
5353
// ARCore library
54-
implementation 'com.google.ar:core:1.5.0'
55-
natives 'com.google.ar:core:1.5.0'
54+
implementation 'com.google.ar:core:1.6.0'
55+
natives 'com.google.ar:core:1.6.0'
5656

5757
implementation 'com.android.support:appcompat-v7:27.1.1'
5858
implementation 'com.android.support:design:27.1.1'

samples/augmented_image_c/app/src/main/java/com/google/ar/core/examples/c/augmentedimage/AugmentedImageActivity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ protected void onCreate(Bundle savedInstanceState) {
5959
surfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0); // Alpha used for plane blending.
6060
surfaceView.setRenderer(this);
6161
surfaceView.setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
62+
surfaceView.setWillNotDraw(false);
6263

6364
JniInterface.assetManager = getAssets();
6465
nativeApplication = JniInterface.createNativeApplication(getAssets());
1.72 KB
Binary file not shown.

samples/augmented_image_java/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ android {
2525

2626
dependencies {
2727
// ARCore library
28-
implementation 'com.google.ar:core:1.5.0'
28+
implementation 'com.google.ar:core:1.6.0'
2929

3030
// Obj - a simple Wavefront OBJ file loader
3131
// https://github.com/javagl/Obj

samples/augmented_image_java/app/src/main/java/com/google/ar/core/examples/java/augmentedimage/AugmentedImageActivity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ protected void onCreate(Bundle savedInstanceState) {
9999
surfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0); // Alpha used for plane blending.
100100
surfaceView.setRenderer(this);
101101
surfaceView.setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
102+
surfaceView.setWillNotDraw(false);
102103

103104
fitToScanView = findViewById(R.id.image_view_fit_to_scan);
104105
glideRequestManager = Glide.with(this);

0 commit comments

Comments
 (0)