Forum Discussion
kennard-consulting
3 years agoExpert Protege
Spatial Anchors - how to view/delete in profile/privacy
I am saving Spatial Anchors to my cloud profile. I am storing their UUIDs separately and trying to remember to clean them up. But I'm worried sometimes I am losing the UUID and accidentally leaving anchors in my cloud storage. They are about 2.5MB each.
Will they expire on their own? Can I see what is stored under my profile somehow?
Ok - just over 24 hours later. For my un-shared anchor stored both locally and in the cloud... the cloud anchor worked all day today until the 24 hours was up and then stopped loading. The local anchor was available all day and did NOT stop loading after 24 hours.
So - regardless of whether you share it or not, if you store it in the cloud its only valid for 24 hours. If you store it locally its only available to you, but it persists until you delete it (assumedly... time will confirm that hypothesis), clear the app data, or delete the app.
18 Replies
Replies have been turned off for this discussion
I had this same concern. I read in some new documentation - (specifically for SHARED spatial anchors - which must be stored in the cloud) - that the shared spatial anchors are good for 24 hours, after which they get deleted. I don't know if that applies to non-shared anchors stored in the cloud. Like you (apparently), I have scoured the documentation for how to get a list of saved UUIDs so you can delete them, and I have found absolutely nothing. Maybe tonight's hobby project will be to create a non-shared anchor in the cloud and see if it's still there 24 hours later.
- kennard-consultingExpert Protege
Thanks heaps for your reply!
24 hours would be fantastic. So would an option during creation to expire after 24 hours.
However I have my doubts if that's true. Isn't Meta trying to pitch some grand vision of hanging paintings on your walls and weather apps on your kitchen bench using shared anchors? Surely the paintings don't disappear after 24 hours?
I share your doubts - why auto-delete an anchor that you saved to the cloud for your own use? But I also find it hard to believe that they would let you create all these anchors and not give you no way to delete them when you didn't save the uuid AND not have a way to free up the resources automatically somehow. Your "delete after 24 hours" save flag is a great idea. It seems to me that the spatial anchor API is still being designed, and they just haven't finalized how to enumerate them securely. I'm excited to start coding with the spatial app stuff in your physical space - It's exciting to think of all the possibilities.
- kennard-consultingExpert Protege
"It's exciting to think of all the possibilities" - it sure is! Here's what I'm doing with spatial anchors: https://www.youtube.com/watch?v=nEYetrAaQtE
Quite impressive! Looks like a martial arts trainer of some sort? I would love to hear some details about what's going on there...
For my stuff - I'm just a hobbyist who enjoys playing with tech stuff. I have a yearning to release a VR game or app, but I've never actually completed one and probably never will.
Test Results: (tldr: Currently, all cloud-saved SHARED spatial anchors seem to get deleted after 24 hours)
Yesterday evening, I created a spatial anchor, saved it to the cloud and shared it with 2 of my test users. Early this evening, I was still able to load the shared spatial anchor from the cloud with myself AND both my test users. At what seemed to be the 24 hours point, loading of the shared anchors from the cloud stopped working. I re-created a new shared anchor and saved it in the cloud - I was able to load it from all users again. Now I'm curious about an un-shared spatial anchor saved to the cloud. I'll do that test next.
- kennard-consultingExpert Protege
Thanks for doing this work!
Yes, knowing what happens to un-shared anchors would be really useful to my work. Please let me know how you go.
NP - I love the experimentation. However, it's a harsh reminder of how incomplete their documentation can be sometimes.
But the test is setup. I just created a spatial anchor, saved it to local, and then saved it to cloud. Did not share it. Made sure I could load both copies.
My guess is that in 24 hours, the cloud one will delete, and the local one will persist until deleted.
Lets see what happens.
Ok - just over 24 hours later. For my un-shared anchor stored both locally and in the cloud... the cloud anchor worked all day today until the 24 hours was up and then stopped loading. The local anchor was available all day and did NOT stop loading after 24 hours.
So - regardless of whether you share it or not, if you store it in the cloud its only valid for 24 hours. If you store it locally its only available to you, but it persists until you delete it (assumedly... time will confirm that hypothesis), clear the app data, or delete the app.
- shubacurryProtege
Hey I know this is 6 months late but I'm trying to establish how to use spatial anchors in a simple singleplayer scene on Unity with MetaXR All-in-One SDK v63 - I can't seem to follow the documentation online, whatever I tried hasn't worked. Where did you learn how to use Spatial Anchors?
This is the online docs where I learned it (but that may be the same documentation that you didn't have much luck with)
Spatial Anchors Overview: Unity | Oculus Developers
I did find it to be complete, albeit complicated.
To be completely honest, if all you want is a very simple spatial anchor that always stays in the same place in your room regardless of where you're looking and regardless of whether you re-center your view, just create your GameObject and add a OVRSpatialAnchor component to it with AddComponent. The SDK itself will take care of the rest. Or if you're using a prefab, just add the OVRSpatialAnchor component to it when you create the prefab. When you instantiate it, the Meta SDK will automagically freeze it in place relative to your room, based upon your orientation when you last recentered your view..
Things get a bit more complicated if you want to store or retrieve the anchors for later use (by your headset), but still is relatively simple. But it gets MUCH more complicated from there if you want to have multiple headsets in the room at the same time, seeing the same object in the same place.
Feel free to let me know which part you want more info about.
- kennard-consultingExpert Protege
Brilliant. Thanks mate.
- kennard-consultingExpert Protege
Yeah, documentation is pretty bare.
Let's help the community! Here is my working code. I've redacted it a little bit, and not tried the redacted version, so apologies if there are some syntax errors. But you may be able to spot some useful differences to your approach. Either way, this is the code that is working in PozeAR.
Please fix it up and, if you get it working, post a finished version.
- kennard-consultingExpert Protege
JeffNik makes a good point.
In fact, an even easier way to do this (for a simple single player game) is to set the new (November 2023) 'Stage' mode for the 'TrackingOrigin' setting. It basically already uses a spatial anchor and fixes the space on startup.
Ahh. Thanks for that kennard-consulting - I wasn't sure what that tracking mode did...
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 3 years ago
- 3 years ago