Google Tango初学者教程

2023-05-16

 

Getting Started with the Tango Java API

In this tutorial, we'll go through setting up your build environment and compiling and running your first "Hello Tango" project using the Java API, which will run sample code and display the pose data from your device.

在本教程中,我们将尝试设置你的开发环境,使用Java API编译并运行你的第一个“Hello Tango”工程。它将运行样本代码,并且展示你的设备的姿态数据。

Prerequisites提前条件

To successfully follow this guide, you will need:要成功进行该指示,你需要:

  • Android Studio

  • Experience developing Android apps. If you have never created an Android app before, you can get started with our Building Your First App tutorial.体验开发Android应用。如果你从未创建过Android应用,你可以从这里开始。

  • The sample project. This includes the Tango Java API files, which you can find in the subfolder named TangoReleaseLibs after you download the project. For download instructions, see the next section.样例程序。它包括Tango Java API文件,下载完后你能在子文件夹名为TangoReleaseLibs中发现它。下载指南请看下一节。

  • A Tango Tablet Development Kit. You can build the code without one, but you won't be able to run it.一个Tango平板开发套件。没有它你也可以生成项目,但是你没办法运行它。

Note: The Android emulator cannot be used for this project or any other project that uses the Tango API. You  musthave a Tango device.安卓模拟器不能用在使用Tango API的项目。

Download the sample project 下载示例项目

The sample project is hosted on GitHub. You can download it as a zip file or use git to clone the repository:样例项目是在Github上保管。你可以以zip文件的形式下载或者使用git克隆该仓库:

git clone https://github.com/googlesamples/tango-examples-java.git

You should now have a directory called tango-examples-java on your machine. Within this directory you should see a subdirectory called java_basic_examples, which contains the code for this guide.现在你应该有一个叫tango-examples-java的目录。在该目录中你应该看到一个叫java_basic_examples的子目录。它包含本向导的代码。

Import the project into Android Studio将工程导入到Android Studio中

  1. Do one of the following: 做下面中的一个:

    • Open Android Studio.打开Android Studio
    • If you are already in Android Studio with a project loaded, close the project.如果你已经在Android Studio中打开一个项目,那么关闭该项目。

    Either action takes you to the Welcome to Android Studio screen.任何一个都会带你到Android Studio的欢迎界面。

  2. Select Import Project (Eclipse ADT, Gradle, etc.). In older versions of Android Studio, this may be Import Non-Android Studio project or simply Import Project. 选择Import Project导入项目。在其他版本的Android Studio中,这可能是Import Non-Android Studio project导入非Android Studio项目或仅仅是Import Project导入项目。

  3. In the Select Eclipse or Gradle Project to Import dialog, navigate to the repository you just cloned. Choose the java_basic_examples directory and then click OK.在导入对话框,跳转到你刚刚克隆的仓库。选择java_basic_examples目录然后单击OK。

Note: If an error appears that says "failed to find target-android-19" and offers you a link to "Install missing platform(s) and sync project", click that link and go through the steps to update your Android platform.如果错误出现说“查找target-android-19失败”,并给你提供一个链接“安装缺少的平台和同步项目”,点击该链接并运行各步骤从而更新你的Android平台。

Connect your device连接你的设备

If you haven't already connected your Tango device to your computer, you should do so now.如果你还没有连接你的Tango设备到你的计算机,你应该现在连接上。

Tango手机USB驱动C:\Users\Administrator\AppData\Local\Android\Sdk\extras\google\usb_driver

Build and run an application建立并运行一个应用

Within the basic examples project you loaded, you have a choice of several different "hello"-style apps to build and run. For this tutorial, we'll choose "Hello Motion Tracking."

在你已经加载的基本样本项目中,你有几个不同的“hello”类型的应用建立和运行。对本教程,我们选择“Hello Motion Tracking”。

  1. On the toolbar, view the Run/Debug Configuration field and make sure hello_motion_tracking is the active configuration. If it is not, click the field and select it.在工具栏中,查看Run/Debug配置栏中确保hello_motion_tracking是活动配置。如果不是,请点击该区域选择它。

  2. Do one of the following:做下面的一个:

    • On the Run menu, click Run.在运行菜单,点击Run运行。
    • On the toolbar, click the Run button (the green arrow).
  3. In the Device Chooser dialog, select Choose a running device, then select your Tango tablet, and then click OK.

Note: If your device isn't showing up in the Device Chooser dialog, make sure it is plugged in and has  Developer options enabled. For more information, see  "Enabling On-device Developer Options".

See logcat for the raw pose data查看logcat中的原始姿态数据

You can see logcat output automatically in the bottom part of Android Studio.你可以在Android Studio的下部看到自动输出的logcat。

If you want to see it in your terminal, type如果你想在你的终端看到,输入:

 

adt_path/sdk/platform-tools/adb logcat  

You will see the pose data being printed in your terminal:你将看到在你的终端打印的姿态数据(平移xyz/旋转/比例尺?):

 

I/MainActivity( 6010): Translation: 0.020329, 0.013915,
-0.008571 | Rotation: 0.581630, 0.014597, -0.021857, 0.813029  

Add to your own project添加到你自己的项目中

The Tango SDK for Java components are distributed on Bintray and are available through the JCenter repository when using Maven.

支持Java组件的Tango SDK分布在Bintray中,在使用Maven时通过JCenter的仓库获取。

  1. First, add jcenter() to your build.gradle file so Gradle can find the AARs. For example: 首先,添加jcenter()到你的build.gradle文件中,从而Gradle可以找到AAR。

     
    allprojects {
        repositories {
            jcenter()
        }
    }
  2. Add the appropriate dependencies to the build.gradle files in your modules. You can determine this by looking at the samples' build.gradle files to see what each one needs. For example, our motion tracking sample uses: 将合适的依赖添加到你的模块中的build.gradle文件中。你可以看一下样例“build.gradle”文件看一下每一个都需要什么。例如,我们的motion tracking运动追踪样例需要:

     

     
    
    dependencies {
        compile 'com.google.tango:sdk-base:LATEST_VERSION'
        compile 'com.google.tango:support-base:LATEST_VERSION'
    }

     

    The latest version looks like 1.51 and can be found on the downloads page. This code indicates that an application similar to the motion tracking sample needs sdk-base and support-base. This will also recursively fetch dependent libraries. 最新版本比如1.51,可以在下载页找到。该代码显示了类似于motion tracking的应用需要sdk-base和support-base两个开发包。这也会递归地获取依赖库。

Once this is done for all of the required libraries, you will be able to reference code in the Tango SDK in your app. 一旦对于所有的所需的类库都完成了,你将会能够引用Tango SDK中的代码。

If you are using your own build system, the Tango libraries are also available from the downloads page.如果你想使用你自己的编译系统,Tango类库也可以在下载页面下载。

Next steps 接下来

Now that you have learned how to set up your environment for development with the Tango Java API, proceed to the following links to learn how to use specific features of Tango in your app:你已经学会如何设置你的Tango Java API的开发环境了,继续下面的链接学习如何使用Tango特定的特征吧:

  • Configure and Connect 配置和连接
  • Motion Tracking 运动追踪
  • Area Learning 区域学习
  • Depth Perception 深度感知
  • User Permissions 用户允许

Also, take a look at our code samples on Github. 然后看一下我们在Github托管的代码例子。

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License, and code samples are licensed under the Apache 2.0 License. For details, see our Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

上次更新日期:四月 7, 2017

本文转自:https://developers.google.com/tango/apis/java/

转载于:https://www.cnblogs.com/2008nmj/p/7152201.html

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Google Tango初学者教程 的相关文章

  • ESP32-s2芯片esp32-s2-saola-1开发板 micropython的repl连接

    本文只是解决通过esp32 s2 saola 1开发板 自带microUSB 作为repl与micro python通信的问题 如果你对esp32 xff0c micropython不熟 xff0c 本文不适合你 如果你用的不是esp32
  • 机械臂模拟2.0

    机械臂模拟 void MobileCrane updateHopeLength int center x int center y int center z int armNodeNum int ropePitchNum int baseN
  • Qt获取时间戳作为图片名

    Qt获取时间戳作为图片名 保存图片 void SaveRealsenseImg QString picIndexName 61 dataSavePath picIndexName append 34 34 获取当前时间 QDateTime
  • [转&精]IO_STACK_LOCATION与IRP的一点笔记

    IO STACK LOCATION和IRP算是驱动中两个很基础的东西 xff0c 为了理解这两个东西 xff0c 找了一点资料 1 IRP可以看成是Win32窗口程序中的消息 xff08 Message xff09 xff0c DEVICE
  • wireshark抓包结果很多[TCP Retransmission]怎么办?

    有一同事问用wireshark抓包时发现很多 TCP Retransmission xff0c 这些包极大影响了自己真正想看的http数据包 xff0c 如下图 我拿到pcapng后首先看到这些包的来源ip都是固定的两个 xff0c 所以首
  • MATLAB神经网络训练结果各参数解释

    最上面的图形显示的是神经网络的结构图 xff0c 可知有一个隐层一个输出层 第二部分显示的是训练算法 xff0c 这里为学习率自适应的梯度下降BP算法 xff1b 误差指标为MSE 第三部分显示训练进度 xff1a Epoch xff1a
  • SQL语句统计个数大于一的记录

    1 主要是利用Having语句进行 xff0c 由于where不能与聚合函数一起使用 xff0c 所以用having SELECT MC COUNT MC AS SL FROM JSB GROUP BY MC HAVING COUNT MC
  • You must give at least one requirement to install (see "pip help install")

    语言 python why install 后面没有参数 xff0c 也就是说没有给想要安装的包 way pip install 后面要跟想要安装的包名 转载于 https www cnblogs com 2bjiujiu p 902966
  • VHDL乘除法及转换

    首先鄙视一下这个不智能的语言 1 要进行乘法与除法 xff0c 数据类型必须是signed 2 两个16位的数相乘 xff0c 结果必须是32位的 3 乘以2的n次幂的数可以直接乘 xff0c 之后截位也比较方便 xff0c xff08 其
  • C语言真正的编译过程

    说实话 xff0c 很多人做了很久的C C 43 43 也用了很多IDE xff0c 但是对于可执行程序的底层生成一片茫然 xff0c 这无疑是一种悲哀 xff0c 可以想象到大公司面试正好被问到这样的问题 xff0c 有多悲催不言而喻 x
  • Docker 删除&清理镜像

    文章首发自个人网站 xff1a https www exception site docker docker delete image 本文中 xff0c 您将学习 Docker 如何删除及清理镜像 xff1f 一 通过标签删除镜像 通过如
  • 解决:invalid application of `sizeof' to incomplete type `({anonymous})'错误

    这个错误的原因 xff1a sizeof不能用在extern变量 xff0c sizeof 的计算发生在代码编译 的时刻 extern 标注的符号 在链接的时刻解析 所以 sizeof 不知道 这个符号到底占用了多少空间 发生错误的程序是这
  • 自制吸锡带

    焊接qfp封装芯片的时候 xff0c 由于两个引脚间距过小 xff0c 常常会在引脚上留有焊锡 xff0c 这个时候就需要吸锡带 xff0c 但是一般情况下我们手边的设备并不齐全 xff0c 所以我们可以利用手边的工具自制 工具 xff1a
  • 实验六

    芯片派生 include lt iostream gt using namespace std class Base public void add int x int y cout lt lt x lt lt 34 43 34 lt lt
  • geometry_msgs.msg.PoseStamped 代码示例

    https programtalk com python examples geometry msgs msg PoseStamped 转载于 https www cnblogs com sea stream p 11129929 html
  • ubuntu 执行apt-get update报错Failed to fetch

    在ubuntu下执行sudo apt get update时 xff0c 经常会遇到报错 xff1a Err http security ubuntu com precise security InReleaseErr http secur
  • github中的wiki是干嘛的_在 Hyperf 框架中,如何定制 gen:model 命令

    Hyperf v2 0 版本中 xff0c 会将 decimal 转化为 float xff0c 从而存在精度丢失的风险 如果直接修改这个问题 xff0c 可能会导致 v2 0 出现 BC xff0c 所以我们在 v2 1 中得到了处理 x
  • APM飞控修改数传模块方法

    APM飞控修改数传模块方法 硬件 ARDUCOPTER第二代数传模块 USB接口 数传模块 telem接口 usb ttl模块 修改方法 注意 xff1a APM固件版本和数传模块估计版本是分开的 xff0c 但有一定的对应关系 xff0c
  • HTTP AUTH 那些事

    谨以此文献给那些需要实现HTTP AUTH的 程序猿 们 关于HTTP AUTH的文档不多 RFC在 http www ietf org rfc rfc2617 txt wiki在 http en wikipedia org wiki Ba
  • 基于超声波的四轴定高控制简析

    笔者是来自武汉理工的小青同学 xff0c 接下来为大家讲一下基于超声波的定高问题 xff0c 鉴于笔者能力有限 xff0c 所以如有错误请多指教 xff0c 且很多仅仅是工程上的近似化应用 xff0c 没有做过仿真模拟 我讲的东西更加偏重于

随机推荐

  • Android 新建工程 卡在Gradle:Resolve dependencies':app:_debugCompile'

    今天更新 androidSDK 到 5 0 xff0c 发现新建工程时卡在 Gradle Resolvedependencies 39 app debugCompile 39 首先 xff0c googledevelop是访问不了的 xff
  • 数学公式

    一 泰勒公式 数学中 xff0c 泰勒公式是一个用函数在某点的信息描述其附近取值的公式 如果函数足够平滑的话 xff0c 在已知函数在某一点的各阶导数值的情况之下 xff0c 泰勒公式可以用这些导数值做系数构建一个多项式来近似函数在这一点的
  • python内置方法和属性

    1 del 方法 作用 当使用类名 创建对象时 xff0c 为对象分配完空间后 xff0c 会自动调用 init 方法 xff0c 当对象被从内存中销毁前 xff0c del 方法会被自动调用 应用场景 xff1a init 方法可以重新设
  • Linux行人识别,0.kcf-tracker 机器人跟踪编程,基于opencv的行人检测和 ,当 发现 后自动进行 。 Linux Network 网络 276万源代码下载- www.pudn.co...

    文件名称 0 kcf tracker下载 收藏 5 4 3 2 1 开发工具 Windows Unix 文件大小 95560 KB 上传时间 2017 05 14 下载次数 0 详细说明 xff1a 机器人跟踪编程 xff0c 基于open
  • 【VirtualBox】快照

    一 快照备份 虚拟机系统快照下来 xff0c 以后就可以恢复到快照之前的系统 右上角 gt 虚拟电脑工具 gt 快照 转载于 https www cnblogs com chenxiaomeng p 9497166 html
  • TX2-start 6 CPU kernel-开启高功耗模式

    1 TX2简介 Jetson TX2是由一个GPU和一个CPU集群组成 CPU集群由双核denver2处理器和四核ARM Cortex A57组成 xff0c 通过高性能互连架构连接 拥有 xff16 个CPU核心和一个GPU xff0c
  • 生成正太随机变量

    clc clear close format long syms u v x y u1 u2 u3 u3 u x1 x2 x3 x4 x5 d L int int int int 1 x5 x4 1 x4 x3 1 x3 x2 1 x2 x
  • 【opencv基础】OpenCV installation stuck at [ 98%] Built target opencv_perf_stitching with no error...

    前言 按照官网步骤安装opencv的过程中进行到98 时一直没有继续进行 原因 后台一直在编译运行 xff0c 只需等待即可 xff0c 参考here xff1b well turns out it gets stuck for quite
  • PX4的UORB通信机制

    在Firmware的msg文件夹里面 xff0c 里面有很多 msg结尾的文件 xff0c 这些msg文件在编译的时候可以生成h头文件 xff0c 这些编译过程中生成的头文件一般是保存在build default src module uo
  • ubuntu下安装和更新R语言

    ubuntu 下安装和更新 R 语言 本文主要讲解在 ubuntu 下如何安装和更新 R 语言 将分别介绍什么是 R 语言 xff0c 简单方法安装 R 语言 xff0c 通过更新源来安装或更新 R 语言 xff0c 和安装 R 语言集成开
  • Linux 中各个文件夹的作用

    根目录 包含了几乎所的文件目录 相当于中央系统 进入的最简单方法是 xff1a cd boot 引导程序 xff0c 内核等存放的目录 这个目录 xff0c 包括了在引导过程中所必需的文件 在最开始的启动阶段 xff0c 通过引导程序将内核
  • 转:Fix Bug的五个阶段

    一个非常严重和困难的bug xff0c 能够成就一个饱经沧桑深受压力的有经验的专业程序员的职业生涯 经受这种考验的创伤程度 xff0c 相当你受到了一次严重的身体伤害 xff0c 离婚 xff0c 或是家庭成为的离世 研究人员在研究了计算机
  • 10.app后端选择什么开发语言

    在qq上 xff0c 经常看到有创业团队的创始人一直都招不到技术人员 xff0c 除了项目的因素外 xff0c 很大的原因就是所需要掌握的开发语言偏门 通过阅读本文 xff0c 详细了解选择开发语言的核心原则 xff0c 使各位心里对开发语
  • dell服务器系统开机提示错误解决方法

    DELL 服务器有时会若硬件的改动 xff0c 在开机以后会提示错误信息 信息一般会提示在显示器上 xff0c 以后举出如下信息的解决办法 信息 原因 纠正措施 Alert iDRAC6 not responding Rebooting i
  • 卡尔曼滤波原理

    卡尔曼滤波原理 原文链接 xff1a http www bzarg com p how a kalman filter works in pictures https blog csdn net u010720661 article det
  • 在网络直播中什么叫推流

    参考 xff1a 推流 xff0c 指的是把采集阶段封包好的内容传输到服务器的过程 其实就是将现场的视频信号传到网络的过程 推流 对网络要求比较高 xff0c 如果网络不稳定 xff0c 直播效果就会很差 xff0c 观众观看直播时就会发生
  • Hello, Weka

    转自http dreamhead blogbus com logs 16813833 html Weka xff0c 是一个用Java编写的数据挖掘软件 数据挖掘 xff0c 从字面上来看 xff0c 它是一个从数据中找寻有用信息的过程 x
  • ubuntu基础知识与技巧

    root用户与超级用户的切换 1 sudo i 2 sudo su 3 su root 安装升级 查看软件xxx安装内容 dpkg L xxx 查找软件库中的软件 apt cache search 正则表达式 或 aptitude sear
  • linux多线程编程书籍推荐:linux大牛之路从这几本书開始总结

    linux多线程编程是指基于Linux操作系统下的多线程编程 xff0c 包含多任务程序的设计 xff0c 并发程序设计 网络程序设计 数据共享等 Linux系统下的多线程遵循POSIX线程接口 xff0c 称为pthread 编写Linu
  • Google Tango初学者教程

    Getting Started with the Tango Java API In this tutorial we 39 ll go through setting up your build environment and compi