[bug?][ARFoundation] planes drift in the Y axis by +/- 2cm

When tracking planes vertical position, as you move the camera around, they drift vertically by a few centimeters, in a bobbing motion.

This is not apparent in Unity ARKit Plugin, seems to only happen in ARFoundation.

Could this be due to auto-focus? Or new points being added?

If you spawn a cube using the place on place scene (with a light that casts shadows), and move your device in and out towards the cube, the drift can be seen quite clearly.

I tested this using the Unity ARKit Plugin and I see the exact same behavior between ARFoundation and UnityARKit. However, it is more obvious in the ARFoundation Samples due to a few factors:

  • In the ARFoundation SimpleAR scene, the cube is placed at a fixed position directly on the plane. This makes it quite obvious if the plane moves up or down as it covers or reveals the cube.

  • Not sure which sample scenes you were comparing, but the UnityARKit scene UnityARBallz, for instance, places objects 3 centimeters above the plane.

  • The balls in UnityARBallz are full rigid bodies, so they move up and down with the plane, making it difficult to detect minor movements.

  • Even if you remove the rigid body component, the plane in UnityARBallz has a nearly transparent material, which makes it difficult to see when it intersects the placed object.

When I removed the rigid body component from the ball prefab, placed it directly on the plane rather than 3 centimeters above it, and changed the plane's material to something more opaque, the results are the same as in the SimpleAR scene from ARFoundation.

In addition, I would be quite surprised to find this sort of behavioral difference between the two SDKs. Neither UnityARKit nor ARFoundation manipulate the plane's position -- it is whatever ARKit tells us it is. Poor frame rate could affect tracking or plane detection fidelity, but both SDKs easily achieve a solid 60 fps.

If this doesn't sound right to you, or you have more details on comparison you performed, please let me know.

Hi @tdmowrer ,

Your test is really helpful, thank you. I'm getting horizontal drift with arkit in arfoundation, is it reasonable to assume this is the expected behaviour? Full details posted on arfoundation git with video link

thanks a ton for your help!

Your tracking is fine. The problem is your model's pivot point is at the center of the model. Your need to offset the model so the feet of the model are level with the floor. Not they are going through the floor-

1 Like

That worked !! I really wouldn't have guessed @BuoDev ! Thanks a ton for sharing :)