我用 ARCore 和 Sceneform 实现了一个应用程序,它将 AR 标记放置在现实世界中的特定 gps 位置。为了使标记在现实世界中保持静止,我使用在“空中”中创建的锚点(与可跟踪对象无关,例如作为飞机):
mAnchor=session.createAnchor(
frame.getCamera().getPose()
.compose(Pose.makeTranslation(xrotated,y,zrotated))
.extractTranslation());
其中 xrotated,y,zrotated 是相机的 gps 位置和目标 gps 位置之间的相对距离。
但是我发现这样创建的锚点不是静止的,也就是说,当我移动手机时,标记会与手机平行移动,甚至可以漂移到 10 米甚至更远。
我尝试通过点击屏幕来创建锚点,附加到锚点的渲染节点工作正常。当手机移动时,它保持静止,就像它是现实世界中的真实标记一样。
我
placing an anchor that is not associated with a Trackable object is usually not a good experience. The trackable object (planes, augmented images, oriented points) are update by ARCore to represent the connections between the real world image and the augmented, virtual images. If you place an anchor in the "air", it will drift and move relative to the real world.
在https://github.com/google-ar/sceneform-android-sdk/issues/185中找到了这样的描述。
我想知道原因是否只是在空中创建的锚点并且与可跟踪对象无关,或者是其他因素导致标记与相机平行移动但我没有找到。在 ARKit 中,我没有找到这样的问题,所以是因为ARCore没有处理GeoAR?