Search Unity

Question Drifitng objects

Discussion in 'AR' started by acme3D, Apr 27, 2022.

  1. acme3D

    acme3D

    Joined:
    Feb 4, 2009
    Posts:
    203
    I'm placing an object (about 2x2x2 meters) using ARFoundation and ARKit. The problem is that when I walk a bit further from the object, it starts to drift. Sometimes it stays still, sometimes it has some small jitter, but sometimes it moves quite sensibly.
    - the tests have been done with the same object and the same floor (trying to achieve consistent results)
    - the floor has good features, so it should allow ARkit to find reliable anchoring points
    - the area is slowly scanned (and also some of the surroundings) before placing the object
    Does anyone have similar experiences? Any technique/hint to prevent this behaviour that at time can be very disturbing?
     
  2. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
  3. acme3D

    acme3D

    Joined:
    Feb 4, 2009
    Posts:
    203
    I was also thinking of anchors... but then the question is "why an object anchred to a plane is drifitng while something attached to a wrld anchor doesn't?" If planes drift, why anchors shouldn't do the same?
     
  4. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
    The short answer is that planes are subject to drift as long as plane detection is enabled.

    From Apple's docs:

    Allow time for plane detection to produce clear results, and disable plane detection when you have the results you need. Plane detection results vary over time—when a plane is first detected, its position and extent may be inaccurate. As the plane remains in the scene over time, ARKit refines its estimate of position and extent. When a large flat surface is in the scene, ARKit may continue changing the plane anchor’s position, extent, and transform after you’ve already used the plane to place content.

    https://developer.apple.com/documen..._objects/understanding_world_tracking#2891890
     
    Last edited: May 11, 2022
  5. Rom-

    Rom-

    Joined:
    Nov 26, 2008
    Posts:
    90
    Hello Andy,

    In the link you supplied Apple talks about giving feedback to the user via UI based on how good the tracking simulation is working:

    Use tracking quality information to provide user feedback. World tracking correlates image analysis with device motion. ARKit develops a better understanding of the scene if the device is moving, even if the device moves only subtly. Excessive motion—too far, too fast, or shaking too vigorously—results in a blurred image or too much distance for tracking features between video frames, reducing tracking quality. The ARCamera class provides tracking state reason information, which you can use to develop UI that tells a user how to resolve low-quality tracking situations.

    How do we access that through the XR Foundation Classes? I would very much like to report to my users the quality of the AR simulation in realtime.
     
    Last edited: Aug 13, 2022
  6. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062