Skip to content
This repository has been archived by the owner on Mar 2, 2018. It is now read-only.

Commit

Permalink
Merge pull request #24 from googlesamples/jacobi-release
Browse files Browse the repository at this point in the history
Jacobi Release
  • Loading branch information
r4ravi2008 committed Mar 17, 2015
2 parents a394cab + 42789d0 commit 24dde1d
Show file tree
Hide file tree
Showing 19 changed files with 97 additions and 49 deletions.
4 changes: 0 additions & 4 deletions AreaLearningJava/.settings/org.eclipse.jdt.core.prefs

This file was deleted.

Binary file added AreaLearningJava/libs/tango_java_lib.jar
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

private void setTangoConfig() {
mConfig = new TangoConfig();
mConfig = mTango.getConfig(TangoConfig.CONFIG_TYPE_CURRENT);
// Check if learning mode
if (mIsLearningMode) {
Expand Down Expand Up @@ -270,6 +271,11 @@ public void onPoseAvailable(TangoPoseData pose) {
mGLView.requestRender();
}
}

@Override
public void onFrameAvailable(int cameraId) {
// We are not using onFrameAvailable for this application.
}
});
}

Expand Down Expand Up @@ -323,7 +329,7 @@ public void onSetName(String name, String uuids) {
/**
* Updates the text view in UI screen with the Pose. Each pose is associated with Target and
* Base Frame. We need to check for that pair ad update our views accordingly.
*
*
* @param pose
*/
private void updateTextViewWith(final TangoPoseData pose) {
Expand Down
Binary file removed MotionTrackingJava/ic_launcher-web.png
Binary file not shown.
Binary file added MotionTrackingJava/libs/tango_java_lib.jar
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ protected void onCreate(Bundle savedInstanceState) {
// Instantiate the Tango service
mTango = new Tango(this);
// Create a new Tango Configuration and enable the MotionTrackingActivity API
mConfig = new TangoConfig();
mConfig = mTango.getConfig(TangoConfig.CONFIG_TYPE_CURRENT);
mConfig.putBoolean(TangoConfig.KEY_BOOLEAN_MOTIONTRACKING, true);

Expand Down Expand Up @@ -146,7 +147,7 @@ protected void onCreate(Bundle savedInstanceState) {
private void setTangoListeners() {
// Lock configuration and connect to Tango
// Select coordinate frame pair
final ArrayList<TangoCoordinateFramePair> framePairs =
final ArrayList<TangoCoordinateFramePair> framePairs =
new ArrayList<TangoCoordinateFramePair>();
framePairs.add(new TangoCoordinateFramePair(
TangoPoseData.COORDINATE_FRAME_START_OF_SERVICE,
Expand Down Expand Up @@ -221,6 +222,11 @@ public void run() {
}
});
}

@Override
public void onFrameAvailable(int cameraId) {
// We are not using onFrameAvailable for this application
}
});
}

Expand Down
Binary file added PointCloudJava/libs/tango_java_lib.jar
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ protected void onCreate(Bundle savedInstanceState) {
mTopDownButton.setOnClickListener(this);

mTango = new Tango(this);
mConfig = new TangoConfig();
mConfig = mTango.getConfig(TangoConfig.CONFIG_TYPE_CURRENT);
mConfig.putBoolean(TangoConfig.KEY_BOOLEAN_DEPTH, true);

Expand Down Expand Up @@ -260,7 +261,7 @@ private void setUpExtrinsics() {

private void setTangoListeners() {
// Configure the Tango coordinate frame pair
final ArrayList<TangoCoordinateFramePair> framePairs =
final ArrayList<TangoCoordinateFramePair> framePairs =
new ArrayList<TangoCoordinateFramePair>();
framePairs.add(new TangoCoordinateFramePair(
TangoPoseData.COORDINATE_FRAME_START_OF_SERVICE,
Expand Down Expand Up @@ -384,6 +385,11 @@ public void run() {
}
});
}

@Override
public void onFrameAvailable(int cameraId) {
// We are not using onFrameAvailable for this application.
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
/**
* A sample application to show hwo to get Point Cloud Data from Project Tango API
* A sample application to show how to get Point Cloud Data from Project Tango API
* and display in world coordinates of Opengl ES2.0.
*/
package com.projecttango.experiments.javapointcloud;
Binary file added QuickstartJava/libs/tango_java_lib.jar
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ public void onTangoEvent(TangoEvent arg0) {
// Ignoring TangoEvents
}

@Override
public void onFrameAvailable(int arg0) {
// Ignoring onFrameAvailable Events

}

});
}

Expand Down
Binary file added VideoOverlaySample/libs/tango_java_lib.jar
Binary file not shown.
Binary file not shown.
9 changes: 0 additions & 9 deletions VideoOverlaySample/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,4 @@
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.projecttango.videooverlaysample.MainActivity" >

<SurfaceView
android:id="@+id/cameraView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true" />

</RelativeLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -15,52 +15,89 @@
*/
package com.projecttango.videooverlaysample;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.widget.Toast;

import com.google.atap.tangoservice.Tango;
import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;
import com.google.atap.tangoservice.TangoCameraIntrinsics;
import com.google.atap.tangoservice.TangoCameraPreview;
import com.google.atap.tangoservice.TangoConfig;
import com.google.atap.tangoservice.TangoCoordinateFramePair;
import com.google.atap.tangoservice.TangoEvent;
import com.google.atap.tangoservice.TangoPoseData;
import com.google.atap.tangoservice.TangoXyzIjData;


public class MainActivity extends Activity implements SurfaceHolder.Callback {

private SurfaceView surfaceView;
private SurfaceHolder surfaceHolder;
public class MainActivity extends Activity {
private TangoCameraPreview tangoCameraPreview;
private Tango mTango;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
surfaceView = (SurfaceView) findViewById(R.id.cameraView);
surfaceHolder = surfaceView.getHolder();
surfaceHolder.addCallback(this);
mTango = new Tango(this);
}

@Override
public void surfaceCreated(SurfaceHolder holder) {
Surface surface = holder.getSurface();
if (surface.isValid()) {
TangoConfig config = new TangoConfig();
config = mTango.getConfig(TangoConfig.CONFIG_TYPE_CURRENT);
mTango.connectSurface(0, surface);
mTango.connect(config);
}
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
tangoCameraPreview = new TangoCameraPreview(this);
mTango = new Tango(this);
startActivityForResult(
Tango.getRequestPermissionIntent(Tango.PERMISSIONTYPE_MOTION_TRACKING),
Tango.TANGO_INTENT_ACTIVITYCODE);
setContentView(tangoCameraPreview);

}

@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width,
int height) {

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 {
startCameraPreview();
}
}
}

@Override
public void surfaceDestroyed(SurfaceHolder holder) {
mTango.disconnectSurface(0);
// Camera Preview
private void startCameraPreview() {
tangoCameraPreview.connectToTangoCamera(mTango,
TangoCameraIntrinsics.TANGO_CAMERA_COLOR);
TangoConfig config = mTango.getConfig(TangoConfig.CONFIG_TYPE_DEFAULT);
mTango.connect(config);
ArrayList<TangoCoordinateFramePair> framePairs = new ArrayList<TangoCoordinateFramePair>();
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) {
if (cameraId == TangoCameraIntrinsics.TANGO_CAMERA_COLOR) {
tangoCameraPreview.onFrameAvailable();
}
}

@Override
public void onXyzIjAvailable(TangoXyzIjData xyzIj) {
// We are not using OnPoseAvailable for this app
}

@Override
public void onTangoEvent(TangoEvent event) {
// We are not using OnPoseAvailable for this app
}
});
}

@Override
protected void onPause() {
super.onPause();
mTango.disconnect();
}
}

0 comments on commit 24dde1d

Please sign in to comment.