我试用了一下sample project from Azure Spatial Anchors for android,一切都正常。我可以从一部智能手机添加一个锚,并从另一部智能手机定位它。问题是我在大约24小时后找不到锚。我知道可以设置过期日期,但我没有,我也没有在代码中看到它。存储类似于ARCore云锚点的空间锚点是否有时间限制?
发布于 2019-04-04 00:58:53
可以存储超过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();
}此行为随后被称为changed in a pull request。
发布于 2019-04-12 14:32:06
我还没有尝试本地化超过24小时限制的锚点。但是,可以按如下方式设置到期日期:
// 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.
..您可以尝试今天设置一个,并在下周的某个时间本地化,以检查锚点是否持续超过24小时,即使是在空闲层。我也会这么做的。
https://stackoverflow.com/questions/55450536
复制相似问题