是否可以存储超过 24 小时的空间锚点?

Is it possible to store spatial anchors longer than 24h?

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

可以将空间锚点存储超过 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

我没有尝试过超过 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 小时,即使是在免费套餐中也是如此。我也会这样做。