简体   繁体   English

Project Tango Unity3d Area Learning Scene无法更新ADF和本地化的姿势数据

[英]Project Tango Unity3d Area Learning Scene does not update pose data for ADF and Localization

I have spent a some hours on Unity3D SDK Area Learning Scene trying to figure out how to load ADF and localize while using it OOTB. 我在Unity3D SDK区域学习场景上花费了几个小时,试图弄清楚如何在使用OOTB时加载ADF并进行本地化。 However, after setting m_useADF to true and verifying that the UUID is valid and passed to the TangoApplication object the system is not returning updates for the ADF and Localized parts of the pose information. 但是,在将m_useADF设置为true并验证UUID有效并传递给TangoApplication对象之后,系统不会为姿势信息的ADF和本地化部分返回更新。 My theory is that they are either never produced or lost somewhere along the pipeline to the callback. 我的理论是,它们从不会在回调的管道中产生或丢失。

This is the first part of the corresponding code: public bool m_useADF = true; 这是相应代码的第一部分:public bool m_useADF = true;

        if(m_useADF)
            {
                // Query the full adf list.
                PoseProvider.RefreshADFList();
                // loading last recorded ADF
                string uuid = PoseProvider.GetLatestADFUUID().GetStringDataUUID();
                m_tangoApplication.InitProviders(uuid);
                Debug.Log ("HERE IS THE UUID: " + uuid);
            }

This is where the ADF and Relocalization data should be reported but they are never updated. 这是应该报告ADF和重新定位数据的位置,但永远不会更新它们。 The controller is correctly registered as a PoseListener and the MotionTracking pose data is updated correctly when the device moves around with status POSE_VALID. 当设备以状态POSE_VALID移动时,控制器已正确注册为PoseListener,并且MotionTracking姿势数据已正确更新。 I haven't detected any error messages regarding the ADF not loading, however, the status is never updated past TANGO_POSE_INITIALIZING for both the ADF and Relocalization pieces of data. 我没有检测到有关未加载ADF的任何错误消息,但是,对于ADF和重新定位数据,状态永远不会更新超过TANGO_POSE_INITIALIZING。

        // ADF
        GUI.Label( new Rect(Common.UI_LABEL_START_X, 
                            Common.UI_LABEL_START_Y + Common.UI_LABEL_OFFSET * 3, 
                            Common.UI_LABEL_SIZE_X , 
                            Common.UI_LABEL_SIZE_Y), "ADF1: <size=15>" + String.Format(Common.UX_TARGET_TO_BASE_FRAME,
                                                             TangoEnums.TangoCoordinateFrameType.TANGO_COORDINATE_FRAME_DEVICE,
                                                             TangoEnums.TangoCoordinateFrameType.TANGO_COORDINATE_FRAME_AREA_DESCRIPTION) + "</size>");

        GUI.Label( new Rect(Common.UI_LABEL_START_X, 
                            Common.UI_LABEL_START_Y + Common.UI_LABEL_OFFSET * 4, 
                            Common.UI_LABEL_SIZE_X , 
                            Common.UI_LABEL_SIZE_Y), "ADF2: <size=15>" + String.Format(Common.UX_STATUS,
                                                             m_status[1],
                                                             m_frameCount[1],
                                                             m_frameDeltaTime[1],
                                                             m_tangoPosition[1],
                                                             m_tangoRotation[1]) + "</size>");
        // RELOCALIZATION
        GUI.Label( new Rect(Common.UI_LABEL_START_X, 
                            Common.UI_LABEL_START_Y + Common.UI_LABEL_OFFSET * 5, 
                            Common.UI_LABEL_SIZE_X , 
                            Common.UI_LABEL_SIZE_Y), "RELOCALIZED1: <size=15>" + String.Format(Common.UX_TARGET_TO_BASE_FRAME,
                                                             TangoEnums.TangoCoordinateFrameType.TANGO_COORDINATE_FRAME_AREA_DESCRIPTION,
                                                             TangoEnums.TangoCoordinateFrameType.TANGO_COORDINATE_FRAME_START_OF_SERVICE) + "</size>");

        GUI.Label( new Rect(Common.UI_LABEL_START_X, 
                            Common.UI_LABEL_START_Y + Common.UI_LABEL_OFFSET * 6, 
                            Common.UI_LABEL_SIZE_X , 
                            Common.UI_LABEL_SIZE_Y), "RELOCALIZED2: <size=15>" + String.Format(Common.UX_STATUS,
                                                             m_status[2],
                                                             m_frameCount[2],
                                                             m_frameDeltaTime[2],
                                                             m_tangoPosition[2],
                                                             m_tangoRotation[2]) + "</size>");

Has anybody faced this before and solved it? 有人面对过这个问题并解决了吗? Does anybody know if this is a known issue? 有人知道这是否是已知问题吗?

Cristhopper Cristhopper

I don't know if this is helpful, but I might know what's going on only in that I experienced the same thing when porting the samples to C#. 我不知道这是否有帮助,但是我可能只知道发生了什么,因为在将示例移植到C#时我经历了同样的事情。 I haven't use the Unity SDK. 我没有使用Unity SDK。

If there is a similar TangoUtilities project or function that supports rendering of the AD, and you are referencing that or have implemented something similar, there is code in the OnPoseAvailable implementation that references the renderer's trajectory: 如果有类似的TangoUtilities项目或功能支持AD的呈现,并且您正在引用它或已经实现了类似的东西,则OnPoseAvailable实现中有代码引用了呈现器的轨迹:

eg 例如

        // Update the trajectory, model matrix, and view matrix, then
        // render the scene again
        if (updateRenderer && (mRenderer.Trajectory != null))

in my version above, I added the && (mRendered.Trajectory != null) because the first few passes, it is still null. 在以上版本中,我添加了&&(mRendered.Trajectory!= null),因为前几遍仍然为null。

If I recall, this was causing a silent failure, and ceased to allow rendering of any of it. 如果我还记得,那是造成无声的失败,并且不再允许呈现任何失败。

I thought it was worth sharing, and hope it might be your solution. 我认为值得分享,希望它可以成为您的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM