What Are Tango Poses?Tango姿态是什么?
What Are Tango Poses?什么是Tango姿态?
As your device moves through 3D space, it calculates where it is (position) and how it's rotated (orientation) up to 100 times per second. A single instance of this combined calculation is called the device's pose. The pose is an essential concept when working with motion tracking, area learning, or depth perception.
当你的设备通过3D空间时,它计算它在哪里(位置)以及它是如何旋转的(方向)。这达到每秒100次。一个单个的这种复合计算的实例称为设备的姿态。
To calculate the poses, you must choose base and target frames of reference , which may use different coordinate systems. You can view a pose as the translation and rotation required to transform vertices from the target frame to the base frame.为了计算位姿,你必须选择基础和目标参考框架,这可能会使用不同的坐标系统。
Here is a simplified version of a Tango pose struct in C:
这里是一个C语言简洁版的Tango姿态结构体:
struct PoseData {
double orientation[4];
double translation[3];
}
The two key components of a pose are:
姿态的两个关键组件是:
A quaternion that defines the rotation of the target frame with respect to the base frame.定义目标框架相对于基础框架的旋转四元数。
A 3D vector that defines the translation of the target frame with respect to the base frame.定义目标框架相对于基础框架的三维矢量。
An actual pose struct contains other fields, such as a timestamp and a copy of the frame pair, as you'll see below.一个真正的姿态结构体包含其他域名,比如时间戳以及框架对的复件,正如下面看到的。
Note: The examples on this page use the C API, but function calls and data structures are similar for Java. In Unity, there are prefabs which handle a lot of these details for you.
Pose data姿态数据
You can request pose data in two ways: 你可以以两种方式请求姿态数据:
Request Method #1 请求方法 #1
Poll for poses using TangoService_getPoseAtTime()
. This returns the pose closest to a given timestamp from the base to the target frame. Here is the code for this function in the C API:使用TangoService_getPoseAtTime()方法请求姿态。它返回从基础框架到目标框架最靠近给定时间戳的姿态。
TangoErrorType TangoService_getPoseAtTime(
double timestamp,
TangoCoordinateFramePair frame_pair,
TangoPoseData* pose);
The TangoCoordinateFramePair
struct specifies the base frame and the target frame.TangoCoordinateFramePair结构体指定了基础框架和目标框架。
Note: If you are making an augmented reality app, we recommend that you use TangoService_getPoseAtTime() or TangoSupport_getPoseAtTime() because, in addition to polling for poses, they allow you to align the pose timestamps with the video frames.
The following code gets a pose of the device frame with respect to the start-of- service frame:
下面的代码可以获取相对于服务开始帧的设备帧的位姿:
TangoPoseData pose_start_service_T_device;
TangoCoordinateFramePair frame_pair;
frame_pair.base = TANGO_COORDINATE_FRAME_START_OF_SERVICE;
frame_pair.target = TANGO_COORDINATE_FRAME_DEVICE;
TangoService_getPoseAtTime(
timestamp,
frame_pair,
&pose_start_service_T_device);
In this example, including the names of the base and target frames in the pose variable name makes the name more descriptive:
在该例子中,由于包含了基础和目标框架的名字,所以位姿变量名更具有描述性:
TangoPoseData pose_start_service_T_device;
Request Method #2 请求方法 #2
Receive pose updates as they become available. To do so, attach an onPoseAvailable()
callback toTangoService_connectOnPoseAvailable()
. This sample is from our hello_motion_tracking example project and can be found in the tango_handler.cc file:
如果位姿更新可用便接受它。为了这么做,添加onPoseAvailable()反馈到TangoService_connectOnPoseAvailable()中。该样例是来自我们的hello_motion_tracking样例项目中,可以在tango_handler.cc文件中找到它:
TangoCoordinateFramePair pair;
pair.base = TANGO_COORDINATE_FRAME_START_OF_SERVICE;
pair.target = TANGO_COORDINATE_FRAME_DEVICE;
if (TangoService_connectOnPoseAvailable(1, &pair, onPoseAvailable) !=
TANGO_SUCCESS) {
LOGE("TangoHandler::ConnectTango, connectOnPoseAvailable error.");
std::exit(EXIT_SUCCESS);
In both cases, you receive a TangoPoseData
struct:
在两种情况下,你都接收一个TangoPoseData结构体:
typedef struct TangoPoseData {
int version;
double timestamp; // In seconds
double orientation[4]; // As a quaternion
double translation[3]; // In meters
TangoPoseStatusType status_code;
TangoCoordinateFramePair frame;
int confidence; // Currently unused
float accuracy; // Currently unused
} TangoPoseData;
Pose status姿态状态
TangoPoseData
contains a state, denoted by the TangoPoseStatusType
enum, which provides information about the status of the pose estimation system. The available TangoPoseStatusType
members are: TangoPoseData包括一个状态,是由TangoPoseStatusType枚举型贡献的,它提供了关于姿态估计系统的状态的信息。可用的TangoPoseStatusType成员有:
typedef enum {
TANGO_POSE_INITIALIZING = 0,
TANGO_POSE_VALID,
TANGO_POSE_INVALID,
TANGO_POSE_UNKNOWN
} TangoPoseStatusType;
INITIALIZING
: The motion tracking system is either starting or recovering from an invalid state, and the pose data should not be used.
INITIALIZING:运动追踪系统要么是启动中,要么是从一个无效的状态中恢复,该姿态数据不可用。
VALID
: The system believes the poses being returned are valid and should be used.
VALID:系统相信返回的姿态是合理的,可用的。
INVALID
: The system has encountered difficulty of some kind, so pose estimations are likely incorrect.
INVALID:系统经历了某些困难,所以姿态预测值很可能是不对的。
UNKNOWN
: The system is in an unknown state.
UNKOWN:系统是处于位姿未知状态。
Lifecycle of pose status位姿状态的声明周期
The TANGO_POSE_INITIALIZING
status code indicates that the Tango framework is initializing and pose data is not yet available. If you are using callbacks, you will receive only one pose update with the status code set toTANGO_POSE_INITIALIZING
while the framework is initializing.
TANGO_POSE_INITIALIZING状态码表示Tango框架正在初始化,而姿态数据还不可用。如果你正在使用反馈机制,你会在当框架初始化时只接收到一个带有一个TANGO_POSE_INITIALIZING的姿态更新。
After initialization finishes, poses are in the TANGO_POSE_VALID
state. If you are using callbacks, you will receive updates as frequently as they are available.
初始化结束后,姿态是TANGO_POSE_VALID状态。如果你使用反馈机制,你将在它们姿态可用时接收更新。
If the system encounters difficulty and enters the TANGO_POSE_INVALID
state, recovery depends on your configuration during initialization. If config_enable_auto_recovery
is set to True
, the system immediately resets the motion tracking system and enters the TANGO_POSE_INITIALIZING
state. Ifconfig_enable_auto_recovery
is set to False
, pose data remains in the TANGO_POSE_INVALID
state and no updates are received until you call TangoService_resetMotionTracking()
.
如果系统遇到困难遇到TANGO_POSE_INVALID状态,恢复依赖于你在初始化时的配置信息。如果config_enable_auto_recovery设置为真,系统将会迅速重置运动追踪系统,进入TANGO_POSE_INITIALIZING状态。如果config_enable_auto_recovery设为否,姿态数据保持在TANGO_POSE_INVALID状态,不接收更新直到你调用TangoService_resetMotionTracking()函数。
Using pose status 使用位姿状态
Your application should react to the status being returned within the pose data. For example, wait until the pose data you are interested in becomes valid before starting interactions in your application. If the pose becomes invalid, pause interactions until after the system recovers. Depending on your application, what you do after the system recovers will vary. If you are using motion tracking alone, you can simply resume your application. If you are using area learning or ADFs, instruct your user to move around until the device can localize itself.
你的应用应该对位姿数据中返回的状态做出反应。举例来说,在开始你的应用交互之前等待直到你感兴趣的姿态数据变得有效为止。如果姿态无效了,中止交互直到你的系统恢复之后。取决于你的应用,系统恢复之后你做什么是不同的。如果你只是在使用运动追踪,那么你只是简单继续你的应用。如果你在使用区域学习或者ADF文件,那么引导你的用户四处转转直到你的设备能够定位。
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.
上次更新日期:三月 9, 2017
What Are Tango Poses?Tango姿态是什么?的更多相关文章
- Getting Started with Google Tango(Google Tango开始教程)
https://developers.google.com/tango/ Build apps that understand space and motion in high fidelity on ...
- Hello_Area_Description 任务三:Project Tango采集区域描述数据
Permission Dialogs for Users in Java在Java中用户使用的权限对话框 Tango works by using visual cues from the devic ...
- How To Start Building Spatially Aware Apps With Google’s Project Tango
How To Start Building Spatially Aware Apps With Google’s Project Tango “Tango can enable a whole new ...
- Hello_Motion_Tracking 任务一:Project Tango采集运动追踪数据
我们来看一下中的几个基本的例子 (区域描述.深度感知.运动追踪.视频4个) 参考:Google Tango初学者教程 1. hello_motion_tracking package com.proj ...
- Google Tango SDK下载
Tango SDK files谷歌Tango开发包 The Tango SDK is under active development; please keep this in mind as you ...
- AR中的SLAM(二)
写在前面 本文想讨论一下AR的架构和SLAM在其中的作用. AR AR的框架可以简单划分为感知和交互两部分. 感知部分主要负责信息的收集和处理.信息主要通过不同的传感器收集,包括图像.设备加速度.距离 ...
- 阿根廷探戈舞会- 一起salsa百科 - 一起salsa网 - Powered by HDWiki!
阿根廷探戈舞会- 一起salsa百科 - 一起salsa网 - Powered by HDWiki! 阿根廷探戈舞会 编辑词条 发表评论(2) 目录 • 京城阿根廷探戈资源 • 上海阿根廷探戈 ...
- 关于AR,你想要的全在这儿了
定义 增强现实(Augmented Reality,简称AR),是一种实时地计算摄影机影像的位置及角度并加上相应图像的技术,这种技术的目标是在屏幕上把虚拟世界套在现实世界并进行互动.这种技术估计由19 ...
- Android 3D游戏开发
OpenGL ES(OpenGL Embedded System) Android 3D游戏开发技术宝典:OpenGL ES 2.0(android 3d游戏开发技术宝典 -opengl es 2.0 ...
随机推荐
- SpringBoot2.0 url中出现特殊符号「带括号{}'"等等」时会抛出400错误
访问 http://127.0.0.1:8080/api?method=taxiong.goods.list¶ms={"page":1,"pageSize ...
- 【转】open-falcon监控windows机器
open-falcon监控windows机器 时间:2016-05-22 15:34:04 来源:眷恋江南 编辑:涛涛 点击:791 A-A+ 最近公司上线了一款新的游戏,用的 ...
- generatorConfig.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE generatorConfiguration ...
- 学习blus老师js(1)--基础
1.网页换肤: <!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <t ...
- [转][C#]压缩解压缩类 GZipStream
本文来自:https://msdn.microsoft.com/zh-cn/library/system.io.compression.gzipstream(v=vs.100).aspx using ...
- osx安装启动mysql
安装mysql 最新版 56 brew install mysql 1 启动报错 ben:~ soul$ which mysql /usr/local/bin/mysql ben:~ soul$ my ...
- Java下LDAP操作的资料
话说LDAP真是个诡异的protocol(或者数据库,或者服务,whatever...),没有一个特别形象的spec.这里列出一些筛选出的还可以的文档,都是oracle的: https://docs. ...
- 建设银行网上银行MD5withRSA php版
1. 首先通过java程序将建设银行的公钥串转成pem格式并写入文件 SignTest.java是运行程序, RSASig.java是建设银行签名算法类, bcprov-jdk15-145.jar是P ...
- Spring Data JPA 基本使用
Spring Data 简化开发,支持Nosql和关系型数据库, DEMO https://github.com/easonstudy/boot-demo/tree/master/boot-sprin ...
- string类型版本号比较
直接上代码吧: boolean CompareVersion(string softVersion1, string softVersion2) { ) { return true; } return ...