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:

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

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:

TangoErrorType TangoService_getPoseAtTime(    double timestamp,     TangoCoordinateFramePair frame_pair,     TangoPoseData* pose);

The TangoCoordinateFramePair struct specifies the base frame and the target frame.

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

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:

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:

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:

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.

VALID: The system believes the poses being returned are valid and should be used.

INVALID: The system has encountered difficulty of some kind, so pose estimations are likely incorrect.

UNKNOWN: The system is in an unknown state.

Lifecycle of pose status

Figure 1: Tango Pose data lifecycle

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.

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.

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().

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.

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

时间: 2024-09-29 06:03:14

What Are Tango Poses?Tango姿态是什么?的相关文章

Where is ADF file on Tango Device?

Where is ADF file on Tango Device? Ask Question up vote2down votefavorite I have a Tango tablet device. So i made a ADF file using Tango Explorer. I want to export the ADF file to PC from device. But i cannot find the ADF file. Please let me know whe

Google Tango SDK下载

Tango SDK files谷歌Tango开发包 The Tango SDK is under active development; please keep this in mind as you explore its capabilities. See our Release Notes for information on the most recent changes to the SDK. If you discover any issues, feel free to commu

How to Find and Write VAG 7th Byte CS with Tango Key Programmer

Find out and write VAG 7th Byte CS requires Tango software version 1.112 or above.  Tango Key Programmer software updated to V1.112 on May 9th, 2018. Tango transponder programmer software added (online update) 1-Added new transponder MEGAMOS AES 2-To

ICCV研讨会:实时SLAM的未来以及深度学习与SLAM的比较

这篇短文写的很好,我把它copy到这里供大家学习 上一届「国际计算机视觉大会(ICCV:International Conference of Computer Vision )」成为了深度学习(Deep Learning)技术的主场,但在我们宣布卷积神经网络(ConvNet)的全面胜利之前,让我们先看看计算机视觉的「非学习(non-learning)」几何方面的进展如何.同步定位与地图构建(SLAM: Simultaneous Localization and Mapping )可以说是机器人

Daydream队伍壮大:谷歌宣布华为Mate 9支持Daydream

在CES 2017展会谷歌宣布在Pixel和Moto Z之后,增加移动虚拟现实平台Daydream的支持机型.华为Mate 9保时捷版.Mate 9 Pro.中兴Axon 7和华硕Zenfone AR都支持Daydream平台.不过华为的这一代旗舰手机将不会支持Tango,谷歌表示他们正致力于把AR平台兼容到未来的华为设备当中. ??"我们发现研发VR智能手机需要大量工作,它需要我们在光学.显示技术.传感器的设计工程上有一个深度密切的合作."Singh说,"事实上,我们已经和

setV:一个管理 Python 虚拟环境的 Bash 函数

了解一下 setV,它是一个轻量级的 Python 虚拟环境管理器,是 virtualenvwrapper 的替代产品.-- Sachin Patil(作者) 这一年多来,我的 bash_scripts 项目中悄悄隐藏这 setV ,但现在是时候该公开了.setV 是一个 Bash 函数,我可以用它代替 virtualenvwrapper .它提供了使你能够执行以下操作的基本功能: 默认使用 Python 3 创建一个新的虚拟环境 使用带有 -p(或 --python)的自定义 Python 路

Google Tango Java SDK开发:Motion Tracking 运动追踪

Java API Motion Tracking Tutorial运动追踪教程 This page describes how the Java API handles motion tracking. 该页面描述了如何使用Java API处理运动追踪. Lifecycle 生命周期 The normal motion tracking system lifecycle consists of three states: TangoPoseData.POSE_INITIALIZING, Tang

Tango Java API常数

Tango Java API Constants常数 Constant Field Values常数字段值 Contents com.google.* com.google.* com.google.atap.tangoservice.Tango  Modifier and Type修饰符和类型 Constant Field常数字段 Value值 public static final java.lang.String ANDROID_PERMISSION_DATASET "com.google

Google Tango初学者教程

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