Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

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.

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, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

How to save anchor for later usage?

Hello, happy to say that I am new to HoloLens development. I am very excited to explore more on this technology.

Anyone knows how to save anchor position for later usage or any sources for example/tutorial.

More details on what I want to achieve:

  1. I want to save anchor of objects in physical spaces using my Spatial Mesh.

  2. Then I want to use the anchor position saved in (Step 1) to initialize the position of my object in when relaunches my app or use anchor in other apps.

What I am able to do:

  1. I tried to import my room model using Spatial Mapping component.

  2. I also tried to add room mesh .obj file into Hierarchy of my project. The purpose of this to visualize my room model in unity editor in order for me to put my object in specific position in physical space. After that, I've attached World Anchor component to the object.

  3. Lastly, when I launch my apps, the object will not go/stay at the physical space specified earlier. In fact, the object appears in random position in front of my camera view.

Question:

  1. Are there any easier ways to use World Anchor Manager because this component is lack in tutorial and example on the internet.

  2. Is anchor saved data accessible (for later use)?

Thank You.

Answers

  • Options
    james_ashleyjames_ashley ✭✭✭✭

    Hi Frank,

    You can do about 1.5 to 2 steps of what you propose. You can use the anchor manager to save your world anchors so when your app restarts, objects will go back to where you last left them. The HoloLens Academy tutorial even shows you how to share anchors between two devices in the same room. https://developer.microsoft.com/en-us/windows/mixed-reality/holograms_240

    You can't share your anchor with someone in a different space, though. And while you can potentially use the dev portal to grab a mesh of your room, this isn't really what HoloLens is using underneath with the anchors, as I understand it.

    So while you can potentially copy the mesh and copy your anchor and share them, they won't work together on someone else's device.

    I don't want to be discouraging because it's a cool idea. But anchors and room meshes aren't the right way to pull this off, sadly.

    James Ashley
    VS 2017 v5.3.3, Unity 2017.3.0f3, MRTK 2017.1.2, W10 17063
    Microsoft MVP, Freelance HoloLens/MR Developer
    www.imaginativeuniversal.com

  • Options

    @james_ashley said:
    Hi Frank,

    You can do about 1.5 to 2 steps of what you propose. You can use the anchor manager to save your world anchors so when your app restarts, objects will go back to where you last left them. The HoloLens Academy tutorial even shows you how to share anchors between two devices in the same room. https://developer.microsoft.com/en-us/windows/mixed-reality/holograms_240

    You can't share your anchor with someone in a different space, though. And while you can potentially use the dev portal to grab a mesh of your room, this isn't really what HoloLens is using underneath with the anchors, as I understand it.

    So while you can potentially copy the mesh and copy your anchor and share them, they won't work together on someone else's device.

    I don't want to be discouraging because it's a cool idea. But anchors and room meshes aren't the right way to pull this off, sadly.

    Hi James, thanks for quick response.

    Yeah I know that I can save my anchor using world anchor manager. But the only example that I know of is TapToPlace.cs from HoloToolkit. World Anchor in this example need to be set by the user in the apps at the first place. Instead of that method, I want to set my world anchor in development process so that when I deploy my apps I don't have to set them all.

    Thanks.

Sign In or Register to comment.