Skip to content

Commit

Permalink
ARCore Android SDK v1.24.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bsanjin committed May 18, 2021
1 parent c684bbd commit 2b18171
Show file tree
Hide file tree
Showing 136 changed files with 53,643 additions and 155 deletions.
659 changes: 536 additions & 123 deletions libraries/include/arcore_c_api.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion samples/augmented_faces_java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ android {

dependencies {
// ARCore (Google Play Services for AR) library.
implementation 'com.google.ar:core:1.23.0'
implementation 'com.google.ar:core:1.24.0'

// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
Expand Down
4 changes: 2 additions & 2 deletions samples/augmented_image_c/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ android {

dependencies {
// ARCore (Google Play Services for AR) library.
implementation 'com.google.ar:core:1.23.0'
natives 'com.google.ar:core:1.23.0'
implementation 'com.google.ar:core:1.24.0'
natives 'com.google.ar:core:1.24.0'

implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
Expand Down
2 changes: 1 addition & 1 deletion samples/augmented_image_java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ android {

dependencies {
// ARCore (Google Play Services for AR) library.
implementation 'com.google.ar:core:1.23.0'
implementation 'com.google.ar:core:1.24.0'

// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
Expand Down
2 changes: 1 addition & 1 deletion samples/cloud_anchor_java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ android {

dependencies {
// ARCore (Google Play Services for AR) library.
implementation 'com.google.ar:core:1.23.0'
implementation 'com.google.ar:core:1.24.0'

// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
Expand Down
4 changes: 2 additions & 2 deletions samples/computervision_c/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ android {

dependencies {
// ARCore (Google Play Services for AR) library.
implementation 'com.google.ar:core:1.23.0'
natives 'com.google.ar:core:1.23.0'
implementation 'com.google.ar:core:1.24.0'
natives 'com.google.ar:core:1.24.0'

implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
Expand Down
2 changes: 1 addition & 1 deletion samples/computervision_java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ android {

dependencies {
// ARCore (Google Play Services for AR) library.
implementation 'com.google.ar:core:1.23.0'
implementation 'com.google.ar:core:1.24.0'

// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
Expand Down
4 changes: 2 additions & 2 deletions samples/hello_ar_c/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ android {

dependencies {
// ARCore (Google Play Services for AR) library.
implementation 'com.google.ar:core:1.23.0'
natives 'com.google.ar:core:1.23.0'
implementation 'com.google.ar:core:1.24.0'
natives 'com.google.ar:core:1.24.0'

implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
Expand Down
20 changes: 13 additions & 7 deletions samples/hello_ar_c/app/src/main/cpp/hello_ar_application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -248,20 +248,17 @@ void HelloArApplication::OnDrawFrame(bool depthColorVisualizationEnabled,
ArPlane_acquireSubsumedBy(ar_session_, ar_plane, &subsume_plane);
if (subsume_plane != nullptr) {
ArTrackable_release(ArAsTrackable(subsume_plane));
ArTrackable_release(ar_trackable);
continue;
}

if (ArTrackingState::AR_TRACKING_STATE_TRACKING != out_tracking_state) {
ArTrackable_release(ar_trackable);
continue;
}

ArTrackingState plane_tracking_state;
ArTrackable_getTrackingState(ar_session_, ArAsTrackable(ar_plane),
&plane_tracking_state);
if (plane_tracking_state == AR_TRACKING_STATE_TRACKING) {
plane_renderer_.Draw(projection_mat, view_mat, *ar_session_, *ar_plane);
ArTrackable_release(ar_trackable);
}
plane_renderer_.Draw(projection_mat, view_mat, *ar_session_, *ar_plane);
ArTrackable_release(ar_trackable);
}

ArTrackableList_destroy(plane_list);
Expand Down Expand Up @@ -409,6 +406,10 @@ void HelloArApplication::OnTouched(float x, float y) {
}
} else if (AR_TRACKABLE_INSTANT_PLACEMENT_POINT == ar_trackable_type) {
ar_hit_result = ar_hit;
} else if (AR_TRACKABLE_DEPTH_POINT == ar_trackable_type) {
// ArDepthPoints are only returned if ArConfig_setDepthMode() is called
// with AR_DEPTH_MODE_AUTOMATIC.
ar_hit_result = ar_hit;
}
}

Expand Down Expand Up @@ -474,6 +475,11 @@ void HelloArApplication::UpdateAnchorColor(ColoredAnchor* colored_anchor) {
return;
}

if (ar_trackable_type == AR_TRACKABLE_DEPTH_POINT) {
SetColor(199.0f, 8.0f, 65.0f, 255.0f, color);
return;
}

if (ar_trackable_type == AR_TRACKABLE_INSTANT_PLACEMENT_POINT) {
ArInstantPlacementPoint* ar_instant_placement_point =
ArAsInstantPlacementPoint(ar_trackable);
Expand Down
2 changes: 1 addition & 1 deletion samples/hello_ar_java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ android {

dependencies {
// ARCore (Google Play Services for AR) library.
implementation 'com.google.ar:core:1.23.0'
implementation 'com.google.ar:core:1.24.0'

// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import com.google.ar.core.Camera;
import com.google.ar.core.Config;
import com.google.ar.core.Config.InstantPlacementMode;
import com.google.ar.core.DepthPoint;
import com.google.ar.core.Frame;
import com.google.ar.core.HitResult;
import com.google.ar.core.InstantPlacementPoint;
Expand Down Expand Up @@ -606,13 +607,15 @@ private void handleTap(Frame frame, Camera camera) {
// If any plane, Oriented Point, or Instant Placement Point was hit, create an anchor.
Trackable trackable = hit.getTrackable();
// If a plane was hit, check that it was hit inside the plane polygon.
// DepthPoints are only returned if Config.DepthMode is set to AUTOMATIC.
if ((trackable instanceof Plane
&& ((Plane) trackable).isPoseInPolygon(hit.getHitPose())
&& (PlaneRenderer.calculateDistanceToPlane(hit.getHitPose(), camera.getPose()) > 0))
|| (trackable instanceof Point
&& ((Point) trackable).getOrientationMode()
== OrientationMode.ESTIMATED_SURFACE_NORMAL)
|| (trackable instanceof InstantPlacementPoint)) {
|| (trackable instanceof InstantPlacementPoint)
|| (trackable instanceof DepthPoint)) {
// Cap the number of objects created. This avoids overloading both the
// rendering system and ARCore.
if (anchors.size() >= 20) {
Expand Down
2 changes: 1 addition & 1 deletion samples/persistent_cloud_anchor_java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ repositories {

dependencies {
// ARCore (Google Play Services for AR) library.
implementation 'com.google.ar:core:1.23.0'
implementation 'com.google.ar:core:1.24.0'

// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,5 @@
</activity>
<!-- Indicates whether "Google Play Services for AR" (ARCore) is "required" or "optional". -->
<meta-data android:name="com.google.ar.core" android:value="required" />
<meta-data android:name="com.google.ar.core.session_settings" android:value="cloud_anchor_non_time_based,true"/>
</application>
</manifest>
16 changes: 16 additions & 0 deletions samples/raw_depth_java/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Android Studio configuration.
*.iml
.idea/

# Gradle configuration.
.gradle/
build/

# User configuration.
local.properties

# OS configurations.
.DS_Store

# Android NDK cmake output.
.cxx/
2 changes: 2 additions & 0 deletions samples/raw_depth_java/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build
google-services.json
38 changes: 38 additions & 0 deletions samples/raw_depth_java/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 29
defaultConfig {
applicationId "com.google.ar.core.examples.java.rawdepth"

// Camera2 API requires minSdkVersion >= 21.
// "AR Optional" apps must declare minSdkVersion >= 14.
// "AR Required" apps must declare minSdkVersion >= 24.
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName '1.0'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
// ARCore (Google Play Services for AR) library.
implementation 'com.google.ar:core:1.24.0'

// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
implementation 'de.javagl:obj:0.2.1'

implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
}
17 changes: 17 additions & 0 deletions samples/raw_depth_java/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /opt/android-sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
54 changes: 54 additions & 0 deletions samples/raw_depth_java/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2021 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.google.ar.core.examples.java.rawdepth">

<uses-permission android:name="android.permission.CAMERA"/>
<!-- Limits app visibility in the Google Play Store to devices that:
- Support ARCore (`android.hardware.camera.ar`)
- Support the Raw Depth API (`com.google.ar.core.depth`)
The current list of supported devices is available from:
- https://developers.google.com/ar/discover/supported-devices
-->
<uses-feature android:name="android.hardware.camera.ar" android:required="true"/>
<uses-feature android:name="com.google.ar.core.depth" android:required="true"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true" />

<application
android:allowBackup="false"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="false"
tools:ignore="GoogleAppIndexingWarning">

<activity
android:name=".RawDepthActivity"
android:configChanges="orientation|screenSize"
android:exported="true"
android:theme="@style/Theme.AppCompat.NoActionBar"
android:screenOrientation="locked">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Indicates whether "Google Play Services for AR" (ARCore) is "required" or "optional". -->
<meta-data android:name="com.google.ar.core" android:value="required" />
</application>
</manifest>
Loading

0 comments on commit 2b18171

Please sign in to comment.