Hello everyone.

We have decided to phase out the Mixed Reality Forums over the next few months in favor of other ways to connect with us.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

The plan between now and the beginning of May is to clean up old, unanswered questions that are no longer relevant. The forums will remain open and usable.

On May 1st we will be locking the forums to new posts and replies. They will remain available for another three months for the purposes of searching them, and then they will be closed altogether on August 1st.

So, where does that leave our awesome community to ask questions? Well, there are a few places we want to engage with you. For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality. If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers. And always feel free to hit us up on Twitter @MxdRealityDev.

World Anchors and Spatial Anchors in 3D

I was wondering what the difference was between these two entities. I need to use some kind of anchoring system to link different rooms together to ensure that the specify the insides of a building. Can anyone help clarify this difference please?

Best Answers

  • PatrickPatrick mod
    Accepted Answer

    Sounds like you've clearly done your research. :)

    The 60fps frame rate is necessary to keep holograms as stable as possible, but your application must be designed to maintain 60 fps. Dipping below 60fps creates a noticeable drop in hologram stability.

    It would be best to test the experience you develop. In some cases you might not even need a spatial anchor to achieve good enough stability. This saves you some processing, but also the complexity of managing objects with anchors. For instance, a GameObject with a WorldAnchor component cannot be moved. You first have to destroy the WorldAnchor, move it, and then add a new WorldAnchor. Also, a child object in Unity cannot have a WorldAnchor if a parent has a WorldAnchor.

    Are these defined in a coordinate system you could use to make a map? Yes. They are defined in the same coordinate as your spatial map. I've made an app that lets you put holographic names on people's cubicles/doors. Even if the app restarts the names are where I left them and they could easily be exported to some file format that included the spatial mapping data that would allow me to render a floor plan on a desktop PC.

    ===
    This post provided as-is with no warranties and confers no rights. Using information provided is done at own risk.

    (Daddy, what does 'now formatting drive C:' mean?)

Answers

  • It would help developers I think if there were just one name for this key element. The Hololens is a great device with massive potential outside of the gaming area. This essential item would be very necessary for those with more serious applications in mind. Thank you Patrick for that important but short sentence.

  • Upon further reflection, WorldAnchor is the term used inside of Unity. Spatial Anchor is the term used by the HoloLens API. They are still effectively synonymous. I agree that it would be better if only one term or the other was used.

    ===
    This post provided as-is with no warranties and confers no rights. Using information provided is done at own risk.

    (Daddy, what does 'now formatting drive C:' mean?)

  • I understand from what Patrick just said is that Spatial Anchors and World Anchors are the same entity when developing Hololens Apps under the Unity system. From what I also have learned, Unity puts the modules/libraries together and exports the system into Visual Studio from where a developer can get c# developer hands into this skeleton code prepared under the Unity Editor. The compiled and linked App runs under a fixed frame rate set to 60 frames per second with the intention of updating the visual reality content that the Hololens produces. So adding anchor points to the code like this:-

    WorldAnchor anchor = gameObject.AddComponent<WorldAnchor>();

    at various key points which are not spaced more than 3 metres apart should help stabilise the scene and minimize drift. From what I read, the more anchor points you add, the more processing has to be done to keep all the holograms correct to local detail. I believe that the relative position of all these anchor points change by little nibbles every time this library of anchor point is updated or refreshed. So the idea is to create only key positions to act as anchors and not have it on every single hologram. Just keep it sparsely distributed and all holograms within a 3 meter radius of anyone should be OK with minimal drift. Is this correct?

    Also, I want to know if there is a global coordinate system in which these spatial anchors are defined so it could be possible at least to determine a map of the separate rooms visited so that this can be viewed as such on export?

    I am still learning my way around this environment so please forgive me if I have just got rhis entirely or partially wrong.

  • PatrickPatrick mod
    Accepted Answer

    Sounds like you've clearly done your research. :)

    The 60fps frame rate is necessary to keep holograms as stable as possible, but your application must be designed to maintain 60 fps. Dipping below 60fps creates a noticeable drop in hologram stability.

    It would be best to test the experience you develop. In some cases you might not even need a spatial anchor to achieve good enough stability. This saves you some processing, but also the complexity of managing objects with anchors. For instance, a GameObject with a WorldAnchor component cannot be moved. You first have to destroy the WorldAnchor, move it, and then add a new WorldAnchor. Also, a child object in Unity cannot have a WorldAnchor if a parent has a WorldAnchor.

    Are these defined in a coordinate system you could use to make a map? Yes. They are defined in the same coordinate as your spatial map. I've made an app that lets you put holographic names on people's cubicles/doors. Even if the app restarts the names are where I left them and they could easily be exported to some file format that included the spatial mapping data that would allow me to render a floor plan on a desktop PC.

    ===
    This post provided as-is with no warranties and confers no rights. Using information provided is done at own risk.

    (Daddy, what does 'now formatting drive C:' mean?)

  • Dear Patrick,
    Thank you for your in depth reply to my complex question and I now understand how to organize my project for the best stability and accuracy. Bearing in mind that the Hololens is just an intelligent group of passive sensors, it seems to perform extraordinary well compared to using a scanning laser. I can see a lot of technology has gone into this and I just hope MIcrosoft continues with developing it.

    For me you have answered all my points and I am most grateful to you.

Sign In or Register to comment.