什么是 Tango 姿势?
2017-02-12 08:58
155 查看
什么是 Tango 姿势?
As your device moves through 3D space, it calculates where it is (position) andhow it's rotated (orientation) up to 100 times per second. A single instance ofthis combined calculation is called the device'spose. The pose is anessential concept when working with motion tracking, area learning, or depthperception.
当您的设备移动通过3D空间时,它计算它的位置(位置),并且它每秒旋转(定向)高达100次。
此组合计算的单个实例称为设备的姿态。 当使用运动跟踪,区域学习或深度感知时,姿势是不重要的概念。
To calculate the poses, you must choose base and target
frames of reference, which may use different
coordinate systems. You can view apose as the translation and rotation required to transform vertices from thetarget frame to the base frame.
要计算姿态,您必须选择基准和目标参考系,这可能使用不同的坐标系。
您可以将apose视为将顶点从目标框架转换为基准框架所需的平移和旋转。
Here is a simplified version of a
Tango pose struct in C:
这里是一个简化版本的探戈姿势结构在C:
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 ofthe frame pair, as you'll see below.
实际的姿势结构包含其他字段,例如时间戳和帧对的副本,如下所示。
Note: The examples on this page use the C API, but function calls and datastructures are similar for Java. In Unity, there are prefabs which handle a lotof these details for you.
注意:本页上的示例使用C API,但函数调用和数据结构与Java类似。
在Unity中,有一些预制件处理这些细节的lotof。
Pose data
姿势数据
You can request pose data in two ways:您可以通过两种方式请求姿势数据:
Request Method #1
请求方法#1
Poll for poses usingTangoService_getPoseAtTime().This returns the pose closest to a given timestamp from the base to the targetframe. Here is the code for this function in the C API:
使用TangoService_getPoseAtTime()轮询姿势,这将返回最接近给定时间戳的姿势从基础到目标帧的姿势。
这里是C API中此函数的代码:
TangoErrorType TangoService_getPoseAtTime( double timestamp, TangoCoordinateFramePair frame_pair, TangoPoseData* pose);
The
TangoCoordinateFramePairstruct specifies the base frame and the target frame.
Note: If you are making an augmented reality app, we recommend that you useTangoService_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:
TangoCoordinateFramePairstruct指定基帧和目标帧。
注意:如果您要制作增强现实应用程序,我们建议您使用TangoService_getPoseAtTime()或TangoSupport_getPoseAtTime(),因为除了轮询姿势之外,它们还允许您将姿势时间戳与视频帧对齐。
以下代码获取设备帧相对于服务启动帧的姿态:
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 posevariable name makes the name more descriptive:
在此示例中,包括姿势变量名称中的基本和目标帧的名称使得名称更具描述性:
TangoPoseData pose_start_service_T_device;
Request Method #2
Receive pose updates as they become available. To do so,attach anonPoseAvailable()callback to
TangoService_connectOnPoseAvailable().This
sample is from ourhello_motion_trackingexample project and can be found in thetango_handler.cc
file:
请求方法#2
接收姿势更新,因为它们变得可用。 为此,请附加onPoseAvailable()回调到TangoService_connectOnPoseAvailable()。此示例来自ourhello_motion_trackingexample项目,可以在thetango_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, connectOnPoseAv b901 ailable error."); std::exit(EXIT_SUCCESS);
In both cases, you receive a
TangoPoseDatastruct:
在这两种情况下,您都会收到一个TangoPoseData结构:
typedef struct TangoPoseData { int version; double timestamp; // In milliseconds 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
TangoPoseDatacontains a state, denoted by the
TangoPoseStatusTypeenum, which provides information about the status
of the pose estimationsystem. The available
TangoPoseStatusTypemembers are:
姿势状态
TangoPoseData包含一个状态,由TangoPoseStatusTypeenum表示,它提供有关姿态估计系统状态的信息。
可用的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 froman invalid state, and the pose data should not be used.
VALID: The system believes the poses being returned are valid and should beused.
INVALID: The system has encountered difficulty of some kind, so poseestimations are likely incorrect.
UNKNOWN: The system is in an unknown state.
INITIALIZING:运动跟踪系统正在从无效状态开始或恢复,并且不应使用姿态数据。
VALID:系统认为返回的姿势是有效的,应该使用。
INVALID:系统遇到某种困难,因此姿态估计可能不正确。
UNKNOWN:系统处于未知状态。
Lifecycle of pose status
姿势状态的生命周期
Figure 1: Tango Pose data lifecycle
图1:姿势数据生命周期
The
TANGO_POSE_INITIALIZINGstatus code indicates that the Tangoframework is initializing and pose data is not yet available. If you are usingcallbacks, you will receive only one pose update with the status code set to
TANGO_POSE_INITIALIZING
while the framework is initializing.
After initialization finishes, poses are in the
TANGO_POSE_VALIDstate. If youare using callbacks, you will receive updates as frequently as they areavailable.
If the system encounters difficulty and enters the
TANGO_POSE_INVALIDstate,recovery depends on your configuration during initialization. If
config_enable_auto_recoveryis set to
True, the system immediately resetsthe motion tracking system and enters the
TANGO_POSE_INITIALIZINGstate. If
config_enable_auto_recoveryis set to
False, pose data remains in the
TANGO_POSE_INVALIDstate and no updates are received until you call
TangoService_resetMotionTracking().
TANGO_POSE_INITIALIZING状态代码表示Tangoframework正在初始化,并且姿势数据尚不可用。
如果您正在使用回呼,则在框架正在初始化时,您将只收到一个状态代码设置为TANGO_POSE_INITIALIZING的姿势更新。
初始化完成后,姿势处于TANGO_POSE_VALID状态。 如果您使用回调,您将收到更新频率,因为他们areavailable。
如果系统遇到困难并进入TANGO_POSE_INVALID状态,则恢复取决于初始化期间的配置。 如果将ifconfig_enable_auto_recovery设置为True,系统将立即重置运动跟踪系统并进入TANGO_POSE_INITIALIZING状态。
如果Ifconfig_enable_auto_recovery设置为False,则姿势数据将保持在TANGO_POSE_INVALID状态,并且在调用TangoService_resetMotionTracking()之前不会接收更新。
Using pose status
Your application should react to the status being returned within the posedata. For example, wait until the pose data you are interested in becomes validbefore starting interactions in your application. If the pose becomes invalid,pause interactions untilafter the system recovers. Depending on yourapplication, what you do after the system recovers will vary. If you are usingmotion tracking alone, you can simply resume your application. If you are usingarea learning or ADFs, instruct your user to move around
until the device canlocalize itself.
使用姿势状态
您的应用程序应对posedata中返回的状态做出反应。 例如,等到您感兴趣的姿势数据在您的应用程序中开始交互之前变为有效。
如果姿势无效,请暂停交互,直到系统恢复。 根据您的应用程序,您在系统恢复后执行的操作将有所不同。
如果您单独使用运动跟踪,您可以简单地恢复您的应用程序。 如果您正在使用区域学习或ADF,请指导您的用户移动,直到设备可以本地化。
相关文章推荐
- 那些千奇百怪的视频直播延时测试方法,论正确姿势是什么?
- 以什么姿势进入DataMining会少走弯路?
- 什么,这些人你还不认识?!一文带你有姿势地侃深度学习大佬
- 10大互联网危机公关事件:什么才是解围的正确姿势?
- Java开发工程师的面试该用什么姿势?做到这些让你多拿5K
- 初学python者自学anaconda的正确姿势是什么??
- 那些千奇百怪的视频直播延时测试方法,论正确姿势是什么?
- 除了优惠券,滴滴和Uber还能靠什么姿势留住用户
- 什么是开始学习英文的正确姿势?
- 移动智能时代当选用什么姿势追赶AI潮?
- 在BroadCastReceiver的onReceive方法中执行耗时操作的正确姿势到底是什么
- 涨点小"姿势" 奥迪TFSI前面数字是什么
- 原创/自译教程:并没什么卵用的移动端UI姿势(原创文章)
- 什么是Tango事件
- What Are Tango Poses?Tango姿态是什么?
- 准备学一学go-lang啦 ~~ 学习Go应该用什么姿势? !
- 初学python者自学anaconda的正确姿势是什么??
- 传统企业上云的三个正确姿势是什么?
- OpenEIM 使用云计算的正确姿势是什么?
- 罗永浩被粉丝起诉成了被告,我们该以什么姿势围观?