ARKit ARParticipantAnchor 的 transform 在 AR Collaboration 中是 NaN

ARKit ARParticipantAnchor's transform is NaN in AR Collaboration

我正在 运行创建这个 ARKit 示例项目 https://developer.apple.com/documentation/arkit/creating_a_collaborative_session。除了 ARParticipantAnchor 的变换总是 NaN(变换矩阵中的所有 16 个数字都是 NaN)之外,一切都完美无缺。其他 ARAnchor 都具有有效的转换值,但 ARParticipantAnchor 没有。

根据我对 ARKit 的理解,在一个节点 iPhone 加入协作会话后,通过委托函数 session:didAddAnchors: 添加一个 ARParticipantAnchor 来表示该节点的位置和方向.之后,ARKit 通过委托函数 session:didUpdateAnchors: 不断更新 ARParticipantAnchor 的变换,以微调那个对等体 iPhone.

的实时位置和方向。

我 运行 这个示例项目几个月前就完成了,它运行得很完美。所以我非常有信心我不会遗漏任何细节。但是从昨天开始,我无法让它工作。一个节点加入协作会话后成功添加了一个ARParticipantAnchor,每帧都会调用委托函数session:didUpdateAnchors:,但是ARParticipantAnchorsession:didUpdateAnchors:中的转换总是南!

我也尝试了这个 repo https://github.com/Unity-Technologies/arfoundation-samples/tree/main/Assets/Scenes/ARKit/ARCollaborationData 中的 Unity ARFoundation 示例,但它也不起作用!我几个月前使用过这个 repo,我很确定它有效。

所以,如果原生 ARKit 和 Unity 都有这个问题,我怀疑可能是 ARParticipantAnchor 在最近的 ARKit 更新后出现了错误?毕竟,如果 ARParticipantAnchor 的变换总是 NaN,那么每帧更新它并通过网络共享该数据有什么意义呢?谁能告诉我如何让它工作?谢谢!

好的,我找到了解决方案。这是因为 iOS 版本。

之前,我是 运行 iOS 15.1,在我将所有设备升级到 iOS Beta 15.2 后,一切正常。