如何在Unity中为Google Tango获得更可靠的Y位置跟踪? [英] How to I get more reliable Y position tracking for the Google Tango in Unity?

查看:99
本文介绍了如何在Unity中为Google Tango获得更可靠的Y位置跟踪?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个统一的场景,该场景使用的区域学习非常可靠,并且与XZ位置保持一致.但是,我们注意到有时探戈三角相机的Y位置会在场景中很高的位置跳起来".当我们强迫探戈重新定位时(通过遮盖传感器几秒钟),Y位置仍然非常偏离.在其他时候,当我们第一次在探戈上启动Unity应用并使用相同的ADF文件将其保持在完全相同的房间中的完全相同的位置时,Y的位置会变化0.5-1.5单位.有没有办法获得更可靠的Y位置跟踪和/或针对这些跳跃进行校正?

We have a unity scene that uses arealearning which has been extremely reliable and consistent about XZ position. However we are noticing that sometimes the tango delta camera’s Y position will "jump up" very high in the scene. When we force the tango to relocalize (by covering the sensors for a few seconds), the Y position remains very off. At other times, the Y position varies a 0.5 - 1.5 unity units when we first start up our Unity app on the tango and are holding it in the exact same position in the exact same room using the same ADF file. Is there a way to get a more reliable Y position tracking and/or correct for these jumps?

推荐答案

(在此情况下,所有XYZ坐标都在Unity约定中,x正确,y向上,z向前)

(All the XYZ coordinate is in the Unity convention in this context, x is right, y is up, z is forward)

Y位置应与XZ坐标相同,并根据ADF原点重新定位到高度.

Y position should work same as XZ coordinates, it relocalized to the height based on the ADF origin.

但是请注意,ADF的起源是您开始学习(记录)ADF的地方.假设您是通过正常握住设备开始学习会话的,那么ADF的原点可能会比地面高一点.在构建虚拟世界进行重新定位时,应考虑高度差.

But note that, the ADF's origin is where you started learning(recording) ADF. Let's say you started the learning session by holding the device normally, then the ADF's origin might be a little bit higher than ground level. When you construct a virtual world to relocalize, you should take the height difference into consideration.

要检查的另一件事是,确保没有为DeltaPoseController预制件设置偏移量或原始位置. DeltaPoseController将初始的起始转换作为偏移量,并在其上放置add up.例如,如果我的DeltaPoseController的起始位置是(0,1,0),而我从设备的姿势是(0,1,1),则DeltaPoseController在Unity中的实际位置将是(0 ,2,1).这适用于平移和旋转.

Another thing to check is that making sure there's no offset or original location set for DeltaPoseController prefab. DeltaPoseController will take the initial starting transformation as a offset, and add up pose on it. For example, if my DeltaPoseController's starting position is at (0,1,0), and my pose from device is (0,1,1), then the actually position for DeltaPoseController in Unity would be (0,2,1). This applies to both translation and rotation.

定义地面高度的另一种高级(也是首选)方式是使用深度传感器找出地面高度.在统一增强现实示例,它显示了如何检测平面并在其上放置标记.您可以轻松地将类似方法应用于地平面,进行 PlaneFinding 并将地面放置在Unity世界空间中的正确高度.

Another advanced (and preferred) way of defining ground level is to use the depth sensor to find out the ground height. In the Unity Augmented Reality example, it showed how to detect the plane and place a marker on it. You can easily apply the similar method to the ground plane, do a PlaneFinding and place the ground at the right height in Unity world space.

这篇关于如何在Unity中为Google Tango获得更可靠的Y位置跟踪?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆