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.

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

  • 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

  • @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.