Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Esimple's avatar
Esimple
Honored Guest
2 years ago

Question about Spatial Anchor saving

Hello Everyone, I am currently trying to work with shared spatial anchors, and what i wanted to do is basically understand, when i save a spatial anchor by saving it's Uuid, what information am i actually storing? If i were to provide another device with that same Uuid, what would happen? Would it be able to restore the anchor to its position in the real world? And if not, would there be any data i can share to make that happen?

 

All in all, my objective is to save the position of an anchor (locally if possible) on one device, then restore it on another device when it installs the app (provided the scene is the same OR the scene anchor it creates is similar (not sure that's an option). 

 

Thanks in advance to any repliers!

3 Replies

Replies have been turned off for this discussion
  • Thats exactly why they created "shared spatial anchors". Keep in mind that you're not exactly sharing it to a specific device - you're giving other SPECIFIC Meta user accounts permission to download it from the cloud ... in THAT specific app, and THAT specific room/scene/location. The guid is just a "lookup" value that you provide to the Meta SDK to pull up a specific spatial anchor's orientation in your space, which they keep private. You can use that guid to load an anchor either from your local device (if only you are going to use it), or from Meta's cloud (if you want to share it with other users of your app), so that when they are in your space, with or without you there, they use the same anchor in the same location as the headset that created it. Be aware, though - a shared anchor is only valid in the cloud for 24 hours. I believe that you can pull an anchor from the cloud on the second player/user, and then store it to their local anchor storage so it doesn't expire, but Im not 100% sure about that.

    I hope this is what you were asking.

    • Esimple's avatar
      Esimple
      Honored Guest

      Yes, it sort of is what i was asking in fact, and thank you very much for the reply! Following up just to make sure i've understood your answer correctly: What you're saying is, unless i save the anchor to Meta's cloud, there is no way to save the anchor somewhere else that isn't meta's cloud (hence the question about accessing more than the anchor's Uuid, i can't for example save the anchor in a text file, or say a personal server, is that right?

  • Yeah - that's correct. I've been playing with the Unity SDK for years, and I remember when they announced that the shared spatial anchors were coming. I had a couple Quests, and I was so excited and impatient about creating a co-located experience that I was trying to think of ways synchronize two headset coordinate systems to the local room without going through their SDK. One thing that seemed like it would work (if you're better at math than I am!) would be to have the users in the space individually place some sort of virtual orientation tool in a single known spot in the room, in a specific orientation, like a desk corner (or maybe 2 corners?), pointing along the long axis of the desk. Then compute the POS/ROT matrix of that spot relative to your virtual world center. If the positional data that you are sharing on the network is in room space coordinates, it seems that you should be able to use that matrix information to correctly convert them to local virtual space coordinates for rendering.