diff --git a/AreaLearningJava/app/build.gradle b/AreaLearningJava/app/build.gradle index ec23419f..d31a3eb1 100644 --- a/AreaLearningJava/app/build.gradle +++ b/AreaLearningJava/app/build.gradle @@ -22,11 +22,6 @@ android { } } -if (project.hasProperty("Tango.signing") - && new File(project.property("Tango.signing") + "/tango.gradle").exists()) { - apply from: project.property("Tango.signing") + "/tango.gradle"; -} - def external_lib_prefix = null if (project.hasProperty("Tango.catkin_devel_prefix")) { external_lib_prefix = project.property("Tango.catkin_devel_prefix") @@ -35,14 +30,9 @@ if (project.hasProperty("Tango.catkin_devel_prefix")) { external_lib_prefix = "../../TangoReleaseLibs" } + dependencies { compile fileTree(dir: external_lib_prefix + '/jar', include: ['**/*.jar']) - compile(name: 'TangoUtils', ext: 'aar') compile 'org.rajawali3d:rajawali:1.0.294-SNAPSHOT@aar' -} - -repositories{ - flatDir{ - dirs external_lib_prefix + '/aar' - } + compile project(':TangoUtils') } diff --git a/AreaLearningJava/app/src/main/java/com/projecttango/experiments/javaarealearning/ALStartActivity.java b/AreaLearningJava/app/src/main/java/com/projecttango/experiments/javaarealearning/ALStartActivity.java index 28d4227f..35ea948d 100644 --- a/AreaLearningJava/app/src/main/java/com/projecttango/experiments/javaarealearning/ALStartActivity.java +++ b/AreaLearningJava/app/src/main/java/com/projecttango/experiments/javaarealearning/ALStartActivity.java @@ -54,10 +54,7 @@ protected void onCreate(Bundle savedInstanceState) { mLoadADFToggleButton.setOnClickListener(this); mStartButton.setOnClickListener(this); startActivityForResult( - Tango.getRequestPermissionIntent(Tango.PERMISSIONTYPE_MOTION_TRACKING), 0); - startActivityForResult( - Tango.getRequestPermissionIntent(Tango.PERMISSIONTYPE_ADF_LOAD_SAVE), 1); - + Tango.getRequestPermissionIntent(Tango.PERMISSIONTYPE_ADF_LOAD_SAVE), 0); } @Override @@ -96,12 +93,6 @@ private void startADFListView() { protected void onActivityResult(int requestCode, int resultCode, Intent data) { // Check which request we're responding to if (requestCode == 0) { - // Make sure the request was successful - if (resultCode == RESULT_CANCELED) { - Toast.makeText(this, R.string.motiontracking_permission, Toast.LENGTH_SHORT).show(); - finish(); - } - } else if (requestCode == 1) { // Make sure the request was successful if (resultCode == RESULT_CANCELED) { Toast.makeText(this, R.string.arealearning_permission, Toast.LENGTH_SHORT).show(); diff --git a/AreaLearningJava/build.gradle b/AreaLearningJava/build.gradle index 217854c1..ca6de6f5 100644 --- a/AreaLearningJava/build.gradle +++ b/AreaLearningJava/build.gradle @@ -1,5 +1,4 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. - buildscript { repositories { jcenter() diff --git a/AreaLearningJava/gradle/wrapper/gradle-wrapper.properties b/AreaLearningJava/gradle/wrapper/gradle-wrapper.properties index 0c71e760..5f98ccc4 100644 --- a/AreaLearningJava/gradle/wrapper/gradle-wrapper.properties +++ b/AreaLearningJava/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Apr 10 15:27:10 PDT 2013 +#Mon Oct 26 08:02:00 ART 2015 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip diff --git a/AreaLearningJava/settings.gradle b/AreaLearningJava/settings.gradle index 9d495b34..87acb705 100644 --- a/AreaLearningJava/settings.gradle +++ b/AreaLearningJava/settings.gradle @@ -1 +1,3 @@ -include ':app' \ No newline at end of file +include ':app' +include ':TangoUtils' +project(':TangoUtils').projectDir = new File('../TangoUtils/app') diff --git a/AugmentedRealitySample/app/build.gradle b/AugmentedRealitySample/app/build.gradle index b293a993..4eb890cc 100644 --- a/AugmentedRealitySample/app/build.gradle +++ b/AugmentedRealitySample/app/build.gradle @@ -23,10 +23,6 @@ android { } } -if (project.hasProperty("Tango.signing") - && new File(project.property("Tango.signing") + "/tango.gradle").exists()) { - apply from: project.property("Tango.signing") + "/tango.gradle"; -} def external_lib_prefix = null if (project.hasProperty("Tango.catkin_devel_prefix")) { @@ -36,14 +32,14 @@ if (project.hasProperty("Tango.catkin_devel_prefix")) { external_lib_prefix = "../../TangoReleaseLibs" } -dependencies { - compile (name: 'TangoUtils', ext: 'aar') - compile (name: 'tango_support_java_lib', ext: 'aar') - compile 'org.rajawali3d:rajawali:1.0.294-SNAPSHOT@aar' -} - -repositories{ - flatDir{ +repositories { + flatDir { dirs external_lib_prefix + '/aar' } } + +dependencies { + compile 'org.rajawali3d:rajawali:1.0.294-SNAPSHOT@aar' + compile (name: 'tango_support_java_lib', ext: 'aar') + compile project(':TangoUtils') +} diff --git a/AugmentedRealitySample/app/src/main/java/com/projecttango/experiments/augmentedrealitysample/AugmentedRealityActivity.java b/AugmentedRealitySample/app/src/main/java/com/projecttango/experiments/augmentedrealitysample/AugmentedRealityActivity.java index 38cbacf2..d2f00123 100644 --- a/AugmentedRealitySample/app/src/main/java/com/projecttango/experiments/augmentedrealitysample/AugmentedRealityActivity.java +++ b/AugmentedRealitySample/app/src/main/java/com/projecttango/experiments/augmentedrealitysample/AugmentedRealityActivity.java @@ -15,8 +15,6 @@ */ package com.projecttango.experiments.augmentedrealitysample; -import java.util.ArrayList; - import android.app.Activity; import android.content.Intent; import android.os.Bundle; @@ -31,11 +29,15 @@ import com.google.atap.tangoservice.TangoConfig; import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoEvent; +import com.google.atap.tangoservice.TangoException; +import com.google.atap.tangoservice.TangoOutOfDateException; import com.google.atap.tangoservice.TangoPoseData; import com.google.atap.tangoservice.TangoXyzIjData; import com.projecttango.rajawali.ar.TangoRajawaliView; import com.projecttango.tangosupport.TangoSupport; +import java.util.ArrayList; + /** * An example showing how to build a very simple augmented reality application in Java. * It uses Rajawali to do the rendering through the utility classes @@ -44,7 +46,7 @@ * user clicks on the camera display, plane detection will be done on the surface closest to the * click location and a 3D object will be placed in the scene anchored in that location. *

- * TangoRajawaliView is used in the same way as the TangoCamaraPreview: we first need initialize the + * TangoRajawaliView is used in the same way as the TangoCameraPreview: We first need initialize the * TangoRajawaliView class with the activity's context and connect to the camera we want by using * connectToTangoCamera method. Once the connection is established we need to update * the view's texture by using the onFrameAvailable callbacks. @@ -60,13 +62,12 @@ * the RGB camera. */ public class AugmentedRealityActivity extends Activity implements View.OnTouchListener { - private static final String TAG = "AugmentedRealityActiv"; + private static final String TAG = AugmentedRealityActivity.class.getSimpleName(); private TangoRajawaliView mGLView; private AugmentedRealityRenderer mRenderer; private PointCloudManager mPointCloudManager; private Tango mTango; private boolean mIsConnected; - private boolean mIsPermissionGranted; @Override protected void onCreate(Bundle savedInstanceState) { @@ -76,87 +77,66 @@ protected void onCreate(Bundle savedInstanceState) { mGLView.setSurfaceRenderer(mRenderer); mGLView.setOnTouchListener(this); mTango = new Tango(this); - startActivityForResult( - Tango.getRequestPermissionIntent(Tango.PERMISSIONTYPE_MOTION_TRACKING), - Tango.TANGO_INTENT_ACTIVITYCODE); setContentView(mGLView); } - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - // Check which request we're responding to - if (requestCode == Tango.TANGO_INTENT_ACTIVITYCODE) { - // Make sure the request was successful - if (resultCode == RESULT_CANCELED) { - Toast.makeText(this, "Motion Tracking Permissions Required!", - Toast.LENGTH_SHORT).show(); - finish(); - } else { - startAugmentedreality(); - mIsPermissionGranted = true; - } - } - } - // Augmented reality view and renderer private void startAugmentedreality() { if (!mIsConnected) { - mIsConnected = true; - // Connect to color camera - mGLView.connectToTangoCamera(mTango, TangoCameraIntrinsics.TANGO_CAMERA_COLOR); - - // Use default configuration for Tango Service, plus low latency IMU integration. - TangoConfig config = mTango.getConfig(TangoConfig.CONFIG_TYPE_DEFAULT); - // NOTE: low latency integration is necessary to achieve a precise alignment of - // virtual objects with the RBG image and produce a good AR effect. - config.putBoolean(TangoConfig.KEY_BOOLEAN_LOWLATENCYIMUINTEGRATION, true); - config.putBoolean(TangoConfig.KEY_BOOLEAN_DEPTH, true); - mTango.connect(config); - - // No need to add any coordinate frame pairs since we are not using - // pose data. So just initialize. - ArrayList framePairs = new ArrayList(); - mTango.connectListener(framePairs, new OnTangoUpdateListener() { - @Override - public void onPoseAvailable(TangoPoseData pose) { - // We are not using OnPoseAvailable for this app - } - - @Override - public void onFrameAvailable(int cameraId) { - // Check if the frame available is for the camera we want and - // update its frame on the view. - if (cameraId == TangoCameraIntrinsics.TANGO_CAMERA_COLOR) { - mGLView.onFrameAvailable(); + try { + mIsConnected = true; + // Connect to color camera. + mGLView.connectToTangoCamera(mTango, TangoCameraIntrinsics.TANGO_CAMERA_COLOR); + + // Use default configuration for Tango Service, plus low latency IMU integration. + TangoConfig config = mTango.getConfig(TangoConfig.CONFIG_TYPE_DEFAULT); + // NOTE: Low latency integration is necessary to achieve a precise alignment of + // virtual objects with the RBG image and produce a good AR effect. + config.putBoolean(TangoConfig.KEY_BOOLEAN_LOWLATENCYIMUINTEGRATION, true); + config.putBoolean(TangoConfig.KEY_BOOLEAN_DEPTH, true); + mTango.connect(config); + + // No need to add any coordinate frame pairs since we are not using + // pose data. So just initialize. + ArrayList framePairs = new ArrayList(); + mTango.connectListener(framePairs, new OnTangoUpdateListener() { + @Override + public void onPoseAvailable(TangoPoseData pose) { + // We are not using OnPoseAvailable for this app. + } + + @Override + public void onFrameAvailable(int cameraId) { + // Check if the frame available is for the camera we want and + // update its frame on the view. + if (cameraId == TangoCameraIntrinsics.TANGO_CAMERA_COLOR) { + mGLView.onFrameAvailable(); + } } - } - - @Override - public void onXyzIjAvailable(TangoXyzIjData xyzIj) { - // Get the device pose at the time the point cloud was acquired - TangoCoordinateFramePair framePair = new TangoCoordinateFramePair( - TangoPoseData.COORDINATE_FRAME_START_OF_SERVICE, - TangoPoseData.COORDINATE_FRAME_DEVICE); - TangoPoseData cloudPose = mTango.getPoseAtTime(xyzIj.timestamp, framePair); - - // Save the cloud and point data for later use - mPointCloudManager.updateXyzIjData(xyzIj, cloudPose); - } - - @Override - public void onTangoEvent(TangoEvent event) { - // We are not using OnPoseAvailable for this app - } - }); - - // Get extrinsics from device for use in transforms - // This needs to be done after connecting Tango and listeners - setupExtrinsics(); - - // Set-up point cloud plane fitting library helper class - mPointCloudManager = new PointCloudManager(mTango.getCameraIntrinsics( - TangoCameraIntrinsics.TANGO_CAMERA_COLOR)); + @Override + public void onXyzIjAvailable(TangoXyzIjData xyzIj) { + // Save the cloud and point data for later use. + mPointCloudManager.updateXyzIjData(xyzIj); + } + + @Override + public void onTangoEvent(TangoEvent event) { + // We are not using OnPoseAvailable for this app. + } + }); + + // Get extrinsics from device for use in transforms. This needs to be done after + // connecting Tango and listeners. + setupExtrinsics(); + + // Setup point cloud plane fitting library helper class. + mPointCloudManager = new PointCloudManager(mTango.getCameraIntrinsics( + TangoCameraIntrinsics.TANGO_CAMERA_COLOR)); + } catch (TangoOutOfDateException e) { + Toast.makeText(getApplicationContext(), R.string.TangoOutOfDateException, + Toast.LENGTH_SHORT).show(); + } } } @@ -165,17 +145,17 @@ public void onTangoEvent(TangoEvent event) { * to be used later for transformations between frames. */ private void setupExtrinsics() { - // Create Camera to IMU Transform + // Create camera to IMU transform. TangoCoordinateFramePair framePair = new TangoCoordinateFramePair(); framePair.baseFrame = TangoPoseData.COORDINATE_FRAME_IMU; framePair.targetFrame = TangoPoseData.COORDINATE_FRAME_CAMERA_COLOR; TangoPoseData imuTrgbPose = mTango.getPoseAtTime(0.0, framePair); - // Create Device to IMU Transform + // Create device to IMU transform. framePair.targetFrame = TangoPoseData.COORDINATE_FRAME_DEVICE; TangoPoseData imuTdevicePose = mTango.getPoseAtTime(0.0, framePair); - // Create Depth camera to IMU Transform + // Create depth camera to IMU transform. framePair.targetFrame = TangoPoseData.COORDINATE_FRAME_CAMERA_DEPTH; TangoPoseData imuTdepthPose = mTango.getPoseAtTime(0.0, framePair); @@ -196,7 +176,7 @@ protected void onPause() { @Override protected void onResume() { super.onResume(); - if (!mIsConnected && mIsPermissionGranted) { + if (!mIsConnected) { startAugmentedreality(); } } @@ -204,14 +184,20 @@ protected void onResume() { @Override public boolean onTouch(View view, MotionEvent motionEvent) { if (motionEvent.getAction() == MotionEvent.ACTION_UP) { - // Calculate click location in u,v (0;1) coordinates + // Calculate click location in u,v (0;1) coordinates. float u = motionEvent.getX() / view.getWidth(); float v = motionEvent.getY() / view.getHeight(); try { doFitPlane(u, v); - } catch (Throwable t) { - Log.e(TAG, "Exception measuring nomral", t); + } catch (TangoException t) { + Toast.makeText(getApplicationContext(), R.string.failed_measurement, + Toast.LENGTH_SHORT).show(); + Log.e(TAG, getString(R.string.failed_measurement), t); + } catch (SecurityException t) { + Toast.makeText(getApplicationContext(), R.string.failed_permissions, + Toast.LENGTH_SHORT).show(); + Log.e(TAG, getString(R.string.failed_permissions), t); } } return true; @@ -223,15 +209,24 @@ public boolean onTouch(View view, MotionEvent motionEvent) { * renderer to show a 3D object in that location. */ private void doFitPlane(float u, float v) { - // Get the current device pose + // NOTE: We request measurement at the latest available time. If we wanted to be even more + // precise, we should use the timestamp of the RGB image rendered at the time the user + // clicked the screen + double measurementTimestamp = 0.0; + + // Perform plane fitting with the latest available point cloud data. + PointCloudManager.FitPlaneResult planeModelAndTimestamp = + mPointCloudManager.fitPlane(u, v, measurementTimestamp); + + // Get the device pose at the time the plane data was acquired. TangoCoordinateFramePair framePair = new TangoCoordinateFramePair( TangoPoseData.COORDINATE_FRAME_START_OF_SERVICE, TangoPoseData.COORDINATE_FRAME_DEVICE); - TangoPoseData devicePose = mTango.getPoseAtTime(0.0, framePair); + TangoPoseData devicePose = + mTango.getPoseAtTime(planeModelAndTimestamp.cloudTimestamp, framePair); - // Perform plane fitting with the latest available point cloud data - TangoSupport.IntersectionPointPlaneModelPair planeModel = - mPointCloudManager.fitPlane(u, v, devicePose, mRenderer.getPoseCalculator()); - mRenderer.updateObjectPose(planeModel.intersectionPoint, planeModel.planeModel, devicePose); + // Update the AR object location + mRenderer.updateObjectPose(planeModelAndTimestamp.planeModelPair.intersectionPoint, + planeModelAndTimestamp.planeModelPair.planeModel, devicePose); } } diff --git a/AugmentedRealitySample/app/src/main/java/com/projecttango/experiments/augmentedrealitysample/AugmentedRealityRenderer.java b/AugmentedRealitySample/app/src/main/java/com/projecttango/experiments/augmentedrealitysample/AugmentedRealityRenderer.java index e92371d6..1679b94a 100644 --- a/AugmentedRealitySample/app/src/main/java/com/projecttango/experiments/augmentedrealitysample/AugmentedRealityRenderer.java +++ b/AugmentedRealitySample/app/src/main/java/com/projecttango/experiments/augmentedrealitysample/AugmentedRealityRenderer.java @@ -20,7 +20,6 @@ import com.google.atap.tangoservice.TangoPoseData; import com.projecttango.rajawali.Pose; -import com.projecttango.rajawali.ScenePoseCalcuator; import com.projecttango.rajawali.ar.TangoRajawaliRenderer; import org.rajawali3d.Object3D; @@ -43,7 +42,6 @@ * - It doesn't do anything with the camera, since that is handled automatically by Tango */ public class AugmentedRealityRenderer extends TangoRajawaliRenderer { - private static final float CUBE_SIDE_LENGTH = 0.5f; private Pose mPlanePose; @@ -57,17 +55,17 @@ public AugmentedRealityRenderer(Context context) { @Override protected void initScene() { - // Remember to call super.initScene() to allow TangoRajawaliArRenderer to set-up + // Remember to call super.initScene() to allow TangoRajawaliArRenderer to be set-up. super.initScene(); - // Add a directional light in an arbitrary direction + // Add a directional light in an arbitrary direction. DirectionalLight light = new DirectionalLight(1, 0.2, -1); light.setColor(1, 1, 1); light.setPower(0.8f); light.setPosition(3, 2, 4); getCurrentScene().addLight(light); - // Set-up a material: green with application of the light and instructions + // Set-up a material: green with application of the light and instructions. Material material = new Material(); material.setColor(0xff009900); try { @@ -80,7 +78,7 @@ protected void initScene() { material.enableLighting(true); material.setDiffuseMethod(new DiffuseMethod.Lambert()); - // Build a Cube and place it initially in the origin + // Build a Cube and place it initially in the origin. mObject = new Cube(CUBE_SIDE_LENGTH); mObject.setMaterial(material); mObject.setPosition(0, 0, -3); @@ -89,17 +87,17 @@ protected void initScene() { } @Override - protected void onRender(long ellapsedRealtime, double deltaTime) { - super.onRender(ellapsedRealtime, deltaTime); + protected void onRender(long elapsedRealTime, double deltaTime) { + super.onRender(elapsedRealTime, deltaTime); synchronized (this) { - if (mPlanePoseUpdated == true) { + if (mPlanePoseUpdated) { mPlanePoseUpdated = false; - // Place the 3D object in the location of the detected plane + // Place the 3D object in the location of the detected plane. mObject.setPosition(mPlanePose.getPosition()); mObject.setOrientation(mPlanePose.getOrientation()); // Move it forward by half of the size of the cube to make it flush with the plane - // surface + // surface. mObject.moveForward(CUBE_SIDE_LENGTH / 2.0f); } } @@ -107,7 +105,7 @@ protected void onRender(long ellapsedRealtime, double deltaTime) { /** * Update the 3D object based on the provided measurement point, normal (in depth frame) and - * device pose at the time of measurement. + * device pose at the time the point and normal were acquired. */ public synchronized void updateObjectPose(double[] point, double[] normal, TangoPoseData devicePose) { @@ -115,15 +113,6 @@ public synchronized void updateObjectPose(double[] point, double[] normal, mPlanePoseUpdated = true; } - /** - * Provide access to scene calculator helper class to perform necessary transformations. - * NOTE: This won't be necessary once transformation functions are available through the - * support library - */ - public ScenePoseCalcuator getPoseCalculator() { - return mScenePoseCalcuator; - } - @Override public void onOffsetsChanged(float xOffset, float yOffset, float xOffsetStep, float yOffsetStep, int xPixelOffset, int yPixelOffset) { diff --git a/AugmentedRealitySample/app/src/main/java/com/projecttango/experiments/augmentedrealitysample/PointCloudManager.java b/AugmentedRealitySample/app/src/main/java/com/projecttango/experiments/augmentedrealitysample/PointCloudManager.java index 69048128..5f793d90 100644 --- a/AugmentedRealitySample/app/src/main/java/com/projecttango/experiments/augmentedrealitysample/PointCloudManager.java +++ b/AugmentedRealitySample/app/src/main/java/com/projecttango/experiments/augmentedrealitysample/PointCloudManager.java @@ -18,7 +18,6 @@ import com.google.atap.tangoservice.TangoCameraIntrinsics; import com.google.atap.tangoservice.TangoPoseData; import com.google.atap.tangoservice.TangoXyzIjData; -import com.projecttango.rajawali.ScenePoseCalcuator; import com.projecttango.tangosupport.TangoSupport; import java.nio.ByteBuffer; @@ -35,7 +34,6 @@ public class PointCloudManager { private final TangoCameraIntrinsics mTangoCameraIntrinsics; private final TangoXyzIjData mXyzIjData; - private TangoPoseData mDevicePoseAtCloudTime; public PointCloudManager(TangoCameraIntrinsics intrinsics) { mXyzIjData = new TangoXyzIjData(); @@ -46,12 +44,8 @@ public PointCloudManager(TangoCameraIntrinsics intrinsics) { * Update the current cloud data with the provided xyzIjData from a Tango callback. * * @param from The point cloud data - * @param xyzIjPose The device pose with respect to start of service at the time - * the point cloud was acquired */ - public synchronized void updateXyzIjData(TangoXyzIjData from, TangoPoseData xyzIjPose) { - mDevicePoseAtCloudTime = xyzIjPose; - + public synchronized void updateXyzIjData(TangoXyzIjData from) { if (mXyzIjData.xyz == null || mXyzIjData.xyz.capacity() < from.xyzCount * 3) { mXyzIjData.xyz = ByteBuffer.allocateDirect(from.xyzCount * 3 * 4) .order(ByteOrder.nativeOrder()).asFloatBuffer(); @@ -74,21 +68,37 @@ public synchronized void updateXyzIjData(TangoXyzIjData from, TangoPoseData xyzI * * @param u u (horizontal) component of the click location * @param v v (vertical) component of the click location - * @param devicePoseAtClickTime Device pose at the time this operation is requested - * @param poseCalcuator ScenePoseCalculator helper instance to calculate transforms - * @return The point and plane model, in depth sensor frame + * @param timestampAtClickTime Timestamp at the time this operation is requested + * @return The point and plane model, in depth sensor frame at the time + * the point cloud data was acquired and the timestamp when the + * the point cloud data was acquired. */ - public synchronized TangoSupport.IntersectionPointPlaneModelPair fitPlane(float u, float v, - TangoPoseData devicePoseAtClickTime, ScenePoseCalcuator poseCalcuator) { + public synchronized FitPlaneResult fitPlane(float u, float v, + double timestampAtClickTime) { // We need to calculate the transform between the color camera at the time the user clicked // and the depth camera at the time the depth cloud was acquired. - // This operation is currently implemented in the provided ScenePoseCalculator helper - // class. In the future, the support library will provide a method for this calculation. TangoPoseData colorCameraTDepthCameraWithTime - = poseCalcuator.calculateColorCameraTDepthWithTime(devicePoseAtClickTime, mDevicePoseAtCloudTime); + = TangoSupport.calculateRelativePose(timestampAtClickTime, + TangoPoseData.COORDINATE_FRAME_CAMERA_COLOR, + mXyzIjData.timestamp, + TangoPoseData.COORDINATE_FRAME_CAMERA_DEPTH); + + return new FitPlaneResult(TangoSupport.fitPlaneModelNearClick(mXyzIjData, mTangoCameraIntrinsics, + colorCameraTDepthCameraWithTime, u, v), mXyzIjData.timestamp); + } - return TangoSupport.fitPlaneModelNearClick(mXyzIjData, mTangoCameraIntrinsics, - colorCameraTDepthCameraWithTime, u, v); + /** + * Internal class used to return the information about a plane fitting call. + */ + public class FitPlaneResult { + public final TangoSupport.IntersectionPointPlaneModelPair planeModelPair; + public final double cloudTimestamp; + + public FitPlaneResult(TangoSupport.IntersectionPointPlaneModelPair planeModelPair, + double cloudTimestamp) { + this.planeModelPair = planeModelPair; + this.cloudTimestamp = cloudTimestamp; + } } } diff --git a/AugmentedRealitySample/app/src/main/res/values/strings.xml b/AugmentedRealitySample/app/src/main/res/values/strings.xml index dd880179..1679b024 100644 --- a/AugmentedRealitySample/app/src/main/res/values/strings.xml +++ b/AugmentedRealitySample/app/src/main/res/values/strings.xml @@ -2,7 +2,8 @@ AugmentedRealitySample - Hello world! Settings - + "Tango service outdated!" + Failed to fit plane + Permissions required! diff --git a/AugmentedRealitySample/build.gradle b/AugmentedRealitySample/build.gradle index 217854c1..ead7bbfe 100644 --- a/AugmentedRealitySample/build.gradle +++ b/AugmentedRealitySample/build.gradle @@ -1,5 +1,4 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. - buildscript { repositories { jcenter() @@ -12,6 +11,7 @@ buildscript { } } + allprojects { repositories { mavenLocal() diff --git a/AugmentedRealitySample/gradle/wrapper/gradle-wrapper.properties b/AugmentedRealitySample/gradle/wrapper/gradle-wrapper.properties index 0c71e760..5f98ccc4 100644 --- a/AugmentedRealitySample/gradle/wrapper/gradle-wrapper.properties +++ b/AugmentedRealitySample/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Apr 10 15:27:10 PDT 2013 +#Mon Oct 26 08:02:00 ART 2015 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip diff --git a/AugmentedRealitySample/settings.gradle b/AugmentedRealitySample/settings.gradle index e7b4def4..87acb705 100644 --- a/AugmentedRealitySample/settings.gradle +++ b/AugmentedRealitySample/settings.gradle @@ -1 +1,3 @@ include ':app' +include ':TangoUtils' +project(':TangoUtils').projectDir = new File('../TangoUtils/app') diff --git a/MotionTrackingJava/app/build.gradle b/MotionTrackingJava/app/build.gradle index 3202a884..874f8e9e 100644 --- a/MotionTrackingJava/app/build.gradle +++ b/MotionTrackingJava/app/build.gradle @@ -17,17 +17,11 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } - lintOptions { abortOnError false } } -if (project.hasProperty("Tango.signing") - && new File(project.property("Tango.signing") + "/tango.gradle").exists()) { - apply from: project.property("Tango.signing") + "/tango.gradle"; -} - def external_lib_prefix = null if (project.hasProperty("Tango.catkin_devel_prefix")) { external_lib_prefix = project.property("Tango.catkin_devel_prefix") @@ -36,14 +30,11 @@ if (project.hasProperty("Tango.catkin_devel_prefix")) { external_lib_prefix = "../../TangoReleaseLibs" } + dependencies { compile fileTree(dir: external_lib_prefix + '/jar', include: ['**/*.jar']) - compile (name: 'TangoUtils', ext: 'aar') compile 'org.rajawali3d:rajawali:1.0.294-SNAPSHOT@aar' + compile project(':TangoUtils') } -repositories{ - flatDir{ - dirs external_lib_prefix + '/aar' - } -} + diff --git a/MotionTrackingJava/app/src/main/java/com/projecttango/experiments/javamotiontracking/StartActivity.java b/MotionTrackingJava/app/src/main/java/com/projecttango/experiments/javamotiontracking/StartActivity.java index 4afde5e6..057c61d2 100644 --- a/MotionTrackingJava/app/src/main/java/com/projecttango/experiments/javamotiontracking/StartActivity.java +++ b/MotionTrackingJava/app/src/main/java/com/projecttango/experiments/javamotiontracking/StartActivity.java @@ -40,9 +40,6 @@ public class StartActivity extends Activity implements View.OnClickListener { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - startActivityForResult( - Tango.getRequestPermissionIntent(Tango.PERMISSIONTYPE_MOTION_TRACKING), - Tango.TANGO_INTENT_ACTIVITYCODE); setContentView(R.layout.start); this.setTitle(R.string.app_name); mAutoResetButton = (ToggleButton) findViewById(R.id.autoresetbutton); @@ -69,16 +66,4 @@ private void startMotionTracking() { startmotiontracking.putExtra(KEY_MOTIONTRACKING_AUTORECOVER, mUseAutoReset); startActivity(startmotiontracking); } - - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - // Check which request we're responding to - if (requestCode == Tango.TANGO_INTENT_ACTIVITYCODE) { - // Make sure the request was successful - if (resultCode == RESULT_CANCELED) { - Toast.makeText(this, R.string.motiontrackingpermission, Toast.LENGTH_SHORT).show(); - finish(); - } - } - } } diff --git a/MotionTrackingJava/build.gradle b/MotionTrackingJava/build.gradle index 217854c1..f07bee07 100644 --- a/MotionTrackingJava/build.gradle +++ b/MotionTrackingJava/build.gradle @@ -1,6 +1,6 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. - buildscript { + repositories { jcenter() } diff --git a/MotionTrackingJava/gradle/wrapper/gradle-wrapper.properties b/MotionTrackingJava/gradle/wrapper/gradle-wrapper.properties index 0c71e760..5f98ccc4 100644 --- a/MotionTrackingJava/gradle/wrapper/gradle-wrapper.properties +++ b/MotionTrackingJava/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Apr 10 15:27:10 PDT 2013 +#Mon Oct 26 08:02:00 ART 2015 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip diff --git a/MotionTrackingJava/settings.gradle b/MotionTrackingJava/settings.gradle index e7b4def4..87acb705 100644 --- a/MotionTrackingJava/settings.gradle +++ b/MotionTrackingJava/settings.gradle @@ -1 +1,3 @@ include ':app' +include ':TangoUtils' +project(':TangoUtils').projectDir = new File('../TangoUtils/app') diff --git a/PointCloudJava/app/build.gradle b/PointCloudJava/app/build.gradle index 39b73431..1838cb22 100644 --- a/PointCloudJava/app/build.gradle +++ b/PointCloudJava/app/build.gradle @@ -23,11 +23,6 @@ android { } } -if (project.hasProperty("Tango.signing") - && new File(project.property("Tango.signing") + "/tango.gradle").exists()) { - apply from: project.property("Tango.signing") + "/tango.gradle"; -} - def external_lib_prefix = null if (project.hasProperty("Tango.catkin_devel_prefix")) { external_lib_prefix = project.property("Tango.catkin_devel_prefix") @@ -36,14 +31,15 @@ if (project.hasProperty("Tango.catkin_devel_prefix")) { external_lib_prefix = "../../TangoReleaseLibs" } -dependencies { - compile (name: 'TangoUtils', ext: 'aar') - compile (name: 'tango-ux-support-library', ext: 'aar') - compile 'org.rajawali3d:rajawali:1.0.294-SNAPSHOT@aar' -} repositories{ flatDir{ dirs external_lib_prefix + '/aar' } } + +dependencies { + compile (name: 'tango-ux-support-library', ext: 'aar') + compile 'org.rajawali3d:rajawali:1.0.294-SNAPSHOT@aar' + compile project(':TangoUtils') +} diff --git a/PointCloudJava/app/src/main/java/com/projecttango/experiments/javapointcloud/PointCloudActivity.java b/PointCloudJava/app/src/main/java/com/projecttango/experiments/javapointcloud/PointCloudActivity.java index bcb6a7f2..47480820 100644 --- a/PointCloudJava/app/src/main/java/com/projecttango/experiments/javapointcloud/PointCloudActivity.java +++ b/PointCloudJava/app/src/main/java/com/projecttango/experiments/javapointcloud/PointCloudActivity.java @@ -49,6 +49,7 @@ import org.rajawali3d.surface.RajawaliSurfaceView; +import java.lang.Override; import java.nio.FloatBuffer; import java.text.DecimalFormat; import java.util.ArrayList; @@ -136,46 +137,27 @@ protected void onResume() { super.onResume(); StartParams params = new StartParams(); mTangoUx.start(params); - if (!mIsTangoServiceConnected) { - startActivityForResult( - Tango.getRequestPermissionIntent(Tango.PERMISSIONTYPE_MOTION_TRACKING), - Tango.TANGO_INTENT_ACTIVITYCODE); + try { + setTangoListeners(); + } catch (TangoErrorException e) { + Toast.makeText(this, R.string.TangoError, Toast.LENGTH_SHORT).show(); + } catch (SecurityException e) { + Toast.makeText(getApplicationContext(), R.string.motiontrackingpermission, + Toast.LENGTH_SHORT).show(); } - Log.i(TAG, "onResumed"); - } - - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - // Check which request we're responding to - if (requestCode == Tango.TANGO_INTENT_ACTIVITYCODE) { - Log.i(TAG, "Triggered"); - // Make sure the request was successful - if (resultCode == RESULT_CANCELED) { - Toast.makeText(this, R.string.motiontrackingpermission, Toast.LENGTH_LONG).show(); - finish(); - return; - } - try { - setTangoListeners(); - } catch (TangoErrorException e) { - Toast.makeText(this, R.string.TangoError, Toast.LENGTH_SHORT).show(); - } catch (SecurityException e) { - Toast.makeText(getApplicationContext(), R.string.motiontrackingpermission, - Toast.LENGTH_SHORT).show(); - } - try { - mTango.connect(mConfig); - mIsTangoServiceConnected = true; - } catch (TangoOutOfDateException outDateEx) { - if (mTangoUx != null) { - mTangoUx.showTangoOutOfDate(); - } - } catch (TangoErrorException e) { - Toast.makeText(getApplicationContext(), R.string.TangoError, Toast.LENGTH_SHORT) - .show(); + try { + mTango.connect(mConfig); + mIsTangoServiceConnected = true; + } catch (TangoOutOfDateException outDateEx) { + if (mTangoUx != null) { + mTangoUx.showTangoOutOfDate(); } - setupExtrinsics(); + } catch (TangoErrorException e) { + Toast.makeText(getApplicationContext(), R.string.TangoError, Toast.LENGTH_SHORT) + .show(); } + setupExtrinsics(); + Log.i(TAG, "onResumed"); } @Override diff --git a/PointCloudJava/build.gradle b/PointCloudJava/build.gradle index 217854c1..f07bee07 100644 --- a/PointCloudJava/build.gradle +++ b/PointCloudJava/build.gradle @@ -1,6 +1,6 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. - buildscript { + repositories { jcenter() } diff --git a/PointCloudJava/gradle/wrapper/gradle-wrapper.properties b/PointCloudJava/gradle/wrapper/gradle-wrapper.properties index 0c71e760..5f98ccc4 100644 --- a/PointCloudJava/gradle/wrapper/gradle-wrapper.properties +++ b/PointCloudJava/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Apr 10 15:27:10 PDT 2013 +#Mon Oct 26 08:02:00 ART 2015 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip diff --git a/PointCloudJava/settings.gradle b/PointCloudJava/settings.gradle index e7b4def4..87acb705 100644 --- a/PointCloudJava/settings.gradle +++ b/PointCloudJava/settings.gradle @@ -1 +1,3 @@ include ':app' +include ':TangoUtils' +project(':TangoUtils').projectDir = new File('../TangoUtils/app') diff --git a/QuickstartJava/app/build.gradle b/QuickstartJava/app/build.gradle index 00a663bc..55b1760b 100644 --- a/QuickstartJava/app/build.gradle +++ b/QuickstartJava/app/build.gradle @@ -22,10 +22,6 @@ android { } } -if (project.hasProperty("Tango.signing") - && new File(project.property("Tango.signing") + "/tango.gradle").exists()) { - apply from: project.property("Tango.signing") + "/tango.gradle"; -} def external_lib_prefix = null if (project.hasProperty("Tango.catkin_devel_prefix")) { diff --git a/QuickstartJava/app/src/main/java/com/projecttango/experiments/quickstartjava/MainActivity.java b/QuickstartJava/app/src/main/java/com/projecttango/experiments/quickstartjava/MainActivity.java index a6c27765..f1fac3ab 100644 --- a/QuickstartJava/app/src/main/java/com/projecttango/experiments/quickstartjava/MainActivity.java +++ b/QuickstartJava/app/src/main/java/com/projecttango/experiments/quickstartjava/MainActivity.java @@ -83,24 +83,6 @@ protected void onResume() { // is brought to the foreground. super.onResume(); if (!mIsTangoServiceConnected) { - startActivityForResult( - Tango.getRequestPermissionIntent(Tango.PERMISSIONTYPE_MOTION_TRACKING), - Tango.TANGO_INTENT_ACTIVITYCODE); - } - } - - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - // Check which request we're responding to - if (requestCode == Tango.TANGO_INTENT_ACTIVITYCODE) { - // Make sure the request was successful - if (resultCode == RESULT_CANCELED) { - Toast.makeText(this, - "This app requires Motion Tracking permission!", - Toast.LENGTH_LONG).show(); - finish(); - return; - } try { setTangoListeners(); } catch (TangoErrorException e) { diff --git a/QuickstartJava/build.gradle b/QuickstartJava/build.gradle index 9405f3fd..5ec6aa5b 100644 --- a/QuickstartJava/build.gradle +++ b/QuickstartJava/build.gradle @@ -1,5 +1,4 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. - buildscript { repositories { jcenter() diff --git a/QuickstartJava/gradle/wrapper/gradle-wrapper.properties b/QuickstartJava/gradle/wrapper/gradle-wrapper.properties index 0c71e760..5f98ccc4 100644 --- a/QuickstartJava/gradle/wrapper/gradle-wrapper.properties +++ b/QuickstartJava/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Apr 10 15:27:10 PDT 2013 +#Mon Oct 26 08:02:00 ART 2015 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip diff --git a/TangoReleaseLibs/aar/TangoUtils.aar b/TangoReleaseLibs/aar/TangoUtils.aar index 14fdece2..189cbad2 100644 Binary files a/TangoReleaseLibs/aar/TangoUtils.aar and b/TangoReleaseLibs/aar/TangoUtils.aar differ diff --git a/TangoReleaseLibs/aar/tango-ux-support-library.aar b/TangoReleaseLibs/aar/tango-ux-support-library.aar index 9d7a599d..dc181b25 100644 Binary files a/TangoReleaseLibs/aar/tango-ux-support-library.aar and b/TangoReleaseLibs/aar/tango-ux-support-library.aar differ diff --git a/TangoReleaseLibs/aar/tango_support_java_lib.aar b/TangoReleaseLibs/aar/tango_support_java_lib.aar index b2c78b9b..4df01320 100644 Binary files a/TangoReleaseLibs/aar/tango_support_java_lib.aar and b/TangoReleaseLibs/aar/tango_support_java_lib.aar differ diff --git a/TangoReleaseLibs/jar/tango_java_lib.jar b/TangoReleaseLibs/jar/tango_java_lib.jar index 345bbaf8..63199d65 100644 Binary files a/TangoReleaseLibs/jar/tango_java_lib.jar and b/TangoReleaseLibs/jar/tango_java_lib.jar differ diff --git a/TangoUtils/app/src/main/java/com/projecttango/rajawali/ScenePoseCalcuator.java b/TangoUtils/app/src/main/java/com/projecttango/rajawali/ScenePoseCalcuator.java index c4f28c2e..eab495f7 100644 --- a/TangoUtils/app/src/main/java/com/projecttango/rajawali/ScenePoseCalcuator.java +++ b/TangoUtils/app/src/main/java/com/projecttango/rajawali/ScenePoseCalcuator.java @@ -15,10 +15,6 @@ */ package com.projecttango.rajawali; -import android.util.Log; - -import com.google.atap.tangoservice.Tango; -import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoPoseData; import org.rajawali3d.math.Matrix; @@ -37,15 +33,15 @@ public class ScenePoseCalcuator { private static final String TAG = ScenePoseCalcuator.class.getSimpleName(); // Transformation from the Tango Area Description or Start of Service coordinate frames - // to the OpenGL coordinate frame - // NOTE: Rajawali uses column-major for matrices + // to the OpenGL coordinate frame. + // NOTE: Rajawali uses column-major for matrices. public static final Matrix4 OPENGL_T_TANGO_WORLD = new Matrix4(new double[]{ 1, 0, 0, 0, 0, 0,-1, 0, 0, 1, 0, 0, 0, 0, 0, 1 }); - // Transformation from the Tango RGB camera coordinate frame to the OpenGL camera frame + // Transformation from the Tango RGB camera coordinate frame to the OpenGL camera frame. public static final Matrix4 COLOR_CAMERA_T_OPENGL_CAMERA = new Matrix4(new double[] { 1, 0, 0, 0, 0,-1, 0, 0, @@ -60,13 +56,13 @@ public class ScenePoseCalcuator { 0, 0, 0, 1 }); - // Up vector in the Tango Start of Service and Area Description frame + // Up vector in the Tango start of Service and Area Description frame. public static final Vector3 TANGO_WORLD_UP = new Vector3(0, 0, 1); - // Transformation from the position of the Depth camera to the Device frame + // Transformation from the position of the depth camera to the device frame. private Matrix4 mDeviceTDepthCamera; - // Transformation from the position of the Color Camera to the Device frame + // Transformation from the position of the color Camera to the device frame. private Matrix4 mDeviceTColorCamera; /** @@ -77,7 +73,7 @@ public static Matrix4 tangoPoseToMatrix(TangoPoseData tangoPose) { tangoPose.translation[1], tangoPose.translation[2]); Quaternion q = new Quaternion(tangoPose.rotation[3], tangoPose.rotation[0], tangoPose.rotation[1], tangoPose.rotation[2]); - // NOTE: Rajawali Quaternions use a left-hand rotation around the axis convention + // NOTE: Rajawali quaternions use a left-hand rotation around the axis convention. q.conjugate(); Matrix4 m = new Matrix4(); m.setAll(v, new Vector3(1, 1, 1), q); @@ -88,11 +84,11 @@ public static Matrix4 tangoPoseToMatrix(TangoPoseData tangoPose) { * Converts a transform in Matrix4 format to TangoPoseData. */ public static TangoPoseData matrixToTangoPose(Matrix4 transform) { - // Get translation and rotation components from the transformation matrix + // Get translation and rotation components from the transformation matrix. Vector3 p = transform.getTranslation(); Quaternion q = new Quaternion(); q.fromMatrix(transform); - // NOTE: Rajawali Quaternions use a left-hand rotation around the axis convention + // NOTE: Rajawali quaternions use a left-hand rotation around the axis convention. q.conjugate(); TangoPoseData tangoPose = new TangoPoseData(); @@ -114,12 +110,12 @@ public static TangoPoseData matrixToTangoPose(Matrix4 transform) { * Rajawali conventions. */ public static Pose matrixToPose(Matrix4 m) { - // Get translation and rotation components from the transformation matrix + // Get translation and rotation components from the transformation matrix. Vector3 p = m.getTranslation(); Quaternion q = new Quaternion(); q.fromMatrix(m); - // NOTE: Rajawali Quaternions use a left-hand rotation around the axis convention + // NOTE: Rajawali quaternions use a left-hand rotation around the axis convention. q.conjugate(); return new Pose(p, q); @@ -130,17 +126,17 @@ public static Pose matrixToPose(Matrix4 m) { * position and orientation for a OpenGL Scene Camera in the Rajawali world. */ public Pose toOpenGLCameraPose(TangoPoseData tangoPose) { - // We can't do this calculation until Extrinsics are set-up + // We can't do this calculation until extrinsics are set-up. if (mDeviceTColorCamera == null) { throw new RuntimeException("You must call setupExtrinsics first."); } Matrix4 startServiceTdevice = tangoPoseToMatrix(tangoPose); - // Get device pose in OpenGL world frame + // Get device pose in OpenGL world frame. Matrix4 openglTDevice = OPENGL_T_TANGO_WORLD.clone().multiply(startServiceTdevice); - // Get OpenGL camera pose in OpenGL world frame + // Get OpenGL camera pose in OpenGL world frame. Matrix4 openglWorldTOpenglCamera = openglTDevice.multiply(mDeviceTColorCamera). multiply(COLOR_CAMERA_T_OPENGL_CAMERA); @@ -152,13 +148,12 @@ public Pose toOpenGLCameraPose(TangoPoseData tangoPose) { * PointCloud in Depth camera coordinate system to the Rajawali world. */ public Pose toOpenGLPointCloudPose(TangoPoseData tangoPose) { - - // We can't do this calculation until Extrinsics are set-up + // We can't do this calculation until extrinsics are set-up. if (mDeviceTDepthCamera == null) { throw new RuntimeException("You must call setupExtrinsics first."); } - //conversion matrix to put point cloud data in Rajwali/Opengl Coordinate system. + //conversion matrix to put point cloud data in Rajawali/OpenGL coordinate system. Matrix4 invertYandZMatrix = new Matrix4(new double[]{1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, @@ -166,10 +161,10 @@ public Pose toOpenGLPointCloudPose(TangoPoseData tangoPose) { Matrix4 startServiceTdevice = tangoPoseToMatrix(tangoPose); - // Get device pose in OpenGL world frame + // Get device pose in OpenGL world frame. Matrix4 openglTDevice = OPENGL_T_TANGO_WORLD.clone().multiply(startServiceTdevice); - // Get OpenGL camera pose in OpenGL world frame + // Get OpenGL camera pose in OpenGL world frame. Matrix4 openglWorldTOpenglCamera = openglTDevice.multiply(mDeviceTDepthCamera). multiply(DEPTH_CAMERA_T_OPENGL_CAMERA).multiply(invertYandZMatrix); @@ -183,7 +178,7 @@ public Pose toOpenGLPointCloudPose(TangoPoseData tangoPose) { static public Pose toOpenGLPose(TangoPoseData tangoPose) { Matrix4 start_service_T_device = tangoPoseToMatrix(tangoPose); - // Get device pose in OpenGL world frame + // Get device pose in OpenGL world frame. Matrix4 opengl_world_T_device = OPENGL_T_TANGO_WORLD.clone().multiply(start_service_T_device); return matrixToPose(opengl_world_T_device); @@ -195,9 +190,9 @@ static public Pose toOpenGLPose(TangoPoseData tangoPose) { * Tango start of service frame. * * @param point Point in depth frame where the plane has been detected. - * @param normal Normal of the detected plane + * @param normal Normal of the detected plane. * @param tangoPose Device pose with respect to start of service at the time the plane was - * fitted + * fitted. */ public Pose planeFitToOpenGLPose(double[] point, double[] normal, TangoPoseData tangoPose) { if (mDeviceTDepthCamera == null) { @@ -206,14 +201,14 @@ public Pose planeFitToOpenGLPose(double[] point, double[] normal, TangoPoseData Matrix4 startServiceTdevice = tangoPoseToMatrix(tangoPose); - // Calculate the UP vector in the Depth frame at the provided measurement pose + // Calculate the UP vector in the depth frame at the provided measurement pose. Vector3 depthUp = TANGO_WORLD_UP.clone(); startServiceTdevice.clone().multiply(mDeviceTDepthCamera).inverse().rotateVector(depthUp); - // Calculate the transform in depth frame corresponding to the plane fitting information + // Calculate the transform in depth frame corresponding to the plane fitting information. Matrix4 depthTplane = matrixFromPointNormalUp(point, normal, depthUp); - // Convert to OpenGL frame + // Convert to OpenGL frame. Matrix4 openglWorldTplane = OPENGL_T_TANGO_WORLD.clone().multiply(startServiceTdevice) .multiply(mDeviceTDepthCamera).multiply(depthTplane); @@ -229,14 +224,10 @@ public Pose planeFitToOpenGLPose(double[] point, double[] normal, TangoPoseData public void setupExtrinsics(TangoPoseData imuTDevicePose, TangoPoseData imuTColorCameraPose, TangoPoseData imuTDepthCameraPose) { Matrix4 deviceTImu = ScenePoseCalcuator.tangoPoseToMatrix(imuTDevicePose).inverse(); - Matrix4 imutColorCamera = ScenePoseCalcuator.tangoPoseToMatrix(imuTColorCameraPose); + Matrix4 imuTColorCamera = ScenePoseCalcuator.tangoPoseToMatrix(imuTColorCameraPose); Matrix4 imuTDepthCamera = ScenePoseCalcuator.tangoPoseToMatrix(imuTDepthCameraPose); mDeviceTDepthCamera = deviceTImu.clone().multiply(imuTDepthCamera); - mDeviceTColorCamera = deviceTImu.multiply(imutColorCamera); - } - - private void throwExceptionIfNoExtrinsics() { - + mDeviceTColorCamera = deviceTImu.multiply(imuTColorCamera); } /** @@ -244,7 +235,7 @@ private void throwExceptionIfNoExtrinsics() { */ public static Matrix4 calculateProjectionMatrix(int width, int height, double fx, double fy, double cx, double cy) { - // Uses frustumM to create a projection matrix taking into account Calibrated camera + // Uses frustumM to create a projection matrix taking into account calibrated camera // intrinsic parameter. // Reference: http://ksimek.github.io/2013/06/03/calibrated_cameras_in_opengl/ double near = 0.1; @@ -302,26 +293,4 @@ private static Matrix4 matrixFromPointNormalUp(double[] point, double[] normal, return m; } - - /** - * Calculates the transform between the color camera at a time t0 and the depth camera at a - * time t1, given the device poses at t0 and t1. - */ - public TangoPoseData calculateColorCameraTDepthWithTime(TangoPoseData ssTdeviceT0pose, - TangoPoseData ssTdeviceT1pose) { - if (mDeviceTDepthCamera == null) { - throw new RuntimeException("You must call setupExtrinsics first"); - } - - // Operation at hand: - // rgb_t0_T_depth_t1 = rgb_T_dev * dev_t0_T_ss * ss_T_dev_t1 * dev_T_depth - - Matrix4 ssTdeviceT0 = tangoPoseToMatrix(ssTdeviceT0pose); - Matrix4 ssTdeviceT1 = tangoPoseToMatrix(ssTdeviceT1pose); - - Matrix4 rgbt0Tdeptht1 = mDeviceTColorCamera.clone().inverse(). - multiply(ssTdeviceT0.inverse()).multiply(ssTdeviceT1).multiply(mDeviceTDepthCamera); - - return matrixToTangoPose(rgbt0Tdeptht1); - } } diff --git a/TangoUtils/app/src/main/java/com/projecttango/rajawali/TouchViewHandler.java b/TangoUtils/app/src/main/java/com/projecttango/rajawali/TouchViewHandler.java index becf3a0e..93809d66 100644 --- a/TangoUtils/app/src/main/java/com/projecttango/rajawali/TouchViewHandler.java +++ b/TangoUtils/app/src/main/java/com/projecttango/rajawali/TouchViewHandler.java @@ -25,12 +25,11 @@ import org.rajawali3d.math.vector.Vector3; /** - * This is a helper class that adds Top-down and Third-person views in a VR setting, including + * This is a helper class that adds top-down and third-person views in a VR setting, including * handling of standard pan and zoom touch interactions. */ public class TouchViewHandler { - - // Touch interaction tuning constants + // Touch interaction tuning constants. private static final int TOUCH_THIRD_PITCH_LIMIT = 60; private static final int TOUCH_THIRD_PITCH_DEFAULT = 45; private static final int TOUCH_THIRD_YAW_DEFAULT = -45; @@ -38,20 +37,20 @@ public class TouchViewHandler { private static final int TOUCH_THIRD_DISTANCE = 10; private static final int TOUCH_TOP_DISTANCE = 10; - // Virtual Reality view parameters + // Virtual reality view parameters. private static final float FIRST_PERSON_FOV = 37.8f; private static final int THIRD_PERSON_FOV = 65; private static final int TOP_DOWN_FOV = 65; private enum ViewMode { FIRST_PERSON, TOP_DOWN, THIRD_PERSON - }; + } private ViewMode viewMode = ViewMode.THIRD_PERSON; private GestureDetector gestureDetector; private ScaleGestureDetector scaleGestureDetector; - private Vector3 topdownCameraDelta = new Vector3(); + private Vector3 topDownCameraDelta = new Vector3(); private float thirdPersonPitch = TOUCH_THIRD_PITCH_DEFAULT; private float thirdPersonYaw = TOUCH_THIRD_YAW_DEFAULT; @@ -76,8 +75,8 @@ public void updateCamera(Vector3 position, Quaternion orientation) { camera.setPosition(position); camera.setOrientation(orientation); } else if (viewMode == ViewMode.TOP_DOWN) { - camera.setPosition(position.x + topdownCameraDelta.x, TOUCH_TOP_DISTANCE, - position.z + topdownCameraDelta.z); + camera.setPosition(position.x + topDownCameraDelta.x, TOUCH_TOP_DISTANCE, + position.z + topDownCameraDelta.z); camera.setRotation(Vector3.Axis.X, 90); } else if (viewMode == ViewMode.THIRD_PERSON) { camera.setPosition(position.x, position.y, position.z); @@ -99,7 +98,7 @@ public void setFirstPersonView() { public void setTopDownView() { viewMode = ViewMode.TOP_DOWN; - topdownCameraDelta = new Vector3(); + topDownCameraDelta = new Vector3(); camera.setFieldOfView(TOP_DOWN_FOV); } @@ -131,7 +130,7 @@ public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float d if (viewMode == ViewMode.TOP_DOWN) { double factor = camera.getFieldOfView() / 45; - topdownCameraDelta.add(new Vector3(distanceX / 100 * factor, 0, distanceY / 100 * factor)); + topDownCameraDelta.add(new Vector3(distanceX / 100 * factor, 0, distanceY / 100 * factor)); } else if (viewMode == ViewMode.THIRD_PERSON) { thirdPersonPitch -= distanceY / 10; thirdPersonPitch = diff --git a/TangoUtils/app/src/main/java/com/projecttango/rajawali/ar/TangoRajawaliRenderer.java b/TangoUtils/app/src/main/java/com/projecttango/rajawali/ar/TangoRajawaliRenderer.java index b6798445..189a21d7 100644 --- a/TangoUtils/app/src/main/java/com/projecttango/rajawali/ar/TangoRajawaliRenderer.java +++ b/TangoUtils/app/src/main/java/com/projecttango/rajawali/ar/TangoRajawaliRenderer.java @@ -55,7 +55,6 @@ * handled by this mRenderer. */ public abstract class TangoRajawaliRenderer extends RajawaliRenderer { - private static final String TAG = "TangoRajawaliRenderer"; private static TangoCoordinateFramePair TANGO_WORLD_T_DEVICE = new TangoCoordinateFramePair( @@ -63,7 +62,7 @@ public abstract class TangoRajawaliRenderer extends RajawaliRenderer { TangoPoseData.COORDINATE_FRAME_DEVICE ); - // Tango support objects + // Tango support objects. private StreamingTexture mTangoCameraTexture; private Tango mTango; private int mCameraId; @@ -71,7 +70,7 @@ public abstract class TangoRajawaliRenderer extends RajawaliRenderer { private int mConnectedTextureId = -1; private double mLastRGBFrameTimestamp = -1; private double mLastSceneCameraFrameTimestamp = -1; - // The ScreenQuad used to render the Tango camera in the background of the scene + // The ScreenQuad used to render the Tango camera in the background of the scene. private ScreenQuad mBackgroundQuad; private boolean mIsCameraConfigured = false; @@ -105,8 +104,8 @@ protected void initScene() { } @Override - protected void onRender(long ellapsedRealtime, double deltaTime) { - super.onRender(ellapsedRealtime, deltaTime); + protected void onRender(long elapsedRealTime, double deltaTime) { + super.onRender(elapsedRealTime, deltaTime); synchronized (this) { if (mTango != null) { @@ -116,20 +115,20 @@ protected void onRender(long ellapsedRealtime, double deltaTime) { mUpdatePending = false; } if (mLastRGBFrameTimestamp != mLastSceneCameraFrameTimestamp) { - // We delay the camera set-up until now because if we do it earlier (i.e.: when the + // We delay the camera set-up until now because if we do it earlier (i.e., when the // camera is connected to the renderer) the Tango service may still not have the - // necessary intrinsic and extrinsic transformation information available + // necessary intrinsic and extrinsic transformation information available. if (!mIsCameraConfigured) { configureCamera(); mIsCameraConfigured = true; } - // Calculate the device pose at the camera frame update time + // Calculate the device pose at the camera frame update time. TangoPoseData lastFramePose = mTango.getPoseAtTime(mLastRGBFrameTimestamp, TANGO_WORLD_T_DEVICE); - // Fall back to latest available time if for some reason that fails + if (lastFramePose.statusCode != TangoPoseData.POSE_VALID) { - lastFramePose = mTango.getPoseAtTime(0, TANGO_WORLD_T_DEVICE); + Log.w(TAG, "Unable to get device pose at camera frame update time = " + mLastRGBFrameTimestamp); } else { Pose sceneCameraPose = mScenePoseCalcuator.toOpenGLCameraPose(lastFramePose); updateCameraPose(sceneCameraPose); @@ -148,7 +147,7 @@ protected void onRender(long ellapsedRealtime, double deltaTime) { /** * Override onRenderSurfaceSizeChanged() so that it will be called after onSurfaceCreated, * nested view get reset or resized, including activity get paused and resumed, in this function - * sets mIsCameracConfigured to false since Rajawali will reset the scene camera if SurfaceSizeChanged + * sets mIsCameraConfigured to false since Rajawali will reset the scene camera if SurfaceSizeChanged * get called. */ @Override @@ -214,21 +213,21 @@ private int connectTangoTexture() { } private void configureCamera() { - // This should never happen, but it never hurts to double-check + // This should never happen, but it never hurts to double-check. if (mTango == null) { return; } - // Configure the Rajawali Scene camera projection to match the Tango camera intrinsic + // Configure the Rajawali Scene camera projection to match the Tango camera intrinsic. TangoCameraIntrinsics intrinsics = mTango.getCameraIntrinsics(mCameraId); - Matrix4 projectionMatrix = mScenePoseCalcuator.calculateProjectionMatrix( + Matrix4 projectionMatrix = ScenePoseCalcuator.calculateProjectionMatrix( intrinsics.width, intrinsics.height, intrinsics.fx, intrinsics.fy, intrinsics.cx, intrinsics.cy); getCurrentCamera().setProjectionMatrix(projectionMatrix); } /** - * Set-up device to sensors transforms + * Set-up device to sensors transforms. */ public void setupExtrinsics(TangoPoseData imuTDevicePose, TangoPoseData imuTColorCameraPose, TangoPoseData imuTDepthCameraPose) { @@ -236,7 +235,7 @@ public void setupExtrinsics(TangoPoseData imuTDevicePose, TangoPoseData imuTColo } /** - * Intended to be called from TangoRajawaliView + * Intended to be called from TangoRajawaliView. */ void connectCamera(Tango tango, int cameraId) { this.mTango = tango; @@ -245,7 +244,7 @@ void connectCamera(Tango tango, int cameraId) { } /** - * Intended to be called from TangoRajawaliView + * Intended to be called from TangoRajawaliView. */ synchronized void disconnectCamera() { Tango oldTango = mTango; @@ -258,19 +257,18 @@ synchronized void disconnectCamera() { } /** - * Intended to be called from TangoRajawaliView + * Intended to be called from TangoRajawaliView. */ synchronized void onTangoFrameAvailable() { mUpdatePending = true; } /** - * Get the latest camera frame timestamp. This value will be updated when + * Get the latest camera frame timestamp. This value will be updated when * the updateTexture() is called. * * @return The timestamp. This can be used to associate camera data with a * pose or other sensor data using other pieces of the Tango API. - * */ public double getTimestamp() { return mLastRGBFrameTimestamp; diff --git a/TangoUtils/app/src/main/java/com/projecttango/rajawali/ar/TangoRajawaliView.java b/TangoUtils/app/src/main/java/com/projecttango/rajawali/ar/TangoRajawaliView.java index 82b8041f..1f376c21 100644 --- a/TangoUtils/app/src/main/java/com/projecttango/rajawali/ar/TangoRajawaliView.java +++ b/TangoUtils/app/src/main/java/com/projecttango/rajawali/ar/TangoRajawaliView.java @@ -30,7 +30,6 @@ * */ public class TangoRajawaliView extends RajawaliSurfaceView { - private static final String TAG = "TangoRajawaliView"; TangoRajawaliRenderer mRenderer; @@ -38,7 +37,7 @@ public TangoRajawaliView(Context context) { super(context); // It is important to set render mode to manual to force rendering only when there is a // Tango Camera image available and get correct synchronization between the camera and the - // rest of the scene + // rest of the scene. setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY); } @@ -46,7 +45,7 @@ public TangoRajawaliView(Context context, AttributeSet attrs) { super(context, attrs); // It is important to set render mode to manual to force rendering only when there is a // Tango Camera image available and get correct synchronization between the camera and the - // rest of the scene + // rest of the scene. setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY); } @@ -61,7 +60,7 @@ public void setSurfaceRenderer(TangoRajawaliRenderer renderer) throws IllegalSta } /** - * Get the latest camera data's timestamp. This value will be updated when + * Get the latest camera data's timestamp. This value will be updated when * the updateTexture() is called. * * @return The timestamp. This can be used to associate camera data with a diff --git a/TangoUtils/app/src/main/java/com/projecttango/rajawali/renderables/FrustumAxes.java b/TangoUtils/app/src/main/java/com/projecttango/rajawali/renderables/FrustumAxes.java index 39dc7468..0018dec1 100644 --- a/TangoUtils/app/src/main/java/com/projecttango/rajawali/renderables/FrustumAxes.java +++ b/TangoUtils/app/src/main/java/com/projecttango/rajawali/renderables/FrustumAxes.java @@ -17,7 +17,6 @@ import android.graphics.Color; -import org.rajawali3d.Object3D; import org.rajawali3d.materials.Material; import org.rajawali3d.math.vector.Vector3; import org.rajawali3d.primitives.Line3D; @@ -53,7 +52,7 @@ private static Stack makePoints() { Vector3 z = new Vector3(0, 0, 1); Stack points = new Stack(); - Collections.addAll(points, new Vector3[]{o, x, o, y, o, z, o, a, b, o, b, c, o, c, d, o, d, a}); + Collections.addAll(points, o, x, o, y, o, z, o, a, b, o, b, c, o, c, d, o, d, a); return points; } diff --git a/TangoUtils/app/src/main/java/com/projecttango/rajawali/renderables/Trajectory.java b/TangoUtils/app/src/main/java/com/projecttango/rajawali/renderables/Trajectory.java index 854a4295..8db7ba39 100644 --- a/TangoUtils/app/src/main/java/com/projecttango/rajawali/renderables/Trajectory.java +++ b/TangoUtils/app/src/main/java/com/projecttango/rajawali/renderables/Trajectory.java @@ -32,10 +32,11 @@ * passing translation data obtained from Tango Pose Data. */ public class Trajectory extends Object3D { - private int mMaxNumberOfVertices = 9000; + private static final int MAX_NUMBER_OF_VERTICES = 9000; private Vector3 mLastPoint = new Vector3(); private FloatBuffer mVertexBuffer; private int mTrajectoryCount; + public Trajectory(int color, float thickness) { super(); init(true); @@ -43,16 +44,16 @@ public Trajectory(int color, float thickness) { m.setColor(color); setMaterial(m); mVertexBuffer = ByteBuffer - .allocateDirect(mMaxNumberOfVertices * Geometry3D.FLOAT_SIZE_BYTES) + .allocateDirect(MAX_NUMBER_OF_VERTICES * Geometry3D.FLOAT_SIZE_BYTES) .order(ByteOrder.nativeOrder()).asFloatBuffer(); } // Initialize the buffers for Trajectory primitive. - // Since only vertex and Index buffers are used, we only initialize them using setdata call. + // Since only vertex and Index buffers are used, we only initialize them using setData call. protected void init(boolean createVBOs) { - float[] vertices = new float[mMaxNumberOfVertices*3]; - int[] indices = new int[mMaxNumberOfVertices]; + float[] vertices = new float[MAX_NUMBER_OF_VERTICES * 3]; + int[] indices = new int[MAX_NUMBER_OF_VERTICES]; for(int i = 0; i < indices.length; ++i){ indices[i] = i; } diff --git a/TangoUtils/app/src/main/java/com/projecttango/rajawali/renderables/primitives/Points.java b/TangoUtils/app/src/main/java/com/projecttango/rajawali/renderables/primitives/Points.java index bcc08287..4579683b 100644 --- a/TangoUtils/app/src/main/java/com/projecttango/rajawali/renderables/primitives/Points.java +++ b/TangoUtils/app/src/main/java/com/projecttango/rajawali/renderables/primitives/Points.java @@ -29,11 +29,11 @@ * Intended to be contributed and PR'ed to Rajawali. */ public class Points extends Object3D { - private int mMaxNumberofVertices; + private int mMaxNumberOfVertices; public Points(int numberOfPoints) { super(); - mMaxNumberofVertices = numberOfPoints; + mMaxNumberOfVertices = numberOfPoints; init(true); Material m = new Material(); m.setColor(Color.GREEN); @@ -41,10 +41,10 @@ public Points(int numberOfPoints) { } // Initialize the buffers for Points primitive. - // Since only vertex and Index buffers are used, we only initialize them using setdata call. + // Since only vertex and index buffers are used, we only initialize them using setData call. protected void init(boolean createVBOs) { - float[] vertices = new float[mMaxNumberofVertices*3]; - int[] indices = new int[mMaxNumberofVertices]; + float[] vertices = new float[mMaxNumberOfVertices * 3]; + int[] indices = new int[mMaxNumberOfVertices]; for(int i = 0; i < indices.length; ++i){ indices[i] = i; } diff --git a/TangoUtils/app/src/main/java/com/projecttango/tangoutils/TangoPoseUtilities.java b/TangoUtils/app/src/main/java/com/projecttango/tangoutils/TangoPoseUtilities.java index 428cdb1a..c6eb02c3 100644 --- a/TangoUtils/app/src/main/java/com/projecttango/tangoutils/TangoPoseUtilities.java +++ b/TangoUtils/app/src/main/java/com/projecttango/tangoutils/TangoPoseUtilities.java @@ -24,14 +24,13 @@ * sample applications */ public class TangoPoseUtilities { - /** * Get translation string from a pose. - * @param pose: Pose from which translation string is constructed. - * @param decimalFormat: Number of decimals for each component of translation. + * @param pose Pose from which translation string is constructed. + * @param decimalFormat Number of decimals for each component of translation. * @return */ - public static String getTranslationString(TangoPoseData pose, DecimalFormat decimalFormat){ + public static String getTranslationString(TangoPoseData pose, DecimalFormat decimalFormat) { String translationString = "[" + decimalFormat.format(pose.translation[0]) + ", " + decimalFormat.format(pose.translation[1]) + ", " @@ -41,11 +40,11 @@ public static String getTranslationString(TangoPoseData pose, DecimalFormat deci /** * Get quaternion string from a pose. - * @param pose: Pose from which quaternion string is constructed. - * @param decimalFormat: Number of decimals for each component of translation. + * @param pose Pose from which quaternion string is constructed. + * @param decimalFormat Number of decimals for each component of translation. * @return */ - public static String getQuaternionString(TangoPoseData pose, DecimalFormat decimalFormat){ + public static String getQuaternionString(TangoPoseData pose, DecimalFormat decimalFormat) { String quaternionString ="[" + decimalFormat.format(pose.rotation[0]) + ", " + decimalFormat.format(pose.rotation[1]) + ", " @@ -56,11 +55,11 @@ public static String getQuaternionString(TangoPoseData pose, DecimalFormat decim /** * Get the status of the Pose as a string. - * @param pose: Pose from which status string is constructed. + * @param pose Pose from which status string is constructed. * @return */ - public static String getStatusString(TangoPoseData pose){ - String poseStatus = "unknown"; + public static String getStatusString(TangoPoseData pose) { + String poseStatus; switch (pose.statusCode){ case TangoPoseData.POSE_UNKNOWN: poseStatus = "unknown"; @@ -77,6 +76,6 @@ public static String getStatusString(TangoPoseData pose){ default: poseStatus = "unknown"; } - return poseStatus; + return poseStatus; } } diff --git a/TangoUtils/build.gradle b/TangoUtils/build.gradle index ca6de6f5..f07bee07 100644 --- a/TangoUtils/build.gradle +++ b/TangoUtils/build.gradle @@ -1,5 +1,6 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + repositories { jcenter() } diff --git a/TangoUtils/gradle/wrapper/gradle-wrapper.properties b/TangoUtils/gradle/wrapper/gradle-wrapper.properties index 0c71e760..5f98ccc4 100644 --- a/TangoUtils/gradle/wrapper/gradle-wrapper.properties +++ b/TangoUtils/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Apr 10 15:27:10 PDT 2013 +#Mon Oct 26 08:02:00 ART 2015 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip diff --git a/VideoOverlaySample/app/build.gradle b/VideoOverlaySample/app/build.gradle index efba93da..3e5d91c0 100644 --- a/VideoOverlaySample/app/build.gradle +++ b/VideoOverlaySample/app/build.gradle @@ -23,10 +23,6 @@ android { } } -if (project.hasProperty("Tango.signing") - && new File(project.property("Tango.signing") + "/tango.gradle").exists()) { - apply from: project.property("Tango.signing") + "/tango.gradle"; -} def external_lib_prefix = null if (project.hasProperty("Tango.catkin_devel_prefix")) { diff --git a/VideoOverlaySample/build.gradle b/VideoOverlaySample/build.gradle index 9405f3fd..7a66dc5a 100644 --- a/VideoOverlaySample/build.gradle +++ b/VideoOverlaySample/build.gradle @@ -1,6 +1,6 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. - buildscript { + repositories { jcenter() } diff --git a/VideoOverlaySample/gradle/wrapper/gradle-wrapper.properties b/VideoOverlaySample/gradle/wrapper/gradle-wrapper.properties index 0c71e760..5f98ccc4 100644 --- a/VideoOverlaySample/gradle/wrapper/gradle-wrapper.properties +++ b/VideoOverlaySample/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Apr 10 15:27:10 PDT 2013 +#Mon Oct 26 08:02:00 ART 2015 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip