Search Unity

Shock causes objects to fly away with AR Foundation

Discussion in 'AR/VR (XR) Discussion' started by Kmil81, May 5, 2020.

  1. Kmil81

    Kmil81

    Joined:
    May 5, 2019
    Posts:
    9
    I'm trying to develop an AR app in which the phone will get bumped around a bit. Think jumping while holding the phone or giving the phone a sharp lift and rapid return back to the same spot.

    I've noticed that with AR foundation, if the device gets jarred (even a relatively small amount) that the AR objects "fly away". If you hold the the device still, sometimes the objects fly back to near where they were before, sometimes they fly off far enough that they cannot be found again.

    This can be replicated by adding AR Foundation and ARKit, putting a 3D object in space, compiling to the phone, running the app, holding the phone on one side and with the other hand giving a sharp (but not necessarily hard) jolt/hit to the device.

    The camera really does not move much if at all in these cases. I suspect it has something to do with the accelerometer data.

    Is there anything that can be done to prevent the fly away or is this a limitation of the g-force handling capabilities in the accelerometer in the phone?

    Thank you for your help.
     
    Last edited: May 12, 2020
  2. Kmil81

    Kmil81

    Joined:
    May 5, 2019
    Posts:
    9
    I've tested a number of AR apps on the iOS App Store and they all seem to exhibit similar behavior. The sharper the rapid acceleration, the quicker and further the AR objects fly away and the less likely they are to come back to the original position, no matter how quickly the device comes back to the original spot.

    Has anyone dealt with this? If so, how did you get around it?