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

Disable spatial mapping when environment changes

We're developing an app where the holograms are anchored to a table. This table's height is adjustable. As suggested in the hololens docs, we anchor a 'root object' as a reference location for other holograms.
Saving and loading the anchor works fine, but we're having trouble making the anchor stick to the table when its height is adjusted. The holograms stick ~50% of the time.

We implemented this solution:

  • get the height of the table from an external source, and use that to determine how high / low the holograms need to be moved.
  • clear the anchor attached to the root object
  • translate the root object's y axis.
  • save the anchor again

But now we end up with a displacement overshoot - the Hololens is also adjusting the root object along with our adjustment.

This is what we think should solve our problem:

  • Disable spatial mapping on the hololens, or atleast stop updating the spatial scan
  • Remove the anchor
  • translate the root object
  • place an anchor
  • Enable spatial mapping

Is this possible?
Is there an alternative solution to our problem?

Tagged:

Answers

  • Options

    @hdhiman,

    Anchors can be a nightmare. Hopefully your proposed solution works, but what stands out is that the overshoot you describe when you attach the anchor back to the object. That seems really weird. Is it possible something else is going on there? Is the root, possibly, being offset twice independent of the anchor?

    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:
    @hdhiman,

    Anchors can be a nightmare. Hopefully your proposed solution works, but what stands out is that the overshoot you describe when you attach the anchor back to the object. That seems really weird. Is it possible something else is going on there? Is the root, possibly, being offset twice independent of the anchor?

    Well, the problem is that there's a delay until we receive the new height of the table - we don't know the height displacement of the holograms until the table stops moving.
    During this time, the Hololens (sometimes) adjusts the root object on its own - which accounts for the overshoot.

    We ended up commenting out our proposed solution, and tried this method - it works to some extent - by covering the Hololens' 3d sensors with our hands for a couple of seconds, the Hololens is forced to remap its surroundings and readjust the root object.
    However, we never achieve the desired accuracy this way.

    That's why I ask if there's a way to disable spatial mapping on command.

  • Options

    To stop mapping, call this:

    SpatialMappingManager.Instance.StopObserver();

    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:
    To stop mapping, call this:

    SpatialMappingManager.Instance.StopObserver();

    Yes, we tried this today.
    CleanupObserver followed by a StopObserver to remove the spatial meshes, and then restarting the observer via StartObserver.

    It doesn't seem to have any affect on the anchor placement.
    Looks like there's more going on under the hood.

    So for now we decided to stick with covering the sensors for a couple of seconds in order to relocate the anchor. Not an elegant solution, but one that works for now.

Sign In or Register to comment.