Search Unity

ARReferencePoint Moving

Discussion in 'Handheld AR' started by j0schm03, Aug 16, 2019.

  1. j0schm03

    j0schm03

    Joined:
    Jun 21, 2018
    Posts:
    4
    When i attach an ARReferencePoint to an existing plane everything works as expected. However, as the user moves around and new trackables are detected, sometimes our reference points will shift. I'm wondering if there is a way to keep the reference point from shifting as new trackables are found. Is there a way to catch when this is changing (referencePointUpdated?) And determine how much the position is changing and then undo that translation?

    I know there are recommendations to place new reference points every so often if the user is moving large distances because of this. I'm just wondering if there is a better way to do this.

    Thanks!
     
  2. j0schm03

    j0schm03

    Joined:
    Jun 21, 2018
    Posts:
    4
    Following up on my previous post.

    Should I be able to get pose changes from referencePointUpdated and use the previous pose returned from this callback to maintain the same position in world space?

    For example sometimes as the app learned more about the environment the pose changes and shifts my reference point +1 meter to the side. Can I subscribe to the referencePointUpdated event and get the new pose and shift the reference point back to it's original position (-1 meter)?
     
  3. j0schm03

    j0schm03

    Joined:
    Jun 21, 2018
    Posts:
    4
    So I was able to subscribe to the referencePointsChanged event and get a list of all updated reference points. I save the original transform position when the reference point is placed. On the referencePointsChanged event I set the transform position back to the original. Not sure yet if this is accomplishing exactly what I want. I do print out the original position and the updated position and see that indeed it does change the position and successfully sets it back to the original.