SlideShare une entreprise Scribd logo
1  sur  50
Télécharger pour lire hors ligne
Primi passi con Tango
Mike Trizio
@mik3lantoniO
Phab 2
SDK available for
onCreate()
...
// Create a new Tango Configuration and enable the MotionTracking API
mConfig = new TangoConfig();
mConfig = mTango.getConfig(TangoConfig.CONFIG_TYPE_CURRENT);
...
onResume()
...
try {
mTango.connect(mConfig);
} catch (TangoOutOfDateException e) {
// handle the error
}
...
onPause()
...
try {
mTango.disconnect();
} catch (TangoErrorException e) {
// handle the error
}
...
mTango.connectListener(framePairs, new OnTangoUpdateListener() {
@Override
public void onTangoEvent(final TangoEvent event) {
if (event.eventKey.equals(TangoEvent.DESCRIPTION_FISHEYE_OVER_EXPOSED) {
// handle the Fisheye camera issue
}
if (event.eventKey.equals(TangoEvent.DESCRIPTION_TOO_FEW_FEATURES_TRACKED)
// handle having too few features
}
// ...
}
}
final ArrayList<TangoCoordinateFramePair> framePairs =
new ArrayList<TangoCoordinateFramePair>();
framePairs.add(new TangoCoordinateFramePair(
TangoPoseData.COORDINATE_FRAME_START_OF_SERVICE,
TangoPoseData.COORDINATE_FRAME_DEVICE));
// Listen for new Tango data
mTango.connectListener(framePairs, new OnTangoUpdateListener() {
@Override
public void onPoseAvailable(final TangoPoseData pose) {
// Process pose data from device with respect to start of service
}
// TODO: Define other overrides
});
// Define what motion is requested.
TangoCoordinateFramePair frames_of_reference;
frames_of_reference.baseFrame = TangoPoseData.COORDINATE_FRAME_START_OF_SERVICE;
frames_of_reference.targetFrame = TangoPoseData.COORDINATE_FRAME_DEVICE;
new Thread(new Runnable() {
final int pollingUpdatePeriodMilliseconds = 66;
@Override
public void run() {
while (true) {
try {
Thread.sleep(pollingUpdatePeriodMilliseconds);
final TangoPoseData queryPoseStartDevice =
mTango.getPoseAtTime(0.0, frames_of_reference);
} catch (TangoErrorException e) { e.printStackTrace(); }
}
}
}).start();
onCreate()
...
// Create a new Tango Configuration with Depth Perception API enabled
mConfig = new TangoConfig();
mConfig = mTango.getConfig(TangoConfig.CONFIG_TYPE_CURRENT);
mConfig.putBoolean(TangoConfig.KEY_BOOLEAN_DEPTH, true);
...
mTango.connectListener(framePairs, new OnTangoUpdateListener() {
....
@Override
public void onPointCloudAvailable(final TangoPointCloudData pointCloudData) {
logPointCloud(pointCloudData);
}
...
});
private void logPointCloud(TangoPointCloudData pointCloudData) {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("Point count: " + pointCloudData.numPoints);
stringBuilder.append(". Average depth (m): " +
calculateAveragedDepth(pointCloudData.points, pointCloudData.numPoints));
Log.i(TAG, stringBuilder.toString());
}
private float calculateAveragedDepth(FloatBuffer pointCloudBuffer, int numPoints) {
float totalZ = 0;
float averageZ = 0;
if (numPoints != 0) {
int numFloats = 4 * numPoints;
for (int i = 2; i < numFloats; i = i + 4) {
totalZ = totalZ + pointCloudBuffer.get(i);
}
averageZ = totalZ / numPoints;
}
return averageZ;
}
onCreate()
...
// Create a new Tango Configuration with Depth Perception API enabled
mConfig = new TangoConfig();
mConfig = mTango.getConfig(TangoConfig.CONFIG_TYPE_CURRENT);
mConfig.putBoolean(TangoConfig.KEY_BOOLEAN_LEARNINGMODE, true);
...
try {
mConfig.putString(TangoConfig.KEY_STRING_AREADESCRIPTION,
area_filename);
} catch (TangoErrorException e) {
// handle exception
}
ArrayList<String> fullUUIDList = new ArrayList<String>();
// Returns a list of ADFs with their UUIDs
fullUUIDList = mTango.listAreaDescriptions();
// Load the latest ADF if ADFs are found.
if (fullUUIDList.size() > 0) {
mConfig.putString(TangoConfig.KEY_STRING_AREADESCRIPTION,
fullUUIDList.get(fullUUIDList.size() - 1));
}
final ArrayList<TangoCoordinateFramePair> framePairs =
new ArrayList<TangoCoordinateFramePair>();
framePairs.add(new TangoCoordinateFramePair(
TangoPoseData.COORDINATE_FRAME_AREA_DESCRIPTION,
TangoPoseData.COORDINATE_FRAME_DEVICE));
// Listen for new Tango data
mTango.connectListener(framePairs, new OnTangoUpdateListener() {
@Override
public void onPoseAvailable(final TangoPoseData pose) {
// Process pose data from device with respect to start of service
}
// TODO: Define other overrides
});
final ArrayList<TangoCoordinateFramePair> framePairs =
new ArrayList<TangoCoordinateFramePair>();
framePairs.add(new TangoCoordinateFramePair(
TangoPoseData.COORDINATE_FRAME_AREA_DESCRIPTION,
TangoPoseData.COORDINATE_FRAME_START_OF_SERVICE));
// Listen for new Tango data
mTango.connectListener(framePairs, new OnTangoUpdateListener() {
@Override
public void onPoseAvailable(final TangoPoseData pose) {
// Process pose data from device with respect to start of service
}
// TODO: Define other overrides
});
@Override
public void onPoseAvailable(TangoPoseData pose) {
if (pose.baseFrame == TangoPoseData.COORDINATE_FRAME_AREA_DESCRIPTION
&& pose.targetFrame == TangoPoseData.COORDINATE_FRAME_DEVICE) {
// Process new ADF to device pose data.
}
else if (pose.baseFrame == TangoPoseData.COORDINATE_FRAME_AREA_DESCRIPTION
&& pose.targetFrame == TangoPoseData.COORDINATE_FRAME_START_OF_SERVICE) {
// Process new localization.
}
String newAdfUUID = mTango.saveAreaDescription()
Tango UX Framework
Java Support Library
Additional goodies
Confidential and proprietary
New scenarios
Indoor Wayfinding
Augmented reality
Measurement
get.google.com/tango/developers/
What’s next?
Playlist: https://goo.gl/mmC3JA
github.com/googlesamples/tango-examples-java
plus.google.com/communities/114537896428695886568
Twitter: @mik3lantoniO
Facebook: mikelantonio
Mail: mikelantonio.trizio@gmail.com
Google+: +MichelantonioTrizio
Github: mikelantonio
Contatti
Thank you :)
and now Feedback
Form!!!
https://goo.gl/txE734
Mike Trizio
@mik3lantoniO

Contenu connexe

Tendances

Reacting with ReactiveUI
Reacting with ReactiveUIReacting with ReactiveUI
Reacting with ReactiveUI
kiahiska
 
NS2: Binding C++ and OTcl variables
NS2: Binding C++ and OTcl variablesNS2: Binding C++ and OTcl variables
NS2: Binding C++ and OTcl variables
Teerawat Issariyakul
 
Lock? We don't need no stinkin' locks!
Lock? We don't need no stinkin' locks!Lock? We don't need no stinkin' locks!
Lock? We don't need no stinkin' locks!
Michael Barker
 

Tendances (20)

Type script in practice
Type script in practiceType script in practice
Type script in practice
 
Go Concurrency Basics
Go Concurrency Basics Go Concurrency Basics
Go Concurrency Basics
 
FSE 2008
FSE 2008FSE 2008
FSE 2008
 
Swift & ReactiveX – Asynchronous Event-Based Funsies with RxSwift
Swift & ReactiveX – Asynchronous Event-Based Funsies with RxSwiftSwift & ReactiveX – Asynchronous Event-Based Funsies with RxSwift
Swift & ReactiveX – Asynchronous Event-Based Funsies with RxSwift
 
Golang Channels
Golang ChannelsGolang Channels
Golang Channels
 
Concurrency in Golang
Concurrency in GolangConcurrency in Golang
Concurrency in Golang
 
Go Concurrency
Go ConcurrencyGo Concurrency
Go Concurrency
 
Reactive Programming with RxSwift
Reactive Programming with RxSwiftReactive Programming with RxSwift
Reactive Programming with RxSwift
 
Go concurrency
Go concurrencyGo concurrency
Go concurrency
 
OSGi World Congress Workshop Exercise - P Kriens
OSGi World Congress Workshop Exercise - P KriensOSGi World Congress Workshop Exercise - P Kriens
OSGi World Congress Workshop Exercise - P Kriens
 
Reacting with ReactiveUI
Reacting with ReactiveUIReacting with ReactiveUI
Reacting with ReactiveUI
 
1st program
1st program1st program
1st program
 
Reactive programming with RxSwift
Reactive programming with RxSwiftReactive programming with RxSwift
Reactive programming with RxSwift
 
Python Coroutines, Present and Future
Python Coroutines, Present and FuturePython Coroutines, Present and Future
Python Coroutines, Present and Future
 
NS2: Binding C++ and OTcl variables
NS2: Binding C++ and OTcl variablesNS2: Binding C++ and OTcl variables
NS2: Binding C++ and OTcl variables
 
Lock? We don't need no stinkin' locks!
Lock? We don't need no stinkin' locks!Lock? We don't need no stinkin' locks!
Lock? We don't need no stinkin' locks!
 
ECMA Script
ECMA ScriptECMA Script
ECMA Script
 
Goroutines and Channels in practice
Goroutines and Channels in practiceGoroutines and Channels in practice
Goroutines and Channels in practice
 
Reactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwiftReactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwift
 
To connect two jframe
To connect two jframeTo connect two jframe
To connect two jframe
 

Similaire à Primi passi con Project Tango

Exercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera CymbronExercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera Cymbron
cymbron
 
망고100 보드로 놀아보자 19
망고100 보드로 놀아보자 19망고100 보드로 놀아보자 19
망고100 보드로 놀아보자 19
종인 전
 

Similaire à Primi passi con Project Tango (20)

Jersey Guice AOP
Jersey Guice AOPJersey Guice AOP
Jersey Guice AOP
 
Android workshop
Android workshopAndroid workshop
Android workshop
 
Using zone.js
Using zone.jsUsing zone.js
Using zone.js
 
Exercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera CymbronExercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera Cymbron
 
Androidaop 170105090257
Androidaop 170105090257Androidaop 170105090257
Androidaop 170105090257
 
Matching Game In Java
Matching Game In JavaMatching Game In Java
Matching Game In Java
 
Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015
 
Android training day 5
Android training day 5Android training day 5
Android training day 5
 
The 2016 Android Developer Toolbox [MOBILIZATION]
The 2016 Android Developer Toolbox [MOBILIZATION]The 2016 Android Developer Toolbox [MOBILIZATION]
The 2016 Android Developer Toolbox [MOBILIZATION]
 
The Ring programming language version 1.5.4 book - Part 81 of 185
The Ring programming language version 1.5.4 book - Part 81 of 185The Ring programming language version 1.5.4 book - Part 81 of 185
The Ring programming language version 1.5.4 book - Part 81 of 185
 
망고100 보드로 놀아보자 19
망고100 보드로 놀아보자 19망고100 보드로 놀아보자 19
망고100 보드로 놀아보자 19
 
The Ring programming language version 1.5.4 book - Part 8 of 185
The Ring programming language version 1.5.4 book - Part 8 of 185The Ring programming language version 1.5.4 book - Part 8 of 185
The Ring programming language version 1.5.4 book - Part 8 of 185
 
京都Gtugコンパチapi
京都Gtugコンパチapi京都Gtugコンパチapi
京都Gtugコンパチapi
 
From Java to Kotlin beyond alt+shift+cmd+k - Kotlin Community Conf Milan
From Java to Kotlin beyond alt+shift+cmd+k - Kotlin Community Conf MilanFrom Java to Kotlin beyond alt+shift+cmd+k - Kotlin Community Conf Milan
From Java to Kotlin beyond alt+shift+cmd+k - Kotlin Community Conf Milan
 
Pablo Magaz | ECMAScript 2018 y más allá | Codemotion Madrid 2018
Pablo Magaz | ECMAScript 2018 y más allá | Codemotion Madrid 2018Pablo Magaz | ECMAScript 2018 y más allá | Codemotion Madrid 2018
Pablo Magaz | ECMAScript 2018 y más allá | Codemotion Madrid 2018
 
The Ring programming language version 1.5.3 book - Part 8 of 184
The Ring programming language version 1.5.3 book - Part 8 of 184The Ring programming language version 1.5.3 book - Part 8 of 184
The Ring programming language version 1.5.3 book - Part 8 of 184
 
Clean coding-practices
Clean coding-practicesClean coding-practices
Clean coding-practices
 
The Ring programming language version 1.5.1 book - Part 7 of 180
The Ring programming language version 1.5.1 book - Part 7 of 180The Ring programming language version 1.5.1 book - Part 7 of 180
The Ring programming language version 1.5.1 book - Part 7 of 180
 
Deep Dumpster Diving
Deep Dumpster DivingDeep Dumpster Diving
Deep Dumpster Diving
 
Backendless apps
Backendless appsBackendless apps
Backendless apps
 

Plus de Michelantonio Trizio

Plus de Michelantonio Trizio (9)

[App devcon 18] Brace yourself with Android Architecture Components
[App devcon 18] Brace yourself with Android Architecture Components[App devcon 18] Brace yourself with Android Architecture Components
[App devcon 18] Brace yourself with Android Architecture Components
 
Android Architecture components
Android Architecture componentsAndroid Architecture components
Android Architecture components
 
Droidcon Turin 2015 - Android wear sdk introduction
Droidcon Turin 2015 - Android wear sdk introductionDroidcon Turin 2015 - Android wear sdk introduction
Droidcon Turin 2015 - Android wear sdk introduction
 
How to deploy a Java application on Google App engine Flexible environment
How to deploy a Java application on Google App engine Flexible environmentHow to deploy a Java application on Google App engine Flexible environment
How to deploy a Java application on Google App engine Flexible environment
 
Open street map
Open street mapOpen street map
Open street map
 
Fonti informative sugli Open Data
Fonti informative sugli Open DataFonti informative sugli Open Data
Fonti informative sugli Open Data
 
About open data
About open dataAbout open data
About open data
 
20131123 open bsk@open
20131123 open bsk@open20131123 open bsk@open
20131123 open bsk@open
 
Startup weekend bootcamp
Startup weekend bootcampStartup weekend bootcamp
Startup weekend bootcamp
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Primi passi con Project Tango

  • 1. Primi passi con Tango Mike Trizio @mik3lantoniO
  • 2.
  • 3.
  • 4.
  • 5.
  • 7.
  • 8.
  • 10.
  • 11. onCreate() ... // Create a new Tango Configuration and enable the MotionTracking API mConfig = new TangoConfig(); mConfig = mTango.getConfig(TangoConfig.CONFIG_TYPE_CURRENT); ...
  • 12. onResume() ... try { mTango.connect(mConfig); } catch (TangoOutOfDateException e) { // handle the error } ...
  • 13. onPause() ... try { mTango.disconnect(); } catch (TangoErrorException e) { // handle the error } ...
  • 14. mTango.connectListener(framePairs, new OnTangoUpdateListener() { @Override public void onTangoEvent(final TangoEvent event) { if (event.eventKey.equals(TangoEvent.DESCRIPTION_FISHEYE_OVER_EXPOSED) { // handle the Fisheye camera issue } if (event.eventKey.equals(TangoEvent.DESCRIPTION_TOO_FEW_FEATURES_TRACKED) // handle having too few features } // ... } }
  • 15.
  • 16. final ArrayList<TangoCoordinateFramePair> framePairs = new ArrayList<TangoCoordinateFramePair>(); framePairs.add(new TangoCoordinateFramePair( TangoPoseData.COORDINATE_FRAME_START_OF_SERVICE, TangoPoseData.COORDINATE_FRAME_DEVICE)); // Listen for new Tango data mTango.connectListener(framePairs, new OnTangoUpdateListener() { @Override public void onPoseAvailable(final TangoPoseData pose) { // Process pose data from device with respect to start of service } // TODO: Define other overrides });
  • 17. // Define what motion is requested. TangoCoordinateFramePair frames_of_reference; frames_of_reference.baseFrame = TangoPoseData.COORDINATE_FRAME_START_OF_SERVICE; frames_of_reference.targetFrame = TangoPoseData.COORDINATE_FRAME_DEVICE;
  • 18. new Thread(new Runnable() { final int pollingUpdatePeriodMilliseconds = 66; @Override public void run() { while (true) { try { Thread.sleep(pollingUpdatePeriodMilliseconds); final TangoPoseData queryPoseStartDevice = mTango.getPoseAtTime(0.0, frames_of_reference); } catch (TangoErrorException e) { e.printStackTrace(); } } } }).start();
  • 19.
  • 20. onCreate() ... // Create a new Tango Configuration with Depth Perception API enabled mConfig = new TangoConfig(); mConfig = mTango.getConfig(TangoConfig.CONFIG_TYPE_CURRENT); mConfig.putBoolean(TangoConfig.KEY_BOOLEAN_DEPTH, true); ...
  • 21. mTango.connectListener(framePairs, new OnTangoUpdateListener() { .... @Override public void onPointCloudAvailable(final TangoPointCloudData pointCloudData) { logPointCloud(pointCloudData); } ... });
  • 22. private void logPointCloud(TangoPointCloudData pointCloudData) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("Point count: " + pointCloudData.numPoints); stringBuilder.append(". Average depth (m): " + calculateAveragedDepth(pointCloudData.points, pointCloudData.numPoints)); Log.i(TAG, stringBuilder.toString()); } private float calculateAveragedDepth(FloatBuffer pointCloudBuffer, int numPoints) { float totalZ = 0; float averageZ = 0; if (numPoints != 0) { int numFloats = 4 * numPoints; for (int i = 2; i < numFloats; i = i + 4) { totalZ = totalZ + pointCloudBuffer.get(i); } averageZ = totalZ / numPoints; } return averageZ; }
  • 23.
  • 24.
  • 25.
  • 26.
  • 27. onCreate() ... // Create a new Tango Configuration with Depth Perception API enabled mConfig = new TangoConfig(); mConfig = mTango.getConfig(TangoConfig.CONFIG_TYPE_CURRENT); mConfig.putBoolean(TangoConfig.KEY_BOOLEAN_LEARNINGMODE, true); ...
  • 29. ArrayList<String> fullUUIDList = new ArrayList<String>(); // Returns a list of ADFs with their UUIDs fullUUIDList = mTango.listAreaDescriptions(); // Load the latest ADF if ADFs are found. if (fullUUIDList.size() > 0) { mConfig.putString(TangoConfig.KEY_STRING_AREADESCRIPTION, fullUUIDList.get(fullUUIDList.size() - 1)); }
  • 30. final ArrayList<TangoCoordinateFramePair> framePairs = new ArrayList<TangoCoordinateFramePair>(); framePairs.add(new TangoCoordinateFramePair( TangoPoseData.COORDINATE_FRAME_AREA_DESCRIPTION, TangoPoseData.COORDINATE_FRAME_DEVICE)); // Listen for new Tango data mTango.connectListener(framePairs, new OnTangoUpdateListener() { @Override public void onPoseAvailable(final TangoPoseData pose) { // Process pose data from device with respect to start of service } // TODO: Define other overrides });
  • 31. final ArrayList<TangoCoordinateFramePair> framePairs = new ArrayList<TangoCoordinateFramePair>(); framePairs.add(new TangoCoordinateFramePair( TangoPoseData.COORDINATE_FRAME_AREA_DESCRIPTION, TangoPoseData.COORDINATE_FRAME_START_OF_SERVICE)); // Listen for new Tango data mTango.connectListener(framePairs, new OnTangoUpdateListener() { @Override public void onPoseAvailable(final TangoPoseData pose) { // Process pose data from device with respect to start of service } // TODO: Define other overrides });
  • 32. @Override public void onPoseAvailable(TangoPoseData pose) { if (pose.baseFrame == TangoPoseData.COORDINATE_FRAME_AREA_DESCRIPTION && pose.targetFrame == TangoPoseData.COORDINATE_FRAME_DEVICE) { // Process new ADF to device pose data. } else if (pose.baseFrame == TangoPoseData.COORDINATE_FRAME_AREA_DESCRIPTION && pose.targetFrame == TangoPoseData.COORDINATE_FRAME_START_OF_SERVICE) { // Process new localization. }
  • 33. String newAdfUUID = mTango.saveAreaDescription()
  • 34. Tango UX Framework Java Support Library Additional goodies
  • 37.
  • 38.
  • 40.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 48.
  • 49. Twitter: @mik3lantoniO Facebook: mikelantonio Mail: mikelantonio.trizio@gmail.com Google+: +MichelantonioTrizio Github: mikelantonio Contatti
  • 50. Thank you :) and now Feedback Form!!! https://goo.gl/txE734 Mike Trizio @mik3lantoniO