Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Shavier's avatar
Shavier
Protege
3 years ago

Spatial Anchors issues and "tutorial"

So I've been testing spatial anchors for a few days and I wanted to make a post to share my progress with the community. There is a little "tutorial" in the end of the post for those who wants to implement the Sharing Spatial Anchor feature.

So far I've seen some issues and wanted to ask you everyone if you think Spatial Anchors are ready to use for bussiness purposes. We wanted to create a AR space with multiple users conected in a local network, but when I configure the spatial anchor it sometimes get a little displacement (4~5 cm) and that can lead to displacement virtual objects in the room. I thought about making multiple spatial anchors and getting some kind of average center point to solve the displacement issue.

The second problem is that sharing this spatial anchors to other users (with the new sharing feature) seems to make another little displacement in other users. So... Am I missing something? Maybe I need to walk around the real room so the oculus quest 2 get all the "tracking points" in the room? Cause I've read the anchors uses real world traking points to get the location of that anchor.

 

So I dont know if this feature is really thought for oculus quest 2 or maybe they are improving this feature in the oculus quest pro - oculus quest 3.

And here is the tutorial for sharing spatial anchors:
So far this is my progress and maybe could help the ones that wanted to use spatial anchors.

Oculus provide this project so you can learn how all the functions works (create the spatial anchor, save it into the devices and share it to othres)
https://github.com/oculus-samples/Unity-SharedSpatialAnchors 

To be clear, the sharing option is not a function that the oculus quest does, it is more a function that "you" have to implement in your network system so you can send the spatial anchors info to other users. They uses Photon in the example but you can use another network systems like Mirror or Netcode for gameobjects.
Once you open the project it is not enough to make a build and run it into the device. You have to upload it to the Meta developer manager (the store from oculus quest).

https://developer.oculus.com/manage 

There you have to create an app so you can get the AppID that you have to write in the Oculus Platform Settings of the project, If you dont set the appID the share spatial anchor feature wont work.

 

Now you can make the build. And then upload it to the meta store (you can use the Meta Quest developer Hub) I recomend to upload it as an Alpha version if you are testing.
https://developer.oculus.com/downloads/package/oculus-developer-hub-win 

Then go back to the Meta developer manager and searh for the Release channels and click in the alpha version you uploaded

 

Then you have to give you access in the users tab so the app will show in your devices app's

 

Annddd now the think that cost me 2 days of work. In order to work, the spatial anchors needs to get to your device ID, and to do that, the app needs some permissions. So you had to enable the appID on the Data use Checkup (in the left menu) I also recommend to set the user profile request access (just cause oculus recommneds it too)

 

And now you can download the app in your device from the All apps menu in your oculus and use the example of sharing spatial anchors.

Hope it helps someone.

16 Replies

Replies have been turned off for this discussion
  • I still have an issue, how can I add some other members from other oculus for testing? because when I added them on alpha platform the issue persists saying "oculus id: 0 and that SSA wont work"

    The exact message is "You are not authenticated to use this app. Shared Spatial Anchors will not work."
    The other account I invited to the organization has already been verified via phone number, also I added him to the alpha program of the same app, something I noticed is that he has no User ID, but I can come to a solution finding it.

    • Atrujanox's avatar
      Atrujanox
      Explorer

      It was my fault. I wasn't downloading the app via quest lab after adding the alpha for the users, I was using unity's tool to build directly onto the HMDs

      • Shavier's avatar
        Shavier
        Protege

        Hii, and were you able to use the sharing spatial anchor feature after installing it via quest lab?

  • Wtf.  Do you have to do all this everytime you make a new build?  How are you supposed to test anything without ripping your hair out?

    • Shavier's avatar
      Shavier
      Protege

      What I do is to test everything without the spatial anchors feature, then when the app is ready, getting all the process done. But yeah, if you have to test the spatial anchors feature you have to do all the process (but just upload an update in the meta dashboard, no need to create a new app)

    • JeffNik's avatar
      JeffNik
      MVP

      No, you don't. Once you have uploaded a build to the website, and installed it from App Lab, you can go back to pushing it to the headset(s) directly through Unity. Of course, eventually you'll want to increment the build code, build it, and push it up to the website again. As long as you've incremented the build code the headset will ask you if you want to update to the latest version when you go to run it again.

  • I have an different issue.
    In play mode from Unity editor it works fine but when I build on Meta Quest 2 and choose Anchor Sharing Demo app crash.
    The strangest thing is that the same application build on Meta Quest Pro works fine.
    Someone happen the same thing? I don't know why it crash

    • Tawkko's avatar
      Tawkko
      Honored Guest

      I had the same problem but it was because I hadn't installed a Meta Quest 2 software update.

    • rebollos.marcel's avatar
      rebollos.marcel
      Honored Guest

      Are you using URP (Universal Render Pipeline) by any chance? I had a similar issue, and when I switched back to the built-in rendering pipeline, the problem went away.

  • ddhvr's avatar
    ddhvr
    Honored Guest

    Hi,

    I've done all the pre-setup I could think of (photon setup, oculus app created, user ID, user profile requested, add both accounts as the test user) but I'm still stuck on an error "OnShareCompleteResult : -1006". Could anyone provide more info about this error code? I always got 1 correct user id and 0 from my both quest pro devices. I guess the 0 might be the reason why the sharing failed.

    Could you confirm the userids you got are all correct?

  • Hi Shavier,

    Many thanks for the post, I am in a similar project than you and have the same main issue: spatial anchors are drifting, you cannot trust them to mark thinks like walls as they drift (in my case) more than 20cm. Did you had any luck sorting it out?

     

    • Shavier's avatar
      Shavier
      Protege

      Yeah if you are sharing the spatial anchors it is normal to have a some drift. The more you walk through the room the more information the device will collect. Probably you'll need an empty space (not much furnitures so the device doesn't get to much information noise). We finally didn't use the sharing spatial anchors in our project cause it get us more problem than just creating an spatial anchor for each device, So yeah... i think they still need to make some improvements in the way you share an spatial anchor but also I dont think its too easy to share real world information according to your room reference points and hoping all devices get the same room reference points.
      Maybe with Quest3 this will improve.

      • srFawlty's avatar
        srFawlty
        Explorer

        Actually the drift already appeared with non-shared anchors, but you gave me a key in your last message that helped me a lot...  I thought Oculus calculated the anchors based on topologic info like deep, etc... so I thought a corner was a very easy to find spot as has different normals at every side. But it is the opposite, looks like the system, at least in Quest II, relies more in pattern detection. Just using  shaped coloured papers as "markers" stick to the walls or corners where to place the anchors we had a much better precision and almost no drift. Even the anchors placed in not marked places are much more solid when a few of them are in marked places. Of course, not all the projects or environments can be marked with visual aids but at least in our case it was a good workaround!

  • Thank you, my friend. I was strugling  in  "unknown origins".... now i know "you have to give you access in the users tab so the app will show in your devices app's"     awesome!