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.

Holograms positioning and spatial anchors

PavelPavel
edited June 2017 in Questions And Answers

Hi,

I have a problem with displaying underground holograms in Unity app. The scenario is next:

  • The app supposed to be run outdoors.
  • I need to display some gameobjects (let it be "treasure chest") underground (up to 3m under) in relatively far distance(let's say up to 20m)
  • Objects are added to the scene on its load.
  • The position of this objects is relative to user init position in rigid coordinate system(for example - 4m forward and 2m left from user init position)

The issue is next:
Such holograms are displayed with a huge shift(towards camera). Some notes:

  • The shift is proportional to distance. More distance - more positioning error.
  • As I said - I run this app outdoors, so the surrounding also matters. In field with no objects around the error is bigger. The more real world objects around the better is positioning. I realize it's should be about spatial mapping
  • To exclude case of some optical illusion I added thin cylinder projection from object to the ground.
  • The shift is only on the distance, when I come to the object - it seems to be almost on its place.
  • Same objects, but place on the ground level are displaying MUCH more accurately.

What I already checked:
1. Microsoft docs
From these I learned that one of the reasons could be using rigid relationships. The doc say that [spatial anchttps://developer.microsoft.com/en-us/windows/mixed-reality/spatial_anchorsnchors) could be a solution, but I'm a bit confused of them:

  • The common scenario of using them - is when user places some object relatively to real world, that's not my case.
  • Distance between objects could be more then 5m sometimes, so not sure if I group my objects into cluster
  • Unity API. From MS docs anchors are looking like something I should place on scene relatively to real world and then place my objects in its space. But in unity World anchor is a component that is bound to gameobject itself. I tried to play with it a little bit, but haven't succeed on improving positioning.
  • To my knowledge anchors are based on spatial mapping mesh, but my objects are below it.(I assume it's the main reason of positioning error for underground objects).
  1. Experiments from Digital Reality Guru. He shares some experience and conclusions about working with Hololens outdoors.
  2. Holographic academy 101 and 240. These are only samples I found for displaying something underground. They show interesting approach and just to check I tried to put my objects in "black box" like they do, so there would be some mesh nearby objects, but the positioning issue stays the same.

Maybe I want too much from currently available tech, but anyway hope to improve the positioning.
If anyone have some comments/remarks/ideas/corrections regarding what I describe - I'll appreciate any feedback.

Thanks for reading!

Answers

  • timgtimg mod
    edited June 2017

    Hi @Pavel , your post contains your answer!

    The more real world objects around the better is positioning

    • Spatial Anchors rely on visual tracking, not spatial mapping.
    • The more feature points the HoloLens can find, the more accurate its visual tracking system becomes.
    • Spatial Anchors are used to ensure hologram stability. For best results, your hologram should be within 3 meters of an anchor.

    Conjecture: if you are positioning hologram(s) "a long distance away" at scene load time, you might be able to programmatically add a series of anchors between the origin of your scene and your hologram(s).

  • @timg Thanks a lot for your answer!

    I also thought about adding anchors programmatically and definetely will try it(even though docs recommend to avoid grid of anchors)

    I tried to add anchor to the very objects, but it didn't help(again - probably I'm doing something wrong as I'm a bit confused about Unity way to use world anchors).

    I still haven't figured out why the accuracy difference between ground and underground objects is so huge. Do you think it's also theoretically could be fixed with anchors?

  • HI @Pavel,
    Make sure you add your anchor after you position your object.
    If you ever have to move an object, remove its anchor first, move it, and then re-add an anchor.
    I'm not sure about the "under ground" objects. How are you determining where the ground is? If you are outside, is your terrain perfectly flat?

  • trzytrzy ✭✭✭
    Isn't this just the lever effect? If your objects are 20m away, a slight error in tracking (at the surface) will cause a much larger effect further away. Imagine casting a ray. If the position of the origin is slightly off, your line will be off only by a little for the first few meters and then proportionally greater for longer distances.
  • PavelPavel
    edited June 2017

    @timg :
    That is what I was trying to do with anchors. I don't have to move my objects(fortunately).
    About determining ground - for now I just use my height. Terrain isn't perfectly flat, but deviations are in range +-15 cm.
    Anyway thanks for ideas, I definetely should do some tests on some outdoor parking.

    @trzy :
    Yes, it seems to be lever effect. I just want to understand why it's so wierd for underground objects.
    Ground objects:

    Under ground objects:

Sign In or Register to comment.