首页 > 学院 > 开发设计 > 正文

Tango概念

2019-11-09 14:26:42
字体:
来源:转载
供稿:网友

Overview 概述 

Tango Concepts  Tango 概念

Tango is a platform that uses computer vision to give devices theability to understand their position relative to the world around them. It’ssimilar to how you use your eyes to find your way to a room, and then to knowwhere you are in the room and where the floor, the walls, and objects aroundyou are. These physical relationships are an essential part of how we movethrough our daily lives. Tango gives mobile devices this kind ofunderstanding by using three core technologies: Motion Tracking, Area Learning,and Depth Perception.

Tango是一个使用计算机视觉的平台,让设备能够了解他们相对于周围世界的位置。它类似于你如何使用你的眼睛找到你的房间的方式,然后知道你在房间里的地方,墙壁和你周围的对象在哪里。这些身体关系是我们如何在我们的日常生活中不可或缺的一部分。Tango通过使用三种核心技术为移动设备提供这种理解:运动跟踪,区域学习和深度感知。

Motion Tracking overview  运动跟踪概述

Motion Tracking means that a Tango device can track its own movementand orientation through 3D space. Walk around with a device and move itforward, backward, up, or down, or tilt it in any direction, and it can tell youwhere it is and which way it's facing. It's similar to how a mouse works, butinstead of moving around on a flat surface, the world is your mousepad.

运动跟踪意味着Tango设备可以通过3D空间跟踪其自身的运动和方向。用设备走动,向前,向后,向上或向下移动,或向任何方向倾斜,它可以告诉你它在哪里,它面对的方式。它类似于鼠标的工作原理,但不是在平坦的表面上移动,世界是你的鼠标垫。

Learn more about Motion Tracking.详细了解运动跟踪。

Area Learning overview  区域学习概述

Human beings learn to recognize where they are in an environment by noticingthe features around them: a doorway, a staircase, the way to the nearestrestroom. Tango gives your mobile device the same ability. With MotionTracking alone, the device "sees" the visual features of the area it is movingthrough but doesn’t "remember" them.

人类通过注意它们周围的特征来学习识别他们在环境中的位置:门口,楼梯,通往最近的洗手间的方式。探戈给您的移动设备相同的能力。仅使用运动跟踪,设备“看到”它正在移动通过的区域的视觉特征,但不“记住”它们。

With Area Learning turned on, the device not only remembers what it sees, itcan also save and recall that information. When you enter a PReviously savedarea, the device uses a process called localization to recognize where you arein the area. This feature opens up a wide range of creative applications. Thedevice also uses Area Learning to improve the accuracy of Motion Tracking.

启用区域学习后,设备不仅会记住它看到的内容,还可以保存和调用该信息。当您输入先前保存的区域时,设备使用称为本地化的过程来识别您在该区域中的位置。此功能打开了广泛的创意应用程序。该设备还使用区域学习来提高运动跟踪的准确性。

Learn more about Area Learning.  详细了解区域学习。

Depth Perception overview     深度感知概述

With depth perception, your device can understand the shape of yoursurroundings. This lets you create "augmented reality," where virtual objectsnot only appear to be a part of your actual environment, they can also interactwith that environment. One example: you create a virtual character who jumpsonto and then skitters across a real-world table top.

使用深度感知,您的设备可以了解您的周围环境的形状。这允许您创建“增强现实”,其中虚拟对象不仅看起来像是您的实际环境的一部分,他们也可以与该环境交互。一个例子:你创建一个虚拟角色,跳到现实世界的桌面上然后跳过。

Learn more about Depth Perception.  详细了解深度感知。

What Are Tango Poses? 什么是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.

要计算姿势,您必须选择基准和目标参考系,这可能使用不同的坐标系。您可以将姿势视为将顶点从目标帧转换为基本帧所需的平移和旋转。

Here is a simplified version of a Tango pose structin 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. 定义目标帧相对于基本帧的平移的3D向量。

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中,有预处理为你处理很多这些细节。

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

TangoCoordinateFramePair结构指定基本帧和目标帧。

Note: If you are making an augmented reality app, we recommend that you useTangoService_getPoseAtTime() orTangoSupport_getPoseAtTime() because, in addition to polling for poses, they allow you to align the pose timestamps with the video frames.

注意:如果您正在制作增强现实应用程序,我们建议您使用TangoService_getPoseAtTime()或TangoSupport_getPoseAtTime(),因为除了轮询姿势,他们允许您将姿势时间戳与视频帧对齐。

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 posevariable 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 ourhello_motion_trackingexample project and can be found in thetango_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 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   姿势状态

TangoPoseData contains a state, denoted by theTangoPoseStatusTypeenum, which provides information about the status of the pose estimationsystem. 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 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_INITIALIZING status 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 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 youare using callbacks, you will receive updates as frequently as they areavailable.

初始化完成后,姿势处于TANGO_POSE_VALID状态。如果您正在使用回调,您将收到更新的频率,因为他们可用。

If the system encounters difficulty and enters the TANGO_POSE_INVALID state,recovery depends on your configuration during initialization. Ifconfig_enable_auto_recovery is set toTrue, the system immediately resetsthe motion tracking system and enters theTANGO_POSE_INITIALIZING state. Ifconfig_enable_auto_recovery is set toFalse, pose data remains in theTANGO_POSE_INVALID state and no updates are received until you callTangoService_resetMotionTracking().

如果系统遇到困难并进入TANGO_POSE_INVALID状态,则恢复取决于初始化期间的配置。如果config_enable_auto_recovery设置为True,系统将立即重置运动跟踪系统并进入TANGO_POSE_INITIALIZING状态。如果config_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 until after 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.

您的应用程序应对姿势数据中返回的状态做出反应。例如,等到您感兴趣的姿势数据在您的应用程序中开始交互之前变得有效。如果姿势无效,请暂停交互,直到系统恢复。根据您的应用程序,您在系统恢复后执行的操作将有所不同。如果您仅使用运动跟踪,则可以简单地恢复应用程序。如果您使用区域学习或ADF,请指导您的用户移动,直到设备可以本地化。

What Are Tango Events?什么是Tango事件?

Primary events   主要事件

The unique array of sensors on a Tango-capable device, and the data they receiveand transmit, are essential to enabling the device to perform the core Tangoactivities:motion tracking, depth sensing,and area learning. As with any Android device,this data is received and passed along as "events." The primary Tango eventsare:

具有探测功能的设备上的传感器的独特阵列,以及它们接收和传输的数据对于使设备能够执行核心探测活动是必要的:运动跟踪,深度感测和区域学习。与任何Android设备一样,此数据将作为“事件”接收和传递。主要Tango事件是:

The pose (position and orientation) of the device.    设备的姿势(位置和方向)。Frames and textures from a camera.    从照相机的框架和纹理。Point clouds, which are generated via depth sensing.   点云,通过深度感测生成。

To receive an event, you pass a callback to a function that listens for thatevent. The callback is called every time the event occurs.

要接收事件,您将回调传递给侦听该事件的函数。每当事件发生时调用回调。

Note: The examples below use the C API, but function calls and data structuresare similar for all platforms.注意:下面的示例使用C API,但是所有平台的函数调用和数据结构类似。

To receive poses  接受姿势

There are are two ways to do this; we recommend that you poll for poses using TangoService_getPoseAtTime(). For a detailedexplanation, see thePose topic.

有两种方法可以做到这一点;我们建议您使用TangoService_getPoseAtTime()轮询姿势。有关详细说明,请参阅“姿势”主题。

To receive notification of new camera textures  接收新照相机纹理的通知

(This is useful to render the camera image in OpenGL for Augmented Reality)  (这对于在OpenGL中渲染摄像机图像是有用的增强现实)

Pass a callback to TangoService_OnTextureAvailable().You will also need to call TangoService_updateTextureExternalOesin the GL thread to update the texture.

将回调传递给TangoService_OnTextureAvailable()。你还需要在GL线程中调用TangoService_updateTextureExternalOes来更新纹理。

To receive frames from a camera  从相机接收帧

(Use this not for display, but for when you need to access the pixel data as an array of bytes.)

(使用这不是用于显示,但是当你需要访问像素数据作为一个字节数组)。

Pass a callback to TangoService_connectOnFrameAvailable(). 将回调传递给TangoService_connectOnFrameAvailable()。

To receive point clouds  接收点云

Pass an OnPointCloudAvailable() callback toTangoService_connectOnPointCloudAvailable().

将OnPointCloudAvailable()回调传递给TangoService_connectOnPointCloudAvailable()。

Status events 状态事件

The TangoEvent notification callback signals important sensor status events,such as descriptions of error states. To receive aTangoEvent, attachanonTangoEvent() callback toTangoService_connectOnTangoEvent(). Thiscallback is called every time a Tango status event occurs.

TangoEvent is definedas:

TangoEvent通知回调指示重要的传感器状态事件,例如错误状态的描述。要接收TangoEvent,请将onTangoEvent()回调附加到TangoService_connectOnTangoEvent()。每当发生探戈状态事件时,都会调用此回调。

TangoEvent定义为:

typedef struct TangoEvent {  double timestamp;  TangoEventType type;  const char* event_key;  const char* event_value;} TangoEvent;

The timestamp indicates when the status event occurs, and can be compared totimestamps elsewhere in the Tango APIs.

时间戳指示状态事件发生的时间,并且可以与Tango API中其他地方的时间戳进行比较。

The type is designated by theTangoEventTypeenumeration, and tells you which sensor triggered the event:

类型由TangoEventType枚举指定,并告诉您哪个传感器触发了事件:

typedef enum {  TANGO_EVENT_UNKNOWN,  TANGO_EVENT_GENERAL,  TANGO_EVENT_FISHEYE_CAMERA,  TANGO_EVENT_COLOR_CAMERA,  TANGO_EVENT_IMU,  TANGO_EVENT_FEATURE_TRACKING,} TangoEventType;

The event_key and event_value describe the specific status event thatoccurred. Here is a table of possible keys:

event_key和event_value描述发生的特定状态事件。这里是一个可能的键表:

Event keyExplanation
TangoServiceExceptionThe service has encountered an exception, and a text description is given in event_value.
FisheyeOverExposedThe fisheye image is overexposed with average pixel value event_value px.
FisheyeUnderExposedThe fisheye image is underexposed with average pixel value event_value px.
ColorOverExposedThe color image is overexposed with average pixel value event_value px.
ColorUnderExposedThe color image is underexposed with average pixel value event_value px.
TooFewFeaturesTrackedToo few features were tracked in the fisheye image; number of features tracked isevent_value.
UnknownDescription unknown.

Event keyExplanation
TangoServiceException服务遇到异常,并在event_value中给出了文本描述。
FisheyeOverExposed鱼眼图像曝光过度,平均像素值为event_value px。
FisheyeUnderExposed鱼眼图像曝光不足,平均像素值为event_value px。
ColorOverExposed彩色图像与平均像素值event_value px曝光过度。
ColorUnderExposed彩色图像曝光不足,平均像素值为event_value px。
TooFewFeaturesTracked鱼眼图像中跟踪的功能太少;跟踪的功能的数量是event_value。
Unknown描述未知

Based on the specific event description, you may choose to display instructionsfor users to correct the circumstances leading to the event. For example, ifyou are receivingColorUnderExposed, it is likely that the user is in an areawhere it is too dark for the Tango framework to function well.

基于特定的事件描述,您可以选择显示用户指示以更正导致事件的情况。例如,如果您正在接收ColorUnderExposed,则很可能用户处于太暗以至于Tango框架无法正常工作的区域。

To learn about another way to handle these events, see theUX Framework.

要了解另一种处理这些事件的方法,请参阅UX Framework。

Frames of Reference 参照系

When describing the position and orientation of something (for example, yourTango device), it is important to indicate theframe ofreference you are using to base your description on.

当描述某物(例如,Tango设备)的位置和方向时,重要的是指出您用来描述的参考框架。

To help understand frames of reference, consider the following: Saying "Mary isstanding three feet away" does not really tell you much. If you want to knowMary's position, you must also address the question "three feet from what?" Ifyou say "Mary is standing three feet in front of the entrance to the Statue ofLiberty," you can now establish Mary'sposition because you are using theStatue of Liberty as your frame of reference and you can measure the distanceand directon of Mary relative to the Statue.

为了帮助理解参考框架,考虑以下:说“玛丽站在三英尺外”并不真正告诉你。如果你想知道玛丽的位置,你还必须解决这个问题“离什么三英尺?如果你说“玛丽站在自由女神像的入口前三英尺”,你现在可以确定玛丽的位置,因为你使用自由女神像作为参考框架,你可以测量玛丽的距离和方向相对于雕像。

But Mary isn't simply a point with a position in 3D space—she also has anorientation, which is described in terms of some type of rotation relativeto the frame of reference. In other Words, Mary, like all 3D objects, faces acertain direction. A full description of Mary's position and orientation (we callthis combination apose) in 3D space would be something like this:"Mary is standing three feet in front of the entrance to the Statue of Liberty,and she is directly facing it." Now you have provided information about herorientation. If Mary turned to her right, you could say "She is now rotated 90degrees away from the Statue." This would be another description of orientation.

但玛丽不仅仅是一个在3D空间中的位置的点,她也具有取向,其根据相对于参考系的某种类型的旋转来描述。换句话说,玛丽像所有3D对象一样,面向一定的方向。在3D空间中对玛丽的位置和方向(我们称之为组合姿势)的完整描述将是这样的:“玛丽站在自由女神像的入口前三英尺,她直接面对它。现在你提供了她的方向的信息。如果玛丽转向她的右边,你可以说“她现在旋转了90度远离雕像。这将是对方向的另一种描述。

So how does all of this relate to a Tango device? In order to performmotion tracking, a device reports its pose (position and orientation) relativeto its chosen frame of reference, which is fixed in 3D space. For example, thedevice might say "from the place that I first started motion tracking, I am nowthree feet forward and one foot up, and I have rotated 30 degrees to theright." By doing this, the device has told you its position using meaningfuldirections: three feet forward and one foot up from its original startingposition. It has also told you about a change in its orientation: rotated 30degrees to the right relative to its starting position.

那么,所有这一切都与Tango设备有关?为了执行运动跟踪,设备相对于其选定的参考系来报告其姿态(位置和取向),其在3D空间中是固定的。例如,设备可能说“从我第一次开始运动跟踪的地方,我现在向前三英尺,一英尺,我已经向右旋转了30度。通过这样做,设备已经告诉你它的位置使用有意义的方向:三英尺前,一英尺从其原始的起始位置。它也告诉你一个方向的变化:相对于它的起始位置向右旋转30度。

To set things up for motion tracking, you must do the following:

要为运动跟踪设置内容,您必须执行以下操作:

Choose a base frame. This is the thing you will be measuring from. As mentioned above, it is fixed in 3D space, like the Statue of Liberty in our example above. Example: theCOORDINATE_FRAME_START_OF_SERVICE frame.

Choose a target frame. This is the thing you will be measuringto. For motion tracking this is usuallyCOORDINATE_FRAME_DEVICE and represents your device's pose at any given instant as it moves through 3D space. The pose of the target frame changes as your device moves, and is measured against the base frame (which never changes), up to 100 times per second. This constant stream of measurements creates your motion track.

        1、选择基准框架。这是你将要测量的东西。如上所述,它固定在3D空间中,像我们上面的例子中的自由女神像。示例:COORDINATE_FRAME_START_OF_SERVICE框架。

         2、选择目标帧。这是你将要测量的东西。对于运动跟踪,这通常是COORDINATE_FRAME_DEVICE,并且在移动到3D空间时表示您设备在任何给定时刻的姿势。目标框架的姿态随着设备移动而改变,并且相对于基本框架(从不改变)进行测量,最多每秒100次。这种恒定的测量流创建您的运动轨迹。

The numerical measurements of the pose of the target frame relative to the baseframe at any given instant answer the question: "What is the device's positionand orientation relative to its base frame of reference?"

在任何给定时刻,目标帧相对于基本帧的姿态的数值测量回答了问题:“设备相对于其基准参考帧的位置和方向是什么?

In the next section, we discuss the use of start-of-service frame, areadescription frame, and device pose frame pairs for motion tracking. For certainapplications, you may need to choose a frame pair that will enable you to makeprecise alignments of data sources from device components. We discuss thesetypes of frame pairs later in this topic.

在下一节中,我们讨论使用服务启动帧,区域描述帧和设备姿态帧对用于运动跟踪。对于某些应用程序,您可能需要选择一个帧对,使您能够对来自设备组件的数据源进行精确对齐。我们将在本主题后面讨论这些类型的帧对。

To learn more about the coordinate systems used for frames of reference, seeCoordinate System Conventions.

要了解有关用于参考系的坐标系的更多信息,请参阅坐标系约定。

Coordinate frames for motion tracking 用于运动跟踪的坐标帧

The Tango APIs give you various frame pair options for motion tracking:

Tango API为运动跟踪提供了各种帧对选项:

Target FrameBase Frame
COORDINATE_FRAME_DEVICECOORDINATE_FRAME_START_OF_SERVICE
COORDINATE_FRAME_DEVICECOORDINATE_FRAME_AREA_DESCRIPTION
COORDINATE_FRAME_START_OF_SERVICECOORDINATE_FRAME_AREA_DESCRIPTION

Let's consider a common use case:

让我们考虑一个常见的用例:

Goal: Your app controls a camera in a fully virtual environment. You wantthe device to always calculate its pose relative to where it was when theTango service started.

目标:您的应用程式会在完全虚拟的环境中控制相机。您希望设备始终计算其相对于Tango服务启动时的位置的姿势。

Solution: For the target frame, choose COORDINATE_FRAME_DEVICE. For thebase frame, chooseCOORDINATE_FRAME_START_OF_SERVICE.

解决方案:对于目标帧,选择COORDINATE_FRAME_DEVICE。对于基准框架,请选择COORDINATE_FRAME_START_OF_SERVICE。

Here is the frame pair used in our example project titledcpp_hello_motion_tracking_example:

下面是我们的示例项目中使用的框架对,名为cpp_hello_motion_tracking_example:

 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::OnResume, connectOnPoseAvailable error.");     std::exit(EXIT_SUCCESS);   }

Let's look at the details of individual frame pairs.

让我们来看看各个帧对的细节。


Target FrameBase Frame
COORDINATE_FRAME_DEVICECOORDINATE_FRAME_START_OF_SERVICE

This frame pair provides the pose of the device relative to when theTango service first initialized successfully. This mode accumulates themovement of the device over time since the service started. The service canalso detect if there is a motion tracking failure. During this period, thesystem reports an invalid pose. If TangoService_resetMotionTracking() iscalled or auto-reset is enabled in the service configuration, the systemattempts to re-initialize tracking. After successful re-initialization, itmakes a best effort attempt to recover the last known good pose of the devicerelative to the start of service frame and pick up where it left off. For moreinformation, seeLifecycle of pose status.This frame pair does not include drift correction or localization. If yourapplication does not use drift correction or localization, you can lowerprocessing requirements by disabling area learning mode and not loading an ADF.

此框架对提供了设备相对于首次成功初始化Tango服务时的姿态。此模式累积了从服务启动以来设备随时间的移动。服务还检测是否存在运动跟踪故障。在此期间,系统报告无效的姿势。如果在服务配置中启用了TangoService_resetMotionTracking()或自动重置,系统将尝试重新初始化跟踪。在成功重新初始化之后,最大努力尝试恢复装置的最后已知的良好姿态到服务帧的开始并且拾取它停止的位置。有关更多信息,请参阅位姿状态的生命周期。此帧对不包括漂移校正或定位。如果您的应用程序未使用漂移校正或本地化,则可以通过禁用区域学习模式而不加载ADF来降低处理要求。


Target FrameBase Frame
COORDINATE_FRAME_DEVICECOORDINATE_FRAME_AREA_DESCRIPTION

This frame pair provides the pose of the device, including corrections,relative to the loaded area description's origin. It requires that area learningmode is turned on or a previously created ADF is loaded. If you turn onlearning mode without loading an ADF, the origin of the area descriptionbase frame is initially the same asstart of service. If you load an ADFwith or without learning mode, the origin of thearea description baseframe is the origin stored in the ADF, and you will receive data only after thedevice has localized. Depending on your configuration settings, this mode isnot always available. For more information, seeUsing Learning Mode and loadedArea Description Files.If you need to use motion tracking before theCOORDINATE_FRAME_DEVICE toCOORDINATE_FRAME_AREA_DESCRIPTION frame pair becomes valid, you can use theCOORDINATE_FRAME_START_OF_SERVICE base frame in the interim.

该帧对提供了设备的姿势,包括相对于加载区域描述的原点的校正。它要求打开区域学习模式或加载先前创建的ADF。如果您在没有加载ADF的情况下启用学习模式,则区域描述库框架的起点最初与启动服务相同。如果加载ADF或不使用学习模式,则区域描述基础框架的原点是存储在ADF中的原点,并且只有在设备已本地化之后才会接收数据。根据您的配置设置,此模式不会始终可用。有关详细信息,请参阅使用学习模式和loadedArea描述文件。如果您需要在COORDINATE_FRAME_DEVICE到COORDINATE_FRAME_AREA_DESCRIPTION帧对有效之前使用运动跟踪,则可以在临时中使用COORDINATE_FRAME_START_OF_SERVICE基本框架。

Note: Drift corrections and localization events cause jumps in the pose. Toavoid these jumps, use theCOORDINATE_FRAME_START_OF_SERVICE base frame todrive the user-facing elements in your application and incorporate the ADFdriven corrections usingCOORDINATE_FRAME_START_OF_SERVICE toCOORDINATE_FRAME_AREA_DESCRIPTION update callbacks.注意:漂移校正和定位事件导致姿势的跳跃。要避免这些跳转,请使用COORDINATE_FRAME_START_OF_SERVICE基本框架来驱动应用程序中的面向用户的元素,并使用COORDINATE_FRAME_START_OF_SERVICE到COORDINATE_FRAME_AREA_DESCRIPTION更新回调来合并ADFdriven更正。

For pairs using the COORDINATE_FRAME_DEVICE target frame, updates areavailable at the pose estimation rate supported by the device.

对于使用COORDINATE_FRAME_DEVICE目标帧的对,以设备支持的姿态估计速率更新区域可用。


Target FrameBase Frame
COORDINATE_FRAME_START_OF_SERVICECOORDINATE_FRAME_AREA_DESCRIPTION

This frame pair provides updates only when a localization event or a driftcorrection occurs. This requires that area learning mode is turned on or apreviously created ADF is loaded. If an ADF is loaded, the origin of theareadescription base frame is the origin stored in the ADF. This isolates theadjustments to the pose of the device from the incremental frame-to-framemotion, allowing you to decide when and how to incorporate the pose adjustmentsin your application to minimize disruption to the user experience.

该帧对仅在发生定位事件或漂移校正时提供更新。这需要打开区域学习模式或加载先前创建的ADF。如果加载了ADF,则表示基准帧的原点是存储在ADF中的原点。这会将调整与从增量帧到帧移动的设备的姿势隔离,从而允许您决定何时以及如何在应用程序中结合姿势调整以最小化用户体验的中断。

Coordinate frames for component alignment  组件对齐的坐标系

Target FrameBase Frame
COORDINATE_FRAME_DEVICECOORDINATE_FRAME_IMU
COORDINATE_FRAME_CAMERA_COLORCOORDINATE_FRAME_IMU
COORDINATE_FRAME_CAMERA_DEPTHCOORDINATE_FRAME_IMU
COORDINATE_FRAME_CAMERA_FISHEYECOORDINATE_FRAME_IMU

Some applications need to align multiple data sources, such as the data fromthe color and depth cameras. You can pair theCOORDINATE_FRAME_IMUbase frame with one of thecomponent target frames for these scenarios:

You want to query the relative offsets of the individual components to the IMU frame of reference without knowing the layout of the specific device.

You want the virtual image from the rendering camera to align with the center of the display.

一些应用程序需要对齐多个数据源,例如来自彩色和深度相机的数据。您可以将COORDINATE_FRAME_IMUbase框架与这些方案的某个组件目标框架配对:    

       1、您希望查询单个组件相对于IMU参考系的相对偏移,而不需要知道特定器件的布局。

        2、您希望渲染摄像机的虚拟图像与显示中心对齐。

Combined with the motion tracking coordinate frames and timestamps on the data,these offsets give you a more complete understanding of the various sensorinputs in both space and time. This is necessary for aligning and compositingmultiple data sources together.

结合运动跟踪坐标系和数据上的时间戳,这些偏移使您能够更全面地了解空间和时间中的各种传感器输入。这对于将多个数据源对齐和合成在一起是必要的。

Note: The relative offsets between two components are sometimes referred to astheextrinsic parameters.注意:两个组件之间的相对偏移有时称为外部参数。

Since devices are designed to be mechanically rigid, these offsets are notexpected to change and updates will not occur in the API. However, devices varyin how their components are spaced. Updating extrinsic parameters over time isnot currently supported by the Tango APIs. These values are generatedeither from a one-time factory calibration or from the manufacturer'smechanical design files. Applications that require extremely tight requirementsfor the extrinsic parameters should consider implementing their own calibrationprocedure which can be performed by the end user.

由于设备设计为机械刚性,这些偏移量不会发生更改,因此API中不会进行更新。然而,设备不同其部件间隔如何。Tango API目前不支持随时间更新外部参数。这些值是从一次性工厂校准或从制造商的机械设计文件生成的。对外部参数要求非常严格要求的应用应考虑实施自己的校准过程,该过程可由最终用户执行。

The COORDINATE_FRAME_IMU base frame provides a common reference point for allof the internal components in the device. The origin of this base frame doesnot necessarily correspond to any one particular component and may differbetween devices. Like other Android sensors, the axis of the device coordinateframe is aligned with the natural (default) orientation of the device asdefined by the manufacturer. The manufacturer-defined natural orientation ofthe device may not match the desired orientation of your app. For maximumfuture compatibility, do not assume a Tango-compliant device has anatural orientation that is either landscape or portrait. Instead, use theAndroidgetRotation() method to determine screen rotation, and then use theAndroidremapCoordinateSystem() method to map sensor coordinates to screencoordinates. For more general information about sensors, see the Androiddocumentation on thesensor coordinatesystem.For a more detailed discussion of issues surrounding deviceorientation, seethis Android Developers Blogpost.

COORDINATE_FRAME_IMU基本框架提供了用于允许设备中的内部组件的公共参考点。该基本框架的原点不一定对应于任何一个特定组件,并且可以在设备之间不同。与其他Android传感器一样,设备坐标系的轴与制造商定义的设备的自然(默认)方向对齐。设备的制造商定义的自然方向可能与您应用的所需方向不一致。为了达到最大兼容性,不要假定Tango兼容设备具有横向或纵向的自然方向。相反,使用Android getRotation()方法来确定屏幕旋转,然后使用Android remapCoordinateSystem()方法将传感器坐标映射到屏幕坐标。有关传感器的更多一般信息,请参阅传感器坐标系统上的Androiddocumentation。有关设备定位问题的更详细的讨论,请参阅此Android开发人员Blogpost。

The component offsets are static and should only need to be queried once.

组件偏移是静态的,应该只需要查询一次。

Note: The unit of measurement for coordinate frame pairs is meters.注意:坐标框架对的测量单位为米。


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表