3

我试用了Azure Spatial Anchors for android 的示例项目,一切正常。我可以从一部智能手机添加锚点并从另一部智能手机定位它。问题是大约 24 小时后我无法找到锚点。我知道可以设置过期日期,但我没有,也没有在代码中看到它。存储类似于 ARCore Cloud Anchors 的空间锚点是否有时间限制?

4

2 回答 2

3

可以将空间锚存储超过 24 小时。该服务不会删除您的任何锚点信息,除非您明确设置锚点的过期时间或手动删除锚点。

如果您当前正在使用共享锚示例,则该示例的原始版本每次都会清除您的应用程序存储。

if (!this.initializing.Wait(0))                 
{                   
    this.initializing.Set();                     
    await this.dbCache.DeleteIfExistsAsync(); // here the database gets deleted
    await this.dbCache.CreateAsync(); 
    this.initialized.Set();
}

此行为随后在拉取请求中被更改

于 2019-04-03T16:58:52.923 回答
0

I haven't tried localizing anchors beyond the 24-hour limit. However, the expiration date can be setup as such:

// Set the expiry of the anchor to 24 hours so that we can play with
// the anchors for a day
CloudSpatialAnchor spatialAnchor = new CloudSpatialAnchor();
..
spatialAnchor.Expiration = DateTimeOffset.Now.AddDays(1); // Pass any Double value you want.
..

You could try setup one today and localize on sometime next week to check if anchors persist beyond 24 hours, even on a free tier. I'll do that too.

于 2019-04-12T06:32:06.033 回答