Search Unity

ARFoundation on Android seems to jitter a projected point - on iOS, it's smooth

Discussion in 'Handheld AR' started by Mal_Duffin, Mar 1, 2019.

  1. Mal_Duffin

    Mal_Duffin

    Joined:
    Jan 22, 2015
    Posts:
    45
    Hi all,

    I'm seeing different issues here with object tracking to a point projected from the ARFoundation camera, when built on iOS ( working ) and Android ( not working )

    I've attached a simple test project showing the issue ( see the link at the bottom of the post ), you'll notice that the iOS and Android builds behave differently.


    Here's a video showing it on iOS...

    https://drive.google.com/open?id=1WDrNMM7BTgRTWBbs8op1ySfLm2vnltYi


    And on Android...

    https://drive.google.com/file/d/1sXH7HoJEWOG2vnbSUnYlx4L13DTcI-AT/view


    To test this, run it and tap to place the prefab. It then parents an object at a point projected in front of the AR camera, and also tries to place the prefab at that location.

    On iOS, this works great ( tested on two separate devices )

    On Android, the object being placed at run-time at the projected point jumps around / is jittery ( tested on two separate devices ).


    I'm posting this just to see if anyone else is seeing the same issue, and if it's a bug in ARFoundation itself that can be confirmed, and fixed for the next release.
     

    Attached Files:

  2. GreeneMachine

    GreeneMachine

    Joined:
    Jul 3, 2015
    Posts:
    126
    Can you make the prefab a child of the main cam with an offset... instead of matching its position via update methods?

    At a quick glance.. it looks like a sync issue to me rather than an AR Foundation issue?

    Or maybe there is an ARFoundation event you can subscribe to when the camera position is updated and use that to position the prefab? So you are positioning the prefab AFTER the cameras position has been updated for current frame?

    Just thinking out loud.. would need to look deeper..

    EDIT: Also look at TrackPoseDriver component on the AR Camera.. see what update type its using.
     
    Last edited: Mar 2, 2019
  3. Mal_Duffin

    Mal_Duffin

    Joined:
    Jan 22, 2015
    Posts:
    45
    > it looks like a sync issue to me rather than an AR Foundation issue?

    It's strange that the same ARFoundation project ( attached to the first post ) works on iOS and not on Android. For a cross platform kit, users expect the same results on both.

    Did you get a chance to run the project, to confirm the results on your own device?

    @jimmya @tdmowrer - It would be great to see if this is fixed in the latest WIP ARFoundation you're working on internally.
     
  4. GreeneMachine

    GreeneMachine

    Joined:
    Jul 3, 2015
    Posts:
    126
    I didn't get a chance to build to me device sorry. I just had a similar issue in the past and found the behaviour on my android device was not the same on IOS and something similar was occurring (ie. I was updating an objects position in updates).

    I had to optimise the android build and also modify my approach to positioning the object in question. The objects position was out of sync with the object being tracked. If that is the camera then it ends up looking like your example. I found the behaviour was not the same across platforms, as it too worked for me on IOS.

    I was suggesting making the object a child of the camera instead to eliminate the issue or look at the track pose driver to make sure you are updating your objects position in sync with each camera transform update before a frame is rendered

    This was just in my case...
     
    Last edited: Mar 2, 2019
  5. mekin

    mekin

    Joined:
    Mar 5, 2019
    Posts:
    4
    Try changing your Tracked Pose Driver's Update Type to "Update" (from the default "Update and Before Render"):
    Screen Shot 2019-03-05 at 9.09.14 AM.png
     
  6. Mal_Duffin

    Mal_Duffin

    Joined:
    Jan 22, 2015
    Posts:
    45
    Hi @mekin, we had used that method to fix the issue, but it didn't explain the difference between iOS and Android.

    If I get some time, I'll try to record three videos from the two platforms, using each of the three update types.
     
    ROBYER1 likes this.
  7. Mal_Duffin

    Mal_Duffin

    Joined:
    Jan 22, 2015
    Posts:
    45
    Just a quick update on this - the jittering is fixed in the latest version of Unity. I've asked for a bit more detail on the bug fix ( date / issue fixed etc ).
     
    mariosgakuto and GreeneMachine like this.
unityunity