Search code examples
androidvirtual-realityarcore

ARCore - determine phone altitude (above the ground)


Can Android ARCore determine how high above the ground is the phone? I know tilt can be more or less taken from accelerometer but I'm looking for a way to precisely calculate phone position in respect to the real world.

I assume that phone altitude, tilt etc. are needed to precisely place virtual plane in respect to the real-world plain. I'm talking about cm precision.


Solution

  • ARCore does not give you ground altitude directly - ARCore devices do not have depth sensors.

    You would need to detect some ground plane first and measure the difference on Y-axis between phone/camera and the plane.

    It certainly will not be 1cm precision though, more 10ish I guess, depending how high the phone is.